Skip to content

Commit a0c4520

Browse files
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 <[email protected]>
1 parent 76ef50a commit a0c4520

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/utils/netbird.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ export const GRPC_API_ORIGIN = config.grpcApiOrigin;
55

66
export const getNetBirdUpCommand = () => {
77
let cmd = "netbird up";
8-
if (!GRPC_API_ORIGIN) return cmd;
9-
cmd += " --management-url " + GRPC_API_ORIGIN;
8+
if (GRPC_API_ORIGIN) {
9+
cmd += " --management-url " + GRPC_API_ORIGIN
10+
}
11+
if (!isNetBirdHosted()) {
12+
let admin_url = window.location.protocol + "://" + window.location.hostname
13+
if (window.location.port != "") {
14+
admin_url += ":" + window.location.port
15+
}
16+
cmd += " --admin-url " + admin_url
17+
};
1018
return cmd;
1119
};
1220

0 commit comments

Comments
 (0)