33 lines
1.3 KiB
SQL
33 lines
1.3 KiB
SQL
-- 创建 AgentDevices_new 表
|
|
CREATE TABLE IF NOT EXISTS `AgentDevices_new` (
|
|
`Uuid` VARCHAR(36) NOT NULL PRIMARY KEY,
|
|
`Hostname` VARCHAR(100) DEFAULT '',
|
|
`IpAddress` VARCHAR(45) DEFAULT '',
|
|
`MacAddress` VARCHAR(17) DEFAULT '',
|
|
`SubnetMask` VARCHAR(15) DEFAULT '',
|
|
`Gateway` VARCHAR(45) DEFAULT '',
|
|
`OsName` VARCHAR(200) DEFAULT '',
|
|
`OsVersion` VARCHAR(100) DEFAULT '',
|
|
`OsArchitecture` VARCHAR(20) DEFAULT '',
|
|
`CpuName` VARCHAR(200) DEFAULT '',
|
|
`TotalMemoryMB` BIGINT DEFAULT 0,
|
|
`Manufacturer` VARCHAR(100) DEFAULT '',
|
|
`Model` VARCHAR(100) DEFAULT '',
|
|
`SerialNumber` VARCHAR(100) DEFAULT '',
|
|
`CurrentUser` VARCHAR(100) DEFAULT '',
|
|
`UserDomain` VARCHAR(100) DEFAULT '',
|
|
`BootTime` DATETIME NULL,
|
|
`LastReportAt` DATETIME NULL,
|
|
`IsOnline` TINYINT(1) DEFAULT 0,
|
|
`CreatedAt` DATETIME NOT NULL,
|
|
INDEX `IX_AgentDevices_new_IpAddress` (`IpAddress`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
|
|
-- 添加 Agent 设备菜单(如果不存在)
|
|
INSERT IGNORE INTO `Menus` (`Id`, `ParentId`, `Name`, `Path`, `Component`, `Title`, `KeepAlive`, `Sort`, `Roles`, `IsSystem`)
|
|
VALUES (204, 77, 'AgentDevices', 'devices', '/admin/agent-devices/index', 'Agent 设备', 1, 1, 'R_SUPER', 1);
|
|
|
|
-- 为超级管理员角色添加菜单权限
|
|
INSERT IGNORE INTO `RoleMenus` (`RoleId`, `MenuId`)
|
|
SELECT r.Id, 204 FROM `Roles` r WHERE r.RoleCode = 'R_SUPER';
|