Skip to content

Commit 349c97f

Browse files
authored
fix: Modify the license sorting method (#8935)
1 parent 4074b94 commit 349c97f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

frontend/src/views/setting/license/index.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,20 @@ const search = async () => {
216216
.then((res) => {
217217
loading.value = false;
218218
data.value = res.data.items || [];
219-
console.log(data.value);
220219
for (const item of data.value) {
221220
item.productName = 'product-1panel-pro';
222221
item.expiresAt = item.productPro === '0' ? '' : timestampToDate(Number(item.productPro));
223222
}
223+
data.value.sort((a, b) => {
224+
const masterLabel = i18n.global.t('xpack.node.master');
225+
const nodeA = loadBindNode(a);
226+
const nodeB = loadBindNode(b);
227+
228+
if (nodeA === masterLabel || nodeB === masterLabel) {
229+
return Number(nodeB === masterLabel) - Number(nodeA === masterLabel);
230+
}
231+
return a.status.localeCompare(b.status);
232+
});
224233
paginationConfig.total = res.data.total;
225234
})
226235
.catch(() => {

0 commit comments

Comments
 (0)