Compare commits

..

19 Commits

Author SHA1 Message Date
刘祥超
a634046757 版本号更改为1.2.5 2023-07-26 15:30:19 +08:00
刘祥超
6a4d86e084 将版本号改为1.2.4 2023-07-26 10:15:40 +08:00
刘祥超
9f9b41c63d 更新Dockerfile中版本号 2023-07-26 10:15:32 +08:00
刘祥超
d813f6515b Update Dockerfile 2023-07-25 13:41:24 +08:00
刘祥超
730a445ef6 版本号修改为1.2.3 2023-07-25 13:16:31 +08:00
刘祥超
938947548b 优化节点同步任务界面 2023-07-25 10:21:50 +08:00
刘祥超
2d5085e652 删除TOA功能 2023-07-24 09:51:37 +08:00
刘祥超
e665e299f2 优化缓存策略相关界面 2023-07-20 17:06:45 +08:00
刘祥超
30b9c5eda5 默认自动检查版本更新 2023-07-20 09:38:09 +08:00
刘祥超
fbf29e774a 优化文字提示 2023-07-19 19:40:11 +08:00
刘祥超
5429971553 优化文字提示 2023-07-19 15:14:33 +08:00
刘祥超
df81bde6fd 优化安装界面 2023-07-19 14:22:48 +08:00
刘祥超
cb8b56ceb8 自动安装的mysql版本从8.0改为8.1 2023-07-19 11:18:25 +08:00
刘祥超
1886c9954b Update Dockerfile 2023-07-18 14:35:46 +08:00
刘祥超
c942503351 版本号更改为1.2.2 2023-07-18 14:33:22 +08:00
刘祥超
806fc42379 优化静态分发组件 2023-07-18 14:33:09 +08:00
刘祥超
06a49f0272 优化静态分发组件 2023-07-18 14:32:32 +08:00
刘祥超
a99bcdc437 路由规则找不到的时候提示用户 2023-07-17 15:30:19 +08:00
刘祥超
2d4378423b 优化静态分发组件 2023-07-17 11:54:41 +08:00
30 changed files with 110 additions and 205 deletions

View File

@@ -1,7 +1,7 @@
FROM alpine:latest
LABEL maintainer="goedge.cdn@gmail.com"
ENV TZ "Asia/Shanghai"
ENV VERSION 1.2.1
ENV VERSION 1.2.4
ENV ROOT_DIR /usr/local/goedge
ENV TAR_FILE edge-admin-linux-amd64-plus-v${VERSION}.zip
ENV TAR_URL "https://dl.goedge.cn/edge/v${VERSION}/edge-admin-linux-amd64-plus-v${VERSION}.zip"

View File

