Skip to content

Commit a69773c

Browse files
author
ssongliu
committed
fix: Modify the license sorting method
1 parent 470d788 commit a69773c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,22 @@ 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+
let nodeA = loadBindNode(a);
225+
let nodeB = loadBindNode(b);
226+
if (nodeA === i18n.global.t('xpack.node.master') && nodeB !== i18n.global.t('xpack.node.master'))
227+
return -1;
228+
if (nodeB === i18n.global.t('xpack.node.master') && nodeA !== i18n.global.t('xpack.node.master'))
229+
return 1;
230+
if (nodeA === i18n.global.t('xpack.node.master') && nodeB === i18n.global.t('xpack.node.master'))
231+
return 0;
232+
233+
return a.status.localeCompare(b.status);
234+
});
224235
paginationConfig.total = res.data.total;
225236
})
226237
.catch(() => {

0 commit comments

Comments
 (0)