blessing-skin-server/resources/views/admin/plugins.tpl

131 lines
4.1 KiB
PHP
Raw Normal View History

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>
<th>名称</th>
<th>描述</th>
<th>作者</th>
<th>版本</th>
<th>状态</th>
<th>操作</th>
</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())
已启用
@else
已禁用
@endif
</td>
<td>
@if ($plugin->isEnabled())
<a class="btn btn-warning btn-sm" href="?action=disable&id={{ $plugin->name }}">禁用插件</a>
@else
<a class="btn btn-primary btn-sm" href="?action=enable&id={{ $plugin->name }}">启用插件</a>
@endif
2016-10-17 17:51:51 +08:00
@if ($plugin->isEnabled() && $plugin->hasConfigView())
2016-10-17 12:20:55 +08:00
<a class="btn btn-default btn-sm" href="?action=config&id={{ $plugin->name }}">插件配置</a>
2016-10-17 17:51:51 +08:00
@else
<a class="btn btn-default btn-sm" disabled="disabled" title="插件已被禁用或无配置页" data-toggle="tooltip" data-placement="top">插件配置</a>
@endif
2016-10-17 12:20:55 +08:00
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('{{ $plugin->name }}');">删除插件</a>
</td>
</tr>
@empty
<tr>
<td>0</td>
<td>无结果</td>
<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({
text: '真的要删除这个插件吗?',
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