Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1fcadaefe | ||
|
|
a0c4520f4b |
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user