mirror of https://github.com/1Panel-dev/1Panel
feat: 统一状态显示
parent
26039cc19d
commit
880ac3ec55
|
@ -17,7 +17,9 @@
|
|||
<el-col :lg="4" :xl="2">
|
||||
<div>
|
||||
{{ $t('commons.table.status') }}:
|
||||
<el-tag type="success">{{ data.status }}</el-tag>
|
||||
<el-tag type="info">
|
||||
<Status :status="data.status"></Status>
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :lg="8" :xl="4">
|
||||
|
@ -50,6 +52,7 @@ import i18n from '@/lang';
|
|||
import router from '@/routers';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import Status from '@/components/status/index.vue';
|
||||
|
||||
const props = defineProps({
|
||||
appKey: {
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<span :style="{ color: getColor(status) }">
|
||||
{{ $t('commons.status.' + status) }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
default: 'runnning',
|
||||
},
|
||||
});
|
||||
let status = ref('');
|
||||
|
||||
const getColor = (status: string) => {
|
||||
switch (status) {
|
||||
case 'running':
|
||||
return '#00c957';
|
||||
case 'error':
|
||||
return '#ff0000';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
status.value = props.status.toLocaleLowerCase();
|
||||
});
|
||||
</script>
|
|
@ -128,6 +128,11 @@ export default {
|
|||
changePassword: '修改密码',
|
||||
logout: '退出登录',
|
||||
},
|
||||
status: {
|
||||
running: '已启动',
|
||||
stopped: '已停止',
|
||||
error: '失败',
|
||||
},
|
||||
},
|
||||
menu: {
|
||||
home: '概览',
|
||||
|
|
|
@ -27,7 +27,11 @@
|
|||
{{ $t('website.' + row.type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('commons.table.status')" prop="status"></el-table-column>
|
||||
<el-table-column :label="$t('commons.table.status')" prop="status">
|
||||
<template #default="{ row }">
|
||||
<Status :status="row.status"></Status>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('website.remark')" prop="remark"></el-table-column>
|
||||
<el-table-column :label="$t('website.protocol')" prop="protocol"></el-table-column>
|
||||
<el-table-column :label="$t('website.expireDate')">
|
||||
|
@ -74,6 +78,7 @@ import { WebSite } from '@/api/interface/website';
|
|||
import AppStatus from '@/components/app-status/index.vue';
|
||||
import NginxConfig from './nginx/index.vue';
|
||||
import { dateFromat } from '@/utils/util';
|
||||
import Status from '@/components/status/index.vue';
|
||||
|
||||
import i18n from '@/lang';
|
||||
import router from '@/routers';
|
||||
|
|
Loading…
Reference in New Issue