Add admin-url to the add-peer dialogue (#416)

* Add admin-url to the add-peer dialogue

* Missed "let" from defining the variable

* Update netbird.ts

Fix isNetBirdHosted check

---------

Co-authored-by: Eduard Gert <eduard@netbird.io>
This commit is contained in:
Jon "The Nice Guy" Spriggs
2024-10-07 16:25:03 +01:00
committed by GitHub
parent 76ef50a886
commit a0c4520f4b
+10 -2
View File
@@ -5,8 +5,16 @@ export const GRPC_API_ORIGIN = config.grpcApiOrigin;
export const getNetBirdUpCommand = () => {
let cmd = "netbird up";
if (!GRPC_API_ORIGIN) return cmd;
cmd += " --management-url " + GRPC_API_ORIGIN;
if (GRPC_API_ORIGIN) {
cmd += " --management-url " + GRPC_API_ORIGIN
}
if (!isNetBirdHosted()) {
let admin_url = window.location.protocol + "://" + window.location.hostname
if (window.location.port != "") {
admin_url += ":" + window.location.port
}
cmd += " --admin-url " + admin_url
};
return cmd;
};