mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-31 05:05:33 +08:00
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 <clio-agent@sisyphuslabs.ai>
79 lines
1.8 KiB
PHP
79 lines
1.8 KiB
PHP
<?php
|
|
|
|
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;
|
|
|
|
/**
|
|
* @ControllerAnnotation(title="system_host")
|
|
*/
|
|
class HostBase extends AdminController
|
|
{
|
|
use \app\admin\traits\Curd;
|
|
|
|
public function __construct(App $app)
|
|
{
|
|
parent::__construct($app);
|
|
|
|
$this->model = new \app\admin\model\SystemHost();
|
|
|
|
$this->assign('select_list_status', $this->model::SELECT_LIST_STATUS, true);
|
|
$this->assign('select_list_is_master', $this->model::SELECT_LIST_IS_MASTER, true);
|
|
}
|
|
|
|
/**
|
|
* 设置主节点.
|
|
*
|
|
* @auth true
|
|
*/
|
|
public function setMaster()
|
|
{
|
|
$nodeId = $this->request->param('node_id', '');
|
|
if (empty($nodeId)) {
|
|
$this->error('参数错误');
|
|
}
|
|
|
|
$result = \app\common\service\HostService::setMasterNode($nodeId);
|
|
if ($result) {
|
|
$this->success('主节点切换成功');
|
|
} else {
|
|
$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('主机节点由系统管理,不支持修改');
|
|
}
|
|
}
|