style: Limit the display length of the node (#8627)

This commit is contained in:
ssongliu 2025-05-14 12:48:26 +08:00 committed by GitHub
parent 404e551f7b
commit 9d198f7dfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -118,7 +118,13 @@ const openChangeNode = () => {
const loadCurrentName = () => {
if (globalStore.currentNode) {
return globalStore.currentNode === 'local' ? i18n.global.t('xpack.node.master') : globalStore.currentNode;
if (globalStore.currentNode === 'local') {
return i18n.global.t('xpack.node.master');
}
if (globalStore.currentNode.length <= 15) {
return globalStore.currentNode;
}
return globalStore.currentNode.substring(0, 12) + '...';
}
return i18n.global.t('xpack.node.master');
};

View file

@ -651,6 +651,8 @@ function load18n(label: string) {
return i18n.global.t('container.compose');
case 'CustomAppstore':
return i18n.global.t('xpack.customApp.name');
case 'NodeFile':
return i18n.global.t('xpack.exchange.exchange');
case 'RuntimeExtension':
return i18n.global.t('website.runtime');
case 'Image':