Compare commits

...

3 Commits

Author SHA1 Message Date
Jon "The Nice Guy" Spriggs
f8281c8057 Typo (#418)
Some checks failed
build and push / build_n_push (push) Has been cancelled
Protocol appears to include the : delimiter
2024-10-22 11:19:16 +02:00
Eduard Gert
c1fcadaefe Fix resetting acl groups on switching active toggle (#417)
Some checks failed
build and push / build_n_push (push) Has been cancelled
2024-10-07 17:31:42 +02:00
Jon "The Nice Guy" Spriggs
a0c4520f4b 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>
2024-10-07 17:25:03 +02:00
3 changed files with 18 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ const RoutesContext = React.createContext(
},
);
export default function RoutesProvider({ children }: Props) {
export default function RoutesProvider({ children }: Readonly<Props>) {
const routeRequest = useApiCall<Route>("/routes", true);
const { mutate } = useSWRConfig();
@@ -38,9 +38,7 @@ export default function RoutesProvider({ children }: Props) {
notify({
title: "Network " + route.network_id + "-" + route.network,
description: message
? message
: "The network route was successfully updated",
description: message ?? "The network route was successfully updated",
promise: routeRequest
.put(
{
@@ -56,7 +54,10 @@ export default function RoutesProvider({ children }: Props) {
metric: toUpdate.metric ?? route.metric ?? 9999,
masquerade: toUpdate.masquerade ?? route.masquerade ?? true,
groups: toUpdate.groups ?? route.groups ?? [],
access_control_groups: toUpdate.access_control_groups ?? undefined,
access_control_groups:
toUpdate.access_control_groups ??
route.access_control_groups ??
undefined,
},
`/${route.id}`,
)
@@ -75,9 +76,7 @@ export default function RoutesProvider({ children }: Props) {
) => {
notify({
title: "Network " + route.network_id + "-" + route.network,
description: message
? message
: "The network route was successfully created",
description: message ?? "The network route was successfully created",
promise: routeRequest
.post({
network_id: route.network_id,

View File

@@ -7,7 +7,7 @@ import { Route } from "@/interfaces/Route";
type Props = {
route: Route;
};
export default function RouteActiveCell({ route }: Props) {
export default function RouteActiveCell({ route }: Readonly<Props>) {
const { updateRoute } = useRoutes();
const { mutate } = useSWRConfig();

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;
};