@@ -1,9 +1,9 @@
package teaconst
const (
Version = "1.2.1"
Version = "1.2.5"
APINodeVersion = "1.2.1"
APINodeVersion = "1.2.5"
ProductName = "Edge Admin"
ProcessName = "edge-admin"

View File

@@ -59,7 +59,7 @@ func (this *CheckUpdatesTask) Loop() error {
return err
}
var valueJSON = valueResp.ValueJSON
var config = &systemconfigs.CheckUpdatesConfig{AutoCheck: false}
var config = systemconfigs.NewCheckUpdatesConfig()
if len(valueJSON) > 0 {
err = json.Unmarshal(valueJSON, config)
if err != nil {

View File

@@ -3,6 +3,7 @@
package utils
import (
"bytes"
"encoding/json"
"reflect"
)
@@ -22,3 +23,8 @@ func JSONClone(v interface{}) (interface{}, error) {
return nv, nil
}
// 判断JSON数据是否为null
func JSONIsNull(jsonData []byte) bool {
return len(jsonData) == 0 || bytes.Equal(jsonData, []byte("null"))
}

View File

@@ -4,6 +4,7 @@ package utils_test
import (
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
"github.com/iwind/TeaGo/assert"
"testing"
)
@@ -23,3 +24,12 @@ func TestJSONClone(t *testing.T) {
t.Logf("%p, %#v", c, c)
}
}
func TestJSONIsNull(t *testing.T) {
var a = assert.NewAssertion(t)
a.IsTrue(utils.JSONIsNull(nil))
a.IsTrue(utils.JSONIsNull([]byte{}))
a.IsTrue(utils.JSONIsNull([]byte("null")))
a.IsFalse(utils.JSONIsNull([]byte{1, 2, 3}))
}

View File

@@ -10,7 +10,6 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/health"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/metrics"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/services"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/toa"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/waf"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/webp"
clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils"
@@ -43,10 +42,6 @@ func init() {
GetPost("", new(dns.IndexAction)).
Post("/randomName", new(dns.RandomNameAction)).
// TOA
Prefix("/clusters/cluster/settings/toa").
GetPost("", new(toa.IndexAction)).
// 系统服务设置
Prefix("/clusters/cluster/settings/services").
GetPost("", new(services.IndexAction)).

View File

@@ -1,83 +0,0 @@
package toa
import (
"encoding/json"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
)
type IndexAction struct {
actionutils.ParentAction
}
func (this *IndexAction) Init() {
this.Nav("", "setting", "")
this.SecondMenu("toa")
}
func (this *IndexAction) RunGet(params struct {
ClusterId int64
}) {
toaResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeClusterTOA(this.AdminContext(), &pb.FindEnabledNodeClusterTOARequest{NodeClusterId: params.ClusterId})
if err != nil {
this.ErrorPage(err)
return
}
if len(toaResp.ToaJSON) == 0 {
this.Data["toa"] = nodeconfigs.DefaultTOAConfig()
} else {
config := &nodeconfigs.TOAConfig{}
err = json.Unmarshal(toaResp.ToaJSON, config)
if err != nil {
this.ErrorPage(err)
return
}
this.Data["toa"] = config
}
this.Show()
}
func (this *IndexAction) RunPost(params struct {
ClusterId int64
IsOn bool
AutoSetup bool
OptionType uint8
MinQueueId uint8
MaxQueueId uint8
Must *actions.Must
CSRF *actionutils.CSRF
}) {
defer this.CreateLogInfo(codes.NodeTOA_LogUpdateClusterTOA, params.ClusterId)
config := &nodeconfigs.TOAConfig{
IsOn: params.IsOn,
Debug: false, // 暂时不允许打开调试
OptionType: params.OptionType,
MinQueueId: params.MinQueueId,
MaxQueueId: params.MaxQueueId,
AutoSetup: params.AutoSetup,
}
configJSON, err := json.Marshal(config)
if err != nil {
this.ErrorPage(err)
return
}
_, err = this.RPC().NodeClusterRPC().UpdateNodeClusterTOA(this.AdminContext(), &pb.UpdateNodeClusterTOARequest{
NodeClusterId: params.ClusterId,
ToaJSON: configJSON,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}

View File

@@ -285,7 +285,7 @@ func (this *CreateAction) RunPost(params struct {
return
}
if len(dupResp.DuplicatedServerNames) > 0 {
this.Fail("域名 " + strings.Join(dupResp.DuplicatedServerNames, ", ") + " 已经被其他服务所占用,不能重复使用")
this.Fail("域名 " + strings.Join(dupResp.DuplicatedServerNames, ", ") + " 已经被其他网站所占用,不能重复使用")
}
}
}

View File

@@ -28,7 +28,7 @@ func (this *IndexAction) RunGet(params struct {
}
this.Data["webId"] = webConfig.Id
locationMaps := []maps.Map{}
var locationMaps = []maps.Map{}
if webConfig.Locations != nil {
for _, location := range webConfig.Locations {
err := location.ExtractPattern()
@@ -46,7 +46,7 @@ func (this *IndexAction) RunGet(params struct {
this.ErrorPage(err)
return
}
pieces := strings.Split(location.Pattern, " ")
var pieces = strings.Split(location.Pattern, " ")
if len(pieces) == 2 {
m["pattern"] = pieces[1]
m["patternTypeName"] = serverconfigs.FindLocationPatternTypeName(location.PatternType())

View File

@@ -23,7 +23,12 @@ func (this *IndexAction) Init() {
func (this *IndexAction) RunGet(params struct {
LocationId int64
}) {
locationConfig := this.Data.Get("locationConfig").(*serverconfigs.HTTPLocationConfig)
var location = this.Data.Get("locationConfig")
if location == nil {
this.NotFound("location", params.LocationId)
return
}
var locationConfig = location.(*serverconfigs.HTTPLocationConfig)
this.Data["patternTypes"] = serverconfigs.AllLocationPatternTypes()

View File

@@ -20,13 +20,13 @@ func NewLocationHelper() *LocationHelper {
}
func (this *LocationHelper) BeforeAction(actionPtr actions.ActionWrapper) {
action := actionPtr.Object()
var action = actionPtr.Object()
if action.Request.Method != http.MethodGet {
return
}
serverIdString := action.ParamString("serverId")
locationIdString := action.ParamString("locationId")
var serverIdString = action.ParamString("serverId")
var locationIdString = action.ParamString("locationId")
action.Data["leftMenuItemIsDisabled"] = true
action.Data["mainMenu"] = "server"
@@ -39,7 +39,7 @@ func (this *LocationHelper) BeforeAction(actionPtr actions.ActionWrapper) {
if parentActionValue.IsValid() {
parentAction, isOk := parentActionValue.Interface().(actionutils.ParentAction)
if isOk {
locationId := action.ParamInt64("locationId")
var locationId = action.ParamInt64("locationId")
locationConfig, isOk := FindLocationConfig(&parentAction, locationId)
if !isOk {
return

View File

@@ -2,9 +2,12 @@ package locationutils
import (
"encoding/json"
"errors"
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/types"
)
// FindLocationConfig 查找路由规则配置
@@ -15,6 +18,11 @@ func FindLocationConfig(parentAction *actionutils.ParentAction, locationId int64
return
}
if utils.JSONIsNull(locationConfigResp.LocationJSON) {
parentAction.ErrorPage(errors.New("location '" + types.String(locationId) + "' not found"))
return
}
locationConfig = &serverconfigs.HTTPLocationConfig{}
err = json.Unmarshal(locationConfigResp.LocationJSON, locationConfig)
if err != nil {

View File

@@ -120,7 +120,7 @@ func (this *IndexAction) RunPost(params struct {
return
}
if len(dupResp.DuplicatedServerNames) > 0 {
this.Fail("域名 " + strings.Join(dupResp.DuplicatedServerNames, ", ") + " 已经被其他服务所占用,不能重复使用")
this.Fail("域名 " + strings.Join(dupResp.DuplicatedServerNames, ", ") + " 已经被其他网站所占用,不能重复使用")
}
}

View File

@@ -408,14 +408,14 @@ func (this *MySQLInstaller) Download() (path string, err error) {
// check latest version
this.log("checking mysql latest version ...")
var latestVersion = "8.0.31" // 默认版本
var latestVersion = "8.1.0" // default version
{
req, err := http.NewRequest(http.MethodGet, "https://dev.mysql.com/downloads/mysql/", nil)
if err != nil {
return "", err
}
req.Header.Set("User-Agent", "curl/7.61.1")
req.Header.Set("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/78.0.3904.108 Chrome/78.0.3904.108 Safari/537.36")
resp, err := client.Do(req)
if err != nil {
return "", errors.New("check latest version failed: " + err.Error())
@@ -430,7 +430,7 @@ func (this *MySQLInstaller) Download() (path string, err error) {
return "", errors.New("read latest version failed: " + err.Error())
}
var reg = regexp.MustCompile(`<h1>MySQL Community Server ([\d.]+) </h1>`)
var reg = regexp.MustCompile(`<h1>MySQL Community Server ([\d.]+) `)
var matches = reg.FindSubmatch(data)
if len(matches) > 0 {
latestVersion = string(matches[1])
@@ -441,9 +441,10 @@ func (this *MySQLInstaller) Download() (path string, err error) {
// download
this.log("start downloading ...")
var downloadURL = "https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-" + latestVersion + "-linux-glibc2.17-x86_64-minimal.tar.xz"
var downloadURL = "https://cdn.mysql.com/Downloads/MySQL-8.1/mysql-" + latestVersion + "-linux-glibc2.17-x86_64-minimal.tar.xz"
{
this.log("downloading from url '" + downloadURL + "' ...")
req, err := http.NewRequest(http.MethodGet, downloadURL, nil)
if err != nil {
return "", err

View File

@@ -4538,7 +4538,7 @@ example2.com
<div style="margin-top: 1em" v-if="!isAdding">
<button type="button" class="ui button tiny" @click.prevent="add">+</button>
</div>
</div>`}),Vue.component("http-web-root-box",{props:["v-root-config","v-is-location","v-is-group"],data:function(){let e=this.vRootConfig;return null==(e=null==e?{isPrior:!1,isOn:!0,dir:"",indexes:[],stripPrefix:"",decodePath:!1,isBreak:!1}:e).indexes&&(e.indexes=[]),{rootConfig:e,advancedVisible:!1}},methods:{changeAdvancedVisible:function(e){this.advancedVisible=e},addIndex:function(){let t=this;teaweb.popup("/servers/server/settings/web/createIndex",{height:"10em",callback:function(e){t.rootConfig.indexes.push(e.data.index)}})},removeIndex:function(e){this.rootConfig.indexes.$remove(e)},isOn:function(){return(!this.vIsLocation&&!this.vIsGroup||this.rootConfig.isPrior)&&this.rootConfig.isOn}},template:`<div>
</div>`}),Vue.component("http-web-root-box",{props:["v-root-config","v-is-location","v-is-group"],data:function(){let e=this.vRootConfig;return null==(e=null==e?{isPrior:!1,isOn:!1,dir:"",indexes:[],stripPrefix:"",decodePath:!1,isBreak:!1}:e).indexes&&(e.indexes=[]),{rootConfig:e,advancedVisible:!1}},methods:{changeAdvancedVisible:function(e){this.advancedVisible=e},addIndex:function(){let t=this;teaweb.popup("/servers/server/settings/web/createIndex",{height:"10em",callback:function(e){t.rootConfig.indexes.push(e.data.index)}})},removeIndex:function(e){this.rootConfig.indexes.$remove(e)},isOn:function(){return(!this.vIsLocation&&!this.vIsGroup||this.rootConfig.isPrior)&&this.rootConfig.isOn}},template:`<div>
<input type="hidden" name="rootJSON" :value="JSON.stringify(rootConfig)"/>
<table class="ui table selectable definition">
<prior-checkbox :v-config="rootConfig" v-if="vIsLocation || vIsGroup"></prior-checkbox>

View File

@@ -12676,7 +12676,7 @@ Vue.component("http-web-root-box", {
if (rootConfig == null) {
rootConfig = {
isPrior: false,
isOn: true,
isOn: false,
dir: "",
indexes: [],
stripPrefix: "",

View File

@@ -5,7 +5,7 @@ Vue.component("http-web-root-box", {
if (rootConfig == null) {
rootConfig = {
isPrior: false,
isOn: true,
isOn: false,
dir: "",
indexes: [],
stripPrefix: "",

View File

@@ -1,55 +0,0 @@
{$layout}
{$template "../menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
<first-menu>
<menu-item><tip-icon content="TCP Option Address(TOA)可以在TCP选项中传递客户端IP多用在TCP负载均衡的源站需要获取客户端真实IP的场景。<br/><br/>注意HTTP协议通常不需要此设置。<br/><br/>如需修改配置,请在专业人士指导下操作。"></tip-icon></menu-item>
</first-menu>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="clusterId" :value="clusterId"/>
<csrf-token></csrf-token>
<table class="ui table selectable definition">
<tr>
<td class="title">启用TOA</td>
<td>
<checkbox name="isOn" v-model="toa.isOn"></checkbox>
<p class="comment">在启用之前请确保当前集群下所有节点服务器已经安装libnetfilter_queue并启用了IPTables。</p>
</td>
</tr>
<tbody v-show="toa.isOn">
<tr>
<td>自动配置</td>
<td>
<checkbox name="autoSetup" v-model="toa.autoSetup"></checkbox>
<p class="comment">TOA功能需要节点服务器安装并开启了IPTables并将网络数据包转发到NFQueue中。如果选中了自动配置则每次在启动时都会自动尝试配置IPTables规则。</p>
</td>
</tr>
<tr>
<td class="title">选项类型数值</td>
<td>
<input type="text" name="optionType" v-model="toa.optionType" style="width:4em" maxlength="3"/>
<p class="comment">用来作为附加的TCP OPTION值通常是254即0xfe请查阅云服务商文档来确认此值。</p>
</td>
</tr>
<tr>
<td>NFQueue队列开始ID</td>
<td>
<input type="text" name="minQueueId" v-model="toa.minQueueId" style="width:4em" maxlength="3"/>
<p class="comment">不能超过255。</p>
</td>
</tr>
<tr>
<td>NFQueue队列结束ID</td>
<td>
<input type="text" name="maxQueueId" v-model="toa.maxQueueId" style="width:4em" maxlength="3"/>
<p class="comment">不能超过255。</p>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>
</div>

View File

@@ -1,3 +0,0 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
})

View File

@@ -3,4 +3,7 @@ h3 span {
color: grey;
font-size: 0.6em !important;
}
table td {
word-break: break-all;
}
/*# sourceMappingURL=listPopup.css.map */

View File

@@ -1 +1 @@
{"version":3,"sources":["listPopup.less"],"names":[],"mappings":"AAAA,EAAG;EACF,kBAAA;EACA,WAAA;EACA,2BAAA","file":"listPopup.css"}
{"version":3,"sources":["listPopup.less"],"names":[],"mappings":"AAAA,EAAG;EACF,kBAAA;EACA,WAAA;EACA,gBAAA;;AAID,KACC;EACC,qBAAA","file":"listPopup.css"}

View File

@@ -24,10 +24,10 @@
<checkbox v-model="task.isChecked" @input="checkTask"></checkbox>
</td>
<td>{{cluster.name}}</td>
<td>
<td nowrap="">
{{task.node.name}} &nbsp; <a :href="'/clusters/cluster/node?clusterId=' + cluster.id + '&nodeId=' + task.node.id" target="_blank"><i class="icon linkify small grey"></i></a>
</td>
<td>
<td nowrap="">
<span v-if="task.type == 'configChanged' || task.type == 'globalServerConfigChanged'">同步配置</span>
<span v-if="task.type == 'ipItemChanged'">同步IP名单</span>
<span v-if="task.type == 'scriptsChanged'">同步脚本</span>
@@ -39,7 +39,7 @@
<span v-if="task.isDone" class="red">{{task.error}}</span>
<span v-else>正在同步...</span>
</td>
<td>{{task.updatedTime}}</td>
<td nowrap="">{{task.updatedTime}}</td>
<td>
<a href="" title="删除" class="remove-btn" @click.prevent="deleteTask(task.id)"><i class="icon remove small grey"></i></a>
</td>

View File

@@ -3,3 +3,10 @@ h3 span {
color: grey;
font-size: 0.6em !important;
}
table {
td {
word-break: break-all;
}
}

View File

@@ -1,10 +1,10 @@
<second-menu>
<menu-item href="/servers/components/cache">列表</menu-item>
<menu-item href="/servers/components/cache">策略列表</menu-item>
<span class="item">|</span>
<menu-item :href="'/servers/components/cache/policy?cachePolicyId=' + cachePolicyId" code="index">{{cachePolicyName}}</menu-item>
<menu-item :href="'/servers/components/cache/test?cachePolicyId=' + cachePolicyId" code="test">测试</menu-item>
<menu-item :href="'/servers/components/cache/stat?cachePolicyId=' + cachePolicyId" code="stat">统计</menu-item>
<menu-item :href="'/servers/components/cache/clean?cachePolicyId=' + cachePolicyId" code="clean">清理</menu-item>
<!--<menu-item :href="'/servers/components/cache/clean?cachePolicyId=' + cachePolicyId" code="clean">清理</menu-item>-->
<menu-item :href="'/servers/components/cache/purge?cachePolicyId=' + cachePolicyId" code="purge">刷新</menu-item>
<menu-item :href="'/servers/components/cache/fetch?cachePolicyId=' + cachePolicyId" code="fetch">预热</menu-item>
<menu-item :href="'/servers/components/cache/update?cachePolicyId=' + cachePolicyId" code="update">修改</menu-item>

View File

@@ -38,20 +38,6 @@
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-count="1" :v-unit="'gb'" :key="'fileMemoryCapacityJSON'"></size-capacity-box>
<p class="comment">单个节点上作为一级缓存的内存最大容量可以作为磁盘缓冲区和存储热点缓存内容如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment"><pro-warning-label></pro-warning-label>保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一。</p>
</td>
</tr>
<tr v-show="teaIsPlus">
<td class="color-border">开启Sendfile</td>
<td>
<checkbox name="fileEnableSendfile"></checkbox>
<p class="comment"><pro-warning-label></pro-warning-label><plus-label></plus-label>使用sendfile提升发送缓存文件的效率。</p>
</td>
</tr>
</tbody>
@@ -76,6 +62,22 @@
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible && policyType == 'file'">
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment"><pro-warning-label></pro-warning-label>保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一。</p>
</td>
</tr>
<tr v-show="teaIsPlus">
<td class="color-border">开启Sendfile</td>
<td>
<checkbox name="fileEnableSendfile"></checkbox>
<p class="comment"><pro-warning-label></pro-warning-label><plus-label></plus-label>使用sendfile提升发送缓存文件的效率。</p>
</td>
</tr>
</tbody>
<tbody v-show="moreOptionsVisible">
<tr>
<td>同步写入压缩缓存</td>
@@ -91,7 +93,7 @@
</td>
</tr>
<tr>
<td>是否启用</td>
<td>启用当前策略</td>
<td>
<div class="ui checkbox">
<input type="checkbox" name="isOn" value="1" checked="checked"/>

View File

@@ -47,9 +47,13 @@
</td>
</tr>
<tr v-if="cachePolicy.options.openFileCache != null && cachePolicy.options.openFileCache.isOn && cachePolicy.options.openFileCache.max > 0">
<td>缓存文件句柄缓存</td>
<td class="color-border">缓存文件句柄缓存</td>
<td>{{cachePolicy.options.openFileCache.max}}</td>
</tr>
<tr v-if="cachePolicy.options.enableSendfile">
<td class="color-border">开启Sendfile</td>
<td><span v-if="cachePolicy.options.enableSendfile" class="green">Y</span><span v-else class="disabled">N</span></td>
</tr>
</tbody>
<tbody v-if="cachePolicy.type != 'file'">

View File

@@ -47,20 +47,6 @@
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-count="0" :v-unit="'gb'"></size-capacity-box>
<p class="comment">作为一级缓存的内存最大容量可以作为磁盘缓冲区和存储热点缓存内容如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" v-model="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment"><pro-warning-label></pro-warning-label>保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一。</p>
</td>
</tr>
<tr v-show="teaIsPlus">
<td class="color-border">开启Sendfile</td>
<td>
<checkbox name="fileEnableSendfile" v-model="cachePolicy.options.enableSendfile"></checkbox>
<p class="comment"><pro-warning-label></pro-warning-label><plus-label></plus-label>使用sendfile提升发送缓存文件的效率。</p>
</td>
</tr>
</tbody>
@@ -83,6 +69,22 @@
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible && policyType == 'file'">
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" v-model="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment"><pro-warning-label></pro-warning-label>保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一。</p>
</td>
</tr>
<tr v-show="teaIsPlus">
<td class="color-border">开启Sendfile</td>
<td>
<checkbox name="fileEnableSendfile" v-model="cachePolicy.options.enableSendfile"></checkbox>
<p class="comment"><pro-warning-label></pro-warning-label><plus-label></plus-label>使用sendfile提升发送缓存文件的效率。</p>
</td>
</tr>
</tbody>
<tbody v-show="moreOptionsVisible">
<tr>
<td>同步写入压缩缓存</td>
@@ -98,7 +100,7 @@
</td>
</tr>
<tr>
<td>是否启用</td>
<td>启用当前策略</td>
<td>
<div class="ui checkbox">
<input type="checkbox" name="isOn" value="1" v-model="cachePolicy.isOn"/>

View File

@@ -62,7 +62,7 @@
</tr>
</table>
<button class="ui button primary" type="button" @click.prevent="start" v-show="!isChecking">开始检查</button>
<button class="ui button primary" type="button" @click.prevent="start" v-show="!isChecking">开始检查</button>
<button class="ui button disabled" type="button" v-show="isChecking">正在检查...</button>
</form>
</div>

View File

@@ -33,6 +33,9 @@ Tea.context(function () {
.params({
autoCheck: this.config.autoCheck ? 1 : 0
})
.success(function () {
teaweb.successToast("已保存")
})
}
this.ignoreVersion = function (version) {

View File

@@ -357,7 +357,7 @@
<button class="ui button" type="button" @click.prevent="goBackAdmin"><i class="icon long arrow left"></i>上一步</button>
<button class="ui button primary" type="submit" v-if="!isInstalling">确认并开始安装</button>
<button class="ui button disabled" type="button" v-if="isInstalling">安装中请耐心等待...</button>
<button class="ui button disabled" type="button" v-if="isInstalling">安装中...</button>
</div>
</form>
</div>