mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-24 10:11:32 +08:00
增加清理附件按钮,对悬空无引用的图片/附件进行清理 (#918)
* add attach_clean & change_theme * add attach_clean & change_theme * add * add readme --------- Co-authored-by: root <root@DESKTOP-L84EQPB.localdomain>
This commit is contained in:
@@ -27,8 +27,9 @@
|
||||
{{template "manager/widgets.tpl" .}}
|
||||
<div class="page-right">
|
||||
<div class="m-box">
|
||||
<div class="box-head">
|
||||
<div class="box-head" id="attachAll">
|
||||
<strong class="box-title">{{i18n .Lang "mgr.attachment_mgr"}}</strong>
|
||||
<button type="button" data-method="clean" class="btn btn-danger btn-sm" data-loading-text="{{i18n $.Lang "message.processing"}}">{{i18n $.Lang "common.clean"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@@ -104,6 +105,29 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#attachAll").on("click","button[data-method='clean']",function () {
|
||||
var $this = $(this);
|
||||
$(this).button("loading");
|
||||
$.ajax({
|
||||
url : "{{urlfor "ManagerController.AttachClean"}}",
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function (res) {
|
||||
if(res.errcode === 0){
|
||||
alert("done");
|
||||
}else {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
},
|
||||
error : function () {
|
||||
layer.msg({{i18n .Lang "message.system_error"}});
|
||||
},
|
||||
complete : function () {
|
||||
$this.button("reset");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user