Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/init/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ func setWebStatic(rootRouter *gin.RouterGroup) {
rootRouter.StaticFS("/public", http.FS(web.Favicon))
rootRouter.StaticFS("/favicon.ico", http.FS(web.Favicon))
rootRouter.Static("/api/v2/images", path.Join(global.CONF.Base.InstallDir, "1panel/uploads/theme"))
rootRouter.Use(func(c *gin.Context) {
c.Next()
})
rootRouter.GET("/assets/*filepath", func(c *gin.Context) {
c.Writer.Header().Set("Cache-Control", fmt.Sprintf("private, max-age=%d", 3600))
staticServer := http.FileServer(http.FS(web.Assets))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good overall. Here are a few minor suggestions:

  1. The Use function call at the beginning of the file seems unnecessary since there's no middleware being added to handle any specific concerns.
  2. If you plan on adding more routes or middleware in future, it would be helpful to keep this pattern consistent for better readability.
rootRouter.StaticFS("/public", http.FS(web.Favicon))
rootRouter.StaticFS("/favicon.ico", http.FS(web.Favicon))

rootRouter.Use(func(c *gin.Context) {
    c.Next()
})

if global.CONF != nil && global.CONF.Base.IsInstalled() {
    rootRouter.Static( "/api/v2/images", path.Join(global.CONF.Base.InstallDir, "1panel/uploads/theme"))
}

rootRouter.GET("/assets/*filepath", func(c *gin.Context) {
    c.Writer.Header().Set("Cache-Control", fmt.Sprintf("private, max-age=%d", 3600))
    staticServer := http.FileServer(http.FS(web.Assets))
})

Overall, the code is clear and functional with some slight improvements that can enhance maintainability and clarity.

Expand Down
13 changes: 0 additions & 13 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
# title
VITE_GLOB_APP_TITLE = '1Panel'

# port
VITE_PORT = 4004

# open 运行 npm run dev 时自动打开浏览器
VITE_OPEN = false

# 是否生成包预览文件
VITE_REPORT = false

# 是否开启gzip压缩
VITE_BUILD_GZIP = false

# 是否删除生产环境 console
VITE_DROP_CONSOLE = true


PANEL_XPACK = false
9 changes: 0 additions & 9 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# 本地环境
NODE_ENV = 'development'

# 本地环境接口地址
VITE_API_URL = '/api/v2'

# 是否生成包预览文件
VITE_REPORT = false

# 是否开启gzip压缩
VITE_BUILD_GZIP = false

VITE_DROP_CONSOLE = true

PANEL_XPACK = true
9 changes: 0 additions & 9 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# 线上环境
NODE_ENV = "production"

# 线上环境接口地址
VITE_API_URL = '/api/v2'

# 是否生成包预览文件
VITE_REPORT = true

# 是否开启gzip压缩
VITE_BUILD_GZIP = false

VITE_DROP_CONSOLE = true

PANEL_XPACK = true
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,7 @@ const message = {
logSaveSize: 'Maximum Log Save Size',
logSaveSizeHelper: 'This is the log save size for a single website',
'360se': '360 Security Browser',
websites: 'Website List',
},
tamper: {
tamper: 'Website Tamper Protection',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code snippet appears to be part of an internationalization (i18n) file for a software application. It contains translations for key strings such as log save sizes and browser names.

Here are some observations:

  1. Translation Errors:

    • The translation for "logSaveSize" is duplicated within the same object.
    • There seems to be an extra comma at the end of the last line under the tamper section.
  2. Potential Issues:

    • While there are no major errors directly affecting feature functionality, consistency in naming conventions can improve maintainability.
  3. Optimization Suggestions:

    • Ensure that all languages have their respective keys and values defined thoroughly to prevent runtime errors if not present.
    • Consider using more descriptive variable names and comments for better readability and future updates.

To address these points, you might want to adjust the content like this:

const message = {
    logSettings: {
        logSaveSize: 'Maximum Log Save Size',
        logSaveSizeHelper: 'This is the log save size for a single website',
    },
    browsers: {
        '360se': '360 Security Browser',
    },
    protection: {
        tamperProtection: 'Website Tamper Protection',
    },
};

This version consolidates duplicate entries and adds proper spacing between sections for clarity. Make sure to update any related usage in your application accordingly.

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,7 @@ const message = {
logSaveSize: '最大ログ保存サイズ',
logSaveSizeHelper: 'これは単一ウェブサイトのログ保存サイズです',
'360se': '360 セキュリティブラウザ',
websites: 'ウェブサイトリスト',
},
tamper: {
tamper: 'ウェブサイトの改ざん防止',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided difference appears to be from an update to a localization file (likely for a product like Firefox Add-ons). The key you added is 'websites', which translates to "Website List" in Japanese.

Key Points:

  1. Translation Addition: You've successfully translated "Website List" into Japanese for better internationalization.
  2. Consistency: Ensure that the rest of the translations remain consistent with the existing ones.
  3. Potential Issues: There are no immediate concerns about errors or issues introduced by this addition, assuming it was intended.
  4. Optimization Suggestions:
    • Keep consistency between languages if there are other similar terms.
    • Verify that translations don't conflict with existing terminology or cause ambiguity.

Overall, your translation looks good and contributes positively to the overall user experience by offering localized options for users who may speak Japanese.

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,7 @@ const message = {
logSaveSize: '최대 로그 저장 크기',
logSaveSizeHelper: '이것은 단일 웹사이트의 로그 저장 크기입니다',
'360se': '360 보안 브라우저',
websites: '웹사이트 목록',
},
tamper: {
tamper: '웹사이트 변조 방지',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3019,6 +3019,7 @@ const message = {
logSaveSize: 'Saiz Simpanan Log Maksimum',
logSaveSizeHelper: 'Ini adalah saiz simpanan log untuk satu laman web',
'360se': '360 Pelayar Keselamatan',
websites: 'Senarai Laman Web',
},
tamper: {
tamper: 'Perlindungan daripada peng篡改 laman web',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3020,6 +3020,7 @@ const message = {
logSaveSize: 'Tamanho Máximo de Salvamento de Log',
logSaveSizeHelper: 'Este é o tamanho de salvamento de log para um único site',
'360se': 'Navegador de Segurança 360',
websites: 'Lista de Sites',
},
tamper: {
tamper: 'Proteção contra adulteração do site',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3013,6 +3013,7 @@ const message = {
logSaveSize: 'Максимальный размер сохранения логов',
logSaveSizeHelper: 'Это размер сохранения логов для одного сайта',
'360se': '360 Secure Browser',
websites: 'Список веб-сайтов',
},
tamper: {
tamper: 'Защита от подделки сайта',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2872,6 +2872,7 @@ const message = {
logSaveSize: '最大日誌保存大小',
logSaveSizeHelper: '此處為單個網站的日誌保存大小',
'360se': '360 安全瀏覽器',
websites: '網站列表',
},
tamper: {
tamper: '網站防篡改',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,7 @@ const message = {
logSaveSize: '最大日志保存大小',
logSaveSizeHelper: '此处为单个网站的日志保存大小',
'360se': '360 安全浏览器',
websites: '网站列表',
},
tamper: {
tamper: '网站防篡改',
Expand Down
Loading