mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-08 02:36:01 +08:00
fix: Modify the license sorting method (#8935)
This commit is contained in:
parent
4074b94800
commit
349c97f06f
1 changed files with 10 additions and 1 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue