diff --git a/frontend/src/composables/useNodeList.js b/frontend/src/composables/useNodeList.js index ca4f416d..9d817bce 100644 --- a/frontend/src/composables/useNodeList.js +++ b/frontend/src/composables/useNodeList.js @@ -36,7 +36,9 @@ export function useNodeList() { return n != null && n.enable && n.status === 'online'; } + const hasActive = computed(() => nodes.value.some((n) => n.enable)); + onMounted(refresh); - return { nodes, fetched, refresh, byId, nameFor, isOnline }; + return { nodes, fetched, refresh, byId, nameFor, isOnline, hasActive }; } diff --git a/frontend/src/pages/inbounds/InboundFormModal.vue b/frontend/src/pages/inbounds/InboundFormModal.vue index 7151350c..45c30a9e 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.vue +++ b/frontend/src/pages/inbounds/InboundFormModal.vue @@ -582,7 +582,7 @@ watch( - + {{ t('pages.inbounds.localPanel') }} diff --git a/frontend/src/pages/inbounds/InboundList.vue b/frontend/src/pages/inbounds/InboundList.vue index cface361..12668cd3 100644 --- a/frontend/src/pages/inbounds/InboundList.vue +++ b/frontend/src/pages/inbounds/InboundList.vue @@ -49,6 +49,7 @@ const props = defineProps({ // Map node id -> node row, supplied by the parent page so each // inbound row can render its node name without an extra fetch. nodesById: { type: Map, default: () => new Map() }, + hasActiveNode: { type: Boolean, default: false }, }); const emit = defineEmits([ @@ -234,7 +235,7 @@ const desktopColumns = computed(() => { if (hasAnyRemark.value) { cols.push(sortableCol({ title: t('pages.inbounds.remark'), dataIndex: 'remark', key: 'remark', align: 'center', width: 60 }, 'remark')); } - if (props.nodesById.size > 0) { + if (props.hasActiveNode) { cols.push(sortableCol({ title: t('pages.inbounds.node'), key: 'node', align: 'center', width: 60 }, 'node')); } cols.push( @@ -374,7 +375,7 @@ function showQrCodeMenu(dbInbound) { {{ protocol }} - {{ node.label }} @@ -466,7 +467,7 @@ function showQrCodeMenu(dbInbound) { {{ t('pages.inbounds.port') }} {{ record.port }} -
+
{{ t('pages.inbounds.node') }} {{ t('pages.inbounds.localPanel') }} diff --git a/frontend/src/pages/inbounds/InboundsPage.vue b/frontend/src/pages/inbounds/InboundsPage.vue index 99c8084a..3ee76f51 100644 --- a/frontend/src/pages/inbounds/InboundsPage.vue +++ b/frontend/src/pages/inbounds/InboundsPage.vue @@ -66,7 +66,7 @@ useWebSocket({ const { isMobile } = useMediaQuery(); // Node list lives on the central panel; the Inbounds page consumes // the id→node map for the new "Node" column. Fetched once on mount. -const { byId: nodesById } = useNodeList(); +const { byId: nodesById, hasActive: hasActiveNode } = useNodeList(); const basePath = window.X_UI_BASE_PATH || ''; const requestUri = window.location.pathname; @@ -647,7 +647,8 @@ function onRowAction({ key, dbInbound }) {