Host switching

This commit is contained in:
2022-09-26 17:38:27 -04:00
parent 31ffadbae3
commit 1a08acdc7c
6 changed files with 138 additions and 35 deletions

View File

@@ -6,6 +6,14 @@ export async function connect(secret, host='vista.northport.med.va.gov', port=19
})).json();
}
export async function close(cid) {
return await (await fetch('/v1/vista/' + cid + '/close', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: Date.now() })
})).json();
}
export async function call(cid, method, ...params) {
return await (await fetch('/v1/vista/' + cid, {
method: 'POST',
@@ -47,5 +55,5 @@ export async function authenticate(cid, avcode=null) {
}
export default window.vista = {
connect, call, callctx, serverinfo, userinfo, authenticate
connect, close, call, callctx, serverinfo, userinfo, authenticate
};