Added validation on change and enable encryption checkbox

This commit is contained in:
Ildar Kamalov 2019-02-18 16:06:27 +03:00
parent d44f68e844
commit 05cce8b107
15 changed files with 356 additions and 123 deletions
client/src/api

View file

@ -358,6 +358,7 @@ export default class Api {
// DNS-over-HTTPS and DNS-over-TLS
TLS_STATUS = { path: 'tls/status', method: 'GET' };
TLS_CONFIG = { path: 'tls/configure', method: 'POST' };
TLS_VALIDATE = { path: 'tls/validate', method: 'POST' };
getTlsStatus() {
const { path, method } = this.TLS_STATUS;
@ -372,4 +373,13 @@ export default class Api {
};
return this.makeRequest(path, method, parameters);
}
validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
}
}