Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/api/interface/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export namespace Login {
menuTabs: string;
panelName: string;
theme: string;
isOffLine: boolean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</div>
</el-scrollbar>
<div class="dropdown-item -mb-1" @click="changeNode('local')">
<div class="node">{{ $t('xpack.node.master') }}</div>
<div class="node">{{ globalStore.masterAlias }}</div>
</div>
</div>
<el-input
Expand Down Expand Up @@ -123,11 +123,11 @@ const openChangeNode = () => {
const loadCurrentName = () => {
if (globalStore.currentNode) {
if (globalStore.currentNode === 'local') {
return i18n.global.t('xpack.node.master');
return globalStore.masterAlias;
}
return globalStore.currentNode;
}
return i18n.global.t('xpack.node.master');
return globalStore.masterAlias;
};

const showPopover = () => {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import { useRoute, useRouter } from 'vue-router';
import { loadMasterProductProFromDB, loadProductProFromDB } from '@/utils/xpack';
import { useTheme } from '@/global/use-theme';
import TaskList from '@/components/task-list/index.vue';
import i18n from '@/lang';
const { switchTheme } = useTheme();

useResize();
Expand Down Expand Up @@ -101,7 +100,7 @@ const handleCollapse = () => {
const loadContent = () => {
let itemName = globalStore.watermark.content.replaceAll(
'${nodeName}',
globalStore.currentNode === 'local' ? i18n.global.t('xpack.node.master') : globalStore.currentNode,
globalStore.currentNode === 'local' ? globalStore.masterAlias : globalStore.currentNode,
);
itemName = itemName.replaceAll('${nodeAddr}', globalStore.currentNodeAddr);
return itemName;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface GlobalState {
isMasterProductPro: boolean;
isOffLine: boolean;

masterAlias: string;
currentNode: string;
currentNodeAddr: string;
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/modules/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const GlobalStore = defineStore({
isMasterProductPro: false,
isOffLine: false,

masterAlias: i18n.global.t('xpack.node.master'),
currentNode: 'local',
currentNodeAddr: '',
}),
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/utils/xpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function resetXSetting() {
globalStore.themeConfig.logoWithText = '';
globalStore.themeConfig.favicon = '';
globalStore.watermark = null;
globalStore.masterAlias = '';
}

export function initFavicon() {
Expand Down Expand Up @@ -117,6 +118,7 @@ export async function getXpackSettingForTheme() {
globalStore.themeConfig.loginBackground = res2.data?.loginBackground;
globalStore.themeConfig.loginBtnLinkColor = res2.data?.loginBtnLinkColor;
globalStore.themeConfig.themeColor = res2.data?.themeColor;
globalStore.masterAlias = res2.data.masterAlias;
if (res2.data?.theme) {
globalStore.themeConfig.theme = res2.data.theme;
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/container/operate/volume.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const props = defineProps({
watch(
() => props.volumes,
(newVal) => {
console.log(newVal);
tmpVolumes.value = newVal || [];
},
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/cronjob/library/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const buttons = [
click: (row: Cronjob.ScriptInfo) => {
ElMessageBox.confirm(
i18n.global.t('cronjob.library.handleHelper', [
globalStore.currentNode === 'local' ? i18n.global.t('xpack.node.master') : globalStore.currentNode,
globalStore.currentNode === 'local' ? globalStore.masterAlias : globalStore.currentNode,
row.name,
]),
i18n.global.t('commons.button.handle'),
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/log/operation/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<el-select v-model="searchNode" @change="search()" clearable class="p-w-200">
<template #prefix>{{ $t('xpack.node.node') }}</template>
<el-option :label="$t('commons.table.all')" value="" />
<el-option :label="$t('xpack.node.master')" value="local" />
<el-option :label="globalStore.masterAlias" value="local" />
<el-option v-for="(node, index) in nodes" :key="index" :label="node.name" :value="node.name" />
</el-select>
<TableSearch @search="search()" v-model:searchName="searchName" />
Expand All @@ -70,7 +70,7 @@
</el-table-column>
<el-table-column v-if="globalStore.isMasterProductPro" :label="$t('xpack.node.node')" prop="node">
<template #default="{ row }">
<span>{{ row.node === 'local' ? $t('xpack.node.master') : row.node }}</span>
<span>{{ row.node === 'local' ? globalStore.masterAlias : row.node }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/license/bind/xpack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const submit = async () => {

const loadNodes = async () => {
if (!globalStore.isMasterProductPro) {
freeNodes.value = [{ id: 0, name: i18n.global.t('xpack.node.master') }];
freeNodes.value = [{ id: 0, name: globalStore.masterAlias }];
return;
}
await listNodeOptions('free')
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/views/setting/license/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ import BindXpack from '@/views/setting/license/bind/xpack.vue';
import { dateFormat } from '@/utils/util';
import i18n from '@/lang';
import { MsgError, MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();

const loading = ref();
const licenseRef = ref();
Expand Down Expand Up @@ -168,7 +170,7 @@ const loadBindNode = (row: any) => {
if (row.freeNodes) {
for (const item of row.freeNodes) {
if (item.addr === row.bindNode) {
return item.name === 'local' ? i18n.global.t('xpack.node.master') : item.addr;
return item.name === 'local' ? globalStore.masterAlias : item.addr;
}
}
}
Expand Down Expand Up @@ -221,7 +223,7 @@ const search = async () => {
item.expiresAt = item.productPro === '0' ? '' : timestampToDate(Number(item.productPro));
}
data.value.sort((a, b) => {
const masterLabel = i18n.global.t('xpack.node.master');
const masterLabel = globalStore.masterAlias;
const nodeA = loadBindNode(a);
const nodeB = loadBindNode(b);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/panel/watermark/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const acceptParams = (watermark: string): void => {
const loadContent = () => {
let itemName = form.content.replaceAll(
'${nodeName}',
globalStore.currentNode === 'local' ? i18n.global.t('xpack.node.master') : globalStore.currentNode,
globalStore.currentNode === 'local' ? globalStore.masterAlias : globalStore.currentNode,
);
itemName = itemName.replaceAll('${nodeAddr}', globalStore.currentNodeAddr);
return itemName;
Expand Down
Loading