mirror of
https://github.com/openziti/zrok.git
synced 2025-06-05 01:17:47 +02:00
handler tweaks (#221)
This commit is contained in:
parent
9a12ab4661
commit
e34e661722
@ -1,39 +1,49 @@
|
|||||||
import {AgentApi, ApiClient} from "../api/src/index.js";
|
import {AgentApi, ApiClient} from "../api/src/index.js";
|
||||||
|
|
||||||
export const getAgentApi = () => {
|
export const getAgentApi = () => {
|
||||||
return new AgentApi(new ApiClient("http://localhost:5173"));
|
return new AgentApi(new ApiClient(window.location.origin));
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createShare = (opts) => {
|
export const createShare = (opts) => {
|
||||||
switch(opts.shareMode) {
|
switch(opts.shareMode) {
|
||||||
case "public":
|
case "public":
|
||||||
getAgentApi().agentSharePublic(opts, (e, d) => {
|
getAgentApi().agentSharePublic(opts, (e, d) => {
|
||||||
console.log("createShare", e, d);
|
if(e) {
|
||||||
|
console.log("createShare", e, d);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "private":
|
case "private":
|
||||||
getAgentApi().agentSharePrivate(opts, (e, d) => {
|
getAgentApi().agentSharePrivate(opts, (e, d) => {
|
||||||
console.log("createShare", e, d);
|
if(e) {
|
||||||
})
|
console.log("createShare", e, d);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const releaseShare = (opts) => {
|
export const releaseShare = (opts) => {
|
||||||
getAgentApi().agentReleaseShare(opts, (e, d) => {
|
getAgentApi().agentReleaseShare(opts, (e, d) => {
|
||||||
console.log("releaseShare", e, d);
|
if(e) {
|
||||||
})
|
console.log("releaseShare", e, d);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createAccess = (opts) => {
|
export const createAccess = (opts) => {
|
||||||
getAgentApi().agentAccessPrivate(opts, (e, d) => {
|
getAgentApi().agentAccessPrivate(opts, (e, d) => {
|
||||||
console.log("createAccess", e, d);
|
if(e) {
|
||||||
})
|
console.log("createAccess", e, d);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const releaseAccess = (opts) => {
|
export const releaseAccess = (opts) => {
|
||||||
getAgentApi().agentReleaseAccess(opts, (e, d) => {
|
if(e) {
|
||||||
console.log("releaseAccess", e, d);
|
getAgentApi().agentReleaseAccess(opts, (e, d) => {
|
||||||
})
|
console.log("releaseAccess", e, d);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user