Don't use the proxy in the JS
This commit is contained in:
parent
28a4ac2ca3
commit
01d0b6a8bd
1 changed files with 2 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
||||||
// This file handles the "Confirm instance details" dialog
|
// This file handles the "Confirm instance details" dialog
|
||||||
|
|
||||||
import { findButtonOrFail, findFormOrFail, findImageOrFail, findInputOrFail, findSelectOrFail } from "./dom.mjs";
|
import { findButtonOrFail, findFormOrFail, findImageOrFail, findInputOrFail, findSelectOrFail } from "./dom.mjs";
|
||||||
import { resize } from "./image.mjs";
|
|
||||||
import knownSoftware from "./known_software.mjs";
|
import knownSoftware from "./known_software.mjs";
|
||||||
|
|
||||||
const blankImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
const blankImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
||||||
|
@ -55,22 +54,16 @@ export function initializeInstanceDetailsDialog(
|
||||||
instanceHost.value = instanceHostValue;
|
instanceHost.value = instanceHostValue;
|
||||||
instanceHostSecure.checked = instanceHostSecureValue;
|
instanceHostSecure.checked = instanceHostSecureValue;
|
||||||
instanceSoftware.value = instanceSoftwareValue;
|
instanceSoftware.value = instanceSoftwareValue;
|
||||||
instanceIcon.src = instanceIconValue === null ? blankImage : `/api/proxy/${encodeURIComponent(instanceIconValue)}`;
|
instanceIcon.src = instanceIconValue ?? blankImage;
|
||||||
};
|
};
|
||||||
|
|
||||||
form.addEventListener("submit", e => {
|
form.addEventListener("submit", e => {
|
||||||
let image: string | null = null;
|
|
||||||
if (instanceIcon.src !== blankImage) {
|
|
||||||
try {
|
|
||||||
image = resize(instanceIcon);
|
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
callback(
|
callback(
|
||||||
instanceName.value,
|
instanceName.value,
|
||||||
instanceHost.value,
|
instanceHost.value,
|
||||||
instanceHostSecure.checked,
|
instanceHostSecure.checked,
|
||||||
instanceSoftware.value,
|
instanceSoftware.value,
|
||||||
image
|
instanceIcon.src
|
||||||
);
|
);
|
||||||
form.reset();
|
form.reset();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue