feat: add domain and external ip configuration items (#18)

This commit is contained in:
Li4n0
2021-05-22 20:40:04 +08:00
committed by GitHub
parent bc6e3962f8
commit 1144f67d37
55 changed files with 228 additions and 143 deletions
+8 -6
View File
@@ -139,12 +139,14 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
console.error(e)
}
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
marginLeft: `${335 - 600}px`,
},
duration: 4
});
})
},
},
+8 -6
View File
@@ -228,12 +228,14 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
console.error(e)
}
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
marginLeft: `${335 - 600}px`,
},
duration: 4
});
})
},
},
+8 -6
View File
@@ -173,12 +173,14 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
console.error(e)
}
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
marginLeft: `${335 - 600}px`,
},
duration: 4
});
})
},
},
+8 -6
View File
@@ -216,12 +216,14 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
console.error(e)
}
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
marginLeft: `${335 - 600}px`,
},
duration: 4
});
})
},
},
+8 -6
View File
@@ -140,12 +140,14 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
console.error(e)
}
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
marginLeft: `${335 - 600}px`,
},
duration: 4
});
})
},
},
+1 -6
View File
@@ -332,11 +332,7 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
this.$notification.error({
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
@@ -344,7 +340,6 @@ export default {
},
duration: 4
});
}
})
},
clickSwitch(record, prop) {
+2 -7
View File
@@ -28,7 +28,7 @@
<a-input
v-model="form.pasv_address"
style="width: 100%"
placeholder="use default value in the config"
placeholder="Use external IP by default"
:readOnly="formReadOnly"
/>
</a-form-model-item>
@@ -267,11 +267,7 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
this.$notification.error({
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
@@ -279,7 +275,6 @@ export default {
},
duration: 4
});
}
})
},
clickSwitch(record, prop) {
+1 -6
View File
@@ -374,11 +374,7 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
this.$notification.error({
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
@@ -386,7 +382,6 @@ export default {
},
duration: 4
});
}
})
},
clickSwitch(record, prop) {
+1 -6
View File
@@ -297,11 +297,7 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
this.$notification.error({
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
@@ -309,7 +305,6 @@ export default {
},
duration: 4
});
}
})
},
clickSwitch(record, prop) {
+1 -6
View File
@@ -225,11 +225,7 @@ export default {
this.pagination = pagination;
this.loading = false
}).catch(e => {
if (e.response.status === 403) {
store.authed = false
return []
} else {
this.$notification.error({
this.$notification.error({
message: 'Unknown error: ' + e.response.status,
style: {
width: '100px',
@@ -237,7 +233,6 @@ export default {
},
duration: 4
});
}
})
},
clickSwitch(record, prop) {
+4 -4
View File
@@ -20,7 +20,7 @@
</template>
<script>
import {getHttpConfig, updateHttpConfig} from "@/api/settings"
import {getPlatformConfig, updatePlatformConfig} from "@/api/settings"
import SettingForm from "@/components/SettingForm";
export default {
@@ -37,7 +37,7 @@ export default {
},
methods: {
getConfig() {
getHttpConfig().then(res => {
getPlatformConfig().then(res => {
this.form = res.data
}).catch(e => {
this.$notification.error({
@@ -55,10 +55,10 @@ export default {
updateConfig() {
this.spinning = true
let targetConfig = JSON.stringify(this.form)
updateHttpConfig(this.form).then(
updatePlatformConfig(this.form).then(
() => {
setTimeout(() => {
getHttpConfig().then((res) => {
getPlatformConfig().then((res) => {
this.spinning = false
let nowConfig = JSON.stringify(res.data)
if (nowConfig !== targetConfig) {
+12 -8
View File
@@ -5,13 +5,13 @@
:active-tab-key="tabKey"
@tabChange="key => this.tabKey = key"
style="width: 100%;">
<http v-if="tabKey==='HTTP'"></http>
<dns v-else-if="tabKey==='DNS'"></dns>
<rmi v-else-if="tabKey==='RMI'"></rmi>
<mysql v-else-if="tabKey==='MYSQL'"></mysql>
<ftp v-else-if="tabKey==='FTP'"></ftp>
<notice v-else-if="tabKey==='NOTICE'"></notice>
<rules v-else-if="tabKey==='RULES'"></rules>
<http ref="settings" v-if="tabKey==='HTTP'"></http>
<dns ref="settings" v-else-if="tabKey==='DNS'"></dns>
<rmi ref="settings" v-else-if="tabKey==='RMI'"></rmi>
<mysql ref="settings" v-else-if="tabKey==='MYSQL'"></mysql>
<ftp ref="settings" v-else-if="tabKey==='FTP'"></ftp>
<notice ref="settings" v-else-if="tabKey==='NOTICE'"></notice>
<rules ref="settings" v-else-if="tabKey==='RULES'"></rules>
</a-card>
</div>
</template>
@@ -42,7 +42,11 @@ export default {
}
}
,
methods: {},
methods: {
fetch() {
this.$refs.settings.getConfig();
}
},
components: {
Http,
Dns,