diff --git a/.gitignore b/.gitignore index 5d54f21bc..7baacd1aa 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ # Dependency directories (remove the comment below to include it) # vendor/ /pkg/ +backend/__debug_bin diff --git a/backend/__debug_bin b/backend/__debug_bin deleted file mode 100755 index 043aba019..000000000 Binary files a/backend/__debug_bin and /dev/null differ diff --git a/backend/app/api/v1/auth.go b/backend/app/api/v1/auth.go index 33a34c58f..9209e129b 100644 --- a/backend/app/api/v1/auth.go +++ b/backend/app/api/v1/auth.go @@ -98,7 +98,7 @@ func (b *BaseApi) SafeEntrance(c *gin.Context) { } codeWithMD5 := encrypt.Md5(code) cookieValue, _ := encrypt.StringEncrypt(codeWithMD5) - c.SetCookie(codeWithMD5, cookieValue, 86400, "", "", false, false) + c.SetCookie(codeWithMD5, cookieValue, 604800, "", "", false, false) helper.SuccessWithData(c, nil) } diff --git a/backend/app/api/v1/backup.go b/backend/app/api/v1/backup.go index 3f21a25df..0183da49a 100644 --- a/backend/app/api/v1/backup.go +++ b/backend/app/api/v1/backup.go @@ -88,25 +88,12 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) { helper.SuccessWithData(c, nil) } -func (b *BaseApi) PageBackup(c *gin.Context) { - var req dto.PageInfo - if err := c.ShouldBindJSON(&req); err != nil { - helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) - return - } - if err := global.VALID.Struct(req); err != nil { - helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) - return - } - - total, list, err := backupService.Page(req) +func (b *BaseApi) ListBackup(c *gin.Context) { + data, err := backupService.List() if err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } - helper.SuccessWithData(c, dto.PageResult{ - Items: list, - Total: total, - }) + helper.SuccessWithData(c, data) } diff --git a/backend/app/dto/backup.go b/backend/app/dto/backup.go index 680bf5519..c9370ee8c 100644 --- a/backend/app/dto/backup.go +++ b/backend/app/dto/backup.go @@ -3,7 +3,6 @@ package dto import "time" type BackupOperate struct { - Name string `json:"name" validate:"required"` Type string `json:"type" validate:"required"` Bucket string `json:"bucket"` Credential string `json:"credential"` @@ -13,7 +12,6 @@ type BackupOperate struct { type BackupInfo struct { ID uint `json:"id"` CreatedAt time.Time `json:"createdAt"` - Name string `json:"name"` Type string `json:"type"` Bucket string `json:"bucket"` Vars string `json:"vars"` diff --git a/backend/app/model/backup.go b/backend/app/model/backup.go index 57b896a08..720578163 100644 --- a/backend/app/model/backup.go +++ b/backend/app/model/backup.go @@ -2,10 +2,8 @@ package model type BackupAccount struct { BaseModel - Name string `gorm:"type:varchar(64);not null" json:"name"` - Type string `gorm:"type:varchar(64)" json:"type"` + Type string `gorm:"type:varchar(64);unique;not null" json:"type"` Bucket string `gorm:"type:varchar(256)" json:"bucket"` Credential string `gorm:"type:varchar(256)" json:"credential"` Vars string `gorm:"type:longText" json:"vars"` - Status string `gorm:"type:varchar(64)" json:"status"` } diff --git a/backend/app/repo/backup.go b/backend/app/repo/backup.go index 68999678e..e6b535699 100644 --- a/backend/app/repo/backup.go +++ b/backend/app/repo/backup.go @@ -8,7 +8,8 @@ import ( type BackupRepo struct{} type IBackupRepo interface { - Page(page, size int, opts ...DBOption) (int64, []model.BackupAccount, error) + Get(opts ...DBOption) (model.BackupAccount, error) + List(opts ...DBOption) ([]model.BackupAccount, error) Create(backup *model.BackupAccount) error Update(id uint, vars map[string]interface{}) error Delete(opts ...DBOption) error @@ -28,7 +29,7 @@ func (u *BackupRepo) Get(opts ...DBOption) (model.BackupAccount, error) { return backup, err } -func (u *BackupRepo) Page(page, size int, opts ...DBOption) (int64, []model.BackupAccount, error) { +func (u *BackupRepo) List(opts ...DBOption) ([]model.BackupAccount, error) { var ops []model.BackupAccount db := global.DB.Model(&model.BackupAccount{}) for _, opt := range opts { @@ -36,8 +37,8 @@ func (u *BackupRepo) Page(page, size int, opts ...DBOption) (int64, []model.Back } count := int64(0) db = db.Count(&count) - err := db.Limit(size).Offset(size * (page - 1)).Find(&ops).Error - return count, ops, err + err := db.Find(&ops).Error + return ops, err } func (u *BackupRepo) Create(backup *model.BackupAccount) error { diff --git a/backend/app/repo/common.go b/backend/app/repo/common.go index c4afede8e..d37ec01af 100644 --- a/backend/app/repo/common.go +++ b/backend/app/repo/common.go @@ -26,6 +26,12 @@ func (c *CommonRepo) WithByName(name string) DBOption { } } +func (c *CommonRepo) WithByType(name string) DBOption { + return func(g *gorm.DB) *gorm.DB { + return g.Where("type = ?", name) + } +} + func (c *CommonRepo) WithLikeName(name string) DBOption { return func(g *gorm.DB) *gorm.DB { return g.Where("name like ?", "%"+name+"%") diff --git a/backend/app/service/auth.go b/backend/app/service/auth.go index 67cd7372d..9c10e82e7 100644 --- a/backend/app/service/auth.go +++ b/backend/app/service/auth.go @@ -102,7 +102,7 @@ func (u *AuthService) generateSession(c *gin.Context, name, authMethod string) ( sessionUser, err := global.SESSION.Get(sID) if err != nil { sID = uuid.NewV4().String() - c.SetCookie(constant.SessionName, sID, lifeTime, "", "", false, false) + c.SetCookie(constant.SessionName, sID, 604800, "", "", false, false) err := global.SESSION.Set(sID, sessionUser, lifeTime) if err != nil { return nil, err diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index db05b3701..979afd162 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -13,7 +13,7 @@ import ( type BackupService struct{} type IBackupService interface { - Page(search dto.PageInfo) (int64, interface{}, error) + List() ([]dto.BackupInfo, error) Create(backupDto dto.BackupOperate) error GetBuckets(backupDto dto.ForBuckets) ([]interface{}, error) Update(id uint, upMap map[string]interface{}) error @@ -24,21 +24,21 @@ func NewIBackupService() IBackupService { return &BackupService{} } -func (u *BackupService) Page(search dto.PageInfo) (int64, interface{}, error) { - total, ops, err := backupRepo.Page(search.Page, search.PageSize, commonRepo.WithOrderBy("created_at desc")) +func (u *BackupService) List() ([]dto.BackupInfo, error) { + ops, err := backupRepo.List(commonRepo.WithOrderBy("created_at desc")) var dtobas []dto.BackupInfo for _, group := range ops { var item dto.BackupInfo if err := copier.Copy(&item, &group); err != nil { - return 0, nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) + return nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) } dtobas = append(dtobas, item) } - return total, dtobas, err + return dtobas, err } func (u *BackupService) Create(backupDto dto.BackupOperate) error { - backup, _ := backupRepo.Get(commonRepo.WithByName(backupDto.Name)) + backup, _ := backupRepo.Get(commonRepo.WithByType(backupDto.Type)) if backup.ID != 0 { return constant.ErrRecordExist } diff --git a/backend/app/service/setting.go b/backend/app/service/setting.go index e1893df3e..383f3c768 100644 --- a/backend/app/service/setting.go +++ b/backend/app/service/setting.go @@ -50,17 +50,6 @@ func (u *SettingService) Update(c *gin.Context, key, value string) error { if err := settingRepo.Update(key, value); err != nil { return err } - switch key { - case "UserName": - sID, _ := c.Cookie(constant.SessionName) - if sID != "" { - c.SetCookie(constant.SessionName, sID, -1, "", "", false, false) - err := global.SESSION.Delete(sID) - if err != nil { - return err - } - } - } return settingRepo.Update(key, value) } diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index dfaf8e069..e90983c6f 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -81,7 +81,7 @@ var AddTableSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "ServerPort", Value: "4004"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "SecurityEntrance", Value: "89dc6ae8"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "SecurityEntrance", Value: "onepanel"}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "PasswordTimeOut", Value: time.Now().AddDate(0, 0, 10).Format("2016.01.02 15:04:05")}).Error; err != nil { @@ -127,10 +127,8 @@ var AddTableBackupAccount = &gormigrate.Migration{ return err } item := &model.BackupAccount{ - Name: "Default Local", - Type: "LOCAL", - Status: "VALID", - Vars: "{\"dir\":\"/opt/1Panel/backup\"}", + Type: "LOCAL", + Vars: "{\"dir\":\"/opt/1Panel/backup\"}", } if err := tx.Create(item).Error; err != nil { return err diff --git a/backend/middleware/session.go b/backend/middleware/session.go index 5ee4fb955..f4d2ee4ad 100644 --- a/backend/middleware/session.go +++ b/backend/middleware/session.go @@ -1,7 +1,10 @@ package middleware import ( + "strconv" + "github.com/1Panel-dev/1Panel/app/api/v1/helper" + "github.com/1Panel-dev/1Panel/app/repo" "github.com/1Panel-dev/1Panel/constant" "github.com/1Panel-dev/1Panel/global" "github.com/gin-gonic/gin" @@ -17,10 +20,18 @@ func SessionAuth() gin.HandlerFunc { helper.ErrorWithDetail(c, constant.CodeErrUnauthorized, constant.ErrTypeNotLogin, nil) return } - if _, err := global.SESSION.Get(sId); err != nil { + psession, err := global.SESSION.Get(sId) + if err != nil { helper.ErrorWithDetail(c, constant.CodeErrUnauthorized, constant.ErrTypeNotLogin, nil) return } + settingRepo := repo.NewISettingRepo() + setting, err := settingRepo.Get(settingRepo.WithByKey("SessionTimeout")) + if err != nil { + global.LOG.Errorf("create operation record failed, err: %v", err) + } + lifeTime, _ := strconv.Atoi(setting.Value) + _ = global.SESSION.Set(sId, psession, lifeTime) c.Next() } } diff --git a/backend/router/ro_backup.go b/backend/router/ro_backup.go index 674642890..3a5d0200c 100644 --- a/backend/router/ro_backup.go +++ b/backend/router/ro_backup.go @@ -14,7 +14,7 @@ func (s *BackupRouter) InitBackupRouter(Router *gin.RouterGroup) { withRecordRouter := Router.Group("backups").Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.OperationRecord()) baseApi := v1.ApiGroupApp.BaseApi { - baRouter.POST("/search", baseApi.PageBackup) + baRouter.GET("/search", baseApi.ListBackup) baRouter.POST("/buckets", baseApi.ListBuckets) withRecordRouter.POST("", baseApi.CreateBackup) withRecordRouter.POST("/del", baseApi.DeleteBackup) diff --git a/frontend/src/api/interface/backup.ts b/frontend/src/api/interface/backup.ts index d6ffeb61e..80b268a7a 100644 --- a/frontend/src/api/interface/backup.ts +++ b/frontend/src/api/interface/backup.ts @@ -1,7 +1,6 @@ export namespace Backup { export interface BackupInfo { id: number; - name: string; type: string; bucket: string; vars: string; @@ -9,7 +8,6 @@ export namespace Backup { } export interface BackupOperate { id: number; - name: string; type: string; bucket: string; credential: string; diff --git a/frontend/src/api/modules/backup.ts b/frontend/src/api/modules/backup.ts index 19d3d3476..ba590b51f 100644 --- a/frontend/src/api/modules/backup.ts +++ b/frontend/src/api/modules/backup.ts @@ -1,9 +1,8 @@ import http from '@/api'; import { Backup } from '../interface/backup'; -import { ResPage, ReqPage } from '../interface'; -export const getBackupList = (params: ReqPage) => { - return http.post>(`/backups/search`, params); +export const getBackupList = () => { + return http.get>(`/backups/search`); }; export const addBackup = (params: Backup.BackupOperate) => { diff --git a/frontend/src/assets/iconfont/iconfont.css b/frontend/src/assets/iconfont/iconfont.css index 8821367a4..f86cc44e0 100644 --- a/frontend/src/assets/iconfont/iconfont.css +++ b/frontend/src/assets/iconfont/iconfont.css @@ -1,9 +1,9 @@ @font-face { font-family: "panel"; /* Project id 3575356 */ - src: url('iconfont.woff2?t=1662692062751') format('woff2'), - url('iconfont.woff?t=1662692062751') format('woff'), - url('iconfont.ttf?t=1662692062751') format('truetype'), - url('iconfont.svg?t=1662692062751#panel') format('svg'); + src: url('iconfont.woff2?t=1663584463212') format('woff2'), + url('iconfont.woff?t=1663584463212') format('woff'), + url('iconfont.ttf?t=1663584463212') format('truetype'), + url('iconfont.svg?t=1663584463212#panel') format('svg'); } .panel { @@ -14,6 +14,38 @@ -moz-osx-font-smoothing: grayscale; } +.p-taolun:before { + content: "\e602"; +} + +.p-StarStar:before { + content: "\e635"; +} + +.p-bug:before { + content: "\e616"; +} + +.p-SFTP:before { + content: "\e647"; +} + +.p-huaban88:before { + content: "\e67c"; +} + +.p-oss:before { + content: "\e607"; +} + +.p-s3:before { + content: "\e8e4"; +} + +.p-minio:before { + content: "\e63c"; +} + .p-logout:before { content: "\e8fe"; } diff --git a/frontend/src/assets/iconfont/iconfont.js b/frontend/src/assets/iconfont/iconfont.js index 46b6b3941..77f588725 100644 --- a/frontend/src/assets/iconfont/iconfont.js +++ b/frontend/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_3575356='',function(h){var c=(c=document.getElementsByTagName("script"))[c.length-1],l=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var t,a,v,m,e,o=function(c,l){l.parentNode.insertBefore(c,l)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}t=function(){var c,l=document.createElement("div");l.innerHTML=h._iconfont_svg_string_3575356,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(c=document.body).firstChild?o(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),t()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(v=t,m=h.document,e=!1,i(),m.onreadystatechange=function(){"complete"==m.readyState&&(m.onreadystatechange=null,z())})}function z(){e||(e=!0,v())}function i(){try{m.documentElement.doScroll("left")}catch(c){return void setTimeout(i,50)}z()}}(window); \ No newline at end of file +window._iconfont_svg_string_3575356='',function(h){var c=(c=document.getElementsByTagName("script"))[c.length-1],l=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,t,v,m,o,z=function(c,l){l.parentNode.insertBefore(c,l)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}a=function(){var c,l=document.createElement("div");l.innerHTML=h._iconfont_svg_string_3575356,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(c=document.body).firstChild?z(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),a()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(v=a,m=h.document,o=!1,p(),m.onreadystatechange=function(){"complete"==m.readyState&&(m.onreadystatechange=null,i())})}function i(){o||(o=!0,v())}function p(){try{m.documentElement.doScroll("left")}catch(c){return void setTimeout(p,50)}i()}}(window); \ No newline at end of file diff --git a/frontend/src/assets/iconfont/iconfont.json b/frontend/src/assets/iconfont/iconfont.json new file mode 100644 index 000000000..1c072380b --- /dev/null +++ b/frontend/src/assets/iconfont/iconfont.json @@ -0,0 +1,247 @@ +{ + "id": "3575356", + "name": "panel", + "font_family": "panel", + "css_prefix_text": "p-", + "description": "", + "glyphs": [ + { + "icon_id": "1760690", + "name": "讨论", + "font_class": "taolun", + "unicode": "e602", + "unicode_decimal": 58882 + }, + { + "icon_id": "5192988", + "name": "Star Star", + "font_class": "StarStar", + "unicode": "e635", + "unicode_decimal": 58933 + }, + { + "icon_id": "6642940", + "name": "bug", + "font_class": "bug", + "unicode": "e616", + "unicode_decimal": 58902 + }, + { + "icon_id": "13532955", + "name": "SFTP", + "font_class": "SFTP", + "unicode": "e647", + "unicode_decimal": 58951 + }, + { + "icon_id": "15337722", + "name": "Logo GitHub", + "font_class": "huaban88", + "unicode": "e67c", + "unicode_decimal": 59004 + }, + { + "icon_id": "16268521", + "name": "oss", + "font_class": "oss", + "unicode": "e607", + "unicode_decimal": 58887 + }, + { + "icon_id": "17895439", + "name": "Amazon S3上传", + "font_class": "s3", + "unicode": "e8e4", + "unicode_decimal": 59620 + }, + { + "icon_id": "20290513", + "name": "minio", + "font_class": "minio", + "unicode": "e63c", + "unicode_decimal": 58940 + }, + { + "icon_id": "924436", + "name": "logout", + "font_class": "logout", + "unicode": "e8fe", + "unicode_decimal": 59646 + }, + { + "icon_id": "837256", + "name": "terminal", + "font_class": "terminal2", + "unicode": "e82a", + "unicode_decimal": 59434 + }, + { + "icon_id": "8358944", + "name": "英文5", + "font_class": "yingwen", + "unicode": "e6c3", + "unicode_decimal": 59075 + }, + { + "icon_id": "8358949", + "name": "中文5", + "font_class": "zhongwen", + "unicode": "e6c8", + "unicode_decimal": 59080 + }, + { + "icon_id": "11487994", + "name": "calendar", + "font_class": "plan", + "unicode": "e746", + "unicode_decimal": 59206 + }, + { + "icon_id": "11488064", + "name": "integral", + "font_class": "database", + "unicode": "e754", + "unicode_decimal": 59220 + }, + { + "icon_id": "11488108", + "name": "rejected-order", + "font_class": "rejected-order", + "unicode": "e75e", + "unicode_decimal": 59230 + }, + { + "icon_id": "11488148", + "name": "tool", + "font_class": "toolbox", + "unicode": "e769", + "unicode_decimal": 59241 + }, + { + "icon_id": "4765743", + "name": "earth", + "font_class": "website", + "unicode": "e781", + "unicode_decimal": 59265 + }, + { + "icon_id": "4765891", + "name": "setting", + "font_class": "config", + "unicode": "e78e", + "unicode_decimal": 59278 + }, + { + "icon_id": "4765962", + "name": "app store", + "font_class": "appstore1", + "unicode": "e792", + "unicode_decimal": 59282 + }, + { + "icon_id": "4765971", + "name": "detail", + "font_class": "log", + "unicode": "e793", + "unicode_decimal": 59283 + }, + { + "icon_id": "4766440", + "name": "sever", + "font_class": "host", + "unicode": "e7b1", + "unicode_decimal": 59313 + }, + { + "icon_id": "4766685", + "name": "home", + "font_class": "home", + "unicode": "e7c6", + "unicode_decimal": 59334 + }, + { + "icon_id": "19688849", + "name": "应用商店", + "font_class": "appstore", + "unicode": "eb65", + "unicode_decimal": 60261 + }, + { + "icon_id": "3876424", + "name": "docker", + "font_class": "docker", + "unicode": "e659", + "unicode_decimal": 58969 + }, + { + "icon_id": "15838431", + "name": "arrow-right", + "font_class": "arrow-right", + "unicode": "e665", + "unicode_decimal": 58981 + }, + { + "icon_id": "6172786", + "name": "terminal", + "font_class": "terminal", + "unicode": "e864", + "unicode_decimal": 59492 + }, + { + "icon_id": "14772948", + "name": "terminal", + "font_class": "terminal1", + "unicode": "e663", + "unicode_decimal": 58979 + }, + { + "icon_id": "7533292", + "name": "中英文", + "font_class": "language", + "unicode": "e605", + "unicode_decimal": 58885 + }, + { + "icon_id": "22551111", + "name": "主题", + "font_class": "theme", + "unicode": "e638", + "unicode_decimal": 58936 + }, + { + "icon_id": "22735864", + "name": "文件类型-文件夹", + "font_class": "file-folder", + "unicode": "66", + "unicode_decimal": 102 + }, + { + "icon_id": "22761833", + "name": "文件类型-未知文件", + "font_class": "file-unknown", + "unicode": "233", + "unicode_decimal": 563 + }, + { + "icon_id": "22761837", + "name": "文件类型-Txt", + "font_class": "file-txt", + "unicode": "74", + "unicode_decimal": 116 + }, + { + "icon_id": "19671156", + "name": "txt-1", + "font_class": "file-normal", + "unicode": "e7ac", + "unicode_decimal": 59308 + }, + { + "icon_id": "22761832", + "name": "文件类型-压缩包", + "font_class": "file-zip", + "unicode": "e606", + "unicode_decimal": 58886 + } + ] +} diff --git a/frontend/src/assets/iconfont/iconfont.svg b/frontend/src/assets/iconfont/iconfont.svg index f12b0d3d6..207bff1c0 100644 --- a/frontend/src/assets/iconfont/iconfont.svg +++ b/frontend/src/assets/iconfont/iconfont.svg @@ -14,6 +14,22 @@ /> + + + + + + + + + + + + + + + + diff --git a/frontend/src/assets/iconfont/iconfont.ttf b/frontend/src/assets/iconfont/iconfont.ttf index 6e735a21e..37b64c4d1 100644 Binary files a/frontend/src/assets/iconfont/iconfont.ttf and b/frontend/src/assets/iconfont/iconfont.ttf differ diff --git a/frontend/src/assets/iconfont/iconfont.woff b/frontend/src/assets/iconfont/iconfont.woff index a2eec67f4..e9eafe0bc 100644 Binary files a/frontend/src/assets/iconfont/iconfont.woff and b/frontend/src/assets/iconfont/iconfont.woff differ diff --git a/frontend/src/assets/iconfont/iconfont.woff2 b/frontend/src/assets/iconfont/iconfont.woff2 index 34dfcf7c2..96bd7ae45 100644 Binary files a/frontend/src/assets/iconfont/iconfont.woff2 and b/frontend/src/assets/iconfont/iconfont.woff2 differ diff --git a/frontend/src/assets/images/ko_image.png b/frontend/src/assets/images/ko_image.png new file mode 100644 index 000000000..00415b040 Binary files /dev/null and b/frontend/src/assets/images/ko_image.png differ diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 16c684d13..4f2d241b5 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -262,6 +262,7 @@ export default { downloading: 'Downloading...', }, setting: { + all: 'All', panel: 'Panel', emailHelper: 'For password retrieval', title: 'Panel alias', @@ -282,6 +283,8 @@ export default { backup: 'Backup', serverDisk: 'Server disks', + OSS: 'Ali OSS', + S3: 'Amazon S3', backupAccount: 'Backup account', loadBucket: 'Get bucket', accountName: 'Account name', @@ -298,11 +301,11 @@ export default { 'The recommended port range is 8888 to 65535. Note: If the server has a security group, permit the new port from the security group in advance', safeEntrance: 'Security entrance', safeEntranceHelper: - 'Panel management portal. You can log in to the panel only through a specified security portal, for example, / 89DC6AE8', - passwordTimeout: 'Password expiration Time', + 'Panel management portal. You can log in to the panel only through a specified security portal, for example: onepanel', + passwordTimeout: 'Expiration Time', timeoutHelper: '[ {0} days ] The panel password is about to expire. After the expiration, you need to reset the password', - complexity: 'Password complexity verification', + complexity: 'Complexity verification', complexityHelper: 'The password must contain at least eight characters and contain at least three uppercase letters, lowercase letters, digits, and special characters', mfa: 'MFA', @@ -324,5 +327,12 @@ export default { emailAddr: 'Service address', emailSMTP: 'SMTP code', secret: 'Secret', + + about: 'About', + project: 'Project Address', + issue: 'Feedback', + chat: 'Community Discussion', + star: 'Star', + description: 'A modern Linux panel tool', }, }; diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 59fe54464..364fa2867 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -259,6 +259,7 @@ export default { downloading: '正在下载...', }, setting: { + all: '全部', panel: '面板', emailHelper: '用于密码找回', title: '面板别名', @@ -278,6 +279,8 @@ export default { backup: '备份', serverDisk: '服务器磁盘', + OSS: '阿里云 OSS', + S3: '亚马逊 S3 云存储', backupAccount: '备份账号', loadBucket: '获取桶', accountName: '账户名称', @@ -292,7 +295,7 @@ export default { panelPort: '面板端口', portHelper: '建议端口范围8888 - 65535,注意:有安全组的服务器请提前在安全组放行新端口', safeEntrance: '安全入口', - safeEntranceHelper: '面板管理入口,设置后只能通过指定安全入口登录面板,如: 89dc6ae8', + safeEntranceHelper: '面板管理入口,设置后只能通过指定安全入口登录面板,如: onepanel', passwordTimeout: '密码过期时间', timeoutHelper: '【 {0} 天后 】面板密码即将过期,过期后需要重新设置密码', complexity: '密码复杂度验证', @@ -318,5 +321,10 @@ export default { secret: '密钥', about: '关于', + project: '项目地址', + issue: '问题反馈', + chat: '参与讨论', + star: '点亮 Star', + description: '一个现代化的 Linux 面板工具', }, }; diff --git a/frontend/src/views/host/terminal/index.vue b/frontend/src/views/host/terminal/index.vue index f816ca4a9..ce2aab82d 100644 --- a/frontend/src/views/host/terminal/index.vue +++ b/frontend/src/views/host/terminal/index.vue @@ -410,23 +410,23 @@ onBeforeMount(() => {