feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间
This commit is contained in:
@@ -54,14 +54,29 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never" header="本机信息(只读)" style="margin-top:12px">
|
||||
<el-descriptions :column="2" border size="small" v-loading="loadingInfo">
|
||||
<el-descriptions-item label="操作系统">{{ info.os || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主机名">{{ info.hostname || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="Go 版本">{{ info.goVersion || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="监听端口">{{ info.port || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="启动时间">{{ info.startTime ? fmtTime(info.startTime) : '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="运行时长">{{ uptimeText }}</el-descriptions-item>
|
||||
<el-descriptions-item label="MES 地址" :span="2">
|
||||
{{ info.mesAddress || '-' }}
|
||||
<span class="tip" style="margin-left:8px">只读;修改需编辑配置文件并重启服务</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { can } from '../utils/perm'
|
||||
import { fmtTime } from '../utils/format'
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
@@ -105,6 +120,28 @@ async function save() {
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
|
||||
// 本机只读信息
|
||||
const loadingInfo = ref(false)
|
||||
const info = ref({})
|
||||
const uptimeText = computed(() => {
|
||||
const s = info.value?.uptimeSeconds || 0
|
||||
if (s < 60) return s + ' 秒'
|
||||
if (s < 3600) return Math.floor(s / 60) + ' 分钟'
|
||||
if (s < 86400) return (s / 3600).toFixed(1) + ' 小时'
|
||||
return (s / 86400).toFixed(1) + ' 天'
|
||||
})
|
||||
async function loadInfo() {
|
||||
loadingInfo.value = true
|
||||
try {
|
||||
info.value = (await request.get('/system/info')) || {}
|
||||
} catch {
|
||||
// 拦截器已提示
|
||||
} finally {
|
||||
loadingInfo.value = false
|
||||
}
|
||||
}
|
||||
onMounted(loadInfo)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user