From 349c97f06f05b8ec184f62465684b92eae479788 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 5 Jun 2025 21:34:54 +0800 Subject: [PATCH] fix: Modify the license sorting method (#8935) --- frontend/src/views/setting/license/index.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/setting/license/index.vue b/frontend/src/views/setting/license/index.vue index 72e94361f..92109df77 100644 --- a/frontend/src/views/setting/license/index.vue +++ b/frontend/src/views/setting/license/index.vue @@ -216,11 +216,20 @@ const search = async () => { .then((res) => { loading.value = false; data.value = res.data.items || []; - console.log(data.value); for (const item of data.value) { item.productName = 'product-1panel-pro'; item.expiresAt = item.productPro === '0' ? '' : timestampToDate(Number(item.productPro)); } + data.value.sort((a, b) => { + const masterLabel = i18n.global.t('xpack.node.master'); + const nodeA = loadBindNode(a); + const nodeB = loadBindNode(b); + + if (nodeA === masterLabel || nodeB === masterLabel) { + return Number(nodeB === masterLabel) - Number(nodeA === masterLabel); + } + return a.status.localeCompare(b.status); + }); paginationConfig.total = res.data.total; }) .catch(() => {