2016-10-17 12:20:55 +08:00
|
|
|
@extends('admin.master')
|
|
|
|
|
|
|
|
@section('title', trans('general.plugin-manage'))
|
|
|
|
|
|
|
|
@section('style')
|
|
|
|
<style>
|
2016-12-31 11:38:07 +08:00
|
|
|
.btn { margin-right: 4px; }
|
|
|
|
td#description { width: 35%; }
|
|
|
|
@media (max-width: 767px) { .content-header > h1 > small { display: none; } }
|
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">
|
2016-12-31 11:38:07 +08:00
|
|
|
|
|
|
|
@if (session()->has('message'))
|
|
|
|
<div class="callout callout-success" role="alert">
|
|
|
|
{{ session('message') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2016-10-17 12:20:55 +08:00
|
|
|
<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>
|
2016-12-30 20:37:27 +08:00
|
|
|
<th>{{ trans('admin.plugins.status.title') }}</th>
|
|
|
|
<th>{{ trans('admin.plugins.operations.title') }}</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 20:37:27 +08:00
|
|
|
{{ trans('admin.plugins.status.enabled') }}
|
2016-10-17 12:20:55 +08:00
|
|
|
@else
|
2016-12-30 20:37:27 +08:00
|
|
|
{{ trans('admin.plugins.status.disabled') }}
|
2016-10-17 12:20:55 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
@if ($plugin->isEnabled())
|
2016-12-30 20:37:27 +08:00
|
|
|
<a class="btn btn-warning btn-sm" href="?action=disable&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.disable') }}</a>
|
2016-10-17 12:20:55 +08:00
|
|
|
@else
|
2016-12-30 20:37:27 +08:00
|
|
|
<a class="btn btn-primary btn-sm" href="?action=enable&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.enable') }}</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 20:37:27 +08:00
|
|
|
<a class="btn btn-default btn-sm" href="?action=config&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.configure') }}</a>
|
2016-10-17 17:51:51 +08:00
|
|
|
@else
|
2016-12-30 20:37:27 +08:00
|
|
|
<a class="btn btn-default btn-sm" disabled="disabled" title="{{ trans('admin.plugins.operations.no-config-notice') }}" data-toggle="tooltip" data-placement="top">{{ trans('admin.plugins.operations.configure') }}</a>
|
2016-10-17 17:51:51 +08:00
|
|
|
@endif
|
|
|
|
|
2016-12-30 20:37:27 +08:00
|
|
|
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('{{ $plugin->name }}');">{{ trans('admin.plugins.operations.delete') }}</a>
|
2016-10-17 12:20:55 +08:00
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@empty
|
|
|
|
<tr>
|
|
|
|
<td>0</td>
|
2016-12-30 20:37:27 +08:00
|
|
|
<td>{{ trans('admin.plugins.empty') }}</td>
|
2016-10-17 12:20:55 +08:00
|
|
|
<td>(´・ω・`)</td>
|
|
|
|
</tr>
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section><!-- /.content -->
|
|
|
|
</div><!-- /.content-wrapper -->
|
|
|
|
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('script')
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function deletePlugin(name) {
|
|
|
|
swal({
|
2016-12-30 20:37:27 +08:00
|
|
|
text: trans('admin.confirmDeletion'),
|
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
|