mirror of
https://github.com/openziti/zrok.git
synced 2025-06-28 21:51:26 +02:00
fixes for --override-endpoint (#347)
This commit is contained in:
parent
6f91bf7f9f
commit
d3ea780a1b
@ -73,6 +73,7 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
target = cmd.overrideEndpoint
|
||||||
if target == "" {
|
if target == "" {
|
||||||
target = resp.Payload.BackendProxyEndpoint
|
target = resp.Payload.BackendProxyEndpoint
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ func (h *updateShareHandler) Handle(params share.UpdateShareParams, principal *r
|
|||||||
|
|
||||||
envFound := false
|
envFound := false
|
||||||
for _, senv := range senvs {
|
for _, senv := range senvs {
|
||||||
if senv.Id == sshr.Id {
|
if senv.Id == sshr.EnvironmentId {
|
||||||
envFound = true
|
envFound = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ const sortNodes = (nodes) => {
|
|||||||
|
|
||||||
const nodesEqual = (a, b) => {
|
const nodesEqual = (a, b) => {
|
||||||
if(a.length !== b.length) return false;
|
if(a.length !== b.length) return false;
|
||||||
return a.every((e, i) => e.id === b[i].id && e.limited === b[i].limited);
|
return a.every((e, i) => e.id === b[i].id && e.limited === b[i].limited && e.label === b[i].label);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
|
export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
|
||||||
@ -116,11 +116,11 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
|
|||||||
// we're going to need to recompute a new graph... but we want to maintain the instances that already exist...
|
// we're going to need to recompute a new graph... but we want to maintain the instances that already exist...
|
||||||
|
|
||||||
// we want to preserve nodes that exist in the new graph, and remove those that don't.
|
// we want to preserve nodes that exist in the new graph, and remove those that don't.
|
||||||
let outputNodes = oldGraph.nodes.filter(oldNode => newGraph.nodes.find(newNode => newNode.id === oldNode.id && newNode.limited === oldNode.limited));
|
let outputNodes = oldGraph.nodes.filter(oldNode => newGraph.nodes.find(newNode => newNode.id === oldNode.id && newNode.limited === oldNode.limited && newNode.label === oldNode.label));
|
||||||
let outputLinks = oldGraph.nodes.filter(oldLink => newGraph.links.find(newLink => newLink.target === oldLink.target && newLink.source === oldLink.source));
|
let outputLinks = oldGraph.nodes.filter(oldLink => newGraph.links.find(newLink => newLink.target === oldLink.target && newLink.source === oldLink.source));
|
||||||
|
|
||||||
// and then do the opposite; add any nodes that are in newGraph that are missing from oldGraph.
|
// and then do the opposite; add any nodes that are in newGraph that are missing from oldGraph.
|
||||||
outputNodes.push(...newGraph.nodes.filter(newNode => !outputNodes.find(oldNode => oldNode.id === newNode.id && oldNode.limited === newNode.limited)));
|
outputNodes.push(...newGraph.nodes.filter(newNode => !outputNodes.find(oldNode => oldNode.id === newNode.id && oldNode.limited === newNode.limited && oldNode.label === newNode.label)));
|
||||||
outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
|
outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user