fix: Modify the license sorting method (#8935)

This commit is contained in:
ssongliu 2025-06-05 21:34:54 +08:00 committed by GitHub
parent 4074b94800
commit 349c97f06f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(() => {