diff --git a/core/app/api/v2/setting.go b/core/app/api/v2/setting.go
index e1ff0f952..c63ce270c 100644
--- a/core/app/api/v2/setting.go
+++ b/core/app/api/v2/setting.go
@@ -71,16 +71,19 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) {
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
+ if req.Key == "SecurityEntrance" {
+ if !checkEntrancePattern(req.Value) {
+ helper.ErrorWithDetail(c, http.StatusBadRequest, "ErrInvalidParams", fmt.Errorf("the format of the security entrance %s is incorrect.", req.Value))
+ return
+ }
+ }
+
if err := settingService.Update(req.Key, req.Value); err != nil {
helper.InternalServer(c, err)
return
}
if req.Key == "SecurityEntrance" {
entranceValue := base64.StdEncoding.EncodeToString([]byte(req.Value))
- if !checkEntrancePattern(entranceValue) {
- helper.ErrorWithDetail(c, http.StatusBadRequest, "ErrInvalidParams", fmt.Errorf("the format of the security entrance %s is incorrect.", entranceValue))
- return
- }
c.SetCookie("SecurityEntrance", entranceValue, 0, "", "", false, true)
}
helper.SuccessWithOutData(c)
diff --git a/core/app/service/command.go b/core/app/service/command.go
index 1d50a624c..d99d28e5a 100644
--- a/core/app/service/command.go
+++ b/core/app/service/command.go
@@ -14,7 +14,7 @@ type ICommandService interface {
List(req dto.OperateByType) ([]dto.CommandInfo, error)
SearchForTree(req dto.OperateByType) ([]dto.CommandTree, error)
SearchWithPage(search dto.SearchCommandWithPage) (int64, interface{}, error)
- Create(commandDto dto.CommandOperate) error
+ Create(req dto.CommandOperate) error
Update(id uint, upMap map[string]interface{}) error
Delete(ids []uint) error
}
@@ -98,12 +98,12 @@ func (u *CommandService) SearchWithPage(req dto.SearchCommandWithPage) (int64, i
return total, dtoCommands, err
}
-func (u *CommandService) Create(commandDto dto.CommandOperate) error {
- command, _ := commandRepo.Get(repo.WithByName(commandDto.Name))
+func (u *CommandService) Create(req dto.CommandOperate) error {
+ command, _ := commandRepo.Get(repo.WithByName(req.Name), repo.WithByType(req.Type))
if command.ID != 0 {
return buserr.New("ErrRecordExist")
}
- if err := copier.Copy(&command, &commandDto); err != nil {
+ if err := copier.Copy(&command, &req); err != nil {
return buserr.WithDetail("ErrStructTransform", err.Error(), nil)
}
if err := commandRepo.Create(&command); err != nil {
diff --git a/core/app/service/host.go b/core/app/service/host.go
index b8dd29b09..1dfc63758 100644
--- a/core/app/service/host.go
+++ b/core/app/service/host.go
@@ -23,7 +23,7 @@ type IHostService interface {
GetHostByID(id uint) (*dto.HostInfo, error)
SearchForTree(search dto.SearchForTree) ([]dto.HostTree, error)
SearchWithPage(search dto.SearchPageWithGroup) (int64, interface{}, error)
- Create(hostDto dto.HostOperate) (*dto.HostInfo, error)
+ Create(req dto.HostOperate) (*dto.HostInfo, error)
Update(id uint, upMap map[string]interface{}) (*dto.HostInfo, error)
Delete(id []uint) error
@@ -300,16 +300,19 @@ func (u *HostService) Create(req dto.HostOperate) (*dto.HostInfo, error) {
}
func (u *HostService) Delete(ids []uint) error {
- hosts, _ := hostRepo.GetList(repo.WithByIDs(ids))
- for _, host := range hosts {
+ for _, id := range ids {
+ host, _ := hostRepo.Get(repo.WithByID(id))
if host.ID == 0 {
return buserr.New("ErrRecordNotFound")
}
- if host.Addr == "127.0.0.1" {
+ if host.Name == "local" {
return errors.New("the local connection information cannot be deleted!")
}
+ if err := hostRepo.Delete(repo.WithByID(id)); err != nil {
+ return err
+ }
}
- return hostRepo.Delete(repo.WithByIDs(ids))
+ return nil
}
func (u *HostService) Update(id uint, upMap map[string]interface{}) (*dto.HostInfo, error) {
diff --git a/core/init/router/router.go b/core/init/router/router.go
index d70d6ad23..4fb335075 100644
--- a/core/init/router/router.go
+++ b/core/init/router/router.go
@@ -218,6 +218,9 @@ func Routers() *gin.Engine {
if global.CONF.Base.IsDemo {
Router.Use(middleware.DemoHandle())
}
+ Router.Use(middleware.JwtAuth())
+ Router.Use(middleware.SessionAuth())
+ Router.Use(middleware.PasswordExpired())
Router.Use(middleware.GlobalLoading())
Router.Use(Proxy())
diff --git a/frontend/src/components/file-list/index.vue b/frontend/src/components/file-list/index.vue
index fe0c492c4..3d3df2f33 100644
--- a/frontend/src/components/file-list/index.vue
+++ b/frontend/src/components/file-list/index.vue
@@ -13,11 +13,11 @@
-
-
/{{ paths[0] }}
+
+
/{{ paths[0] }}
- ...
+ ...
-
+
/{{ paths[paths.length - 1] }}
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 39863c041..7290944a2 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -1292,6 +1292,7 @@ const message = {
databases: 'Database',
licenses: 'License',
nodes: 'Node',
+ commands: 'Quick Commands',
},
websiteLog: 'Website Logs',
runLog: 'Run Log',
diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts
index 330da873e..a98888242 100644
--- a/frontend/src/lang/modules/ja.ts
+++ b/frontend/src/lang/modules/ja.ts
@@ -1229,6 +1229,7 @@ const message = {
databases: 'データベース',
licenses: 'ライセンス',
nodes: 'ノード',
+ commands: 'クイックコマンド',
},
websiteLog: 'ウェブサイトログ',
runLog: 'ログを実行します',
diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts
index 53ff63bdc..88dca6c0c 100644
--- a/frontend/src/lang/modules/ko.ts
+++ b/frontend/src/lang/modules/ko.ts
@@ -1217,6 +1217,7 @@ const message = {
databases: '데이터베이스',
licenses: '라이선스',
nodes: '노드',
+ commands: '빠른 명령',
},
websiteLog: '웹사이트 로그',
runLog: '실행 로그',
diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts
index 5ef4421b8..03080fdb7 100644
--- a/frontend/src/lang/modules/ms.ts
+++ b/frontend/src/lang/modules/ms.ts
@@ -1272,6 +1272,7 @@ const message = {
databases: 'Pangkalan',
licenses: 'lesen',
nodes: 'nod',
+ commands: 'Perintah Pantas',
},
websiteLog: 'Log Laman Web',
runLog: 'Log Jalankan',
diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts
index 56a3c5bae..845d1706c 100644
--- a/frontend/src/lang/modules/pt-br.ts
+++ b/frontend/src/lang/modules/pt-br.ts
@@ -1255,6 +1255,7 @@ const message = {
databases: 'Bancos de Dados',
licenses: 'licenças',
nodes: 'nós',
+ commands: 'Comandos Rápidos',
},
websiteLog: 'Logs do website',
runLog: 'Logs de execução',
diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts
index 32f7ff95a..4a67ab210 100644
--- a/frontend/src/lang/modules/ru.ts
+++ b/frontend/src/lang/modules/ru.ts
@@ -1263,6 +1263,7 @@ const message = {
databases: 'Базы данных',
licenses: 'лицензии',
nodes: 'ноды',
+ commands: 'Быстрые команды',
},
websiteLog: 'Логи веб-сайта',
runLog: 'Логи выполнения',
diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts
index 3e56090b1..41b5154be 100644
--- a/frontend/src/lang/modules/zh-Hant.ts
+++ b/frontend/src/lang/modules/zh-Hant.ts
@@ -1220,6 +1220,7 @@ const message = {
databases: '資料庫',
licenses: '許可證',
nodes: '節點',
+ commands: '快速命令',
},
websiteLog: '網站日誌',
runLog: '運行日誌',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 8ff95ac5b..e3c118e49 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -1218,6 +1218,7 @@ const message = {
databases: '数据库',
licenses: '许可证',
nodes: '节点',
+ commands: '快速命令',
},
websiteLog: '网站日志',
runLog: '运行日志',
diff --git a/frontend/src/views/app-store/installed/upgrade/index.vue b/frontend/src/views/app-store/installed/upgrade/index.vue
index 1b84a1701..ad4471e17 100644
--- a/frontend/src/views/app-store/installed/upgrade/index.vue
+++ b/frontend/src/views/app-store/installed/upgrade/index.vue
@@ -57,7 +57,7 @@
{{ $t('app.upgradeWarn') }}
-
{{ $t('app.showDiff') }}
+
{{ $t('app.showDiff') }}
diff --git a/frontend/src/views/database/postgresql/conn/index.vue b/frontend/src/views/database/postgresql/conn/index.vue
index 23a990c5f..cc8c8345e 100644
--- a/frontend/src/views/database/postgresql/conn/index.vue
+++ b/frontend/src/views/database/postgresql/conn/index.vue
@@ -53,7 +53,7 @@
-
+
diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue
index f758559a8..10cc3df41 100644
--- a/frontend/src/views/login/components/login-form.vue
+++ b/frontend/src/views/login/components/login-form.vue
@@ -397,7 +397,7 @@ const loadDataFromDB = async () => {
i18n.locale.value = res.data.language;
i18n.warnHtmlMessage = false;
globalStore.entrance = res.data.securityEntrance;
- globalStore.setOpenMenuTabs(res.data.menuTabs === 'enable');
+ globalStore.setOpenMenuTabs(res.data.menuTabs === 'Enable');
globalStore.updateLanguage(res.data.language);
let theme = globalStore.themeConfig.theme === res.data.theme ? res.data.theme : globalStore.themeConfig.theme;
globalStore.setThemeConfig({ ...themeConfig.value, theme: theme, panelName: res.data.panelName });
diff --git a/frontend/src/views/setting/about/index.vue b/frontend/src/views/setting/about/index.vue
index f12a5d7b0..d8c57ea03 100644
--- a/frontend/src/views/setting/about/index.vue
+++ b/frontend/src/views/setting/about/index.vue
@@ -13,7 +13,7 @@
{{ globalStore.themeConfig.title || $t('setting.description') }}
-
+
@@ -94,4 +94,7 @@ onMounted(() => {
height: 45px;
}
}
+.upgrade {
+ all: initial;
+}
diff --git a/frontend/src/views/setting/expired.vue b/frontend/src/views/setting/expired.vue
index ac9c3393e..331b77c28 100644
--- a/frontend/src/views/setting/expired.vue
+++ b/frontend/src/views/setting/expired.vue
@@ -100,7 +100,7 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
const search = async () => {
const res = await getSettingInfo();
let settingForm = res.data;
- isComplexity.value = settingForm?.complexityVerification === 'enable';
+ isComplexity.value = settingForm?.complexityVerification === 'Enable';
};
onMounted(() => {
diff --git a/frontend/src/views/setting/panel/api-interface/index.vue b/frontend/src/views/setting/panel/api-interface/index.vue
index 6e4928e42..8a04bc8d3 100644
--- a/frontend/src/views/setting/panel/api-interface/index.vue
+++ b/frontend/src/views/setting/panel/api-interface/index.vue
@@ -85,7 +85,7 @@ const formRef = ref();
const apiURL = `${window.location.protocol}//${window.location.hostname}${
window.location.port ? `:${window.location.port}` : ''
}/1panel/swagger/index.html`;
-const panelURL = `${globalStore.docsUrl}/user_manual/api_manual/`;
+const panelURL = `${globalStore.docsUrl}/dev_manual/api_manual/`;
const form = reactive({
apiKey: '',
ipWhiteList: '',
diff --git a/frontend/src/views/setting/panel/index.vue b/frontend/src/views/setting/panel/index.vue
index 9ddea1191..1e9bbac1a 100644
--- a/frontend/src/views/setting/panel/index.vue
+++ b/frontend/src/views/setting/panel/index.vue
@@ -452,7 +452,7 @@ const onSave = async (key: string, val: any) => {
handleThemeChange(val);
}
if (key === 'MenuTabs') {
- globalStore.setOpenMenuTabs(val === 'enable');
+ globalStore.setOpenMenuTabs(val === 'Enable');
}
MsgSuccess(i18n.t('commons.msg.operationSuccess'));
search();
diff --git a/frontend/src/views/terminal/command/index.vue b/frontend/src/views/terminal/command/index.vue
index 3e6627a68..2a7bdefde 100644
--- a/frontend/src/views/terminal/command/index.vue
+++ b/frontend/src/views/terminal/command/index.vue
@@ -5,7 +5,7 @@
-
+
{{ $t('commons.button.create') }}{{ $t('terminal.quickCommand') }}
@@ -28,6 +28,7 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -132,10 +92,9 @@
diff --git a/frontend/src/views/terminal/host/index.vue b/frontend/src/views/terminal/host/index.vue
index db98e9cb5..44356943e 100644
--- a/frontend/src/views/terminal/host/index.vue
+++ b/frontend/src/views/terminal/host/index.vue
@@ -107,7 +107,7 @@ const acceptParams = () => {
};
function selectable(row) {
- return row.addr !== '127.0.0.1';
+ return row.name !== 'local';
}
const dialogRef = ref();
const onOpenDialog = async (
@@ -174,12 +174,12 @@ const buttons = [
},
{
label: i18n.global.t('commons.button.delete'),
+ disabled: (row: any) => {
+ return row.name === 'local';
+ },
click: (row: Host.Host) => {
onBatchDelete(row);
},
- disabled: (row: any) => {
- return row.addr === '127.0.0.1';
- },
},
];
diff --git a/frontend/src/views/terminal/host/operate/index.vue b/frontend/src/views/terminal/host/operate/index.vue
index f289190ef..09c26f500 100644
--- a/frontend/src/views/terminal/host/operate/index.vue
+++ b/frontend/src/views/terminal/host/operate/index.vue
@@ -60,7 +60,7 @@
-