From 739b536f8d32868c90b4147a214dd23508a79fbb Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 25 Jul 2026 22:40:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(host):=20Host=20=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=89=8B=E5=8A=A8=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E4=B8=8E=E6=8C=89=E9=92=AE=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HostBase 补 add/edit/delete/modify 禁用方法(节点自动注册,不支持手动操作)。_common.js 的 addUrl/editUrl/deleteUrl/exportUrl/modifyUrl 改空字符串。index.js 补 toolbar: ['refresh'](C 类页面,去掉默认的 add/delete/export)。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- .../base/admin/controller/system/HostBase.php | 33 +++++++++++++++++++ extend/base/admin/view/system/host/_common.js | 10 +++--- extend/base/admin/view/system/host/index.js | 1 + 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/extend/base/admin/controller/system/HostBase.php b/extend/base/admin/controller/system/HostBase.php index c09336c..a1021f9 100644 --- a/extend/base/admin/controller/system/HostBase.php +++ b/extend/base/admin/controller/system/HostBase.php @@ -3,6 +3,7 @@ namespace base\admin\controller\system; use app\admin\service\annotation\ControllerAnnotation; +use app\admin\service\annotation\NodeAnotation; use app\common\controller\AdminController; use think\App; @@ -42,4 +43,36 @@ class HostBase extends AdminController $this->error('节点不存在'); } } + + /** + * @NodeAnotation(title="添加") + */ + public function add() + { + $this->error('主机节点由系统自动注册,不支持手动添加'); + } + + /** + * @NodeAnotation(title="编辑") + */ + public function edit($id) + { + $this->error('主机节点信息由系统自动采集,不支持编辑'); + } + + /** + * @NodeAnotation(title="删除") + */ + public function delete($id) + { + $this->error('主机节点由系统管理,不支持删除'); + } + + /** + * @NodeAnotation(title="属性修改") + */ + public function modify() + { + $this->error('主机节点由系统管理,不支持修改'); + } } diff --git a/extend/base/admin/view/system/host/_common.js b/extend/base/admin/view/system/host/_common.js index 984b2ab..940a889 100644 --- a/extend/base/admin/view/system/host/_common.js +++ b/extend/base/admin/view/system/host/_common.js @@ -2,10 +2,10 @@ var init = { tableElem: '#currentTable', tableRenderId: 'currentTableRenderId', indexUrl: 'system.host/index', - addUrl: 'system.host/add' + location.search, - editUrl: 'system.host/edit', - deleteUrl: 'system.host/delete', - exportUrl: 'system.host/export', - modifyUrl: 'system.host/modify', + addUrl: '', + editUrl: '', + deleteUrl: '', + exportUrl: '', + modifyUrl: '', set_master_url: 'system.host/setMaster', }; \ No newline at end of file diff --git a/extend/base/admin/view/system/host/index.js b/extend/base/admin/view/system/host/index.js index 09a201d..061ac0d 100644 --- a/extend/base/admin/view/system/host/index.js +++ b/extend/base/admin/view/system/host/index.js @@ -1,5 +1,6 @@ $(function(){ ua.table.render({ + toolbar: ['refresh'], init: init, cols: [[ {type: 'checkbox'},