Files
ProxyPanel/resources/views/admin/node/cert/index.blade.php
兔姬桑 c3dbcb19f4 使用whenFilled优化代码筛选 & 页面代码适量简化
针对管理页面中筛选行为使用whenFilled属性进行重写简化&规范化修正;
同时对页面搜索代码进行适量简化;
2021-03-16 13:13:42 -04:00

113 lines
5.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('admin.layouts')
@section('css')
<link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
@endsection
@section('content')
<div class="page-content container-fluid">
<div class="panel">
<div class="panel-heading">
<h2 class="panel-title">域名证书列表<small>V2Ray节点的伪装域名</small></h2>
@can('admin.node.cert.create')
<div class="panel-actions">
<a href="{{route('admin.node.cert.create')}}" class="btn btn-primary">
<i class="icon wb-plus" aria-hidden="true"></i>添加域名证书
</a>
</div>
@endcan
</div>
<div class="panel-body">
<table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
<thead class="thead-default">
<tr>
<th> #</th>
<th> 域名</th>
<th> KEY</th>
<th> PEM</th>
<th> 签发机构</th>
<th> 签发日期</th>
<th> 到期时间</th>
<th> {{trans('common.action')}}</th>
</tr>
</thead>
<tbody>
@foreach ($certs as $cert)
<tr>
<td> {{$cert->id}} </td>
<td> {{$cert->domain}} </td>
<td> {{$cert->key ? '✔️' : '❌'}} </td>
<td> {{$cert->pem ? '✔️' : '❌'}} </td>
<td> {{$cert->issuer}} </td>
<td> {{$cert->from}} </td>
<td> {{$cert->to}} </td>
<td>
@canany(['admin.node.cert.edit', 'admin.node.cert.destroy'])
<div class="btn-group">
@can('admin.node.cert.edit')
<a href="{{route('admin.node.cert.edit', $cert)}}" class="btn btn-primary">
<i class="icon wb-edit" aria-hidden="true"></i>
</a>
@endcan
@can('admin.node.cert.destroy')
<button onclick="delCertificate('{{$cert->id}}')" class="btn btn-danger">
<i class="icon wb-trash" aria-hidden="true"></i>
</button>
@endcan
</div>
@endcanany
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-4">
<code>{{$certs->total()}}</code> 个域名证书
</div>
<div class="col-sm-8">
<nav class="Page navigation float-right">
{{$certs->links()}}
</nav>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
@can('admin.node.cert.destroy')
<script>
// 删除授权
function delCertificate(id) {
swal.fire({
title: '提示',
text: '确定删除该证书吗?',
icon: 'info',
showCancelButton: true,
cancelButtonText: '{{trans('common.close')}}',
confirmButtonText: '{{trans('common.confirm')}}',
}).then((result) => {
if (result.value) {
$.ajax({
method: 'DELETE',
url: '{{route('admin.node.cert.destroy', '')}}/' + id,
data: {_token: '{{csrf_token()}}'},
dataType: 'json',
success: function(ret) {
if (ret.status === 'success') {
swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
} else {
swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
}
},
});
}
});
}
</script>
@endcan
@endsection