deving
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
:title="isEdit ? '编辑办公PC' : '新增办公PC'"
|
||||
:title="isEdit ? '编辑数据库' : '新增数据库'"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
@update:visible="handleUpdateVisible"
|
||||
@@ -20,25 +20,30 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="name" label="办公PC名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入办公PC名称" />
|
||||
<a-form-item field="name" label="数据库名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入数据库名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="os" label="操作系统">
|
||||
<a-select v-model="formData.os" placeholder="请选择操作系统">
|
||||
<a-option value="windows">Windows</a-option>
|
||||
<a-option value="linux">Linux</a-option>
|
||||
<a-option value="other">其它</a-option>
|
||||
<a-form-item field="database" label="数据库类型">
|
||||
<a-select v-model="formData.database" placeholder="请选择数据库类型">
|
||||
<a-option value="MySQL">MySQL</a-option>
|
||||
<a-option value="PostgreSQL">PostgreSQL</a-option>
|
||||
<a-option value="Oracle">Oracle</a-option>
|
||||
<a-option value="SQL Server">SQL Server</a-option>
|
||||
<a-option value="Redis">Redis</a-option>
|
||||
<a-option value="MongoDB">MongoDB</a-option>
|
||||
<a-option value="Elasticsearch">Elasticsearch</a-option>
|
||||
<a-option value="Other">其它</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="tags" label="标签">
|
||||
<a-input v-model="formData.tags" placeholder="多个标签,逗号间隔" />
|
||||
<a-form-item field="version" label="版本">
|
||||
<a-input v-model="formData.version" placeholder="请输入数据库版本" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -52,20 +57,42 @@
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="ip" label="IP地址">
|
||||
<a-input v-model="formData.ip" placeholder="可以输入多个IP,逗号做分隔" />
|
||||
<a-form-item field="tags" label="标签">
|
||||
<a-input v-model="formData.tags" placeholder="多个标签,逗号间隔" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="remote_port" label="远程访问端口">
|
||||
<a-input v-model="formData.remote_port" placeholder="为空则不可远程访问" />
|
||||
<a-form-item field="ip" label="IP 地址">
|
||||
<a-input v-model="formData.ip" placeholder="请输入 IP 地址" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item field="agent_url" label="Agent URL配置">
|
||||
<a-input v-model="formData.agent_url" placeholder="请输入Agent URL配置" />
|
||||
</a-form-item>
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="port" label="端口">
|
||||
<a-input v-model="formData.port" placeholder="请输入数据库端口" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="remote_access" label="远程访问">
|
||||
<a-switch v-model="formData.remote_access" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="agent_config" label="Agent 配置">
|
||||
<a-switch v-model="formData.agent_config" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item v-if="formData.agent_config" field="agent_url" label="Agent URL">
|
||||
<a-input v-model="formData.agent_url" placeholder="请输入 Agent URL" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
@@ -74,17 +101,30 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item v-if="formData.data_collection" field="collection_interval" label="采集时间">
|
||||
<a-select v-model="formData.collection_interval" placeholder="请选择采集时间">
|
||||
<a-option :value="1">1分钟</a-option>
|
||||
<a-option :value="5">5分钟</a-option>
|
||||
<a-option :value="10">10分钟</a-option>
|
||||
<a-option :value="30">30分钟</a-option>
|
||||
<a-form-item v-if="formData.data_collection" field="collection_interval" label="采集间隔">
|
||||
<a-select v-model="formData.collection_interval" placeholder="请选择采集间隔">
|
||||
<a-option :value="1">1 分钟</a-option>
|
||||
<a-option :value="5">5 分钟</a-option>
|
||||
<a-option :value="10">10 分钟</a-option>
|
||||
<a-option :value="30">30 分钟</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="status" label="状态">
|
||||
<a-select v-model="formData.status" placeholder="请选择状态">
|
||||
<a-option value="online">在线</a-option>
|
||||
<a-option value="offline">离线</a-option>
|
||||
<a-option value="maintenance">维护中</a-option>
|
||||
<a-option value="retired">已退役</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item field="remark" label="备注信息">
|
||||
<a-textarea
|
||||
v-model="formData.remark"
|
||||
@@ -122,22 +162,25 @@ const isEdit = computed(() => !!props.record?.id)
|
||||
const formData = reactive({
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
database: '',
|
||||
version: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
ip: '',
|
||||
remote_port: '',
|
||||
port: '',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
agent_url: '',
|
||||
data_collection: false,
|
||||
collection_interval: 5,
|
||||
status: 'offline',
|
||||
remark: '',
|
||||
})
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入办公名称' }],
|
||||
server_type: [{ required: true, message: '请选择办公类型' }],
|
||||
os: [{ required: true, message: '请选择操作系统' }],
|
||||
name: [{ required: true, message: '请输入数据库名称' }],
|
||||
database: [{ required: true, message: '请选择数据库类型' }],
|
||||
ip: [{ required: true, message: '请输入 IP 地址' }],
|
||||
}
|
||||
|
||||
const locationOptions = ref([
|
||||
@@ -158,15 +201,18 @@ watch(
|
||||
Object.assign(formData, {
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
database: '',
|
||||
version: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
ip: '',
|
||||
remote_port: '',
|
||||
port: '',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
agent_url: '',
|
||||
data_collection: false,
|
||||
collection_interval: 5,
|
||||
status: 'offline',
|
||||
remark: '',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ export const columns = [
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'type',
|
||||
title: '类型',
|
||||
dataIndex: 'database',
|
||||
title: '数据库',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
dataIndex: 'os',
|
||||
title: '操作系统',
|
||||
dataIndex: 'version',
|
||||
title: '版本',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -41,40 +41,27 @@ export const columns = [
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'remote_access',
|
||||
title: '远程访问',
|
||||
dataIndex: 'port',
|
||||
title: '端口',
|
||||
width: 100,
|
||||
slotName: 'remote_access',
|
||||
},
|
||||
{
|
||||
dataIndex: 'agent_config',
|
||||
title: 'Agent配置',
|
||||
width: 150,
|
||||
slotName: 'agent_config',
|
||||
},
|
||||
{
|
||||
dataIndex: 'cpu',
|
||||
title: 'CPU使用率',
|
||||
dataIndex: 'sys_indicator',
|
||||
title: '系统指标',
|
||||
width: 150,
|
||||
slotName: 'cpu',
|
||||
},
|
||||
{
|
||||
dataIndex: 'memory',
|
||||
title: '内存使用率',
|
||||
dataIndex: 'qps',
|
||||
title: '数据库指标 QPS',
|
||||
width: 150,
|
||||
slotName: 'memory',
|
||||
slotName: 'qps',
|
||||
},
|
||||
{
|
||||
dataIndex: 'disk',
|
||||
title: '硬盘使用率',
|
||||
dataIndex: 'conn',
|
||||
title: '数据库指标 Conn',
|
||||
width: 150,
|
||||
slotName: 'disk',
|
||||
},
|
||||
{
|
||||
dataIndex: 'data_collection',
|
||||
title: '数据采集',
|
||||
width: 100,
|
||||
slotName: 'data_collection',
|
||||
slotName: 'conn',
|
||||
},
|
||||
{
|
||||
dataIndex: 'status',
|
||||
|
||||
@@ -30,73 +30,36 @@
|
||||
{{ record.id }}
|
||||
</template>
|
||||
|
||||
<!-- 远程访问 -->
|
||||
<template #remote_access="{ record }">
|
||||
<a-tag :color="record.remote_access ? 'green' : 'gray'">
|
||||
{{ record.remote_access ? '已开启' : '未开启' }}
|
||||
<!-- 数据库类型 -->
|
||||
<template #database="{ record }">
|
||||
{{ record.database || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- 版本 -->
|
||||
<template #version="{ record }">
|
||||
{{ record.version || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- 位置信息 -->
|
||||
<template #location="{ record }">
|
||||
{{ record.location || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- 标签 -->
|
||||
<template #tags="{ record }">
|
||||
<a-tag v-for="(tag, index) in (record.tags || '').split(',').filter(t => t.trim())" :key="index">
|
||||
{{ tag.trim() }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<!-- Agent配置 -->
|
||||
<template #agent_config="{ record }">
|
||||
<a-tag :color="record.agent_config ? 'green' : 'gray'">
|
||||
{{ record.agent_config ? '已配置' : '未配置' }}
|
||||
</a-tag>
|
||||
|
||||
<!-- IP 地址 -->
|
||||
<template #ip="{ record }">
|
||||
{{ record.ip || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- CPU -->
|
||||
<template #cpu="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-label">CPU</span>
|
||||
<span class="resource-value">{{ record.cpu_info?.value || 0 }}%</span>
|
||||
</div>
|
||||
<a-progress
|
||||
:percent="(record.cpu_info?.value || 0) / 100"
|
||||
:color="getProgressColor(record.cpu_info?.value || 0)"
|
||||
size="small"
|
||||
:show-text="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 内存 -->
|
||||
<template #memory="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-laebl">内存</span>
|
||||
<span class="resource-value">{{ record.memory_info?.value || 0 }}%</span>
|
||||
</div>
|
||||
<a-progress
|
||||
:percent="(record.memory_info?.value || 0) / 100"
|
||||
:color="getProgressColor(record.memory_info?.value || 0)"
|
||||
size="small"
|
||||
:show-text="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 硬盘 -->
|
||||
<template #disk="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-label">硬盘</span>
|
||||
<span class="resource-value">{{ record.disk_info?.value || 0 }}%</span>
|
||||
</div>
|
||||
<a-progress
|
||||
:percent="(record.disk_info?.value || 0) / 100"
|
||||
:color="getProgressColor(record.disk_info?.value || 0)"
|
||||
size="small"
|
||||
:show-text="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 数据采集 -->
|
||||
<template #data_collection="{ record }">
|
||||
<a-tag :color="record.data_collection ? 'green' : 'gray'">
|
||||
{{ record.data_collection ? '已启用' : '未启用' }}
|
||||
</a-tag>
|
||||
|
||||
<!-- 端口 -->
|
||||
<template #port="{ record }">
|
||||
{{ record.port || '-' }}
|
||||
</template>
|
||||
|
||||
<!-- 状态 -->
|
||||
@@ -209,204 +172,124 @@ const router = useRouter()
|
||||
const mockServerData = [
|
||||
{
|
||||
id: 1,
|
||||
unique_id: 'SRV-2024-0001',
|
||||
name: 'Web数据库-01',
|
||||
type: 'Web数据库',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心A-1楼-机柜01-U1',
|
||||
tags: 'Web,应用',
|
||||
unique_id: 'DB-2024-0001',
|
||||
name: 'MySQL 主库 -01',
|
||||
database: 'MySQL',
|
||||
version: '8.0.32',
|
||||
location: '数据中心 A-1 楼 - 机柜 01-U1',
|
||||
tags: '生产,核心,主库',
|
||||
ip: '192.168.1.101',
|
||||
port: '3306',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 45, total: '8核', used: '3.6核' },
|
||||
memory_info: { value: 62, total: '32GB', used: '19.8GB' },
|
||||
disk_info: { value: 78, total: '1TB', used: '780GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unique_id: 'SRV-2024-0002',
|
||||
name: '数据库数据库-01',
|
||||
type: '数据库数据库',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-1楼-机柜02-U1',
|
||||
tags: '数据库,MySQL',
|
||||
unique_id: 'DB-2024-0002',
|
||||
name: 'PostgreSQL 从库 -01',
|
||||
database: 'PostgreSQL',
|
||||
version: '15.2',
|
||||
location: '数据中心 A-1 楼 - 机柜 02-U1',
|
||||
tags: '生产,从库,备份',
|
||||
ip: '192.168.1.102',
|
||||
port: '5432',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '2TB NVMe',
|
||||
cpu_info: { value: 78, total: '16核', used: '12.5核' },
|
||||
memory_info: { value: 85, total: '64GB', used: '54.4GB' },
|
||||
disk_info: { value: 92, total: '2TB', used: '1.84TB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
unique_id: 'SRV-2024-0003',
|
||||
name: '应用数据库-01',
|
||||
type: '应用数据库',
|
||||
os: 'Windows Server 2019',
|
||||
location: '数据中心A-2楼-机柜05-U2',
|
||||
tags: '应用,.NET',
|
||||
unique_id: 'DB-2024-0003',
|
||||
name: 'Redis 缓存 -01',
|
||||
database: 'Redis',
|
||||
version: '7.0.9',
|
||||
location: '数据中心 A-2 楼 - 机柜 05-U2',
|
||||
tags: '缓存,会话存储',
|
||||
ip: '192.168.1.103',
|
||||
port: '6379',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
memory_info: { value: 0, total: '16GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '500GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
status: 'offline',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
unique_id: 'SRV-2024-0004',
|
||||
name: '缓存数据库-01',
|
||||
type: '缓存数据库',
|
||||
os: 'CentOS 8.5',
|
||||
location: '数据中心A-2楼-机柜06-U1',
|
||||
tags: '缓存,Redis',
|
||||
unique_id: 'DB-2024-0004',
|
||||
name: 'MongoDB 集群 -01',
|
||||
database: 'MongoDB',
|
||||
version: '6.0.5',
|
||||
location: '数据中心 A-2 楼 - 机柜 06-U1',
|
||||
tags: '文档存储,日志',
|
||||
ip: '192.168.1.104',
|
||||
port: '27017',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 35, total: '8核', used: '2.8核' },
|
||||
memory_info: { value: 68, total: '32GB', used: '21.8GB' },
|
||||
disk_info: { value: 42, total: '1TB', used: '420GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
unique_id: 'SRV-2024-0005',
|
||||
name: '文件数据库-01',
|
||||
type: '文件数据库',
|
||||
os: 'Debian 11',
|
||||
location: '数据中心B-1楼-机柜03-U1',
|
||||
tags: '文件,NFS',
|
||||
unique_id: 'DB-2024-0005',
|
||||
name: 'Oracle 数据库 -01',
|
||||
database: 'Oracle',
|
||||
version: '19c',
|
||||
location: '数据中心 B-1 楼 - 机柜 03-U1',
|
||||
tags: '财务系统,核心',
|
||||
ip: '192.168.2.101',
|
||||
port: '1521',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '10TB HDD',
|
||||
cpu_info: { value: 28, total: '12核', used: '3.4核' },
|
||||
memory_info: { value: 45, total: '48GB', used: '21.6GB' },
|
||||
disk_info: { value: 88, total: '10TB', used: '8.8TB' },
|
||||
data_collection: true,
|
||||
status: 'maintenance',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
unique_id: 'SRV-2024-0006',
|
||||
name: '测试数据库-01',
|
||||
type: '测试数据库',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心B-2楼-机柜10-U1',
|
||||
tags: '测试,开发',
|
||||
unique_id: 'DB-2024-0006',
|
||||
name: 'SQL Server-01',
|
||||
database: 'SQL Server',
|
||||
version: '2019',
|
||||
location: '数据中心 B-2 楼 - 机柜 10-U1',
|
||||
tags: 'OA 系统,报表',
|
||||
ip: '192.168.2.102',
|
||||
port: '1433',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '8GB',
|
||||
disk: '256GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
memory_info: { value: 0, total: '8GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '256GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
status: 'retired',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
unique_id: 'SRV-2024-0007',
|
||||
name: '监控数据库-01',
|
||||
type: '监控数据库',
|
||||
os: 'Ubuntu 20.04',
|
||||
location: '数据中心A-1楼-机柜08-U1',
|
||||
tags: '监控,Prometheus',
|
||||
unique_id: 'DB-2024-0007',
|
||||
name: 'Elasticsearch-01',
|
||||
database: 'Elasticsearch',
|
||||
version: '8.7.0',
|
||||
location: '数据中心 A-1 楼 - 机柜 08-U1',
|
||||
tags: '搜索,日志分析',
|
||||
ip: '192.168.1.105',
|
||||
port: '9200',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 55, total: '8核', used: '4.4核' },
|
||||
memory_info: { value: 72, total: '32GB', used: '23.0GB' },
|
||||
disk_info: { value: 65, total: '1TB', used: '650GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
unique_id: 'SRV-2024-0008',
|
||||
name: '备份数据库-01',
|
||||
type: '备份数据库',
|
||||
os: 'Rocky Linux 9',
|
||||
location: '数据中心B-1楼-机柜04-U1',
|
||||
tags: '备份,存储',
|
||||
unique_id: 'DB-2024-0008',
|
||||
name: 'MySQL 测试库 -01',
|
||||
database: 'MySQL',
|
||||
version: '8.0.30',
|
||||
location: '数据中心 B-1 楼 - 机柜 04-U1',
|
||||
tags: '测试,开发',
|
||||
ip: '192.168.2.103',
|
||||
port: '3307',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '20TB HDD',
|
||||
cpu_info: { value: 42, total: '16核', used: '6.7核' },
|
||||
memory_info: { value: 38, total: '64GB', used: '24.3GB' },
|
||||
disk_info: { value: 75, total: '20TB', used: '15TB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
unique_id: 'SRV-2024-0009',
|
||||
name: 'CI/CD数据库-01',
|
||||
type: 'CI/CD数据库',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-2楼-机柜07-U1',
|
||||
tags: 'CI/CD,Jenkins',
|
||||
ip: '192.168.1.106',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 68, total: '8核', used: '5.4核' },
|
||||
memory_info: { value: 75, total: '16GB', used: '12GB' },
|
||||
disk_info: { value: 55, total: '500GB', used: '275GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
unique_id: 'SRV-2024-0010',
|
||||
name: '日志数据库-01',
|
||||
type: '日志数据库',
|
||||
os: 'CentOS Stream 9',
|
||||
location: '数据中心B-2楼-机柜12-U1',
|
||||
tags: '日志,ELK',
|
||||
ip: '192.168.2.104',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '2TB SSD',
|
||||
cpu_info: { value: 0, total: '12核', used: '0核' },
|
||||
memory_info: { value: 0, total: '48GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '2TB', used: '0TB' },
|
||||
data_collection: true,
|
||||
status: 'offline',
|
||||
},
|
||||
]
|
||||
|
||||
// 状态管理
|
||||
@@ -639,38 +522,4 @@ export default {
|
||||
.container {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.resource-display {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 4px 0;
|
||||
|
||||
.resource-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
> div {
|
||||
display: inline-block;
|
||||
}
|
||||
.resource-value {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: rgb(var(--text-1));
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.arco-progress) {
|
||||
margin: 0;
|
||||
|
||||
.arco-progress-bar-bg {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.arco-progress-bar {
|
||||
border-radius: 2px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
:title="isEdit ? '编辑办公PC' : '新增办公PC'"
|
||||
:title="isEdit ? '编辑中间件' : '新增中间件'"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
@update:visible="handleUpdateVisible"
|
||||
@@ -14,31 +14,35 @@
|
||||
<a-form-item field="unique_id" label="唯一标识">
|
||||
<a-input
|
||||
v-model="formData.unique_id"
|
||||
placeholder="输入为空系统自动生成UUID"
|
||||
placeholder="输入为空系统自动生成 UUID"
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="name" label="办公PC名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入办公PC名称" />
|
||||
<a-form-item field="name" label="中间件名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入中间件名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="os" label="操作系统">
|
||||
<a-select v-model="formData.os" placeholder="请选择操作系统">
|
||||
<a-option value="windows">Windows</a-option>
|
||||
<a-option value="linux">Linux</a-option>
|
||||
<a-form-item field="middleware" label="中间件类型">
|
||||
<a-select v-model="formData.middleware" placeholder="请选择中间件类型">
|
||||
<a-option value="nginx">Nginx</a-option>
|
||||
<a-option value="tomcat">Tomcat</a-option>
|
||||
<a-option value="redis">Redis</a-option>
|
||||
<a-option value="kafka">Kafka</a-option>
|
||||
<a-option value="rabbitmq">RabbitMQ</a-option>
|
||||
<a-option value="elasticsearch">Elasticsearch</a-option>
|
||||
<a-option value="other">其它</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="tags" label="标签">
|
||||
<a-input v-model="formData.tags" placeholder="多个标签,逗号间隔" />
|
||||
<a-form-item field="version" label="版本">
|
||||
<a-input v-model="formData.version" placeholder="请输入版本号" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -50,6 +54,10 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="tags" label="标签">
|
||||
<a-input v-model="formData.tags" placeholder="多个标签,逗号间隔" />
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="ip" label="IP地址">
|
||||
@@ -122,8 +130,8 @@ const isEdit = computed(() => !!props.record?.id)
|
||||
const formData = reactive({
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
middleware: '',
|
||||
version: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
ip: '',
|
||||
@@ -135,9 +143,9 @@ const formData = reactive({
|
||||
})
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入办公名称' }],
|
||||
server_type: [{ required: true, message: '请选择办公类型' }],
|
||||
os: [{ required: true, message: '请选择操作系统' }],
|
||||
name: [{ required: true, message: '请输入中间件名称' }],
|
||||
middleware: [{ required: true, message: '请选择中间件类型' }],
|
||||
version: [{ required: true, message: '请输入版本号' }],
|
||||
}
|
||||
|
||||
const locationOptions = ref([
|
||||
@@ -158,8 +166,8 @@ watch(
|
||||
Object.assign(formData, {
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
middleware: '',
|
||||
version: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
ip: '',
|
||||
|
||||
@@ -16,13 +16,13 @@ export const columns = [
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'type',
|
||||
title: '类型',
|
||||
dataIndex: 'middleware',
|
||||
title: '中间件',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
dataIndex: 'os',
|
||||
title: '操作系统',
|
||||
dataIndex: 'version',
|
||||
title: '版本',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -41,40 +41,16 @@ export const columns = [
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'remote_access',
|
||||
title: '远程访问',
|
||||
width: 100,
|
||||
slotName: 'remote_access',
|
||||
},
|
||||
{
|
||||
dataIndex: 'agent_config',
|
||||
title: 'Agent配置',
|
||||
width: 150,
|
||||
slotName: 'agent_config',
|
||||
},
|
||||
{
|
||||
dataIndex: 'cpu',
|
||||
title: 'CPU使用率',
|
||||
dataIndex: 'sys_indicator',
|
||||
title: '系统指标',
|
||||
width: 150,
|
||||
slotName: 'cpu',
|
||||
},
|
||||
{
|
||||
dataIndex: 'memory',
|
||||
title: '内存使用率',
|
||||
dataIndex: 'middleware_indicator',
|
||||
title: '中间件指标',
|
||||
width: 150,
|
||||
slotName: 'memory',
|
||||
},
|
||||
{
|
||||
dataIndex: 'disk',
|
||||
title: '硬盘使用率',
|
||||
width: 150,
|
||||
slotName: 'disk',
|
||||
},
|
||||
{
|
||||
dataIndex: 'data_collection',
|
||||
title: '数据采集',
|
||||
width: 100,
|
||||
slotName: 'data_collection',
|
||||
slotName: 'middleware_indicator',
|
||||
},
|
||||
{
|
||||
dataIndex: 'status',
|
||||
|
||||
@@ -36,16 +36,16 @@
|
||||
{{ record.remote_access ? '已开启' : '未开启' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<!-- Agent配置 -->
|
||||
|
||||
<!-- Agent 配置 -->
|
||||
<template #agent_config="{ record }">
|
||||
<a-tag :color="record.agent_config ? 'green' : 'gray'">
|
||||
{{ record.agent_config ? '已配置' : '未配置' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<!-- CPU -->
|
||||
<template #cpu="{ record }">
|
||||
|
||||
<!-- 系统指标 -->
|
||||
<template #sys_indicator="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-label">CPU</span>
|
||||
@@ -59,12 +59,12 @@
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 内存 -->
|
||||
<template #memory="{ record }">
|
||||
|
||||
<!-- 中间件指标 -->
|
||||
<template #middleware_indicator="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-laebl">内存</span>
|
||||
<span class="resource-label">内存</span>
|
||||
<span class="resource-value">{{ record.memory_info?.value || 0 }}%</span>
|
||||
</div>
|
||||
<a-progress
|
||||
@@ -76,22 +76,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 硬盘 -->
|
||||
<template #disk="{ record }">
|
||||
<div class="resource-display">
|
||||
<div class="resource-info">
|
||||
<span class="resource-label">硬盘</span>
|
||||
<span class="resource-value">{{ record.disk_info?.value || 0 }}%</span>
|
||||
</div>
|
||||
<a-progress
|
||||
:percent="(record.disk_info?.value || 0) / 100"
|
||||
:color="getProgressColor(record.disk_info?.value || 0)"
|
||||
size="small"
|
||||
:show-text="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 数据采集 -->
|
||||
<template #data_collection="{ record }">
|
||||
<a-tag :color="record.data_collection ? 'green' : 'gray'">
|
||||
@@ -195,8 +179,8 @@ import {
|
||||
import type { FormItem } from '@/components/search-form/types'
|
||||
import SearchTable from '@/components/search-table/index.vue'
|
||||
import { searchFormConfig } from './config/search-form'
|
||||
import FormDialog from '../pc/components/FormDialog.vue'
|
||||
import QuickConfigDialog from '../pc/components/QuickConfigDialog.vue'
|
||||
import FormDialog from './components/FormDialog.vue'
|
||||
import QuickConfigDialog from './components/QuickConfigDialog.vue'
|
||||
import { columns as columnsConfig } from './config/columns'
|
||||
import {
|
||||
fetchServerList,
|
||||
@@ -209,201 +193,161 @@ const router = useRouter()
|
||||
const mockServerData = [
|
||||
{
|
||||
id: 1,
|
||||
unique_id: 'SRV-2024-0001',
|
||||
name: 'Web中间件-01',
|
||||
type: 'Web中间件',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心A-1楼-机柜01-U1',
|
||||
tags: 'Web,应用',
|
||||
unique_id: 'MW-2024-0001',
|
||||
name: 'Nginx 服务器 -01',
|
||||
middleware: 'nginx',
|
||||
version: '1.24.0',
|
||||
location: '数据中心 A-1 楼 -机柜 01-U1',
|
||||
tags: 'Web,负载均衡',
|
||||
ip: '192.168.1.101',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 45, total: '8核', used: '3.6核' },
|
||||
cpu_info: { value: 45, total: '8 核', used: '3.6 核' },
|
||||
memory_info: { value: 62, total: '32GB', used: '19.8GB' },
|
||||
disk_info: { value: 78, total: '1TB', used: '780GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unique_id: 'SRV-2024-0002',
|
||||
name: '数据库中间件-01',
|
||||
type: '数据库中间件',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-1楼-机柜02-U1',
|
||||
tags: '数据库,MySQL',
|
||||
unique_id: 'MW-2024-0002',
|
||||
name: 'Redis 缓存 -01',
|
||||
middleware: 'redis',
|
||||
version: '7.2.3',
|
||||
location: '数据中心 A-1 楼 -机柜 02-U1',
|
||||
tags: '缓存,高性能',
|
||||
ip: '192.168.1.102',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '2TB NVMe',
|
||||
cpu_info: { value: 78, total: '16核', used: '12.5核' },
|
||||
cpu_info: { value: 78, total: '16 核', used: '12.5 核' },
|
||||
memory_info: { value: 85, total: '64GB', used: '54.4GB' },
|
||||
disk_info: { value: 92, total: '2TB', used: '1.84TB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
unique_id: 'SRV-2024-0003',
|
||||
name: '应用中间件-01',
|
||||
type: '应用中间件',
|
||||
os: 'Windows Server 2019',
|
||||
location: '数据中心A-2楼-机柜05-U2',
|
||||
tags: '应用,.NET',
|
||||
unique_id: 'MW-2024-0003',
|
||||
name: 'Tomcat 应用 -01',
|
||||
middleware: 'tomcat',
|
||||
version: '10.1.15',
|
||||
location: '数据中心 A-2 楼 -机柜 05-U2',
|
||||
tags: '应用,Java',
|
||||
ip: '192.168.1.103',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
cpu_info: { value: 0, total: '4 核', used: '0 核' },
|
||||
memory_info: { value: 0, total: '16GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '500GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
status: 'offline',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
unique_id: 'SRV-2024-0004',
|
||||
name: '缓存中间件-01',
|
||||
type: '缓存中间件',
|
||||
os: 'CentOS 8.5',
|
||||
location: '数据中心A-2楼-机柜06-U1',
|
||||
tags: '缓存,Redis',
|
||||
unique_id: 'MW-2024-0004',
|
||||
name: 'Kafka 消息队列 -01',
|
||||
middleware: 'kafka',
|
||||
version: '3.6.0',
|
||||
location: '数据中心 A-2 楼 -机柜 06-U1',
|
||||
tags: '消息队列,分布式',
|
||||
ip: '192.168.1.104',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 35, total: '8核', used: '2.8核' },
|
||||
cpu_info: { value: 35, total: '8 核', used: '2.8 核' },
|
||||
memory_info: { value: 68, total: '32GB', used: '21.8GB' },
|
||||
disk_info: { value: 42, total: '1TB', used: '420GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
unique_id: 'SRV-2024-0005',
|
||||
name: '文件中间件-01',
|
||||
type: '文件中间件',
|
||||
os: 'Debian 11',
|
||||
location: '数据中心B-1楼-机柜03-U1',
|
||||
tags: '文件,NFS',
|
||||
unique_id: 'MW-2024-0005',
|
||||
name: 'Elasticsearch-01',
|
||||
middleware: 'elasticsearch',
|
||||
version: '8.11.1',
|
||||
location: '数据中心 B-1 楼 -机柜 03-U1',
|
||||
tags: '搜索,日志分析',
|
||||
ip: '192.168.2.101',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '10TB HDD',
|
||||
cpu_info: { value: 28, total: '12核', used: '3.4核' },
|
||||
cpu_info: { value: 28, total: '12 核', used: '3.4 核' },
|
||||
memory_info: { value: 45, total: '48GB', used: '21.6GB' },
|
||||
disk_info: { value: 88, total: '10TB', used: '8.8TB' },
|
||||
data_collection: true,
|
||||
status: 'maintenance',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
unique_id: 'SRV-2024-0006',
|
||||
name: '测试中间件-01',
|
||||
type: '测试中间件',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心B-2楼-机柜10-U1',
|
||||
tags: '测试,开发',
|
||||
unique_id: 'MW-2024-0006',
|
||||
name: 'RabbitMQ-01',
|
||||
middleware: 'rabbitmq',
|
||||
version: '3.12.10',
|
||||
location: '数据中心 B-2 楼 -机柜 10-U1',
|
||||
tags: '消息队列,AMQP',
|
||||
ip: '192.168.2.102',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '8GB',
|
||||
disk: '256GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
cpu_info: { value: 0, total: '4 核', used: '0 核' },
|
||||
memory_info: { value: 0, total: '8GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '256GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
status: 'retired',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
unique_id: 'SRV-2024-0007',
|
||||
name: '监控中间件-01',
|
||||
type: '监控中间件',
|
||||
os: 'Ubuntu 20.04',
|
||||
location: '数据中心A-1楼-机柜08-U1',
|
||||
tags: '监控,Prometheus',
|
||||
unique_id: 'MW-2024-0007',
|
||||
name: 'Nginx 反向代理 -01',
|
||||
middleware: 'nginx',
|
||||
version: '1.25.3',
|
||||
location: '数据中心 A-1 楼 -机柜 08-U1',
|
||||
tags: '反向代理,负载均衡',
|
||||
ip: '192.168.1.105',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 55, total: '8核', used: '4.4核' },
|
||||
cpu_info: { value: 55, total: '8 核', used: '4.4 核' },
|
||||
memory_info: { value: 72, total: '32GB', used: '23.0GB' },
|
||||
disk_info: { value: 65, total: '1TB', used: '650GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
unique_id: 'SRV-2024-0008',
|
||||
name: '备份中间件-01',
|
||||
type: '备份中间件',
|
||||
os: 'Rocky Linux 9',
|
||||
location: '数据中心B-1楼-机柜04-U1',
|
||||
tags: '备份,存储',
|
||||
unique_id: 'MW-2024-0008',
|
||||
name: 'Redis 集群 -01',
|
||||
middleware: 'redis',
|
||||
version: '7.0.15',
|
||||
location: '数据中心 B-1 楼 -机柜 04-U1',
|
||||
tags: '缓存,集群',
|
||||
ip: '192.168.2.103',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '20TB HDD',
|
||||
cpu_info: { value: 42, total: '16核', used: '6.7核' },
|
||||
cpu_info: { value: 42, total: '16 核', used: '6.7 核' },
|
||||
memory_info: { value: 38, total: '64GB', used: '24.3GB' },
|
||||
disk_info: { value: 75, total: '20TB', used: '15TB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
unique_id: 'SRV-2024-0009',
|
||||
name: 'CI/CD中间件-01',
|
||||
type: 'CI/CD中间件',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-2楼-机柜07-U1',
|
||||
tags: 'CI/CD,Jenkins',
|
||||
unique_id: 'MW-2024-0009',
|
||||
name: 'Tomcat 集群 -01',
|
||||
middleware: 'tomcat',
|
||||
version: '9.0.83',
|
||||
location: '数据中心 A-2 楼 -机柜 07-U1',
|
||||
tags: '应用,集群',
|
||||
ip: '192.168.1.106',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 68, total: '8核', used: '5.4核' },
|
||||
cpu_info: { value: 68, total: '8 核', used: '5.4 核' },
|
||||
memory_info: { value: 75, total: '16GB', used: '12GB' },
|
||||
disk_info: { value: 55, total: '500GB', used: '275GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
unique_id: 'SRV-2024-0010',
|
||||
name: '日志中间件-01',
|
||||
type: '日志中间件',
|
||||
os: 'CentOS Stream 9',
|
||||
location: '数据中心B-2楼-机柜12-U1',
|
||||
tags: '日志,ELK',
|
||||
unique_id: 'MW-2024-0010',
|
||||
name: 'Kafka 日志 -01',
|
||||
middleware: 'kafka',
|
||||
version: '3.5.2',
|
||||
location: '数据中心 B-2 楼 -机柜 12-U1',
|
||||
tags: '日志,流处理',
|
||||
ip: '192.168.2.104',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '2TB SSD',
|
||||
cpu_info: { value: 0, total: '12核', used: '0核' },
|
||||
cpu_info: { value: 0, total: '12 核', used: '0 核' },
|
||||
memory_info: { value: 0, total: '48GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '2TB', used: '0TB' },
|
||||
data_collection: true,
|
||||
status: 'offline',
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
:title="isEdit ? '编辑办公PC' : '新增办公PC'"
|
||||
:title="isEdit ? '编辑网络设备' : '新增网络设备'"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
@update:visible="handleUpdateVisible"
|
||||
@@ -14,28 +14,72 @@
|
||||
<a-form-item field="unique_id" label="唯一标识">
|
||||
<a-input
|
||||
v-model="formData.unique_id"
|
||||
placeholder="输入为空系统自动生成UUID"
|
||||
placeholder="输入为空系统自动生成 UUID"
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="name" label="办公PC名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入办公PC名称" />
|
||||
<a-form-item field="name" label="设备名称">
|
||||
<a-input v-model="formData.name" placeholder="请输入设备名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="os" label="操作系统">
|
||||
<a-select v-model="formData.os" placeholder="请选择操作系统">
|
||||
<a-option value="windows">Windows</a-option>
|
||||
<a-option value="linux">Linux</a-option>
|
||||
<a-option value="other">其它</a-option>
|
||||
<a-form-item field="type" label="设备类型">
|
||||
<a-select v-model="formData.type" placeholder="请选择设备类型">
|
||||
<a-option value="交换机">交换机</a-option>
|
||||
<a-option value="路由器">路由器</a-option>
|
||||
<a-option value="防火墙">防火墙</a-option>
|
||||
<a-option value="负载均衡">负载均衡</a-option>
|
||||
<a-option value="无线控制器">无线控制器</a-option>
|
||||
<a-option value="其它">其它</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="manu" label="厂商">
|
||||
<a-select v-model="formData.manu" placeholder="请选择厂商">
|
||||
<a-option value="华为">华为</a-option>
|
||||
<a-option value="华三">华三</a-option>
|
||||
<a-option value="思科">思科</a-option>
|
||||
<a-option value="深信服">深信服</a-option>
|
||||
<a-option value="F5">F5</a-option>
|
||||
<a-option value="锐捷">锐捷</a-option>
|
||||
<a-option value="TP-LINK">TP-LINK</a-option>
|
||||
<a-option value="其它">其它</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="model_num" label="型号">
|
||||
<a-input v-model="formData.model_num" placeholder="请输入设备型号" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="protocol" label="通讯协议">
|
||||
<a-select v-model="formData.protocol" placeholder="请选择通讯协议">
|
||||
<a-option value="SNMP">SNMP</a-option>
|
||||
<a-option value="TELNET">TELNET</a-option>
|
||||
<a-option value="SSH">SSH</a-option>
|
||||
<a-option value="HTTP">HTTP</a-option>
|
||||
<a-option value="HTTPS">HTTPS</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="ip" label="IP 地址">
|
||||
<a-input v-model="formData.ip" placeholder="可以输入多个 IP,逗号做分隔" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="tags" label="标签">
|
||||
<a-input v-model="formData.tags" placeholder="多个标签,逗号间隔" />
|
||||
@@ -50,41 +94,6 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="ip" label="IP地址">
|
||||
<a-input v-model="formData.ip" placeholder="可以输入多个IP,逗号做分隔" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="remote_port" label="远程访问端口">
|
||||
<a-input v-model="formData.remote_port" placeholder="为空则不可远程访问" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item field="agent_url" label="Agent URL配置">
|
||||
<a-input v-model="formData.agent_url" placeholder="请输入Agent URL配置" />
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="data_collection" label="数据采集">
|
||||
<a-switch v-model="formData.data_collection" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item v-if="formData.data_collection" field="collection_interval" label="采集时间">
|
||||
<a-select v-model="formData.collection_interval" placeholder="请选择采集时间">
|
||||
<a-option :value="1">1分钟</a-option>
|
||||
<a-option :value="5">5分钟</a-option>
|
||||
<a-option :value="10">10分钟</a-option>
|
||||
<a-option :value="30">30分钟</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item field="remark" label="备注信息">
|
||||
<a-textarea
|
||||
v-model="formData.remark"
|
||||
@@ -115,39 +124,28 @@ const emit = defineEmits(['update:visible', 'success'])
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const confirmLoading = ref(false)
|
||||
const selectedLocation = ref('')
|
||||
|
||||
const isEdit = computed(() => !!props.record?.id)
|
||||
|
||||
const formData = reactive({
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
type: '',
|
||||
manu: '',
|
||||
model_num: '',
|
||||
protocol: '',
|
||||
ip: '',
|
||||
remote_port: '',
|
||||
agent_url: '',
|
||||
data_collection: false,
|
||||
collection_interval: 5,
|
||||
tags: '',
|
||||
location: '',
|
||||
remark: '',
|
||||
})
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入办公名称' }],
|
||||
server_type: [{ required: true, message: '请选择办公类型' }],
|
||||
os: [{ required: true, message: '请选择操作系统' }],
|
||||
name: [{ required: true, message: '请输入设备名称' }],
|
||||
type: [{ required: true, message: '请选择设备类型' }],
|
||||
manu: [{ required: true, message: '请选择厂商' }],
|
||||
}
|
||||
|
||||
const locationOptions = ref([
|
||||
{ label: 'A数据中心-3层-24机柜-5U位', value: 'A数据中心-3层-24机柜-5U位' },
|
||||
{ label: 'A数据中心-3层-24机柜-6U位', value: 'A数据中心-3层-24机柜-6U位' },
|
||||
{ label: 'B数据中心-1层-12机柜-1U位', value: 'B数据中心-1层-12机柜-1U位' },
|
||||
{ label: 'B数据中心-1层-12机柜-2U位', value: 'B数据中心-1层-12机柜-2U位' },
|
||||
{ label: 'C数据中心-2层-8机柜-3U位', value: 'C数据中心-2层-8机柜-3U位' },
|
||||
])
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
@@ -158,15 +156,13 @@ watch(
|
||||
Object.assign(formData, {
|
||||
unique_id: '',
|
||||
name: '',
|
||||
server_type: '',
|
||||
os: '',
|
||||
location: '',
|
||||
tags: '',
|
||||
type: '',
|
||||
manu: '',
|
||||
model_num: '',
|
||||
protocol: '',
|
||||
ip: '',
|
||||
remote_port: '',
|
||||
agent_url: '',
|
||||
data_collection: false,
|
||||
collection_interval: 5,
|
||||
tags: '',
|
||||
location: '',
|
||||
remark: '',
|
||||
})
|
||||
}
|
||||
@@ -174,10 +170,6 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
const handleLocationSelect = (value: string) => {
|
||||
formData.location = value
|
||||
}
|
||||
|
||||
const handleOk = async () => {
|
||||
try {
|
||||
await formRef.value?.validate()
|
||||
@@ -208,4 +200,4 @@ const handleCancel = () => {
|
||||
emit('update:visible', false)
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -7,7 +7,7 @@ export const columns = [
|
||||
},
|
||||
{
|
||||
dataIndex: 'unique_id',
|
||||
title: '唯一标识',
|
||||
title: 'OID',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -21,8 +21,13 @@ export const columns = [
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
dataIndex: 'os',
|
||||
title: '操作系统',
|
||||
dataIndex: 'manu',
|
||||
title: '厂商',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'model_num',
|
||||
title: '型号',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -41,40 +46,15 @@ export const columns = [
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
dataIndex: 'remote_access',
|
||||
title: '远程访问',
|
||||
dataIndex: 'protocol',
|
||||
title: '通讯协议',
|
||||
width: 100,
|
||||
slotName: 'remote_access',
|
||||
},
|
||||
{
|
||||
dataIndex: 'agent_config',
|
||||
title: 'Agent配置',
|
||||
dataIndex: 'indicator',
|
||||
title: '网络设备指标',
|
||||
width: 150,
|
||||
slotName: 'agent_config',
|
||||
},
|
||||
{
|
||||
dataIndex: 'cpu',
|
||||
title: 'CPU使用率',
|
||||
width: 150,
|
||||
slotName: 'cpu',
|
||||
},
|
||||
{
|
||||
dataIndex: 'memory',
|
||||
title: '内存使用率',
|
||||
width: 150,
|
||||
slotName: 'memory',
|
||||
},
|
||||
{
|
||||
dataIndex: 'disk',
|
||||
title: '硬盘使用率',
|
||||
width: 150,
|
||||
slotName: 'disk',
|
||||
},
|
||||
{
|
||||
dataIndex: 'data_collection',
|
||||
title: '数据采集',
|
||||
width: 100,
|
||||
slotName: 'data_collection',
|
||||
slotName: 'indicator',
|
||||
},
|
||||
{
|
||||
dataIndex: 'status',
|
||||
|
||||
@@ -109,29 +109,12 @@
|
||||
<!-- 操作栏 - 下拉菜单 -->
|
||||
<template #actions="{ record }">
|
||||
<a-space>
|
||||
<a-button
|
||||
v-if="!record.agent_config"
|
||||
type="outline"
|
||||
size="small"
|
||||
@click="handleQuickConfig(record)"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-settings />
|
||||
</template>
|
||||
快捷配置
|
||||
</a-button>
|
||||
<a-dropdown trigger="hover">
|
||||
<a-button type="primary" size="small">
|
||||
管理
|
||||
<icon-down />
|
||||
</a-button>
|
||||
<template #content>
|
||||
<a-doption @click="handleRestart(record)">
|
||||
<template #icon>
|
||||
<icon-refresh />
|
||||
</template>
|
||||
重启
|
||||
</a-doption>
|
||||
<a-doption @click="handleDetail(record)">
|
||||
<template #icon>
|
||||
<icon-eye />
|
||||
@@ -144,12 +127,6 @@
|
||||
</template>
|
||||
编辑
|
||||
</a-doption>
|
||||
<a-doption @click="handleRemoteControl(record)">
|
||||
<template #icon>
|
||||
<icon-desktop />
|
||||
</template>
|
||||
远程控制
|
||||
</a-doption>
|
||||
<a-doption @click="handleDelete(record)" style="color: rgb(var(--danger-6))">
|
||||
<template #icon>
|
||||
<icon-delete />
|
||||
@@ -195,8 +172,7 @@ import {
|
||||
import type { FormItem } from '@/components/search-form/types'
|
||||
import SearchTable from '@/components/search-table/index.vue'
|
||||
import { searchFormConfig } from './config/search-form'
|
||||
import FormDialog from '../pc/components/FormDialog.vue'
|
||||
import QuickConfigDialog from '../pc/components/QuickConfigDialog.vue'
|
||||
import FormDialog from './components/FormDialog.vue'
|
||||
import { columns as columnsConfig } from './config/columns'
|
||||
import {
|
||||
fetchServerList,
|
||||
@@ -209,204 +185,116 @@ const router = useRouter()
|
||||
const mockServerData = [
|
||||
{
|
||||
id: 1,
|
||||
unique_id: 'SRV-2024-0001',
|
||||
name: 'Web网络设备-01',
|
||||
type: 'Web网络设备',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心A-1楼-机柜01-U1',
|
||||
tags: 'Web,应用',
|
||||
ip: '192.168.1.101',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 45, total: '8核', used: '3.6核' },
|
||||
memory_info: { value: 62, total: '32GB', used: '19.8GB' },
|
||||
disk_info: { value: 78, total: '1TB', used: '780GB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0001',
|
||||
name: '核心交换机 -01',
|
||||
type: '交换机',
|
||||
manu: '华为',
|
||||
model_num: 'CE6857-48S6CQ',
|
||||
location: '数据中心 A-3 层 -24 机柜 -5U 位',
|
||||
tags: '核心,生产',
|
||||
ip: '192.168.1.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:45%,内存:62%',
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
unique_id: 'SRV-2024-0002',
|
||||
name: '数据库网络设备-01',
|
||||
type: '数据库网络设备',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-1楼-机柜02-U1',
|
||||
tags: '数据库,MySQL',
|
||||
ip: '192.168.1.102',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '2TB NVMe',
|
||||
cpu_info: { value: 78, total: '16核', used: '12.5核' },
|
||||
memory_info: { value: 85, total: '64GB', used: '54.4GB' },
|
||||
disk_info: { value: 92, total: '2TB', used: '1.84TB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0002',
|
||||
name: '汇聚路由器 -01',
|
||||
type: '路由器',
|
||||
manu: '思科',
|
||||
model_num: 'ISR4451-X/K9',
|
||||
location: '数据中心 A-3 层 -24 机柜 -6U 位',
|
||||
tags: '汇聚,生产',
|
||||
ip: '192.168.1.2',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:78%,内存:85%',
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
unique_id: 'SRV-2024-0003',
|
||||
name: '应用网络设备-01',
|
||||
type: '应用网络设备',
|
||||
os: 'Windows Server 2019',
|
||||
location: '数据中心A-2楼-机柜05-U2',
|
||||
tags: '应用,.NET',
|
||||
ip: '192.168.1.103',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
memory_info: { value: 0, total: '16GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '500GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
unique_id: 'NET-2024-0003',
|
||||
name: '接入交换机 -01',
|
||||
type: '交换机',
|
||||
manu: '华三',
|
||||
model_num: 'S5560X-54C-EI',
|
||||
location: '数据中心 B-1 层 -12 机柜 -1U 位',
|
||||
tags: '接入,办公',
|
||||
ip: '192.168.2.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: '-',
|
||||
status: 'offline',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
unique_id: 'SRV-2024-0004',
|
||||
name: '缓存网络设备-01',
|
||||
type: '缓存网络设备',
|
||||
os: 'CentOS 8.5',
|
||||
location: '数据中心A-2楼-机柜06-U1',
|
||||
tags: '缓存,Redis',
|
||||
ip: '192.168.1.104',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 35, total: '8核', used: '2.8核' },
|
||||
memory_info: { value: 68, total: '32GB', used: '21.8GB' },
|
||||
disk_info: { value: 42, total: '1TB', used: '420GB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0004',
|
||||
name: '防火墙 -01',
|
||||
type: '防火墙',
|
||||
manu: '深信服',
|
||||
model_num: 'AF-2000',
|
||||
location: '数据中心 B-1 层 -12 机柜 -2U 位',
|
||||
tags: '安全,边界',
|
||||
ip: '192.168.1.254',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:35%,内存:68%',
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
unique_id: 'SRV-2024-0005',
|
||||
name: '文件网络设备-01',
|
||||
type: '文件网络设备',
|
||||
os: 'Debian 11',
|
||||
location: '数据中心B-1楼-机柜03-U1',
|
||||
tags: '文件,NFS',
|
||||
ip: '192.168.2.101',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '10TB HDD',
|
||||
cpu_info: { value: 28, total: '12核', used: '3.4核' },
|
||||
memory_info: { value: 45, total: '48GB', used: '21.6GB' },
|
||||
disk_info: { value: 88, total: '10TB', used: '8.8TB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0005',
|
||||
name: '负载均衡器 -01',
|
||||
type: '负载均衡',
|
||||
manu: 'F5',
|
||||
model_num: 'BIG-IP i2800',
|
||||
location: '数据中心 C-2 层 -8 机柜 -3U 位',
|
||||
tags: '负载,应用',
|
||||
ip: '192.168.3.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:28%,内存:45%',
|
||||
status: 'maintenance',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
unique_id: 'SRV-2024-0006',
|
||||
name: '测试网络设备-01',
|
||||
type: '测试网络设备',
|
||||
os: 'CentOS 7.9',
|
||||
location: '数据中心B-2楼-机柜10-U1',
|
||||
tags: '测试,开发',
|
||||
ip: '192.168.2.102',
|
||||
remote_access: false,
|
||||
agent_config: false,
|
||||
cpu: '4核 Intel Xeon',
|
||||
memory: '8GB',
|
||||
disk: '256GB SSD',
|
||||
cpu_info: { value: 0, total: '4核', used: '0核' },
|
||||
memory_info: { value: 0, total: '8GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '256GB', used: '0GB' },
|
||||
data_collection: false,
|
||||
unique_id: 'NET-2024-0006',
|
||||
name: '无线控制器 -01',
|
||||
type: '无线控制器',
|
||||
manu: '锐捷',
|
||||
model_num: 'WS6008',
|
||||
location: '数据中心 A-1 层 -05 机柜 -8U 位',
|
||||
tags: '无线,办公',
|
||||
ip: '192.168.4.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: '-',
|
||||
status: 'retired',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
unique_id: 'SRV-2024-0007',
|
||||
name: '监控网络设备-01',
|
||||
type: '监控网络设备',
|
||||
os: 'Ubuntu 20.04',
|
||||
location: '数据中心A-1楼-机柜08-U1',
|
||||
tags: '监控,Prometheus',
|
||||
ip: '192.168.1.105',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '32GB',
|
||||
disk: '1TB SSD',
|
||||
cpu_info: { value: 55, total: '8核', used: '4.4核' },
|
||||
memory_info: { value: 72, total: '32GB', used: '23.0GB' },
|
||||
disk_info: { value: 65, total: '1TB', used: '650GB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0007',
|
||||
name: '光模块交换机 -01',
|
||||
type: '交换机',
|
||||
manu: '华为',
|
||||
model_num: 'CE8850-64CQ-EI',
|
||||
location: '数据中心 A-2 层 -15 机柜 -10U 位',
|
||||
tags: '高速,存储网络',
|
||||
ip: '192.168.5.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:55%,内存:72%',
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
unique_id: 'SRV-2024-0008',
|
||||
name: '备份网络设备-01',
|
||||
type: '备份网络设备',
|
||||
os: 'Rocky Linux 9',
|
||||
location: '数据中心B-1楼-机柜04-U1',
|
||||
tags: '备份,存储',
|
||||
ip: '192.168.2.103',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '16核 AMD EPYC',
|
||||
memory: '64GB',
|
||||
disk: '20TB HDD',
|
||||
cpu_info: { value: 42, total: '16核', used: '6.7核' },
|
||||
memory_info: { value: 38, total: '64GB', used: '24.3GB' },
|
||||
disk_info: { value: 75, total: '20TB', used: '15TB' },
|
||||
data_collection: true,
|
||||
unique_id: 'NET-2024-0008',
|
||||
name: '管理交换机 -01',
|
||||
type: '交换机',
|
||||
manu: 'TP-LINK',
|
||||
model_num: 'TL-SG3428',
|
||||
location: '数据中心 B-2 层 -18 机柜 -12U 位',
|
||||
tags: '管理,带外',
|
||||
ip: '192.168.100.1',
|
||||
protocol: 'SNMP',
|
||||
indicator: 'CPU:42%,内存:38%',
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
unique_id: 'SRV-2024-0009',
|
||||
name: 'CI/CD网络设备-01',
|
||||
type: 'CI/CD网络设备',
|
||||
os: 'Ubuntu 22.04',
|
||||
location: '数据中心A-2楼-机柜07-U1',
|
||||
tags: 'CI/CD,Jenkins',
|
||||
ip: '192.168.1.106',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '8核 Intel Xeon',
|
||||
memory: '16GB',
|
||||
disk: '500GB SSD',
|
||||
cpu_info: { value: 68, total: '8核', used: '5.4核' },
|
||||
memory_info: { value: 75, total: '16GB', used: '12GB' },
|
||||
disk_info: { value: 55, total: '500GB', used: '275GB' },
|
||||
data_collection: true,
|
||||
status: 'online',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
unique_id: 'SRV-2024-0010',
|
||||
name: '日志网络设备-01',
|
||||
type: '日志网络设备',
|
||||
os: 'CentOS Stream 9',
|
||||
location: '数据中心B-2楼-机柜12-U1',
|
||||
tags: '日志,ELK',
|
||||
ip: '192.168.2.104',
|
||||
remote_access: true,
|
||||
agent_config: true,
|
||||
cpu: '12核 Intel Xeon',
|
||||
memory: '48GB',
|
||||
disk: '2TB SSD',
|
||||
cpu_info: { value: 0, total: '12核', used: '0核' },
|
||||
memory_info: { value: 0, total: '48GB', used: '0GB' },
|
||||
disk_info: { value: 0, total: '2TB', used: '0TB' },
|
||||
data_collection: true,
|
||||
status: 'offline',
|
||||
},
|
||||
]
|
||||
|
||||
// 状态管理
|
||||
|
||||
Reference in New Issue
Block a user