\n' +
'
菜单授权\n' +
+ '
下线\n' +
'
删除\n' +
@@ -280,6 +294,57 @@
location.href = "/admin/action/" + $(this).attr('data-id');
});
+ // 下线
+ $(document).on('click', '.btn-offline', function () {
+ const id = $(this).attr('data-id');
+
+ $.confirm({
+ title: '谨慎操作',
+ content: '确认要
下线 吗?',
+ icon: 'mdi mdi-alert',
+ animation: 'scale',
+ closeAnimation: 'zoom',
+ buttons: {
+ okay: {
+ text: '确认',
+ keys: ['enter'],
+ btnClass: 'btn-orange',
+ action: function () {
+ AjaxForm(
+ "PATCH",
+ '/api/admin/offline',
+ {id: id},
+ function () {},
+ function (data) {
+ $.alert({
+ title: '操作成功',
+ icon: 'mdi mdi-check-decagram',
+ type: 'green',
+ content: '编号:' + data.id + ' 已下线。',
+ buttons: {
+ okay: {
+ text: '关闭',
+ action: function () {
+ location.reload();
+ }
+ }
+ }
+ });
+ },
+ function (response) {
+ AjaxError(response);
+ }
+ );
+ }
+ },
+ cancel: {
+ text: '取消',
+ keys: ['ctrl', 'shift'],
+ }
+ }
+ });
+ });
+
// 删除
$(document).on('click', '.btn-confirm', function () {
const id = $(this).attr('data-id');
diff --git a/assets/templates/dashboard/dashboard.html b/assets/templates/dashboard/dashboard.html
index f76ebc39..b348d519 100644
--- a/assets/templates/dashboard/dashboard.html
+++ b/assets/templates/dashboard/dashboard.html
@@ -15,7 +15,7 @@
操作系统:{{ .GoOS }} {{ .GoArch }} {{ .GoVersion }}
diff --git a/assets/templates/index/index.html b/assets/templates/index/index.html
index d224bbb0..fc72cfac 100644
--- a/assets/templates/index/index.html
+++ b/assets/templates/index/index.html
@@ -22,82 +22,29 @@