diff --git a/frontend/src/components/content/ContentPane.vue b/frontend/src/components/content/ContentPane.vue index 4ab25d0..1b03fca 100644 --- a/frontend/src/components/content/ContentPane.vue +++ b/frontend/src/components/content/ContentPane.vue @@ -22,15 +22,29 @@ const serverName = computed(() => { } return '' }) -const refreshInfo = async () => { +const loadingServerInfo = ref(false) + +/** + * refresh server status info + * @param {boolean} [force] force refresh will show loading indicator + * @returns {Promise} + */ +const refreshInfo = async (force) => { + if (force) { + loadingServerInfo.value = true + } if (!isEmpty(serverName.value) && connectionStore.isConnected(serverName.value)) { - serverInfo.value = await connectionStore.getServerInfo(serverName.value) + try { + serverInfo.value = await connectionStore.getServerInfo(serverName.value) + } finally { + loadingServerInfo.value = false + } } } let intervalId onMounted(() => { - refreshInfo() + refreshInfo(true) intervalId = setInterval(() => { if (autoRefresh.value) { refreshInfo() @@ -143,7 +157,8 @@ const onCloseTab = (tabIndex) => { v-model:auto-refresh="autoRefresh" :server="serverName" :info="serverInfo" - @refresh="refreshInfo" + :loading="loadingServerInfo" + @refresh="refreshInfo(true)" />
diff --git a/frontend/src/components/content_value/ContentServerStatus.vue b/frontend/src/components/content_value/ContentServerStatus.vue index e4723c0..352488b 100644 --- a/frontend/src/components/content_value/ContentServerStatus.vue +++ b/frontend/src/components/content_value/ContentServerStatus.vue @@ -10,6 +10,7 @@ const props = defineProps({ server: String, info: Object, autoRefresh: false, + loading: false, }) const emit = defineEmits(['update:autoRefresh', 'refresh']) @@ -116,32 +117,34 @@ const infoFilter = ref('') - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + { title: $t('value'), key: 'value' }, + ]" + :data="infoList" + /> +