Skip to content

Commit 15a11c3

Browse files
committed
优化代码
1 parent 57b8496 commit 15a11c3

File tree

9 files changed

+19
-12
lines changed

9 files changed

+19
-12
lines changed

internal/nodes/admin_node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package nodes
22

33
import (
4+
"errors"
45
"github.com/TeaOSLab/EdgeAdmin/internal/configs"
56
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
6-
"github.com/TeaOSLab/EdgeAdmin/internal/errors"
77
"github.com/TeaOSLab/EdgeAdmin/internal/events"
88
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
99
"github.com/iwind/TeaGo"
@@ -90,7 +90,7 @@ func (this *AdminNode) Run() {
9090
EndAll().
9191
Session(sessions.NewFileSessionManager(86400, secret), teaconst.CookieSID).
9292
ReadHeaderTimeout(3 * time.Second).
93-
ReadTimeout(600 * time.Second).
93+
ReadTimeout(1200 * time.Second).
9494
Start()
9595
}
9696

web/public/js/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
22042204
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
22052205
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
22062206
<tr>
2207-
<td class="title">启用</td>
2207+
<td class="title">启用防盗链</td>
22082208
<td>
22092209
<div class="ui checkbox">
22102210
<input type="checkbox" value="1" v-model="config.isOn"/>

web/public/js/components.src.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6652,7 +6652,7 @@ Vue.component("http-referers-config-box", {
66526652
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
66536653
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
66546654
<tr>
6655-
<td class="title">启用</td>
6655+
<td class="title">启用防盗链</td>
66566656
<td>
66576657
<div class="ui checkbox">
66586658
<input type="checkbox" value="1" v-model="config.isOn"/>

web/public/js/components/server/http-referers-config-box.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Vue.component("http-referers-config-box", {
3131
<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
3232
<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
3333
<tr>
34-
<td class="title">启用</td>
34+
<td class="title">启用防盗链</td>
3535
<td>
3636
<div class="ui checkbox">
3737
<input type="checkbox" value="1" v-model="config.isOn"/>

web/views/@default/clusters/cluster/node/detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ <h3>运行状态</h3>
209209
</tr>
210210
</tbody>
211211
<tbody>
212-
<tr>
212+
<tr v-if="node.status.buildVersion != null && node.status.buildVersion.length > 0">
213213
<td>版本</td>
214214
<td>v{{node.status.buildVersion}}
215215
&nbsp; <a :href="'/clusters/cluster/upgradeRemote?clusterId=' + clusterId" v-if="shouldUpgrade"><span class="red">发现新版本v{{newVersion}} &raquo;</span></a>

web/views/@default/clusters/cluster/node/install.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4>方法1:通过SSH自动安装</h4>
2424
<h4>方法2:手动安装</h4>
2525
<table class="ui table definition selectable">
2626
<tr v-if="installerFiles != null && installerFiles.length > 0">
27-
<td>安装文件</td>
27+
<td class="title">下载安装文件</td>
2828
<td>
2929
<table class="ui table celled">
3030
<thead class="full-width">

web/views/@default/setup/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@
158158
<td>数据库连接端口 *</td>
159159
<td>
160160
<input type="text" name="port" maxlength="5" placeholder="比如 3306" style="width:7em" v-model="localDB.port"/>
161+
<p class="comment">MySQL默认端口为3306。</p>
161162
</td>
162163
</tr>
163164
<tr>
164165
<td>数据库名称 *</td>
165166
<td>
166167
<input type="text" name="database" value="edges" style="width:16em"/>
167-
<p class="comment">请事先创建好此数据库,如果不存在,则会尝试自动创建。</p>
168+
<p class="comment">请事先创建好此数据库,如果不存在,则会尝试自动创建。手动创建数据库语句<code-label>CREATE DATABASE `数据库名称` CHARSET utf8mb4;</code-label></p>
168169
</td>
169170
</tr>
170171
<tr>
@@ -185,7 +186,7 @@
185186
<td>访问日志保留天数</td>
186187
<td>
187188
<div class="ui input right labeled">
188-
<input type="number" name="accessLogKeepDays" style="width: 5em" maxlength="4" value="14"/>
189+
<input type="number" name="accessLogKeepDays" style="width: 5em" maxlength="4" value="7"/>
189190
<span class="ui label"></span>
190191
</div>
191192
<p class="comment">网站等服务记录的访问日志保留天数,防止无限制地占用数据库空间,如果你的数据库空间比较小,请适当调小此值。</p>
@@ -220,7 +221,7 @@
220221
<tr>
221222
<td>登录密码 *</td>
222223
<td>
223-
<input type="password" name="adminPassword" maxlength="100" style="width:16em" v-model="adminPassword" v-show="!adminPasswordVisible" tabindex="2"/>
224+
<input type="password" name="adminPassword" maxlength="100" style="width:16em" v-model="adminPassword" v-show="!adminPasswordVisible" tabindex="2" ref="adminPasswordInput"/>
224225
<input type="text" value="" v-model="adminPassword" style="width:16em" v-show="adminPasswordVisible"/>
225226
<p class="comment">只能是英文、数字和下划线的组合 <a href="" title="显示明文密码" @click.prevent="showAdminPassword"><i class="icon eye grey"></i></a></p>
226227
</td>
@@ -242,7 +243,7 @@
242243

243244
<!-- 完成安装 -->
244245
<div v-show="step == STEP_FINISH">
245-
<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">
246+
<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">
246247
<input type="hidden" name="apiNodeJSON" :value="JSON.stringify(apiNodeInfo)"/>
247248
<input type="hidden" name="dbJSON" :value="JSON.stringify(dbInfo)"/>
248249
<input type="hidden" name="adminJSON" :value="JSON.stringify(adminInfo)"/>

web/views/@default/setup/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ Tea.context(function () {
9292
this.dbSuccess = function (resp) {
9393
this.step = this.STEP_ADMIN
9494
this.dbInfo = resp.data.db
95+
96+
this.$delay(function () {
97+
if (this.$refs.adminPasswordInput != null) {
98+
this.$refs.adminPasswordInput.focus()
99+
}
100+
})
95101
}
96102

97103
this.dbDone = function () {

web/views/@default/users/@user_menu.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<menu-item :href="'/users/user?userId=' + user.id" code="index">{{user.fullname}}&nbsp; <span class="small">({{user.username}})</span></menu-item>
55
<menu-item :href="'/users/user/servers?userId=' + user.id" code="server" v-if="teaIsPlus">网站服务</menu-item>
66
<menu-item :href="'/users/update?userId=' + user.id" code="update">修改</menu-item>
7-
<menu-item :href="'/users/features?userId=' + user.id" code="feature">功能</menu-item>
7+
<menu-item :href="'/users/features?userId=' + user.id" code="feature" v-if="teaIsPlus">功能</menu-item>
88
<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>
99
<menu-item :href="'/users/accessKeys?userId=' + user.id" code="accessKey">API AccessKey({{user.countAccessKeys}})</menu-item>
1010
</first-menu>

0 commit comments

Comments
 (0)