fix: more money, more problems

web-rdp-cloud-fixes
Parkreiner 10 months ago
parent 047ccd67ca
commit d530d68b12

@ -48,7 +48,7 @@ const formFieldEntries = {
querySelector: "web-client-username-control input",
/** @readonly */
value: "CODER_USERNAME",
value: "${CODER_USERNAME}",
},
/** @readonly */
@ -57,7 +57,7 @@ const formFieldEntries = {
querySelector: "web-client-password-control input",
/** @readonly */
value: "CODER_PASSWORD",
value: "${CODER_PASSWORD}",
},
};
@ -135,7 +135,7 @@ function setInputValue(inputField, inputText) {
if (i === -1) {
inputField.value = "";
} else {
inputField.value = `${inputField.value}${currentChar}`;
inputField.value = `$${inputField.value}$${currentChar}`;
}
inputField.dispatchEvent(inputEvent);
@ -184,7 +184,7 @@ async function autoSubmitForm(myForm) {
// they're part of the form. Avoids CSS stacking context issues, maybe?
/** @type {HTMLLIElement | null} */
const protocolOption = document.querySelector(
`p-dropdownitem[ng-reflect-label="${PROTOCOL}"] li`,
`p-dropdownitem[ng-reflect-label="$${PROTOCOL}"] li`,
);
if (protocolOption === null) {
@ -223,7 +223,7 @@ async function autoSubmitForm(myForm) {
if (input === null) {
throw new Error(
`Unable to element that matches query "${querySelector}"`,
`Unable to element that matches query "$${querySelector}"`,
);
}
@ -332,7 +332,7 @@ function setupFormDetection() {
function setupObscuringStyles() {
const styleId = "coder-patch--styles";
const existingContainer = document.querySelector(`#${styleId}`);
const existingContainer = document.querySelector(`#$${styleId}`);
if (existingContainer) {
return;
}

@ -95,10 +95,10 @@ resource "coder_script" "windows-rdp" {
$patch = '<script defer id="coder-patch" src="coder.js"></script>'
# Always copy the file in case we change it.
"${replace(templatefile("${path.module}/devolutions-patch.js", {
"${templatefile("${path.module}/devolutions-patch.js", {
CODER_USERNAME : var.admin_username,
CODER_PASSWORD : var.admin_password,
}), "$", "$$")}" | Set-Content "$root\coder.js"
})}" | Set-Content "$root\coder.js"
# Only inject the src if we have not before.
$isPatched = Select-String -Path "$devolutionsHtml" -Pattern "$patch"

Loading…
Cancel
Save