ESLint: Auto reformat and fixing some warnings / errors.
This commit is contained in:
parent
5237db38e0
commit
91690509d3
50 changed files with 2141 additions and 1493 deletions
server/utils
|
@ -1,32 +1,34 @@
|
|||
import {config} from "../config"
|
||||
import {MonitoringToken, Url} from "../types"
|
||||
import { config } from "../config";
|
||||
import { MonitoringToken, Url } from "../types";
|
||||
|
||||
function formUrl(route: string, queryParams?: { [key: string]: string }): Url {
|
||||
let url = config.server.baseUrl as string;
|
||||
if (route || queryParams) {
|
||||
url += '/#/';
|
||||
url += "/#/";
|
||||
}
|
||||
if (route) {
|
||||
url += route;
|
||||
}
|
||||
if (queryParams) {
|
||||
url += '?';
|
||||
url +=
|
||||
Object.entries(queryParams)
|
||||
.map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value))
|
||||
.join("&");
|
||||
url += "?";
|
||||
url += Object.entries(queryParams)
|
||||
.map(
|
||||
([key, value]) =>
|
||||
encodeURIComponent(key) + "=" + encodeURIComponent(value)
|
||||
)
|
||||
.join("&");
|
||||
}
|
||||
return url as Url;
|
||||
}
|
||||
|
||||
export function editNodeUrl(): Url {
|
||||
return formUrl('update');
|
||||
return formUrl("update");
|
||||
}
|
||||
|
||||
export function monitoringConfirmUrl(monitoringToken: MonitoringToken): Url {
|
||||
return formUrl('monitoring/confirm', {token: monitoringToken});
|
||||
return formUrl("monitoring/confirm", { token: monitoringToken });
|
||||
}
|
||||
|
||||
export function monitoringDisableUrl(monitoringToken: MonitoringToken): Url {
|
||||
return formUrl('monitoring/disable', {token: monitoringToken});
|
||||
return formUrl("monitoring/disable", { token: monitoringToken });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue