mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-08 08:04:37 +08:00
fix: Modify the default group value (#8157)
This commit is contained in:
parent
af5d12bfee
commit
e64b3f2d7d
13 changed files with 22 additions and 20 deletions
|
|
@ -566,7 +566,7 @@ func changeLocalBackup(oldPath, newPath string) error {
|
|||
}
|
||||
}
|
||||
if fileOp.Stat(path.Join(oldPath, "website")) {
|
||||
if err := fileOp.CopyDir(path.Join(oldPath, "website"), newPath); err != nil {
|
||||
if err := fileOp.Mv(path.Join(oldPath, "website"), newPath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ var InitHost = &gormigrate.Migration{
|
|||
ID: "20240816-init-host",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
hostGroup := &model.Group{Name: "Default", Type: "host", IsDefault: true}
|
||||
if err := tx.Create(hostGroup).Error; err != nil {
|
||||
if err := global.DB.Create(hostGroup).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
if err := tx.Create(&model.Group{Name: "Default", Type: "node", IsDefault: true}).Error; err != nil {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ export const syncLicense = (id: number) => {
|
|||
export const bindLicense = (id: number, nodeID: number) => {
|
||||
return http.post(`/core/licenses/bind`, { nodeID: nodeID, licenseID: id }, TimeoutEnum.T_60S);
|
||||
};
|
||||
export const unbindLicense = (id: number) => {
|
||||
return http.post(`/core/licenses/unbind`, { id: id }, TimeoutEnum.T_60S);
|
||||
export const unbindLicense = (id: number, force: boolean) => {
|
||||
return http.post(`/core/licenses/unbind`, { id: id, force: force }, TimeoutEnum.T_60S);
|
||||
};
|
||||
export const loadLicenseOptions = () => {
|
||||
return http.get(`/core/licenses/options`);
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
<el-table-column :label="$t('commons.table.name')" prop="name">
|
||||
<template #default="{ row }">
|
||||
<div v-if="!row.edit">
|
||||
<span v-if="row.name === 'default'">
|
||||
<span v-if="row.name === 'Default'">
|
||||
{{ $t('commons.table.default') }}
|
||||
</span>
|
||||
<span v-if="row.name !== 'default'">{{ row.name }}</span>
|
||||
<span v-if="row.name !== 'Default'">{{ 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,10 @@
|
|||
<el-table-column :label="$t('commons.table.name')" prop="name">
|
||||
<template #default="{ row }">
|
||||
<div v-if="!row.edit">
|
||||
<span v-if="row.name === 'default'">
|
||||
<span v-if="row.name === 'Default'">
|
||||
{{ $t('commons.table.default') }}
|
||||
</span>
|
||||
<span v-if="row.name !== 'default'">{{ row.name }}</span>
|
||||
<span v-if="row.name !== 'Default'">{{ row.name }}</span>
|
||||
<el-tag v-if="row.isDefault" type="success" class="ml-2" size="small">
|
||||
({{ $t('commons.table.default') }})
|
||||
</el-tag>
|
||||
|
|
|
|||
|
|
@ -1053,7 +1053,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
}
|
||||
|
||||
dialogData.value.rowData.alertCount =
|
||||
dialogData.value.rowData!.hasAlert && isProductPro.value ? dialogData.value.rowData.alertCount : 3;
|
||||
dialogData.value.rowData!.hasAlert && isProductPro.value ? dialogData.value.rowData.alertCount : 0;
|
||||
dialogData.value.rowData.alertTitle =
|
||||
dialogData.value.rowData!.hasAlert && isProductPro.value
|
||||
? i18n.global.t('cronjob.alertTitle', [
|
||||
|
|
|
|||
|
|
@ -335,6 +335,7 @@ const login = (formEl: FormInstance | undefined) => {
|
|||
globalStore.setAgreeLicense(true);
|
||||
menuStore.setMenuList([]);
|
||||
tabsStore.removeAllTabs();
|
||||
globalStore.currentNode = 'local';
|
||||
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
|
||||
router.push({ name: 'home' });
|
||||
} catch (res) {
|
||||
|
|
@ -370,6 +371,7 @@ const mfaLogin = async (auto: boolean) => {
|
|||
menuStore.setMenuList([]);
|
||||
tabsStore.removeAllTabs();
|
||||
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
|
||||
globalStore.currentNode = 'local';
|
||||
router.push({ name: 'home' });
|
||||
} catch (res) {
|
||||
if (res.code === 401) {
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ const onUnbind = async (row: any) => {
|
|||
};
|
||||
const submitUnbind = async () => {
|
||||
loading.value = true;
|
||||
await unbindLicense(unbindRow.value.id)
|
||||
await unbindLicense(unbindRow.value.id, forceUnbind.value)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<template #prefix>{{ $t('commons.table.group') }}</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'default'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
@ -64,11 +64,11 @@
|
|||
<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 === 'Default' ? $t('commons.table.default') : row.groupBelong }}
|
||||
</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'default'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
<el-select filterable v-model="commandInfo.groupID" clearable style="width: 100%">
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'default'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<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'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
@ -47,11 +47,11 @@
|
|||
<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 === 'Default' ? $t('commons.table.default') : row.groupBelong }}
|
||||
</template>
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'default'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<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'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<el-select filterable v-model="hostInfo.groupID" clearable style="width: 100%">
|
||||
<div v-for="item in groupList" :key="item.id">
|
||||
<el-option
|
||||
v-if="item.name === 'default'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<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'"
|
||||
v-if="item.name === 'Default'"
|
||||
:label="$t('commons.table.default')"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue