mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 12:20:27 +08:00
优化代码
This commit is contained in:
@@ -26,7 +26,7 @@ func (this *AddPortPopupAction) RunGet(params struct {
|
|||||||
}) {
|
}) {
|
||||||
this.Data["from"] = params.From
|
this.Data["from"] = params.From
|
||||||
|
|
||||||
protocols := serverconfigs.AllServerProtocolsForType(params.ServerType)
|
protocols := serverconfigs.FindAllServerProtocolsForType(params.ServerType)
|
||||||
if len(params.Protocol) > 0 {
|
if len(params.Protocol) > 0 {
|
||||||
result := []maps.Map{}
|
result := []maps.Map{}
|
||||||
for _, p := range protocols {
|
for _, p := range protocols {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Vue.component("network-addresses-box", {
|
Vue.component("network-addresses-box", {
|
||||||
props: ["v-server-type", "v-addresses", "v-protocol", "v-name", "v-from", "v-support-range"],
|
props: ["v-server-type", "v-addresses", "v-protocol", "v-name", "v-from", "v-support-range", "v-url"],
|
||||||
data: function () {
|
data: function () {
|
||||||
let addresses = this.vAddresses
|
let addresses = this.vAddresses
|
||||||
if (addresses == null) {
|
if (addresses == null) {
|
||||||
@@ -41,7 +41,13 @@ Vue.component("network-addresses-box", {
|
|||||||
addAddr: function () {
|
addAddr: function () {
|
||||||
let that = this
|
let that = this
|
||||||
window.UPDATING_ADDR = null
|
window.UPDATING_ADDR = null
|
||||||
teaweb.popup("/servers/addPortPopup?serverType=" + this.vServerType + "&protocol=" + this.protocol + "&from=" + this.from + "&supportRange=" + (this.supportRange() ? 1 : 0), {
|
|
||||||
|
let url = this.vUrl
|
||||||
|
if (url == null) {
|
||||||
|
url = "/servers/addPortPopup"
|
||||||
|
}
|
||||||
|
|
||||||
|
teaweb.popup(url + "?serverType=" + this.vServerType + "&protocol=" + this.protocol + "&from=" + this.from + "&supportRange=" + (this.supportRange() ? 1 : 0), {
|
||||||
height: "18em",
|
height: "18em",
|
||||||
callback: function (resp) {
|
callback: function (resp) {
|
||||||
var addr = resp.data.address
|
var addr = resp.data.address
|
||||||
@@ -72,7 +78,13 @@ Vue.component("network-addresses-box", {
|
|||||||
updateAddr: function (index, addr) {
|
updateAddr: function (index, addr) {
|
||||||
let that = this
|
let that = this
|
||||||
window.UPDATING_ADDR = addr
|
window.UPDATING_ADDR = addr
|
||||||
teaweb.popup("/servers/addPortPopup?serverType=" + this.vServerType + "&protocol=" + this.protocol + "&from=" + this.from + "&supportRange=" + (this.supportRange() ? 1 : 0), {
|
|
||||||
|
let url = this.vUrl
|
||||||
|
if (url == null) {
|
||||||
|
url = "/servers/addPortPopup"
|
||||||
|
}
|
||||||
|
|
||||||
|
teaweb.popup(url + "?serverType=" + this.vServerType + "&protocol=" + this.protocol + "&from=" + this.from + "&supportRange=" + (this.supportRange() ? 1 : 0), {
|
||||||
height: "18em",
|
height: "18em",
|
||||||
callback: function (resp) {
|
callback: function (resp) {
|
||||||
var addr = resp.data.address
|
var addr = resp.data.address
|
||||||
|
|||||||
Reference in New Issue
Block a user