Add a test upstreams button

Closes 
This commit is contained in:
Ildar Kamalov 2018-09-21 18:08:39 +03:00
parent 02b28f4511
commit f727f999f9
7 changed files with 77 additions and 3 deletions
client/src/api

View file

@ -31,6 +31,7 @@ export default class Api {
GLOBAL_QUERY_LOG_ENABLE = { path: 'querylog_enable', method: 'POST' };
GLOBAL_QUERY_LOG_DISABLE = { path: 'querylog_disable', method: 'POST' };
GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstream_dns', method: 'POST' };
GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' };
GLOBAL_VERSION = { path: 'version.json', method: 'GET' };
restartGlobalFiltering() {
@ -108,6 +109,15 @@ export default class Api {
return this.makeRequest(path, method, config);
}
testUpstream(servers) {
const { path, method } = this.GLOBAL_TEST_UPSTREAM_DNS;
const config = {
data: servers,
header: { 'Content-Type': 'text/plain' },
};
return this.makeRequest(path, method, config);
}
getGlobalVersion() {
const { path, method } = this.GLOBAL_VERSION;
return this.makeRequest(path, method);