插件管理优化

This commit is contained in:
技术老胡
2024-10-19 16:58:44 +08:00
parent 0473a992a8
commit 5728976e9f
10 changed files with 248 additions and 77 deletions

View File

@@ -43,7 +43,7 @@
<button class="layui-btn layui-btn-primary layui-bg-gray layui-btn-sm" grp-btn lay-event="showWaitInstall">待安装</button>
</script>
<script type="text/html" id="plugin-state">
<input type="checkbox" name="state" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="pluginEnable" {{ d.state == 1 ? 'checked' : '' }} />
<input type="checkbox" name="state" value="{{d.platform}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="pluginEnable" {{ d.state == 1 ? 'checked' : '' }} />
</script>
<script type="text/html" id="plugin-action">
<a href="javascript:;" class="layui-font-green" lay-event="createConfig">配置</a><div class="divider-vl"></div>
@@ -105,8 +105,8 @@
// 启用状态
form.on('switch(pluginEnable)', function (obj) {
const state = obj.elem.checked == true ? 1 : 0;
const id = obj.value;
const field = { state: state, id: id };
const platform = obj.value;
const field = { state: state, platform: platform };
plugin.enable(obj, field);
return false;
});