Skip to content

Commit 6ae764e

Browse files
committed
feat: Support for modifying host information
1 parent b2fa0aa commit 6ae764e

File tree

28 files changed

+118
-173
lines changed

28 files changed

+118
-173
lines changed

core/app/service/host.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ func (u *HostService) Create(req dto.HostOperate) (*dto.HostInfo, error) {
266266
req.GroupID = group.ID
267267
}
268268
var sameHostID uint
269-
if req.Addr == "127.0.0.1" {
270-
hostSame, _ := hostRepo.Get(hostRepo.WithByAddr(req.Addr))
269+
if req.Name == "local" {
270+
hostSame, _ := hostRepo.Get(repo.WithByName("local"))
271271
sameHostID = hostSame.ID
272272
} else {
273273
hostSame, _ := hostRepo.Get(hostRepo.WithByAddr(req.Addr), hostRepo.WithByUser(req.User), hostRepo.WithByPort(req.Port))

core/cmd/server/conf/app.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
system:
2-
db_core_file: core.db
3-
base_dir: /opt
1+
base:
2+
install_dir: /opt
43
mode: dev
5-
repo_url: https://resource.fit2cloud.com/1panel/package
6-
app_repo: https://apps-assets.fit2cloud.com
74
is_demo: false
85
is_intl: false
96
port: 9999
107
username: admin
118
password: admin123
9+
version: v2.0.0
10+
11+
remote_url:
12+
repo_url: https://resource.fit2cloud.com/1panel/package
13+
app_repo: https://apps-assets.fit2cloud.com
1214

1315
log:
1416
level: debug
1517
time_zone: Asia/Shanghai
1618
log_name: 1Panel
1719
log_suffix: .log
18-
max_backup: 10
20+
max_backup: 10

core/global/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ type ApiInterface struct {
3636
}
3737

3838
type RemoteURL struct {
39-
RepoUrl string `mapstructure:"repo_url"`
40-
ResourceUrl string `mapstructure:"resource_url"`
39+
RepoUrl string `mapstructure:"repo_url"`
4140
}
4241

4342
type LogConfig struct {

core/init/migration/migrate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func Init() {
2020
migrations.AddTaskDB,
2121
migrations.UpdateSettingStatus,
2222
migrations.RemoveLocalBackup,
23+
migrations.AddMFAInterval,
2324
})
2425
if err := m.Migrate(); err != nil {
2526
global.LOG.Error(err)

core/init/migration/migrations/init.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,13 @@ var RemoveLocalBackup = &gormigrate.Migration{
297297
return nil
298298
},
299299
}
300+
301+
var AddMFAInterval = &gormigrate.Migration{
302+
ID: "20250207-add-mfa-interval",
303+
Migrate: func(tx *gorm.DB) error {
304+
if err := tx.Create(&model.Setting{Key: "MFAInterval", Value: "30"}).Error; err != nil {
305+
return err
306+
}
307+
return nil
308+
},
309+
}

frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
},
2222
"dependencies": {
2323
"@codemirror/lang-json": "^6.0.1",
24+
"@codemirror/lang-html": "^6.4.9",
25+
"@codemirror/lang-php": "^6.0.1",
2426
"@codemirror/language": "^6.10.2",
2527
"@codemirror/legacy-modes": "^6.4.0",
2628
"@codemirror/theme-one-dark": "^6.1.2",

frontend/src/components/group/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<DrawerPro v-model="open" :header="$t('commons.table.group')" size="large" :back="handleClose">
33
<template #content>
44
<ComplexTable :data="data" @search="search()">
5-
<template #leftToolBar>
5+
<template #toolbar>
66
<el-button type="primary" @click="openCreate">{{ $t('website.createGroup') }}</el-button>
77
</template>
88
<el-table-column :label="$t('commons.table.name')" prop="name">

frontend/src/components/upload/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
v-model:selects="selects"
6666
:data="data"
6767
>
68-
<template #leftToolBar>
68+
<template #toolbar>
6969
<el-button
7070
class="ml-2.5"
7171
plain

frontend/src/lang/modules/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ const message = {
11091109
},
11101110
ftp: {
11111111
ftp: 'FTP Account',
1112+
notStart: 'FTP service is currently not running, please start it first!',
11121113
noFtp: 'FTP (pure-ftpd) service not detected, please refer to the official documentation for installation!',
11131114
operation: 'Perform [{0}] operation on FTP service, continue?',
11141115
noPasswdMsg: 'Can not get the current FTP account password, please set the password and try again! ',

frontend/src/lang/modules/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ const message = {
10501050
},
10511051
ftp: {
10521052
ftp: 'FTPアカウント|FTPアカウント',
1053+
notStart: 'FTP Serviceは現在実行されていません。最初に開始してください!',
10531054
noFtp: `FTP(Pure-FTPD)サービスは検出されません。インストールする公式ドキュメントを参照してください。`,
10541055
operation: 'これにより、FTPサービスで「{0}」操作が実行されます。続けたいですか?',
10551056
noPasswdMsg: '現在のFTPアカウントパスワードを取得できません。パスワードを設定して再試行してください!',

0 commit comments

Comments
 (0)