style: Adjust the display of license binding information (#8616)

This commit is contained in:
ssongliu
2025-05-13 16:13:18 +08:00
committed by GitHub
parent db02dbed16
commit 8a85fe6461
+13 -1
View File
@@ -44,7 +44,7 @@
<div v-if="row.status && row.status !== 'Free'">
<div>
{{ $t('license.pro') }}:
{{ row.bindNode === '127.0.0.1' ? $t('xpack.node.master') : row.bindNode }}
{{ loadBindNode(row) }}
</div>
<div>
{{ $t('license.oss') }}:
@@ -152,6 +152,18 @@ const onBindFree = async (row: any) => {
});
};
const loadBindNode = (row: any) => {
if (!row.bindNode && row.freeNodes?.length) {
return row.bindNode;
}
for (const item of row.freeNodes) {
if (item.addr === row.bindNode) {
return item.name === 'local' ? i18n.global.t('xpack.node.master') : item.addr;
}
}
return row.bindNode;
};
const onUnbind = async (row: any) => {
if (row.freeNodes && (row.freeNodes.length > 1 || !row.freeNodes[0].isXpack)) {
MsgError(i18n.global.t('license.licenseUnbindHelper'));