|
@ -1,15 +1,22 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="bg-white border-b p-5 flex flex-row flex-wrap"> |
|
|
|
|
|
<div class="p-1 grow" style="min-width:33.33%;" v-for="(status,index) in statuses" :key="index"> |
|
|
|
|
|
<div class="py-1 px-2 rounded border"> |
|
|
|
|
|
{{ status.name }} : |
|
|
|
|
|
<template v-if="isBoolean(status.value)"> |
|
|
|
|
|
<BulbOutlined class="align-text-bottom" :class="{'text-green-400':status.value}"/> |
|
|
|
|
|
</template> |
|
|
|
|
|
<span v-else>{{ status.value }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="flex flex-row flex-wrap p-5 bg-white"> |
|
|
|
|
|
<div v-for="group in statuses" :key="group.name" class="p-1" style="min-width: 25%;"> |
|
|
|
|
|
<fieldset class="border h-full"> |
|
|
|
|
|
<legend class="px-3">{{ group.name }} </legend> |
|
|
|
|
|
<table class="w-full"> |
|
|
|
|
|
<tr v-for="item in group.items" :key="item.key"> |
|
|
|
|
|
<td class="py-1 px-2">{{ item.name }} : </td> |
|
|
|
|
|
<td class="py-1 px-2"> |
|
|
|
|
|
<template v-if="isBoolean(item.value)"> |
|
|
|
|
|
<BulbOutlined class="align-text-bottom" :class="{'text-green-400':item.value}"/> |
|
|
|
|
|
</template> |
|
|
|
|
|
<span v-else>{{ item.value }}</span> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</table> |
|
|
|
|
|
</fieldset> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script setup> |
|
|
<script setup> |
|
|
import ApiClient from '@/utils/ApiClient'; |
|
|
import ApiClient from '@/utils/ApiClient'; |
|
@ -49,11 +56,28 @@ async function handleServiceKeyChange() { |
|
|
async function refreshServiceStatusList() { |
|
|
async function refreshServiceStatusList() { |
|
|
try { |
|
|
try { |
|
|
let client = ApiClient.getClient(); |
|
|
let client = ApiClient.getClient(); |
|
|
statuses.value = await client.call('service-config/service-status-list', {serviceKey:props.serviceKey}); |
|
|
|
|
|
|
|
|
let list = await client.call('service-config/service-status-list', {serviceKey:props.serviceKey}); |
|
|
|
|
|
|
|
|
|
|
|
statuses.value = []; |
|
|
|
|
|
for ( var item of list ) { |
|
|
|
|
|
let gname = item.group; |
|
|
|
|
|
let group = statuses.value.find(g => g.name == item.group); |
|
|
|
|
|
if ( undefined === group ) { |
|
|
|
|
|
group = {name:gname, order:item.order, items:[]}; |
|
|
|
|
|
statuses.value.push(group); |
|
|
|
|
|
} |
|
|
|
|
|
group.order = Math.max(group.order, item.order); |
|
|
|
|
|
group.items.push(item); |
|
|
|
|
|
group.items.sort((a,b) => a.order - b.order); |
|
|
|
|
|
} |
|
|
|
|
|
statuses.value.sort((a,b) => a.order - b.order); |
|
|
|
|
|
console.log(statuses.value); |
|
|
if ( false !== statusRefreshTimer ) { |
|
|
if ( false !== statusRefreshTimer ) { |
|
|
statusRefreshTimer = setTimeout(refreshServiceStatusList, 1000); |
|
|
statusRefreshTimer = setTimeout(refreshServiceStatusList, 1000); |
|
|
} |
|
|
} |
|
|
} catch ( e ) {/** nothing to do here */} |
|
|
|
|
|
|
|
|
} catch ( e ) { |
|
|
|
|
|
console.error(e); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// is boolean |
|
|
// is boolean |
|
|