可以在分组中设置一些全局配置选项

This commit is contained in:
刘祥超
2021-09-22 19:39:38 +08:00
parent 92777366ec
commit 4016296e0b
66 changed files with 1698 additions and 214 deletions

View File

@@ -85,7 +85,7 @@ Vue.component("origin-list-table", {
</tr>
</thead>
<tr v-for="origin in vOrigins">
<td :class="{disabled:!origin.isOn}">{{origin.addr}}
<td :class="{disabled:!origin.isOn}"><a href="" @click.prevent="updateOrigin(origin.id)">{{origin.addr}} &nbsp;<i class="icon clone outline small"></i></a>
<div v-if="origin.name.length > 0" style="margin-top: 0.5em">
<tiny-basic-label>{{origin.name}}</tiny-basic-label>
</div>

View File

@@ -1,143 +1,146 @@
Vue.component("reverse-proxy-box", {
props: ["v-reverse-proxy-ref", "v-reverse-proxy-config", "v-is-location", "v-family"],
data: function () {
let reverseProxyRef = this.vReverseProxyRef
if (reverseProxyRef == null) {
reverseProxyRef = {
isPrior: false,
isOn: false,
reverseProxyId: 0
}
}
props: ["v-reverse-proxy-ref", "v-reverse-proxy-config", "v-is-location", "v-is-group", "v-family"],
data: function () {
let reverseProxyRef = this.vReverseProxyRef
if (reverseProxyRef == null) {
reverseProxyRef = {
isPrior: false,
isOn: false,
reverseProxyId: 0
}
}
let reverseProxyConfig = this.vReverseProxyConfig
if (reverseProxyConfig == null) {
reverseProxyConfig = {
requestPath: "",
stripPrefix: "",
requestURI: "",
requestHost: "",
requestHostType: 0,
addHeaders: [],
connTimeout: {count: 0, unit: "second"},
readTimeout: {count: 0, unit: "second"},
idleTimeout: {count: 0, unit: "second"},
maxConns: 0,
maxIdleConns: 0
}
}
if (reverseProxyConfig.addHeaders == null) {
reverseProxyConfig.addHeaders = []
}
if (reverseProxyConfig.connTimeout == null) {
reverseProxyConfig.connTimeout = {count: 0, unit: "second"}
}
if (reverseProxyConfig.readTimeout == null) {
reverseProxyConfig.readTimeout = {count: 0, unit: "second"}
}
if (reverseProxyConfig.idleTimeout == null) {
reverseProxyConfig.idleTimeout = {count: 0, unit: "second"}
}
let reverseProxyConfig = this.vReverseProxyConfig
if (reverseProxyConfig == null) {
reverseProxyConfig = {
requestPath: "",
stripPrefix: "",
requestURI: "",
requestHost: "",
requestHostType: 0,
addHeaders: [],
connTimeout: {count: 0, unit: "second"},
readTimeout: {count: 0, unit: "second"},
idleTimeout: {count: 0, unit: "second"},
maxConns: 0,
maxIdleConns: 0
}
}
if (reverseProxyConfig.addHeaders == null) {
reverseProxyConfig.addHeaders = []
}
if (reverseProxyConfig.connTimeout == null) {
reverseProxyConfig.connTimeout = {count: 0, unit: "second"}
}
if (reverseProxyConfig.readTimeout == null) {
reverseProxyConfig.readTimeout = {count: 0, unit: "second"}
}
if (reverseProxyConfig.idleTimeout == null) {
reverseProxyConfig.idleTimeout = {count: 0, unit: "second"}
}
let forwardHeaders = [
{
name: "X-Real-IP",
isChecked: false
},
{
name: "X-Forwarded-For",
isChecked: false
},
{
name: "X-Forwarded-By",
isChecked: false
},
{
name: "X-Forwarded-Host",
isChecked: false
},
{
name: "X-Forwarded-Proto",
isChecked: false
}
]
forwardHeaders.forEach(function (v) {
v.isChecked = reverseProxyConfig.addHeaders.$contains(v.name)
})
let forwardHeaders = [
{
name: "X-Real-IP",
isChecked: false
},
{
name: "X-Forwarded-For",
isChecked: false
},
{
name: "X-Forwarded-By",
isChecked: false
},
{
name: "X-Forwarded-Host",
isChecked: false
},
{
name: "X-Forwarded-Proto",
isChecked: false
}
]
forwardHeaders.forEach(function (v) {
v.isChecked = reverseProxyConfig.addHeaders.$contains(v.name)
})
return {
reverseProxyRef: reverseProxyRef,
reverseProxyConfig: reverseProxyConfig,
advancedVisible: false,
family: this.vFamily,
forwardHeaders: forwardHeaders
}
},
watch: {
"reverseProxyConfig.requestHostType": function (v) {
let requestHostType = parseInt(v)
if (isNaN(requestHostType)) {
requestHostType = 0
}
this.reverseProxyConfig.requestHostType = requestHostType
},
"reverseProxyConfig.connTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.connTimeout.count = count
},
"reverseProxyConfig.readTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.readTimeout.count = count
},
"reverseProxyConfig.idleTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.idleTimeout.count = count
},
"reverseProxyConfig.maxConns": function (v) {
let maxConns = parseInt(v)
if (isNaN(maxConns) || maxConns < 0) {
maxConns = 0
}
this.reverseProxyConfig.maxConns = maxConns
},
"reverseProxyConfig.maxIdleConns": function (v) {
let maxIdleConns = parseInt(v)
if (isNaN(maxIdleConns) || maxIdleConns < 0) {
maxIdleConns = 0
}
this.reverseProxyConfig.maxIdleConns = maxIdleConns
},
},
methods: {
isOn: function () {
return (!this.vIsLocation || this.reverseProxyRef.isPrior) && this.reverseProxyRef.isOn
},
changeAdvancedVisible: function (v) {
this.advancedVisible = v
},
changeAddHeader: function () {
this.reverseProxyConfig.addHeaders = this.forwardHeaders.filter(function (v) {
return v.isChecked
}).map(function (v) {
return v.name
})
}
},
template: `<div>
return {
reverseProxyRef: reverseProxyRef,
reverseProxyConfig: reverseProxyConfig,
advancedVisible: false,
family: this.vFamily,
forwardHeaders: forwardHeaders
}
},
watch: {
"reverseProxyConfig.requestHostType": function (v) {
let requestHostType = parseInt(v)
if (isNaN(requestHostType)) {
requestHostType = 0
}
this.reverseProxyConfig.requestHostType = requestHostType
},
"reverseProxyConfig.connTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.connTimeout.count = count
},
"reverseProxyConfig.readTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.readTimeout.count = count
},
"reverseProxyConfig.idleTimeout.count": function (v) {
let count = parseInt(v)
if (isNaN(count) || count < 0) {
count = 0
}
this.reverseProxyConfig.idleTimeout.count = count
},
"reverseProxyConfig.maxConns": function (v) {
let maxConns = parseInt(v)
if (isNaN(maxConns) || maxConns < 0) {
maxConns = 0
}
this.reverseProxyConfig.maxConns = maxConns
},
"reverseProxyConfig.maxIdleConns": function (v) {
let maxIdleConns = parseInt(v)
if (isNaN(maxIdleConns) || maxIdleConns < 0) {
maxIdleConns = 0
}
this.reverseProxyConfig.maxIdleConns = maxIdleConns
},
},
methods: {
isOn: function () {
if (this.vIsLocation || this.vIsGroup) {
return this.reverseProxyRef.isPrior && this.reverseProxyRef.isOn
}
return this.reverseProxyRef.isOn
},
changeAdvancedVisible: function (v) {
this.advancedVisible = v
},
changeAddHeader: function () {
this.reverseProxyConfig.addHeaders = this.forwardHeaders.filter(function (v) {
return v.isChecked
}).map(function (v) {
return v.name
})
}
},
template: `<div>
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
<input type="hidden" name="reverseProxyJSON" :value="JSON.stringify(reverseProxyConfig)"/>
<table class="ui table selectable definition">
<prior-checkbox :v-config="reverseProxyRef" v-if="vIsLocation"></prior-checkbox>
<tbody v-show="!vIsLocation || reverseProxyRef.isPrior">
<prior-checkbox :v-config="reverseProxyRef" v-if="vIsLocation || vIsGroup"></prior-checkbox>
<tbody v-show="(!vIsLocation && !vIsGroup) || reverseProxyRef.isPrior">
<tr>
<td class="title">是否启用反向代理</td>
<td>

View File

@@ -15,7 +15,7 @@ Vue.component("server-group-selector", {
let groupIds = this.groups.map(function (v) {
return v.id.toString()
}).join(",")
teaweb.popup("/servers/components/groups/selectPopup?selectedGroupIds=" + groupIds, {
teaweb.popup("/servers/groups/selectPopup?selectedGroupIds=" + groupIds, {
callback: function (resp) {
that.groups.push(resp.data.group)
}
@@ -23,7 +23,7 @@ Vue.component("server-group-selector", {
},
addGroup: function () {
let that = this
teaweb.popup("/servers/components/groups/createPopup", {
teaweb.popup("/servers/groups/createPopup", {
callback: function (resp) {
that.groups.push(resp.data.group)
}

View File

@@ -60,6 +60,9 @@
.left-box.with-menu {
top: 10em;
}
.left-box.without-menu {
top: 6em;
}
.right-box {
position: fixed;
top: 7.5em;
@@ -86,6 +89,9 @@ body.expanded .right-box {
.right-box.with-menu {
top: 10em;
}
.right-box.without-menu {
top: 6em;
}
.main.without-footer .left-box {
bottom: 0.2em;
}
@@ -180,6 +186,9 @@ div.margin,
p.margin {
margin-top: 1em;
}
.opacity-mask {
opacity: 0.6;
}
/** 操作按钮容器 **/
.op.one {
width: 4em;

File diff suppressed because one or more lines are too long

View File

@@ -103,6 +103,10 @@ div.margin, p.margin {
margin-top: 1em;
}
.opacity-mask {
opacity: 0.6;
}
/** 操作按钮容器 **/
.op.one {
width: 4em;
@@ -799,4 +803,4 @@ td {
// input
input.error {
border: 1px #e0b4b4 solid !important;
}
}

View File

@@ -83,6 +83,10 @@
top: 10em;
}
.left-box.without-menu {
top: 6em;
}
.right-box {
position: fixed;
top: 7.5em;
@@ -115,6 +119,10 @@ body.expanded .right-box {
top: 10em;
}
.right-box.without-menu {
top: 6em;
}
// main
.main.without-footer .left-box {
bottom: 0.2em;

View File

@@ -0,0 +1,9 @@
<div class="margin"></div>
<div class="left-box without-menu" :class="{disabled:leftMenuItemIsDisabled}">
<div class="ui menu text blue vertical small">
<a class="item" v-for="item in leftMenuItems" :href="item.url" :class="{active:item.isActive, separator:item.name == '-', on:item.isOn, off:item.isOff}">
<span v-if="item.name != '-'"><i class="icon play tiny" :style="{'visibility':item.isActive ? 'visible' : 'hidden'}"></i>{{item.name}}<var v-if="item.isOff"></var></span>
</a>
</div>
</div>

View File

@@ -54,7 +54,7 @@
<!-- 当前任务 -->
<div v-if="tasks.length > 0">
<h4>正在执行的任务</h4>
<h3>正在执行的任务</h3>
<table class="ui table selectable celled">
<thead>
<tr>
@@ -94,7 +94,7 @@
<!-- 问题合集 -->
<div v-if="issues.length > 0">
<h4>需要修复的问题</h4>
<h3>需要修复的问题</h3>
<table class="ui table selectable celled" v-if="issues.length > 0">
<thead>
<tr>
@@ -131,7 +131,7 @@
<p class="comment">下面的DNS解析记录也可以手工在DNS服务商提供的管理平台添加。</p>
<!-- 节点DNS解析记录 -->
<h4>节点DNS解析记录 <span>&nbsp; ({{nodes.length}}个)</span></h4>
<h3>节点DNS解析记录 <span>&nbsp; ({{nodes.length}}个)</span></h3>
<p class="comment" v-if="nodes.length == 0">暂时没有需要设置的DNS记录。</p>
<table class="ui table selectable celled" v-if="nodes.length > 0">
<thead>
@@ -174,7 +174,7 @@
</table>
<!-- 网站服务解析记录 -->
<h4>网站服务解析记录 <span>&nbsp; ({{servers.length}}个)</span></h4>
<h3>网站服务解析记录 <span>&nbsp; ({{servers.length}}个)</span></h3>
<p class="comment" v-if="servers.length == 0">暂时没有需要设置的DNS记录。</p>
<table class="ui table selectable celled" v-if="servers.length > 0">
<thead>

View File

@@ -0,0 +1,7 @@
<first-menu>
<menu-item href="/servers/groups">分组列表</menu-item>
<span class="item disabled">|</span>
<menu-item :href="'/servers/groups/group?groupId=' + group.id" code="group.index">"{{group.name}}"详情</menu-item>
<menu-item :href="'/servers/groups/group/settings?groupId=' + group.id" :active="!firstMenuItem.startsWith('group.')">全局设置 &nbsp;<tip-icon content="这里添加的设置将会自动应用到当前分组下的所有服务。"></tip-icon></menu-item>
<menu-item :href="'/servers/groups/group/update?groupId=' + group.id" code="group.update">修改</menu-item>
</first-menu>

View File

@@ -0,0 +1,84 @@
{$layout}
{$template "menu"}
<table class="ui table definition selectable">
<tr>
<td class="title">分组名称</td>
<td>
{{group.name}}
</td>
</tr>
</table>
<h3>服务</h3>
<p class="comment" v-if="servers.length == 0">暂时还没有服务。</p>
<table class="ui table selectable celled" v-if="servers.length > 0">
<thead>
<tr>
<th>服务名称</th>
<th>所属用户</th>
<th>部署集群</th>
<th>域名</th>
<th>端口</th>
<th class="two wide center">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="server in servers">
<td><a :href="'/servers/server?serverId=' + server.id"><keyword :v-word="keyword">{{server.name}}</keyword></a>
<div style="margin-top:0.4em">
<grey-label>{{server.serverTypeName}}</grey-label>
</div>
</td>
<td>
<span v-if="server.user != null">{{server.user.fullname}}<link-icon v-if="canVisitUser" :href="'/users/user?userId=' + server.user.id"></link-icon></span>
<span v-else>-</span>
</td>
<td>{{server.cluster.name}}</td>
<td>
<span v-if="server.serverNames.length > 0">
<span v-if="server.serverNames[0].subNames == null || server.serverNames[0].subNames.length == 0"><keyword :v-word="keyword">{{server.serverNames[0].name}}</keyword></span>
<span v-else><keyword :v-word="keyword">{{server.serverNames[0].subNames[0]}}</keyword></span>
<span v-if="server.countServerNames > 1">等{{server.countServerNames}}个域名 <popup-icon :href="'/servers/serverNamesPopup?serverId=' + server.id" height="20em"></popup-icon></span>
</span>
<span v-else class="disabled">-</span>
<!-- 审核中 -->
<div v-if="server.isAuditing" style="margin-top: 0.5em">
<a class="ui label basic tiny red" title="点击跳到审核页面" :href="'/servers/server/settings/serverNames?serverId=' + server.id">审核中 &nbsp;<i class="icon long arrow right alternate"></i></a>
</div>
<!-- 审核失败 -->
<div v-if="!server.auditingIsOk" style="margin-top: 0.5em">
<a class="ui label basic tiny red" title="点击跳到审核页面" :href="'/servers/server/settings/serverNames?serverId=' + server.id">审核不通过 &nbsp;<i class="icon long arrow right alternate"></i></a>
</div>
</td>
<td>
<span v-if="server.ports.length == 0">-</span>
<div v-for="port in server.ports">
<tiny-basic-label><keyword :v-word="keyword">{{port.portRange}}</keyword><span class="small">{{port.protocol}}</span></tiny-basic-label>
</div>
</td>
<td class="center">
<div v-if="!checkDNS">
<label-on :v-is-on="server.isOn"></label-on>
</div>
<div v-else>
<span v-if="!server.isOn" class="grey">停用中</span>
<span v-else-if="server.status.isOk" class="green">正常</span>
<span v-else-if="server.status.message.length == 0">检查中</span>
<span v-else class="red">{{server.status.message}}
<tip-icon :content="server.status.todo"></tip-icon>
</span>
</div>
</td>
<td>
<a :href="'/servers/server?serverId=' + server.id">详情</a> &nbsp;
<a :href="'/servers/server/settings?serverId=' + server.id">设置</a>
</td>
</tr>
</table>
<div class="page" v-html="page"></div>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.checkDNS = false
})

View File

@@ -0,0 +1,5 @@
<second-menu>
<menu-item :href="Tea.url('.', {groupId: group.id})" code="index">源站列表</menu-item>
<menu-item :href="Tea.url('.scheduling', {groupId: group.id})" code="scheduling">调度算法</menu-item>
<menu-item :href="Tea.url('.setting', {groupId: group.id})" code="setting">更多设置</menu-item>
</second-menu>

View File

@@ -0,0 +1,19 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div v-if="!reverseProxyRef.isPrior || !reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="Tea.url('.setting', { groupId: group.id })">[更多设置]</a> 开启 。</warning-message>
</div>
<div :class="{'opacity-mask': !reverseProxyRef.isPrior || !reverseProxyRef.isOn}">
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
:v-server-type="serverType"
:v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyConfig.id + '&serverType=' + serverType"
:v-is-group="true"></origin-list-box>
</div>
</div>

View File

@@ -0,0 +1,9 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<origin-scheduling-view-box :v-scheduling="scheduling" :v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyId + '&family=' + family"></origin-scheduling-view-box>
</div>

View File

@@ -0,0 +1,15 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div class="margin"></div>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="groupId" :value="group.id"/>
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef" :v-reverse-proxy-config="reverseProxyConfig" :v-family="family" :v-is-group="true"></reverse-proxy-box>
<submit-btn></submit-btn>
</form>
</div>

View File

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

View File

@@ -0,0 +1,5 @@
<second-menu>
<menu-item :href="Tea.url('.', {groupId: group.id})" code="index">源站列表</menu-item>
<menu-item :href="Tea.url('.scheduling', {groupId: group.id})" code="scheduling">调度算法</menu-item>
<menu-item :href="Tea.url('.setting', {groupId: group.id})" code="setting">更多设置</menu-item>
</second-menu>

View File

@@ -0,0 +1,19 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div v-if="!reverseProxyRef.isPrior || !reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="Tea.url('.setting', { groupId: group.id })">[更多设置]</a> 开启 。</warning-message>
</div>
<div :class="{'opacity-mask': !reverseProxyRef.isPrior || !reverseProxyRef.isOn}">
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
:v-server-type="serverType"
:v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyConfig.id + '&serverType=' + serverType"
:v-is-group="true"></origin-list-box>
</div>
</div>

View File

@@ -0,0 +1,9 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<origin-scheduling-view-box :v-scheduling="scheduling" :v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyId + '&family=' + family"></origin-scheduling-view-box>
</div>

View File

@@ -0,0 +1,15 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div class="margin"></div>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="groupId" :value="group.id"/>
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef" :v-reverse-proxy-config="reverseProxyConfig" :v-family="family" :v-is-group="true"></reverse-proxy-box>
<submit-btn></submit-btn>
</form>
</div>

View File

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

View File

@@ -0,0 +1,5 @@
<second-menu>
<menu-item :href="Tea.url('.', {groupId: group.id})" code="index">源站列表</menu-item>
<menu-item :href="Tea.url('.scheduling', {groupId: group.id})" code="scheduling">调度算法</menu-item>
<menu-item :href="Tea.url('.setting', {groupId: group.id})" code="setting">更多设置</menu-item>
</second-menu>

View File

@@ -0,0 +1,19 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div v-if="!reverseProxyRef.isPrior || !reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="Tea.url('.setting', { groupId: group.id })">[更多设置]</a> 开启 。</warning-message>
</div>
<div :class="{'opacity-mask': !reverseProxyRef.isPrior || !reverseProxyRef.isOn}">
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
:v-server-type="serverType"
:v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyConfig.id + '&serverType=' + serverType"
:v-is-group="true"></origin-list-box>
</div>
</div>

View File

@@ -0,0 +1,9 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<origin-scheduling-view-box :v-scheduling="scheduling" :v-params="'type=group&groupId=' + group.id + '&reverseProxyId=' + reverseProxyId + '&family=' + family"></origin-scheduling-view-box>
</div>

View File

@@ -0,0 +1,15 @@
{$layout}
{$template "/servers/groups/group/menu"}
{$template "/left_menu_without_menu"}
<div class="right-box without-menu">
{$template "menu"}
<div class="margin"></div>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="groupId" :value="group.id"/>
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef" :v-reverse-proxy-config="reverseProxyConfig" :v-family="family" :v-is-group="true"></reverse-proxy-box>
<submit-btn></submit-btn>
</form>
</div>

View File

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

View File

@@ -1,6 +1,6 @@
{$layout "layout_popup"}
{$layout "layout"}
{$template "menu"}
<h3>修改分组</h3>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="groupId" :value="group.id"/>
<table class="ui table definition selectable">

View File

@@ -0,0 +1,5 @@
Tea.context(function () {
this.success = NotifySuccess("保存成功", ".", {
groupId: this.group.id
})
})

View File

@@ -1,7 +1,7 @@
{$layout}
<first-menu>
<menu-item href="/servers/components/groups" active="true">列表</menu-item>
<menu-item href="/servers/groups" active="true">列表</menu-item>
<span class="item">|</span>
<a href="" class="item" @click.prevent="createGroup()">[创建]</a>
</first-menu>
@@ -21,13 +21,15 @@
<tbody v-for="group in groups" :data-group-id="group.id">
<tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td>{{group.name}}</td>
<td>
<a :href="'/servers/groups/group?groupId=' + group.id">{{group.name}}</a>
</td>
<td class="center">
<a :href="'/servers?groupId=' + group.id" v-if="group.countServers > 0">{{group.countServers}}</a>
<span v-else class="disabled">0</span>
</td>
<td>
<a href="" @click.prevent="updateGroup(group.id)">修改</a> &nbsp; <a href="" @click.prevent="deleteGroup(group.id)">删除</a>
<a :href="'/servers/groups/group?groupId=' + group.id">详情</a> &nbsp; <a href="" @click.prevent="deleteGroup(group.id)">删除</a>
</td>
</tr>
</tbody>

View File

@@ -6,7 +6,7 @@ Tea.context(function () {
document.querySelectorAll("*[data-group-id]").forEach(function (element) {
groupIds.push(element.getAttribute("data-group-id"))
})
that.$post("/servers/components/groups/sort")
that.$post("/servers/groups/sort")
.params({
groupIds: groupIds
})
@@ -17,17 +17,7 @@ Tea.context(function () {
})
this.createGroup = function () {
teaweb.popup("/servers/components/groups/createPopup", {
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
})
}
this.updateGroup = function (groupId) {
teaweb.popup("/servers/components/groups/updatePopup?groupId=" + groupId, {
teaweb.popup("/servers/groups/createPopup", {
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
@@ -39,7 +29,7 @@ Tea.context(function () {
this.deleteGroup = function (groupId) {
let that = this
teaweb.confirm("确定要删除这个分组吗?", function () {
that.$post("/servers/components/groups/delete")
that.$post("/servers/groups/group/delete")
.params({
groupId: groupId
})

View File

@@ -129,7 +129,8 @@
</div>
</td>
<td>
<a :href="'/servers/server?serverId=' + server.id">详情</a>
<a :href="'/servers/server?serverId=' + server.id">详情</a> &nbsp;
<a :href="'/servers/server/settings?serverId=' + server.id">设置</a>
</td>
</tr>
</table>

View File

@@ -4,12 +4,19 @@
<div class="right-box">
{$template "menu"}
<div v-if="!reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId">[更多设置]</a> 开启 </warning-message>
</div>
<div v-if="hasGroupConfig">
<div class="margin"></div>
<warning-message>由于已经在当前服务分组中进行了对应的配置,在这里的配置将不会生效</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 :class="{'opacity-mask': hasGroupConfig}">
<div v-if="!reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId">[更多设置]</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>