|
|
@@ -33,6 +33,28 @@
|
|
|
<a-space>
|
|
|
<a @click="getSys(record)">系统信息</a>
|
|
|
<a @click="openlevelUpModal(record)">算子升级</a>
|
|
|
+ <a-dropdown>
|
|
|
+ <a class="ant-dropdown-link" @click.prevent>
|
|
|
+ 属性
|
|
|
+ <DownOutlined />
|
|
|
+ </a>
|
|
|
+ <template #overlay>
|
|
|
+ <a-menu>
|
|
|
+ <a-menu-item>
|
|
|
+ <a href="javascript:;" @click="deviceAttr('flow', record.clientId)" >视频</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a href="javascript:;" @click="deviceAttr('aiTask', record.clientId)" >任务</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a href="javascript:;" @click="deviceAttr('arg', record.clientId)">参数</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a href="javascript:;" @click="deviceAttr('plan', record.clientId)">计划</a>
|
|
|
+ </a-menu-item>
|
|
|
+ </a-menu>
|
|
|
+ </template>
|
|
|
+ </a-dropdown>
|
|
|
<a-dropdown>
|
|
|
<a class="ant-dropdown-link" @click.prevent>
|
|
|
操作
|
|
|
@@ -41,7 +63,7 @@
|
|
|
<template #overlay>
|
|
|
<a-menu>
|
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;" @click="getMeta" >运行参数</a>
|
|
|
+ <a href="javascript:;" @click="openMetaModal" >运行参数</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
|
<a href="javascript:;" @click="getTime" >运行时间</a>
|
|
|
@@ -50,7 +72,7 @@
|
|
|
<a href="javascript:;" @click="calibrationTime">校准时间</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;" @click="getNet">网络信息</a>
|
|
|
+ <a href="javascript:;" @click="openNetModal">网络信息</a>
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
</template>
|
|
|
@@ -61,6 +83,7 @@
|
|
|
</template>
|
|
|
</table-pro>
|
|
|
|
|
|
+ <!-- 系统信息 -->
|
|
|
<modal-pro
|
|
|
:labe="'客户端ID:' + sys?.clientId"
|
|
|
:open="sysVisible"
|
|
|
@@ -79,6 +102,41 @@
|
|
|
</a-form>
|
|
|
</modal-pro>
|
|
|
|
|
|
+ <!-- 运行参数 -->
|
|
|
+ <modal-pro
|
|
|
+ width="800px"
|
|
|
+ title="运行参数"
|
|
|
+ :open="metaVisible"
|
|
|
+ @cancel="metaVisible = false"
|
|
|
+ @ok="metaVisible = true"
|
|
|
+ >
|
|
|
+ <a-descriptions title="" bordered :column="2" :contentStyle="{antDescriptionsItemLabel: '#fff'}" >
|
|
|
+ <a-descriptions-item label="cpu核数">{{metaState?.coreCount}}核</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="cpu使用率">
|
|
|
+ <div class="process-container" >
|
|
|
+ <div class="process" :style="{width: metaState?.CPUUsage.toFixed(2) + '%'}" ></div>
|
|
|
+ <div class="count" >{{metaState?.CPUUsage.toFixed(2)}}%</div>
|
|
|
+ </div>
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="内存"> 已使用 / 总内存 : {{metaState?.freeDiskSpace_GB.toFixed(2)}}GB / {{metaState.systemdata?.totalDiskSpace_GB.toFixed(2)}}GB </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="内存使用率">
|
|
|
+ <div class="process-container" >
|
|
|
+ <div class="process" :style="{width: metaState?.diskRate + '%'}"></div>
|
|
|
+ <div class="count" >{{metaState?.diskRate}}%</div>
|
|
|
+ </div>
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="存储">
|
|
|
+ 已使用 / 总存储 : {{metaState?.freeMemory_GB.toFixed(2)}}GB / {{metaState?.totalMemory_GB.toFixed(2)}}GB
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="存储使用率">
|
|
|
+ <div class="process-container" >
|
|
|
+ <div class="process" :style="{width: metaState?.memoryRate + '%'}"></div>
|
|
|
+ <div class="count" >{{metaState?.memoryRate}}%</div>
|
|
|
+ </div>
|
|
|
+ </a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </modal-pro>
|
|
|
+ <!-- 算子升级 -->
|
|
|
<modal-pro
|
|
|
style="width: 700px;"
|
|
|
label="算子升级"
|
|
|
@@ -114,6 +172,41 @@
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</modal-pro>
|
|
|
+
|
|
|
+ <!-- 网络信息 -->
|
|
|
+ <!-- okText="修改" -->
|
|
|
+ <modal-pro
|
|
|
+ style="width: 700px;"
|
|
|
+ label="网络信息"
|
|
|
+ :open="netVisible"
|
|
|
+ @cancel="netVisible = false"
|
|
|
+ @ok="netVisible = false"
|
|
|
+ >
|
|
|
+ <a-form
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 14 }"
|
|
|
+ >
|
|
|
+ <a-form-item label="网卡名称" v-bind="validateInfos.networkIDName">
|
|
|
+ <a-input v-model:value="netState.networkIDName" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="网络地址" v-bind="validateInfos.networkAddr">
|
|
|
+ <a-input v-model:value="netState.networkAddr" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="子网掩码" v-bind="validateInfos.subnetMask">
|
|
|
+ <a-input v-model:value="netState.netMask" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="网关" v-bind="validateInfos.gatewayAddr" >
|
|
|
+ <a-input v-model:value="netState.gatewayAddr" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="物理地址" v-bind="validateInfos.physicalAddr" >
|
|
|
+ <a-input v-model:value="netState.physicalAddr" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="dns" v-bind="validateInfos.dnsAddr" >
|
|
|
+ <a-input v-model:value="netState.domainNameSys" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </modal-pro>
|
|
|
+
|
|
|
</a-card>
|
|
|
</template>
|
|
|
<script lang='ts' setup >
|
|
|
@@ -121,10 +214,10 @@ import { AiboxCloudController, AiboxController, OperatorController, SpaceControl
|
|
|
import dayjs from 'dayjs'
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
-import { Form } from 'ant-design-vue'
|
|
|
+import { Form, message } from 'ant-design-vue'
|
|
|
import { CopyTsx, InputTsx, SelectTsx } from '@/components/MicroComponents'
|
|
|
import UploadPro from '@/components/UploadPro'
|
|
|
-import { InboxOutlined } from '@ant-design/icons-vue'
|
|
|
+import { InboxOutlined, DownOutlined } from '@ant-design/icons-vue'
|
|
|
import { format } from 'echarts'
|
|
|
|
|
|
const router = useRouter()
|
|
|
@@ -176,6 +269,13 @@ const sys = ref<Partial<CVS.AiBox.Sys> & {clientId: string}>()
|
|
|
|
|
|
const sysVisible = ref<boolean>(false)
|
|
|
|
|
|
+const metaVisible = ref(false)
|
|
|
+
|
|
|
+const metaState = ref()
|
|
|
+
|
|
|
+const netVisible = ref(false)
|
|
|
+const netState = ref()
|
|
|
+
|
|
|
const levelUpVisble = ref(false)
|
|
|
const aiboxState = reactive({
|
|
|
clientId: '',
|
|
|
@@ -188,11 +288,17 @@ const aiboxState = reactive({
|
|
|
const useForm = Form.useForm
|
|
|
|
|
|
const { resetFields, validate, validateInfos } = useForm(aiboxState, {
|
|
|
- file: [{ required: true, message: '请上传文件' }],
|
|
|
+
|
|
|
+ // file: [{ required: true, message: '请上传文件' }],
|
|
|
version: [{ required: true, message: '请填写版本号' }],
|
|
|
aiId: [{ required: true, message: '请选择升级算法' }]
|
|
|
})
|
|
|
|
|
|
+const openMetaModal = async () => {
|
|
|
+ metaState.value = await AiboxCloudController.meta()
|
|
|
+ metaVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
const uploadDone = (file) => {
|
|
|
console.log(file)
|
|
|
// aiboxState.file = url
|
|
|
@@ -211,38 +317,74 @@ const customRequest = (file) => {
|
|
|
// return false
|
|
|
}
|
|
|
|
|
|
+const openNetModal = async () => {
|
|
|
+ netState.value = await AiboxCloudController.net()
|
|
|
+ netVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
const getSys = async (record: CVS.AiBox.AiBox) => {
|
|
|
sys.value = Object.assign({}, { ...await AiboxCloudController.sys(), clientId: record.clientId })
|
|
|
sysVisible.value = true
|
|
|
}
|
|
|
|
|
|
-const getMeta = () => {
|
|
|
- AiboxCloudController.meta()
|
|
|
+const getTime = async () => {
|
|
|
+ const timestamp = await AiboxCloudController.time()
|
|
|
+ message.success('当前设备运行时间:' + dayjs(timestamp * 1000).format('YYYY/MM/DD HH:mm:ss'))
|
|
|
}
|
|
|
|
|
|
-const getTime = () => {
|
|
|
- AiboxCloudController.time()
|
|
|
-}
|
|
|
-
|
|
|
-const calibrationTime = () => {
|
|
|
- AiboxCloudController.calibrationTime()
|
|
|
-}
|
|
|
-
|
|
|
-const getNet = () => {
|
|
|
- AiboxCloudController.net()
|
|
|
-}
|
|
|
+const calibrationTime = () => AiboxCloudController.calibrationTime()
|
|
|
|
|
|
const levelUpOk = async () => {
|
|
|
AiboxController.levelUp({ ...aiboxState, devId: aiboxState.clientId })
|
|
|
}
|
|
|
|
|
|
const openlevelUpModal = (record: CVS.AiBox.AiBox) => {
|
|
|
- console.log(record)
|
|
|
-
|
|
|
resetFields(record)
|
|
|
levelUpVisble.value = true
|
|
|
}
|
|
|
|
|
|
+const deviceAttr = (key: 'flow' | 'plan' | 'aiTask' | 'arg', clientId: string) => {
|
|
|
+ router.push({
|
|
|
+ path: '/cvs/edge/' + key,
|
|
|
+ query: { clientId }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
<style lang='less' scoped >
|
|
|
+
|
|
|
+.device-status {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .dot {
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ border-radius: 50%;
|
|
|
+ scale: 0.8;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.process-container {
|
|
|
+ width: 200px;
|
|
|
+ height: 20px;
|
|
|
+ border-radius: 10px;
|
|
|
+ overflow: hidden;
|
|
|
+ background-color: #f1ebeb;
|
|
|
+ line-height: 10px;
|
|
|
+ position: relative;
|
|
|
+ .process {
|
|
|
+ width: 0%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #1677ff;
|
|
|
+ }
|
|
|
+ .count {
|
|
|
+ margin: 0 auto;
|
|
|
+ color: #000;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|