样式修改
This commit is contained in:
@@ -146,6 +146,57 @@ func (this *BaseInstaller) LookupLatestInstaller(filePrefix string) (string, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// LookupLatestInstallerForTarget 按目标系统优先选择安装包:
|
||||
// 1) Linux 且识别到发行版时,优先 filePrefix-{distroTag}-v*.zip(如 ubuntu22.04 / amzn2023)
|
||||
// 2) 回退 filePrefix-v*.zip(通用包)
|
||||
func (this *BaseInstaller) LookupLatestInstallerForTarget(filePrefix string, env *Env) (string, error) {
|
||||
if env != nil && env.OS == "linux" {
|
||||
distroTag, err := this.detectLinuxDistroTag()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(distroTag) > 0 {
|
||||
zipFile, err := this.LookupLatestInstaller(filePrefix + "-" + distroTag)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(zipFile) > 0 {
|
||||
return zipFile, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.LookupLatestInstaller(filePrefix)
|
||||
}
|
||||
|
||||
// detectLinuxDistroTag 识别远端 Linux 发行版标签(用于选择发行版定制安装包)。
|
||||
// 当前支持:ubuntu22.04 / amzn2023;其他系统返回空字符串(回退通用包)。
|
||||
func (this *BaseInstaller) detectLinuxDistroTag() (string, error) {
|
||||
if this.client == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
releaseData, stderr, err := this.client.Exec("cat /etc/os-release")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("read /etc/os-release failed: %w, stderr: %s", err, stderr)
|
||||
}
|
||||
if len(strings.TrimSpace(releaseData)) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
releaseMap := parseOSRelease(releaseData)
|
||||
id := strings.ToLower(strings.TrimSpace(releaseMap["ID"]))
|
||||
versionID := strings.TrimSpace(releaseMap["VERSION_ID"])
|
||||
|
||||
switch {
|
||||
case id == "ubuntu" && strings.HasPrefix(versionID, "22.04"):
|
||||
return "ubuntu22.04", nil
|
||||
case id == "amzn" && strings.HasPrefix(versionID, "2023"):
|
||||
return "amzn2023", nil
|
||||
default:
|
||||
return "", nil
|
||||
}
|
||||
}
|
||||
|
||||
// InstallHelper 上传安装助手
|
||||
func (this *BaseInstaller) InstallHelper(targetDir string, role nodeconfigs.NodeRole) (env *Env, err error) {
|
||||
var uname = this.uname()
|
||||
|
||||
@@ -47,12 +47,12 @@ func (this *NodeInstaller) Install(dir string, params interface{}, installStatus
|
||||
|
||||
// 上传安装文件
|
||||
var filePrefix = "edge-node-" + env.OS + "-" + env.Arch
|
||||
zipFile, err := this.LookupLatestInstaller(filePrefix)
|
||||
zipFile, err := this.LookupLatestInstallerForTarget(filePrefix, env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(zipFile) == 0 {
|
||||
return errors.New("can not find installer file for " + env.OS + "/" + env.Arch)
|
||||
return errors.New("can not find installer file for " + env.OS + "/" + env.Arch + ", expected '" + filePrefix + "-v*.zip' or distro-specific '" + filePrefix + "-{ubuntu22.04|amzn2023}-v*.zip'")
|
||||
}
|
||||
var targetZip = ""
|
||||
var firstCopyErr error
|
||||
|
||||
@@ -49,12 +49,12 @@ func (this *NSNodeInstaller) Install(dir string, params interface{}, installStat
|
||||
|
||||
// 上传安装文件
|
||||
filePrefix := "edge-dns-" + env.OS + "-" + env.Arch
|
||||
zipFile, err := this.LookupLatestInstaller(filePrefix)
|
||||
zipFile, err := this.LookupLatestInstallerForTarget(filePrefix, env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(zipFile) == 0 {
|
||||
return errors.New("can not find installer file for " + env.OS + "/" + env.Arch)
|
||||
return errors.New("can not find installer file for " + env.OS + "/" + env.Arch + ", expected '" + filePrefix + "-v*.zip' or distro-specific '" + filePrefix + "-{ubuntu22.04|amzn2023}-v*.zip'")
|
||||
}
|
||||
var targetZip = ""
|
||||
var firstCopyErr error
|
||||
|
||||
@@ -300,9 +300,7 @@ func (this *CreateAction) RunPost(params struct {
|
||||
if err != nil {
|
||||
this.Fail("源站地址解析失败:" + err.Error())
|
||||
}
|
||||
if len(originConfigs) == 0 {
|
||||
this.FailField("emptyOrigin", "请添加至少一个源站地址")
|
||||
}
|
||||
// 允许不填源站,保存时统一提示
|
||||
|
||||
var originRefs = []*serverconfigs.OriginRef{}
|
||||
for _, originConfig := range originConfigs {
|
||||
|
||||
@@ -50,8 +50,15 @@ func (this *AdvancedHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNex
|
||||
}
|
||||
// 外层始终显示「日志数据库」与「ClickHouse 配置」两个标签,不随点击变化
|
||||
path := action.Request.URL.Path
|
||||
tabbar.Add("日志数据库(MySQL)", "", "/db", "", (path == "/db" || strings.HasPrefix(path, "/db/")) && path != "/db/clickhouse")
|
||||
tabbar.Add("日志数据库(ClickHouse)", "", "/db/clickhouse", "", path == "/db/clickhouse")
|
||||
langCode := strings.ToLower(configloaders.FindAdminLangForAction(actionPtr))
|
||||
mysqlTabName := "Log Databases (MySQL)"
|
||||
clickHouseTabName := "Log Databases (ClickHouse)"
|
||||
if strings.HasPrefix(langCode, "zh") {
|
||||
mysqlTabName = "日志数据库(MySQL)"
|
||||
clickHouseTabName = "日志数据库(ClickHouse)"
|
||||
}
|
||||
tabbar.Add(mysqlTabName, "", "/db", "", (path == "/db" || strings.HasPrefix(path, "/db/")) && path != "/db/clickhouse")
|
||||
tabbar.Add(clickHouseTabName, "", "/db/clickhouse", "", path == "/db/clickhouse")
|
||||
if teaconst.IsPlus {
|
||||
// 目前仅在调试模式下使用
|
||||
if Tea.IsTesting() {
|
||||
|
||||
@@ -17,11 +17,6 @@ Tea.context(function () {
|
||||
teaweb.warn(err.messages[0], function () {
|
||||
that.$refs.serverNameBox.addServerName()
|
||||
})
|
||||
} else if (err.param == "emptyOrigin") {
|
||||
isFiltered = true
|
||||
teaweb.warn(err.messages[0], function () {
|
||||
that.addOrigin()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -383,6 +383,12 @@ body.expanded .main {
|
||||
.top-nav .item.red {
|
||||
color: red !important;
|
||||
}
|
||||
.top-nav .item .hover-span span {
|
||||
display: none;
|
||||
}
|
||||
.top-nav .item:hover .hover-span span {
|
||||
display: inline;
|
||||
}
|
||||
/** 顶部菜单 **/
|
||||
.top-secondary-menu {
|
||||
position: fixed;
|
||||
|
||||
@@ -73,21 +73,27 @@
|
||||
</a>
|
||||
|
||||
<div class="right menu">
|
||||
<a href="/messages" class="item" :class="{active:teaMenu == 'message'}"><span
|
||||
:class="{'blink':globalMessageBadge > 0}"><i class="icon bell"></i>消息({{globalMessageBadge}})
|
||||
</span></a>
|
||||
<a href="/messages" class="item" :class="{active:teaMenu == 'message'}">
|
||||
<span v-if="globalMessageBadge > 0" class="blink hover-span"><i
|
||||
class="icon bell"></i><span>消息({{globalMessageBadge}})</span></span>
|
||||
<span v-if="globalMessageBadge == 0" class="hover-span"><i class="icon bell disabled"></i><span
|
||||
class="disabled">消息(0)</span></span>
|
||||
</a>
|
||||
<a href="/settings/profile" class="item">
|
||||
<i class="icon user" v-if="teaUserAvatar.length == 0"></i>
|
||||
<img class="avatar" alt="" :src="teaUserAvatar" v-if="teaUserAvatar.length > 0" />
|
||||
{{teaUsername}}
|
||||
<span class="hover-span"><span class="disabled">{{teaUsername}}</span></span>
|
||||
</a>
|
||||
<a href="/docs" class="item" :class="{active: teaMenu == 'docs'}"><i class="icon file"></i>文档</a>
|
||||
<a href="/docs" class="item" :class="{active: teaMenu == 'docs'}"><i class="icon file"></i><span
|
||||
class="hover-span"><span>文档</span></span></a>
|
||||
<!-- 自定义主题颜色 -->
|
||||
<theme-color-picker></theme-color-picker>
|
||||
<a href="/" class="item" v-show="teaShowIndexPage">
|
||||
<i class="icon home"></i>首页
|
||||
<i class="icon home"></i><span class="hover-span"><span>首页</span></span>
|
||||
</a>
|
||||
<a :href="Tea.url('logout')" class="item" title="安全退出登录"><i class="icon sign out"></i>
|
||||
<span class="hover-span"><span class="disabled">退出</span></span>
|
||||
</a>
|
||||
<a :href="Tea.url('logout')" class="item" title="安全退出登录"><i class="icon sign out"></i>退出</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user