Skip to content

Commit fa4e062

Browse files
committed
machine-setup: add heartbeat/network info
1 parent 00d8347 commit fa4e062

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

packages/machine-setup/frontend/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<n-grid x-gap="12" :cols="2">
44
<n-gi>
55
<basic-info />
6-
<connect-server />
6+
<heartbeat-info />
77
<video-info />
88
</n-gi>
99
<n-gi>
@@ -19,7 +19,7 @@
1919
NGrid, NGi, darkTheme, NConfigProvider, useOsTheme,
2020
} from 'naive-ui';
2121
import BasicInfo from './components/BasicInfo.vue';
22-
import ConnectServer from './components/HeartbeatInfo.vue';
22+
import HeartbeatInfo from './components/HeartbeatInfo.vue';
2323
import SystemInfo from './components/SystemInfo.vue';
2424
import NetworkInfo from './components/NetworkInfo.vue';
2525
import VideoInfo from './components/VideoInfo.vue';
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<n-card bordered shadow="always">
3+
<n-grid x-gap="12" :cols="2">
4+
<n-gi>
5+
<p>XCPC-TOOLS 心跳上报状态:<n-tag :type="onHeartbeat ? 'success' : 'error'">{{ onHeartbeat ? '已开启' : '未开启' }}</n-tag></p>
6+
<p>当前上报中心:<n-tag :type="!heartbeaturl ? 'error' : 'success'">{{ heartbeaturl }}</n-tag></p>
7+
</n-gi>
8+
<n-gi>
9+
<n-input placeholder="请输入心跳上报URL" v-model:value="heartbeaturl" size="large" style="width: 100%; margin-bottom: .5em;" />
10+
<n-grid x-gap="12" :cols="2" style="width: 100%;">
11+
<n-gi>
12+
<n-button style="width: 100%;">保存</n-button>
13+
</n-gi>
14+
<n-gi>
15+
<n-button type="info" style="width: 100%;">测试</n-button>
16+
</n-gi>
17+
</n-grid>
18+
</n-gi>
19+
</n-grid>
20+
</n-card>
21+
</template>
22+
23+
<script setup lang="ts">
24+
import { NCard, NGrid, NGi, NButton, NInput } from 'naive-ui';
25+
import { ref } from 'vue';
26+
27+
const heartbeaturl = ref<string>('');
28+
const onHeartbeat = ref<boolean>(false);
29+
</script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<n-card bordered title="网络信息" shadow="always">
3+
<n-grid x-gap="12" :cols="2">
4+
<n-gi v-for="info in netInfo" :key="info.ip">
5+
<p>{{ info.dev }}/{{ info.mac }}</p>
6+
<p>IP: {{ info.ip }}</p>
7+
</n-gi>
8+
</n-grid>
9+
<p v-if="netInfo.length === 0">No network information found.</p>
10+
</n-card>
11+
</template>
12+
13+
<script setup lang="ts">
14+
import { ref } from 'vue';
15+
16+
const netInfo = ref<any[]>([]);
17+
</script>

0 commit comments

Comments
 (0)