Initial commit (code only without large binaries)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<div class="margin"></div>
|
||||
|
||||
<div class="left-box tiny">
|
||||
<div class="ui menu text blue vertical tiny">
|
||||
<a class="item" v-for="item in tinyLeftMenuItems" :href="item.url" :class="{active:item.isActive, separator:item.name == '-', on:item.isOn, off:item.isOff||item.isImportant}">
|
||||
<i class="icon play tiny" :style="{'visibility':item.isActive ? 'visible' : 'hidden'}"></i><span v-if="item.name != '-'">{{item.name}}<var v-if="item.isOff">关</var><var v-if="item.isImportant">开</var></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
<first-menu>
|
||||
<menu-item :href="'/servers/server/settings/locations?serverId=' + serverId">« 返回网站设置</menu-item>
|
||||
<span class="item disabled" style="padding-left:0;padding-right:0">|</span>
|
||||
<menu-item :href="'/servers/server/settings/locations?serverId=' + serverId">路由规则</menu-item>
|
||||
<raquo-item></raquo-item>
|
||||
<menu-item :href="'/servers/server/settings/locations/location?serverId=' + serverId + '&locationId=' + locationId" :active="true">{{locationConfig.pattern}}</menu-item>
|
||||
</first-menu>
|
||||
@@ -0,0 +1,4 @@
|
||||
<first-menu>
|
||||
<menu-item :href="'/servers/server/settings/locations?serverId=' + serverId" code="index">列表</menu-item>
|
||||
<menu-item :href="'/servers/server/settings/locations/create?serverId=' + serverId" code="create">创建</menu-item>
|
||||
</first-menu>
|
||||
@@ -0,0 +1,16 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success" ref="authForm">
|
||||
<input type="hidden" name="webId" :value="webId">
|
||||
<http-auth-config-box :v-auth-config="authConfig" :v-is-location="true"
|
||||
@change="changeMethods"></http-auth-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
|
||||
this.changeMethods = function (config) {
|
||||
Tea.action("$")
|
||||
.form(this.$refs.authForm)
|
||||
.post()
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-access-log-config-box
|
||||
:v-access-log-config="accessLogConfig"
|
||||
:v-fields="fields"
|
||||
:v-default-field-codes="defaultFieldCodes"
|
||||
:v-is-location="true"></http-access-log-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
17
EdgeAdmin/web/views/@default/servers/server/settings/locations/cache/index.html
vendored
Normal file
17
EdgeAdmin/web/views/@default/servers/server/settings/locations/cache/index.html
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-cache-config-box :v-cache-config="cacheConfig" :v-cache-policy="cachePolicy" :v-is-location="true"></http-cache-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
<p class="comment">修改条件设置后请记得保存。</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
3
EdgeAdmin/web/views/@default/servers/server/settings/locations/cache/index.js
vendored
Normal file
3
EdgeAdmin/web/views/@default/servers/server/settings/locations/cache/index.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<http-cc-config-box :v-cc-config="ccConfig" :v-is-location="true"></http-cc-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-charsets-box :v-usual-charsets="usualCharsets" :v-all-charsets="allCharsets" :v-charset-config="charsetConfig" :v-is-location="true"></http-charsets-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,21 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<input type="hidden" name="gzipId" :value="gzipConfig.id"/>
|
||||
|
||||
<http-gzip-box :v-gzip-ref="gzipRef" :v-gzip-config="gzipConfig" :v-is-location="true"></http-gzip-box>
|
||||
|
||||
<div class="margin"></div>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,21 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-compression-config-box :v-compression-config="compressionConfig" :v-is-location="true"></http-compression-config-box>
|
||||
|
||||
<div class="margin"></div>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,91 @@
|
||||
{$layout}
|
||||
{$template "../settings_menu"}
|
||||
{$template "/left_menu_with_menu"}
|
||||
|
||||
<div class="right-box with-menu">
|
||||
{$template "menu"}
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>路径匹配规则 *</td>
|
||||
<td>
|
||||
<input type="text" name="pattern" maxlength="500" ref="focus"/>
|
||||
<p class="comment">路径通常以斜杠(/)开头,比如/hello。如果匹配类型是正则表达式匹配,则可以是一个正则表达式</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>匹配类型</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="patternType" v-model="type" @change="changePatternType(type)">
|
||||
<option v-for="patternType in patternTypes" :value="patternType.type">{{patternType.name}}</option>
|
||||
</select>
|
||||
<p class="comment" v-if="selectedType != null" v-html="selectedType.description"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终止往下匹配</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isBreak" value="1"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">如果选中了此选项,一旦匹配成功,不会继续匹配其他的路由规则。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">名称</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100"/>
|
||||
<p class="comment">可以用来说明此规则用途。。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>匹配条件</td>
|
||||
<td>
|
||||
<http-request-conds-box></http-request-conds-box>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>专属域名</td>
|
||||
<td>
|
||||
<domains-box></domains-box>
|
||||
<p class="comment">默认不需要填写,表示支持所有域名。如果填写了专属域名,表示当前路由规则只会在所列的专属域名被访问时才生效。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>不区分大小写</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isCaseInsensitive" value="1"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">选中表示匹配规则中的路径中的英文字母不区分大小写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>反向匹配</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isReverse" value="1"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">选中表示匹配所有<strong>不符合规则</strong>的路径。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="200"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("添加成功", "/servers/server/settings/locations?serverId=" + this.serverId)
|
||||
|
||||
this.type = 1
|
||||
this.selectedType = this.patternTypes[0]
|
||||
|
||||
|
||||
this.changePatternType = function (type) {
|
||||
this.selectedType = this.patternTypes.$find(function (k, v) {
|
||||
return v.type == type;
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-fastcgi-box :v-fastcgi-ref="fastcgiRef" :v-fastcgi-configs="fastcgiConfigs" :v-is-location="true"></http-fastcgi-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,22 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-header-policy-box
|
||||
:v-request-header-policy="requestHeaderPolicy"
|
||||
:v-request-header-ref="requestHeaderRef"
|
||||
:v-response-header-policy="responseHeaderPolicy"
|
||||
:v-response-header-ref="responseHeaderRef"
|
||||
:v-params="'serverId=' + serverId"
|
||||
:v-is-location="true"></http-header-policy-box>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-redirect-to-https-box :v-redirect-to-https-config="redirectToHTTPSConfig" :v-is-location="true"></http-redirect-to-https-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
undefined
|
||||
@@ -0,0 +1,45 @@
|
||||
{$layout}
|
||||
|
||||
{$var "header"}
|
||||
<script type="text/javascript" src="/js/sortable.min.js"></script>
|
||||
{$end}
|
||||
|
||||
{$template "../settings_menu"}
|
||||
{$template "/left_menu_with_menu"}
|
||||
|
||||
<div class="right-box with-menu">
|
||||
{$template "menu"}
|
||||
|
||||
<p class="comment" v-if="locations.length == 0">暂时还没有路由规则。</p>
|
||||
|
||||
<table class="ui table selectable celled" v-if="locations.length > 0" id="sortable-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:1em"></th>
|
||||
<th>匹配规则</th>
|
||||
<th class="two wide">匹配类型</th>
|
||||
<th class="two wide">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-for="location in locations" :v-id="location.id">
|
||||
<tr>
|
||||
<td><i class="icon bars grey handle"></i></td>
|
||||
<td>
|
||||
<a :href="'/servers/server/settings/locations/location?serverId=' + serverId + '&locationId=' + location.id">{{location.pattern}}</a>
|
||||
<http-location-labels :v-location-config="location" :v-server-id="serverId"></http-location-labels>
|
||||
</td>
|
||||
<td>{{location.patternTypeName}}</td>
|
||||
<td>
|
||||
<label-on :v-is-on="location.isOn"></label-on>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/servers/server/settings/locations/location?serverId=' + serverId + '&locationId=' + location.id">详情</a>
|
||||
<a href="" @click.prevent="deleteLocation(location.id)">删除</a>
|
||||
<!--<a :href="'/servers/server/settings/locations/create?serverId=' + serverId + '&webId=' + webId + '&parentId=' + location.id" title="添加子规则">+</a>-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="comment" v-if="locations.length > 0">拖动左侧的<i class="icon bars grey"></i>图标可以对路由规则进行排序。</p>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.sort()
|
||||
}, 1000)
|
||||
|
||||
// 删除路由规则
|
||||
this.deleteLocation = function (locationId) {
|
||||
teaweb.confirm("确定要删除此路由规则吗?", function () {
|
||||
this.$post(".delete")
|
||||
.params({
|
||||
webId: this.webId,
|
||||
locationId: locationId
|
||||
})
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
// 排序
|
||||
this.sort = function () {
|
||||
if (this.locations.length == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
let box = this.$find("#sortable-table")[0]
|
||||
let that = this
|
||||
Sortable.create(box, {
|
||||
draggable: "tbody",
|
||||
handle: ".icon.handle",
|
||||
onStart: function () {
|
||||
},
|
||||
onUpdate: function (event) {
|
||||
let rows = box.querySelectorAll("tbody")
|
||||
let locationIds = []
|
||||
rows.forEach(function (row) {
|
||||
locationIds.push(parseInt(row.getAttribute("v-id")))
|
||||
})
|
||||
that.$post(".sort")
|
||||
.params({
|
||||
webId: that.webId,
|
||||
locationIds: locationIds
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("保存成功")
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,103 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="locationId" :value="locationConfig.id"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>路径匹配规则 *</td>
|
||||
<td>
|
||||
<input type="text" name="pattern" v-model="pattern" maxlength="500" ref="focus"/>
|
||||
<p class="comment">路径通常以斜杠(/)开头,比如/hello。如果匹配类型是正则表达式匹配,则可以是一个正则表达式</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>匹配类型</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="patternType" v-model="type" @change="changePatternType(type)">
|
||||
<option v-for="patternType in patternTypes" :value="patternType.type">{{patternType.name}}</option>
|
||||
</select>
|
||||
<p class="comment" v-if="selectedType != null" v-html="selectedType.description"></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终止往下匹配</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isBreak" value="1" v-model="locationConfig.isBreak"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">如果选中了此选项,一旦匹配成功,不会继续匹配其他的路由规则。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">名称</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" v-model="locationConfig.name"/>
|
||||
<p class="comment">可以用来说明此规则用途。。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>匹配条件</td>
|
||||
<td>
|
||||
<http-request-conds-box :v-conds="conds"></http-request-conds-box>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>专属域名</td>
|
||||
<td>
|
||||
<domains-box :v-domains="domains"></domains-box>
|
||||
<p class="comment">默认不需要填写,表示支持所有域名。如果填写了专属域名,表示当前路由规则只会在所列的专属域名被访问时才生效。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>不区分大小写</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isCaseInsensitive" value="1" v-model="isCaseInsensitive"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">选中表示匹配规则中的路径中的英文字母不区分大小写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>反向匹配</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isReverse" value="1" v-model="isReverse"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">选中表示匹配所有<strong>不符合规则</strong>的路径。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea rows="3" name="description" maxlength="200" v-model="locationConfig.description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>启用当前路由规则</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" v-model="locationConfig.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
|
||||
this.$delay(function () {
|
||||
this.changePatternType(this.type)
|
||||
})
|
||||
|
||||
this.selectedType = null
|
||||
|
||||
this.changePatternType = function (type) {
|
||||
this.selectedType = this.patternTypes.$find(function (k, v) {
|
||||
return v.type == type;
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
<first-menu>
|
||||
<menu-item code="hls" :href="'.hls?serverId=' + server.id">启用HLS加密配置</menu-item>
|
||||
</first-menu>
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-hls-config-box v-model="hlsConfig" :v-is-location="true"></http-hls-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-optimization-config-box :v-optimization-config="optimizationConfig" :v-is-location="true"></http-optimization-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-pages-and-shutdown-box :v-pages="pages" :v-shutdown-config="shutdownConfig" :v-is-location="true" :v-enable-global-pages="enableGlobalPages"></http-pages-and-shutdown-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-referers-config-box :v-referers-config="referersConfig" :v-is-location="true"></http-referers-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-remote-addr-config-box :v-remote-addr-config="remoteAddrConfig" :v-is-location="true"></http-remote-addr-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<http-request-limit-config-box :v-request-limit-config="requestLimitConfig" :v-is-location="true"></http-request-limit-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,21 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
{$template "/code_editor"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<http-request-scripts-config-box
|
||||
:v-request-scripts-config="requestScriptsConfig"
|
||||
:v-is-location="true"></http-request-scripts-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
<first-menu>
|
||||
<menu-item :href="'/servers/server/settings/locations/reverseProxy?serverId=' + serverId + '&locationId=' + locationId" code="index">源站列表</menu-item>
|
||||
<menu-item :href="'/servers/server/settings/locations/reverseProxy/scheduling?serverId=' + serverId + '&locationId=' + locationId" code="scheduling">调度算法</menu-item>
|
||||
<menu-item :href="'/servers/server/settings/locations/reverseProxy/setting?serverId=' + serverId + '&locationId=' + locationId" code="setting">更多设置</menu-item>
|
||||
</first-menu>
|
||||
@@ -0,0 +1,20 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
{$template "menu"}
|
||||
<div class="margin"></div>
|
||||
<div v-if="!reverseProxyRef.isPrior || !reverseProxyRef.isOn">
|
||||
<div class="margin"></div>
|
||||
<warning-message>当前源站没有启用,可以通过点击 <a :href="'/servers/server/settings/locations/reverseProxy/setting?serverId=' + serverId + '&locationId=' + locationId">[更多设置]</a> 开启 。</warning-message>
|
||||
</div>
|
||||
|
||||
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
|
||||
:v-server-type="serverType"
|
||||
:v-params="'type=server&serverId=' + serverId + '&reverseProxyId=' + reverseProxyConfig.id"></origin-list-box>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
|
||||
this.updateOn = function (b) {
|
||||
teaweb.confirm(b ? "确定要启用源站吗?" : "确定要停用源站服务吗?", function () {
|
||||
this.$post(".updateOn")
|
||||
.params({
|
||||
"serverId": this.serverId,
|
||||
"isOn": b ? 1 : 0,
|
||||
"reverseProxyId": this.reverseProxyId
|
||||
})
|
||||
.success(function () {
|
||||
window.location.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,13 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
{$template "menu"}
|
||||
|
||||
<origin-scheduling-view-box :v-scheduling="scheduling" :v-params="'type=server&serverId=' + serverId + '&reverseProxyId=' + reverseProxyId"></origin-scheduling-view-box>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
{$template "menu"}
|
||||
<div class="margin"></div>
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="locationId" :value="locationId"/>
|
||||
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
|
||||
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef"
|
||||
:v-reverse-proxy-config="reverseProxyConfig"
|
||||
:v-is-location="true"></reverse-proxy-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,60 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改调度算法</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="dataType" :value="dataType"/>
|
||||
<input type="hidden" name="serverId" :value="serverId"/>
|
||||
<input type="hidden" name="reverseProxyId" :value="reverseProxyId"/>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">选择调度算法</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="type" v-model="selectedType"
|
||||
@change="changeSchedulingType()">
|
||||
<option v-for="schedulingType in schedulingTypes"
|
||||
:value="schedulingType.code">{{schedulingType.name}}</option>
|
||||
</select>
|
||||
<p class="comment">{{schedulingTypeDescription}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="selectedType == 'hash'">
|
||||
<td>
|
||||
Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="hashKey" v-model="hashKey" maxlength="500"/>
|
||||
<p class="comment">用来计算Hash的字符串,其中可以使用变量。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="selectedType == 'hash'">
|
||||
<td>常用变量</td>
|
||||
<td>
|
||||
<select class="ui dropdown" style="width:12em" v-model="hashVar" @change="changeHashVar()">
|
||||
<option></option>
|
||||
<option value="${remoteAddr}">客户端IP</option>
|
||||
<option value="${host}${requestURI}">请求URL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="selectedType == 'sticky'">
|
||||
<td>参数类型</td>
|
||||
<td>
|
||||
<select class="ui dropdown" style="width:12em" name="stickyType" v-model="stickyType">
|
||||
<option value="cookie">Cookie</option>
|
||||
<option value="header">HTTP Header</option>
|
||||
<option value="argument">URL参数</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="selectedType == 'sticky'">
|
||||
<td>参数名</td>
|
||||
<td>
|
||||
<input type="text" name="stickyParam" v-model="stickyParam" maxlength="50"/>
|
||||
<p class="comment">记录或指定源站的参数名,只能是英文字母和数字的组合,不允许有下划线(因为在HTTP Header中下划线是不标准的)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,39 @@
|
||||
Tea.context(function () {
|
||||
var that = this;
|
||||
|
||||
this.success = NotifyPopup
|
||||
|
||||
this.selectedType = this.scheduling.code;
|
||||
this.schedulingTypeDescription = null;
|
||||
|
||||
this.changeSchedulingType = function () {
|
||||
this.schedulingTypeDescription = this.schedulingTypes.$find(function (k, v) {
|
||||
return v.code == that.selectedType;
|
||||
}).description;
|
||||
};
|
||||
this.changeSchedulingType();
|
||||
|
||||
// hash
|
||||
this.hashKey = "";
|
||||
this.hashVar = "";
|
||||
if (this.scheduling.code == "hash") {
|
||||
this.hashKey = this.scheduling.options.key;
|
||||
} else {
|
||||
this.hashKey = "${remoteAddr}";
|
||||
}
|
||||
|
||||
this.changeHashVar = function () {
|
||||
if (this.hashVar.length > 0) {
|
||||
this.hashKey = this.hashVar;
|
||||
}
|
||||
};
|
||||
|
||||
// sticky
|
||||
if (this.scheduling.code == "sticky") {
|
||||
this.stickyType = this.scheduling.options.type;
|
||||
this.stickyParam = this.scheduling.options.param;
|
||||
} else {
|
||||
this.stickyType = "cookie";
|
||||
this.stickyParam = "Origin";
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<first-menu>
|
||||
<a class="item" @click.prevent="createRewriteRule()">[创建]</a>
|
||||
</first-menu>
|
||||
<http-rewrite-rule-list :v-web-id="webId" :v-rewrite-rules="rewriteRules"></http-rewrite-rule-list>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
Tea.context(function () {
|
||||
// 创建重写规则
|
||||
this.createRewriteRule = function () {
|
||||
teaweb.popup("/servers/server/settings/rewrite/createPopup?webId=" + this.webId, {
|
||||
height: "26em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-stat-config-box :v-stat-config="statConfig" :v-is-location="true"></http-stat-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<uam-config-box :v-uam-config="uamConfig" :v-is-location="true"></uam-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<user-agent-config-box v-model="userAgentConfig" :v-is-location="true"></user-agent-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-firewall-config-box :v-firewall-config="firewallConfig" :v-firewall-policy="firewallPolicy" :v-is-location="true"></http-firewall-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-web-root-box :v-root-config="rootConfig" :v-is-location="true"></http-web-root-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-webp-config-box :v-webp-config="webpConfig" :v-is-location="true"></http-webp-config-box>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-websocket-box :v-websocket-ref="websocketRef"
|
||||
:v-websocket-config="websocketConfig"
|
||||
:v-is-location="true"></http-websocket-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
Reference in New Issue
Block a user