mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
feat: Internationalize Certain Files (#7252)
This commit is contained in:
parent
b6f65f278d
commit
8e3a06b07f
@ -243,14 +243,14 @@ var AddDefaultGroup = &gormigrate.Migration{
|
|||||||
ID: "2023022-change-default-group",
|
ID: "2023022-change-default-group",
|
||||||
Migrate: func(tx *gorm.DB) error {
|
Migrate: func(tx *gorm.DB) error {
|
||||||
defaultGroup := &model.Group{
|
defaultGroup := &model.Group{
|
||||||
Name: "默认",
|
Name: "Default",
|
||||||
IsDefault: true,
|
IsDefault: true,
|
||||||
Type: "website",
|
Type: "website",
|
||||||
}
|
}
|
||||||
if err := tx.Create(defaultGroup).Error; err != nil {
|
if err := tx.Create(defaultGroup).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tx.Model(&model.Group{}).Where("name = ? AND type = ?", "default", "host").Update("name", "默认").Error; err != nil {
|
if err := tx.Model(&model.Group{}).Where("name = ? AND type = ?", "default", "host").Update("name", "Default").Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tx.Model(&model.Website{}).Where("1 = 1").Update("website_group_id", defaultGroup.ID).Error; err != nil {
|
if err := tx.Model(&model.Website{}).Where("1 = 1").Update("website_group_id", defaultGroup.ID).Error; err != nil {
|
||||||
|
@ -35,7 +35,7 @@ var AddCommandGroup = &gormigrate.Migration{
|
|||||||
if err := tx.AutoMigrate(&model.Command{}); err != nil {
|
if err := tx.AutoMigrate(&model.Command{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defaultCommand := &model.Group{IsDefault: true, Name: "默认", Type: "command"}
|
defaultCommand := &model.Group{IsDefault: true, Name: "Default", Type: "command"}
|
||||||
if err := tx.Create(defaultCommand).Error; err != nil {
|
if err := tx.Create(defaultCommand).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ var AddTablePHPExtensions = &gormigrate.Migration{
|
|||||||
if err := tx.AutoMigrate(&model.PHPExtensions{}); err != nil {
|
if err := tx.AutoMigrate(&model.PHPExtensions{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tx.Create(&model.PHPExtensions{Name: "默认", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
|
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tx.Create(&model.PHPExtensions{Name: "WordPress", Extensions: "exif,igbinary,imagick,intl,zip,apcu,memcached,opcache,redis,bc,image,shmop,mysqli,pdo_mysql,gd"}).Error; err != nil {
|
if err := tx.Create(&model.PHPExtensions{Name: "WordPress", Extensions: "exif,igbinary,imagick,intl,zip,apcu,memcached,opcache,redis,bc,image,shmop,mysqli,pdo_mysql,gd"}).Error; err != nil {
|
||||||
@ -133,9 +133,6 @@ var AddTablePHPExtensions = &gormigrate.Migration{
|
|||||||
if err := tx.Create(&model.PHPExtensions{Name: "Flarum", Extensions: "curl,gd,pdo_mysql,mysqli,bz2,exif,yaf,imap"}).Error; err != nil {
|
if err := tx.Create(&model.PHPExtensions{Name: "Flarum", Extensions: "curl,gd,pdo_mysql,mysqli,bz2,exif,yaf,imap"}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tx.Create(&model.PHPExtensions{Name: "苹果CMS-V10", Extensions: "mysqli,pdo_mysql,zip,gd,redis,memcache,memcached"}).Error; err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := tx.Create(&model.PHPExtensions{Name: "SeaCMS", Extensions: "mysqli,pdo_mysql,gd,curl"}).Error; err != nil {
|
if err := tx.Create(&model.PHPExtensions{Name: "SeaCMS", Extensions: "mysqli,pdo_mysql,gd,curl"}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,6 @@ func handleNoRoute(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file := fmt.Sprintf("html/%s.html", resPage)
|
file := fmt.Sprintf("html/%s.html", resPage)
|
||||||
if resPage == "200" && c.GetHeader("Accept-Language") == "en" {
|
|
||||||
file = "html/200_en.html"
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := res.ErrorMsg.ReadFile(file)
|
data, err := res.ErrorMsg.ReadFile(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.String(http.StatusInternalServerError, "Internal Server Error")
|
c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>暂无法访问</title>
|
<title>Access Temporarily Unavailable</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
@ -46,9 +46,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>暂时无法访问</h1>
|
<h1>Access Temporarily Unavailable</h1>
|
||||||
<p>当前环境已经开启了安全入口登录。</p>
|
<p>The current environment has enabled secure login access.</p>
|
||||||
<p>在 SSH 终端输入以下命令来查看面板入口</p>
|
<p>Please enter the following command in the SSH terminal to view the panel login URL:</p>
|
||||||
<p class="command">1pctl user-info</p>
|
<p class="command">1pctl user-info</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Access Temporarily Unavailable</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
max-width: 600px;
|
|
||||||
margin: 50px auto;
|
|
||||||
padding: 20px;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
.icon img {
|
|
||||||
width: 100px;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 24px;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #666;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.command {
|
|
||||||
font-family: monospace;
|
|
||||||
background: #f0f0f0;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h1>Access Temporarily Unavailable</h1>
|
|
||||||
<p>The current environment has enabled secure login access.</p>
|
|
||||||
<p>Please enter the following command in the SSH terminal to view the panel login URL:</p>
|
|
||||||
<p class="command">1pctl user-info</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user