优化代码

This commit is contained in:
GoEdgeLab
2022-09-25 20:34:43 +08:00
parent 85d862b4d2
commit b63afd5f66
9 changed files with 19 additions and 12 deletions

View File

@@ -1,9 +1,9 @@
package nodes
import (
"errors"
"github.com/TeaOSLab/EdgeAdmin/internal/configs"
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
"github.com/TeaOSLab/EdgeAdmin/internal/errors"
"github.com/TeaOSLab/EdgeAdmin/internal/events"
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
"github.com/iwind/TeaGo"
@@ -90,7 +90,7 @@ func (this *AdminNode) Run() {
EndAll().
Session(sessions.NewFileSessionManager(86400, secret), teaconst.CookieSID).
ReadHeaderTimeout(3 * time.Second).
ReadTimeout(600 * time.Second).
ReadTimeout(1200 * time.Second).
Start()
}

View File

@@ -2204,7 +2204,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
<tr>
<td class="title">启用</td>
<td class="title">启用防盗链</td>
<td>
<div class="ui checkbox">
<input type="checkbox" value="1" v-model="config.isOn"/>

View File

@@ -6652,7 +6652,7 @@ Vue.component("http-referers-config-box", {
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
<tr>
<td class="title">启用</td>
<td class="title">启用防盗链</td>
<td>
<div class="ui checkbox">
<input type="checkbox" value="1" v-model="config.isOn"/>

View File

@@ -31,7 +31,7 @@ Vue.component("http-referers-config-box", {
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
<tr>
<td class="title">启用</td>
<td class="title">启用防盗链</td>
<td>
<div class="ui checkbox">
<input type="checkbox" value="1" v-model="config.isOn"/>

View File

@@ -209,7 +209,7 @@
</tr>
</tbody>
<tbody>
<tr>
<tr v-if="node.status.buildVersion != null && node.status.buildVersion.length > 0">
<td>版本</td>
<td>v{{node.status.buildVersion}}
&nbsp; <a :href="'/clusters/cluster/upgradeRemote?clusterId=' + clusterId" v-if="shouldUpgrade"><span class="red">发现新版本v{{newVersion}} &raquo;</span></a>

View File

@@ -24,7 +24,7 @@
<h4>方法2手动安装</h4>
<table class="ui table definition selectable">
<tr v-if="installerFiles != null && installerFiles.length > 0">
<td>安装文件</td>
<td class="title">下载安装文件</td>
<td>
<table class="ui table celled">
<thead class="full-width">

View File

@@ -158,13 +158,14 @@
<td>数据库连接端口 *</td>
<td>
<input type="text" name="port" maxlength="5" placeholder="比如 3306" style="width:7em" v-model="localDB.port"/>
<p class="comment">MySQL默认端口为3306。</p>
</td>
</tr>
<tr>
<td>数据库名称 *</td>
<td>
<input type="text" name="database" value="edges" style="width:16em"/>
<p class="comment">请事先创建好此数据库,如果不存在,则会尝试自动创建。</p>
<p class="comment">请事先创建好此数据库,如果不存在,则会尝试自动创建。手动创建数据库语句<code-label>CREATE DATABASE `数据库名称` CHARSET utf8mb4;</code-label></p>
</td>
</tr>
<tr>
@@ -185,7 +186,7 @@
<td>访问日志保留天数</td>
<td>
<div class="ui input right labeled">
<input type="number" name="accessLogKeepDays" style="width: 5em" maxlength="4" value="14"/>
<input type="number" name="accessLogKeepDays" style="width: 5em" maxlength="4" value="7"/>
<span class="ui label"></span>
</div>
<p class="comment">网站等服务记录的访问日志保留天数,防止无限制地占用数据库空间,如果你的数据库空间比较小,请适当调小此值。</p>
@@ -220,7 +221,7 @@
<tr>
<td>登录密码 *</td>
<td>
<input type="password" name="adminPassword" maxlength="100" style="width:16em" v-model="adminPassword" v-show="!adminPasswordVisible" tabindex="2"/>
<input type="password" name="adminPassword" maxlength="100" style="width:16em" v-model="adminPassword" v-show="!adminPasswordVisible" tabindex="2" ref="adminPasswordInput"/>
<input type="text" value="" v-model="adminPassword" style="width:16em" v-show="adminPasswordVisible"/>
<p class="comment">只能是英文、数字和下划线的组合 <a href="" title="显示明文密码" @click.prevent="showAdminPassword"><i class="icon eye grey"></i></a></p>
</td>
@@ -242,7 +243,7 @@
<!-- 完成安装 -->
<div v-show="step == STEP_FINISH">
<form method="post" class="ui form" data-tea-action=".install" data-tea-success="finishSuccess" data-tea-before="finishSubmit" data-tea-done="finishDone" data-tea-timeout="600">
<form method="post" class="ui form" data-tea-action=".install" data-tea-success="finishSuccess" data-tea-before="finishSubmit" data-tea-done="finishDone" data-tea-timeout="1200">
<input type="hidden" name="apiNodeJSON" :value="JSON.stringify(apiNodeInfo)"/>
<input type="hidden" name="dbJSON" :value="JSON.stringify(dbInfo)"/>
<input type="hidden" name="adminJSON" :value="JSON.stringify(adminInfo)"/>

View File

@@ -92,6 +92,12 @@ Tea.context(function () {
this.dbSuccess = function (resp) {
this.step = this.STEP_ADMIN
this.dbInfo = resp.data.db
this.$delay(function () {
if (this.$refs.adminPasswordInput != null) {
this.$refs.adminPasswordInput.focus()
}
})
}
this.dbDone = function () {

View File

@@ -4,7 +4,7 @@
<menu-item :href="'/users/user?userId=' + user.id" code="index">{{user.fullname}}&nbsp; <span class="small">({{user.username}})</span></menu-item>
<menu-item :href="'/users/user/servers?userId=' + user.id" code="server" v-if="teaIsPlus">网站服务</menu-item>
<menu-item :href="'/users/update?userId=' + user.id" code="update">修改</menu-item>
<menu-item :href="'/users/features?userId=' + user.id" code="feature">功能</menu-item>
<menu-item :href="'/users/features?userId=' + user.id" code="feature" v-if="teaIsPlus">功能</menu-item>
<menu-item :href="'/users/identity?userId=' + user.id" code="identity" v-if="teaIsPlus">实名认证<span v-if="user.hasNewIndividualIdentity || user.hasNewEnterpriseIdentity" class="red small">(待审核)</span><span v-if="user.identityTag != null && user.identityTag.length > 0" class="green">({{user.identityTag}})</span></menu-item>
<menu-item :href="'/users/accessKeys?userId=' + user.id" code="accessKey">API AccessKey({{user.countAccessKeys}})</menu-item>
</first-menu>