实现基本的反向代理

This commit is contained in:
GoEdgeLab
2020-09-27 15:26:11 +08:00
parent 09763d4d60
commit 27e85a450a
4 changed files with 19 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ func (this *IndexAction) RunPost(params struct {
IsBreak bool
IsCaseInsensitive bool
IsReverse bool
IsOn bool
Must *actions.Must
}) {
@@ -74,6 +75,7 @@ func (this *IndexAction) RunPost(params struct {
Description: params.Description,
Pattern: resultPattern,
IsBreak: params.IsBreak,
IsOn: params.IsOn,
})
if err != nil {
this.ErrorPage(err)

View File

@@ -0,0 +1,4 @@
Vue.component("label-on", {
props: ["v-is-on"],
template: '<div><span v-if="vIsOn" class="ui label tiny green">已启用</span><span v-if="!vIsOn" class="ui label tiny red">已关闭</span></div>'
})

View File

@@ -11,11 +11,15 @@
<thead>
<tr>
<th>匹配规则</th>
<th class="two wide">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="location in locations">
<td>{{location.pattern}}</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> &nbsp;
<a href="" @click.prevent="deleteLocation(location.id)">删除</a>

View File

@@ -42,6 +42,15 @@
<p class="comment">可以用来说明此规则用途。。</p>
</td>
</tr>
<tr>
<td>是否启用</td>
<td>
<div class="ui checkbox">
<input type="checkbox" name="isOn" v-model="locationConfig.isOn"/>
<label></label>
</div>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>