2016-10-17 12:20:55 +08:00
|
|
|
@extends('admin.master')
|
|
|
|
|
|
|
|
@section('title', trans('general.plugin-manage'))
|
|
|
|
|
|
|
|
@section('style')
|
|
|
|
<style>
|
|
|
|
.btn {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
2016-10-30 14:48:47 +08:00
|
|
|
td#description {
|
|
|
|
width: 35%;
|
|
|
|
}
|
2016-10-17 12:20:55 +08:00
|
|
|
</style>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
<!-- Content Wrapper. Contains page content -->
|
|
|
|
<div class="content-wrapper">
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
<section class="content-header">
|
|
|
|
<h1>
|
|
|
|
{{ trans('general.plugin-manage') }}
|
|
|
|
<small>Plugin Manage</small>
|
|
|
|
</h1>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<!-- Main content -->
|
|
|
|
<section class="content">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-body table-responsive no-padding">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2016-12-30 15:01:34 +08:00
|
|
|
<th>{{ trans('admin.plugins.name') }}</th>
|
|
|
|
<th>{{ trans('admin.plugins.description') }}</th>
|
|
|
|
<th>{{ trans('admin.plugins.author') }}</th>
|
|
|
|
<th>{{ trans('admin.plugins.version') }}</th>
|
|
|
|
<th>{{ trans('admin.plugins.status') }}</th>
|
2016-12-30 17:44:53 +08:00
|
|
|
<th>{{ trans('admin.plugins.operation') }}</th>
|
2016-10-17 12:20:55 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
@forelse($installed as $plugin)
|
|
|
|
<tr id="plugin-{{ $plugin->name }}">
|
|
|
|
<td>{{ $plugin->title }}</td>
|
|
|
|
<td id="description">{{ $plugin->description }}</td>
|
|
|
|
<td id="author">{{ $plugin->author }}</td>
|
|
|
|
<td id="version">{{ $plugin->version }}</td>
|
|
|
|
<td id="status">
|
|
|
|
@if ($plugin->isEnabled())
|
2016-12-30 15:01:34 +08:00
|
|
|
{{ trans('admin.plugins.enabled') }}
|
2016-10-17 12:20:55 +08:00
|
|
|
@else
|
2016-12-30 15:01:34 +08:00
|
|
|
{{ trans('admin.plugins.disabled') }}
|
2016-10-17 12:20:55 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
@if ($plugin->isEnabled())
|
2016-12-30 15:01:34 +08:00
|
|
|
<a class="btn btn-warning btn-sm" href="?action=disable&id={{ $plugin->name }}">{{ trans('admin.plugins.disable-plugin') }}</a>
|
2016-10-17 12:20:55 +08:00
|
|
|
@else
|
2016-12-30 15:01:34 +08:00
|
|
|
<a class="btn btn-primary btn-sm" href="?action=enable&id={{ $plugin->name }}">{{ trans('admin.plugins.enable-plugin') }}</a>
|
2016-10-17 12:20:55 +08:00
|
|
|
@endif
|
|
|
|
|
2016-10-17 17:51:51 +08:00
|
|
|
@if ($plugin->isEnabled() && $plugin->hasConfigView())
|
2016-12-30 15:01:34 +08:00
|
|
|
<a class="btn btn-default btn-sm" href="?action=config&id={{ $plugin->name }}">{{ trans('admin.plugins.plugin-config') }}</a>
|
2016-10-17 17:51:51 +08:00
|
|
|
@else
|
2016-12-30 15:01:34 +08:00
|
|
|
<a class="btn btn-default btn-sm" disabled="disabled" title="{{ trans('admin.plugins.no-config') }}" data-toggle="tooltip" data-placement="top">{{ trans('admin.plugins.no-config') }}</a>
|
2016-10-17 17:51:51 +08:00
|
|
|
@endif
|
|
|
|
|
2016-12-30 15:01:34 +08:00
|
|
|
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('{{ $plugin->name }}');">{{ trans('admin.plugins.delete-plugin') }}</a>
|
2016-10-17 12:20:55 +08:00
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@empty
|
|
|
|
<tr>
|
|
|
|
<td>0</td>
|
2016-12-30 15:01:34 +08:00
|
|
|
<td>{{ trans('admin.plugins.no-result') }}</td>
|
2016-10-17 12:20:55 +08:00
|
|
|
<td>(´・ω・`)</td>
|
|
|
|
</tr>
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section><!-- /.content -->
|
|
|
|
</div><!-- /.content-wrapper -->
|
|
|
|
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('style')
|
|
|
|
<style>
|
|
|
|
@media (max-width: 767px) {
|
|
|
|
.content-header > h1 > small {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('script')
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function deletePlugin(name) {
|
|
|
|
swal({
|
2016-12-30 15:01:34 +08:00
|
|
|
text: trans('admin.deletionConfirmation'),
|
2016-10-17 12:20:55 +08:00
|
|
|
type: 'warning',
|
|
|
|
showCancelButton: true
|
|
|
|
}).then(function() {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "?action=delete&id=" + name,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(json) {
|
|
|
|
if (json.errno == 0) {
|
|
|
|
toastr.success(json.msg);
|
|
|
|
|
|
|
|
$('tr[id=plugin-'+name+']').remove();
|
|
|
|
} else {
|
|
|
|
toastr.warning(json.msg);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: showAjaxError
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
@endsection
|