mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-15 16:00:43 +00:00
fix: stop translating the built-in Default group name (#14100)
* fix: stop translating the built-in Default group name * fix: resolve default cronjob group by flag --------- Co-authored-by: ssongliu <sloooop1x@gmail.com>
This commit is contained in:
@@ -8,10 +8,7 @@
|
||||
<el-table-column :label="$t('commons.table.name')" prop="name">
|
||||
<template #default="{ row }">
|
||||
<div v-if="!row.edit">
|
||||
<span v-if="row.name === 'Default'">
|
||||
{{ $t('commons.table.default') }}
|
||||
</span>
|
||||
<span v-if="row.name !== 'Default'">{{ row.name }}</span>
|
||||
<span>{{ row.name }}</span>
|
||||
<el-tag v-if="row.isDefault" type="success" class="ml-2" size="small">
|
||||
({{ $t('commons.table.default') }})
|
||||
</el-tag>
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
<el-table-column :label="$t('commons.table.name')" prop="name">
|
||||
<template #default="{ row }">
|
||||
<div v-if="!row.edit">
|
||||
<span v-if="row.name === 'Default'">
|
||||
{{ $t('commons.table.default') }}
|
||||
</span>
|
||||
<span v-if="row.name !== 'Default'">{{ row.name }}</span>
|
||||
<span>{{ row.name }}</span>
|
||||
<el-tag v-if="row.isDefault" type="success" class="ml-2" size="small">
|
||||
({{ $t('commons.table.default') }})
|
||||
</el-tag>
|
||||
|
||||
@@ -154,7 +154,7 @@ const connectionTree = computed<ConnectionTreeItem[]>(() => {
|
||||
groups.push(
|
||||
...hostTree.value.map((group): ConnectionTreeItem => ({
|
||||
id: `host-group-${group.id}`,
|
||||
label: group.label === 'Default' ? i18n.global.t('commons.table.default') : group.label,
|
||||
label: group.label,
|
||||
kind: 'group',
|
||||
children: (group.children || []).map((host) => ({
|
||||
id: `host-${host.id}`,
|
||||
|
||||
@@ -38,14 +38,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!form.isLocal" :label="$t('commons.table.group')" prop="groupID">
|
||||
<el-select filterable v-model="form.groupID" clearable style="width: 100%">
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!form.isLocal" :label="$t('commons.table.title')" prop="name">
|
||||
|
||||
@@ -163,9 +163,6 @@ const displayNodeName = (item: NodeItem) => {
|
||||
};
|
||||
|
||||
const displayGroupName = (item: NodeItem) => {
|
||||
if (item.groupBelong === 'Default') {
|
||||
return i18n.global.t('commons.table.default');
|
||||
}
|
||||
return item.group || item.groupBelong || i18n.global.t('commons.table.default');
|
||||
};
|
||||
|
||||
|
||||
@@ -45,14 +45,7 @@
|
||||
<TableViewSwitch v-model="viewMode" storage-key="cronjob" />
|
||||
<el-select v-model="searchGroupID" @change="search()" clearable class="p-w-200">
|
||||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<div v-for="item in groupOptions" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<TableSearch @search="search()" v-model:searchName="searchName" />
|
||||
<TableRefresh @search="search()" />
|
||||
@@ -104,16 +97,14 @@
|
||||
@change="updateGroup(row)"
|
||||
>
|
||||
<template #read>
|
||||
{{ row.groupBelong === 'Default' ? $t('commons.table.default') : row.groupBelong }}
|
||||
{{ row.groupBelong }}
|
||||
</template>
|
||||
<div v-for="item in groupOptions" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</fu-select-rw-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -474,17 +465,10 @@ const loadGroups = async () => {
|
||||
searchGroupID.value = undefined;
|
||||
paginationConfig.currentPage = 1;
|
||||
}
|
||||
for (const group of groupOptions.value) {
|
||||
if (group.name === 'Default') {
|
||||
defaultGroupID.value = group.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
defaultGroupID.value = groupOptions.value.find((group) => group.isDefault)?.id;
|
||||
for (const item of data.value) {
|
||||
if (item.groupID === 0) {
|
||||
item.groupBelong = 'Default';
|
||||
item.groupID = defaultGroupID.value;
|
||||
continue;
|
||||
}
|
||||
let hasGroup = false;
|
||||
for (const group of groupOptions.value) {
|
||||
|
||||
@@ -80,14 +80,12 @@
|
||||
<LayoutCol>
|
||||
<el-form-item :label="$t('commons.table.group')" prop="groupID">
|
||||
<el-select filterable v-model="form.groupID" clearable>
|
||||
<div v-for="item in groupOptions" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</LayoutCol>
|
||||
|
||||
@@ -45,14 +45,7 @@
|
||||
<template #rightToolBar>
|
||||
<el-select v-model="group" @change="search()" clearable class="p-w-200">
|
||||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<div v-for="item in groupOptions" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<TableSearch @search="search()" v-model:searchName="searchInfo" />
|
||||
<TableRefresh @search="search()" />
|
||||
@@ -91,10 +84,7 @@
|
||||
<el-button class="mr-3" size="small" v-if="row.isSystem">{{ $t('menu.system') }}</el-button>
|
||||
<span v-if="row.groupBelong">
|
||||
<el-button size="small" v-for="(item, index) in row.groupBelong" :key="index">
|
||||
<span v-if="item === 'Default'">
|
||||
{{ $t('commons.table.default') }}
|
||||
</span>
|
||||
<span v-else>{{ item }}</span>
|
||||
{{ item }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -21,14 +21,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.table.group')" prop="groupList">
|
||||
<el-select filterable v-model="dialogData.rowData!.groupList" multiple>
|
||||
<div v-for="item in groupOptions" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<span class="input-help">{{ $t('cronjob.library.groupHelper') }}</span>
|
||||
</el-form-item>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
import { ref, nextTick } from 'vue';
|
||||
import Terminal from '@/components/terminal/index.vue';
|
||||
import { getCommandTree } from '@/api/modules/command';
|
||||
import i18n from '@/lang';
|
||||
|
||||
const terminalVisible = ref(false);
|
||||
const terminalRef = ref<InstanceType<typeof Terminal> | null>(null);
|
||||
@@ -64,11 +63,6 @@ const initTerm = async (cwd: string) => {
|
||||
const loadCommandTree = async () => {
|
||||
const res = await getCommandTree('command');
|
||||
commandTree.value = res.data || [];
|
||||
for (const item of commandTree.value) {
|
||||
if (item.label === 'Default') {
|
||||
item.label = i18n.global.t('commons.table.default');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function quickInput(val: Array<string>) {
|
||||
|
||||
@@ -27,10 +27,7 @@
|
||||
@change="changeGroup"
|
||||
class="p-w-200 ml-2 mt-2"
|
||||
>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option v-if="item.name === 'Default'" :label="$t('commons.table.default')" :value="item.id" />
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
|
||||
<el-card class="mt-2 w-full" v-loading="loading">
|
||||
@@ -54,12 +51,7 @@
|
||||
min-width="80"
|
||||
prop="groupBelong"
|
||||
fix
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.groupBelong === 'Default'">{{ $t('commons.table.default') }}</span>
|
||||
<span v-else>{{ row.groupBelong }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('terminal.command')"
|
||||
:min-width="120"
|
||||
|
||||
@@ -27,14 +27,7 @@
|
||||
<template #rightToolBar>
|
||||
<el-select v-model="group" @change="search()" clearable class="p-w-200">
|
||||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<TableSearch @search="search()" v-model:searchName="info" />
|
||||
<TableRefresh @search="search()" />
|
||||
@@ -74,16 +67,14 @@
|
||||
<template #default="{ row }">
|
||||
<fu-select-rw-switch v-model="row.groupID" @change="updateGroup(row)">
|
||||
<template #read>
|
||||
{{ row.groupBelong === 'Default' ? $t('commons.table.default') : row.groupBelong }}
|
||||
{{ row.groupBelong }}
|
||||
</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</fu-select-rw-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -22,14 +22,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.table.group')" prop="groupID">
|
||||
<el-select filterable v-model="dialogData.rowData!.groupID" clearable style="width: 100%">
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!batchMode" :label="$t('terminal.command')" prop="command">
|
||||
|
||||
@@ -16,14 +16,7 @@
|
||||
<el-select v-model="group" @change="search()" clearable class="p-w-200">
|
||||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<el-option :label="$t('commons.table.all')" value=""></el-option>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<TableSearch @search="search()" v-model:searchName="info" />
|
||||
<TableRefresh @search="search()" />
|
||||
@@ -48,16 +41,14 @@
|
||||
<template #default="{ row }">
|
||||
<fu-select-rw-switch v-model="row.groupID" @change="updateGroup(row)">
|
||||
<template #read>
|
||||
{{ row.groupBelong === 'Default' ? $t('commons.table.default') : row.groupBelong }}
|
||||
{{ row.groupBelong }}
|
||||
</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option
|
||||
v-for="item in groupList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</fu-select-rw-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -50,14 +50,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.table.group')" prop="groupID">
|
||||
<el-select filterable v-model="dialogData.rowData!.groupID" clearable style="width: 100%">
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.table.title')" prop="name">
|
||||
|
||||
@@ -268,11 +268,6 @@ const handleTabsRemove = async (targetName: string, action: 'remove' | 'add') =>
|
||||
const loadCommandTree = async () => {
|
||||
const res = await getCommandTree('command');
|
||||
commandTree.value = res.data || [];
|
||||
for (const item of commandTree.value) {
|
||||
if (item.label === 'Default') {
|
||||
item.label = i18n.global.t('commons.table.default');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const sendToTerminals = (command: string, all: boolean) => {
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<el-form-item :label="$t('commons.table.group')" :prop="prop">
|
||||
<el-select v-model="selectedValue">
|
||||
<el-option
|
||||
v-for="(group, index) in groups"
|
||||
:key="index"
|
||||
:label="group.name === 'Default' ? $t('commons.table.default') : group.name"
|
||||
:value="group.id"
|
||||
/>
|
||||
<el-option v-for="(group, index) in groups" :key="index" :label="group.name" :value="group.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -45,14 +45,7 @@
|
||||
<el-select v-model="req.websiteGroupId" @change="search()" class="p-w-200" :disabled="disabledConfig">
|
||||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<el-option :label="$t('commons.table.all')" :value="0"></el-option>
|
||||
<div v-for="item in groups" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :label="item.name" :value="item.id" />
|
||||
</div>
|
||||
<el-option v-for="item in groups" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<TableSearch @search="search()" v-model:searchName="req.name" :disabled="disabledConfig" />
|
||||
<TableRefresh @search="search()" :disabled="disabledConfig" />
|
||||
|
||||
Reference in New Issue
Block a user