fix: address code review findings for DNS management
- CRITICAL: Change DNS zones endpoint from GET to POST to avoid leaking API token in URL query parameters - HIGH: Add sync.RWMutex to protect dnsProvider field in Server, Deployer, and proxy Manager against concurrent read/write races - HIGH: Capture old DNS provider reference synchronously before launching background cleanup goroutine - HIGH: Use getDNS()/getDNSProviderLocked() accessors instead of direct field reads in all DNS operations
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
import { h as head, e as escape_html, s as store_get, a as attr, u as unsubscribe_stores } from "../../../chunks/index.js";
|
||||
import { F as FormField } from "../../../chunks/FormField.js";
|
||||
import { I as IconSearch, E as EntityPicker } from "../../../chunks/EntityPicker.js";
|
||||
import "../../../chunks/toast.js";
|
||||
import { t } from "../../../chunks/index2.js";
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
var $$store_subs;
|
||||
let imageUrl = "";
|
||||
let inspecting = false;
|
||||
let errors = {};
|
||||
let showImagePicker = false;
|
||||
let imagePickerItems = [];
|
||||
function selectPickedImage(value) {
|
||||
imageUrl = value;
|
||||
showImagePicker = false;
|
||||
}
|
||||
let $$settled = true;
|
||||
let $$inner_renderer;
|
||||
function $$render_inner($$renderer3) {
|
||||
head("2t7dow", $$renderer3, ($$renderer4) => {
|
||||
$$renderer4.title(($$renderer5) => {
|
||||
$$renderer5.push(`<title>${escape_html(store_get($$store_subs ??= {}, "$t", t)("quickDeploy.title"))} - ${escape_html(store_get($$store_subs ??= {}, "$t", t)("app.name"))}</title>`);
|
||||
});
|
||||
});
|
||||
$$renderer3.push(`<div class="mx-auto max-w-2xl space-y-6"><div><h1 class="text-2xl font-bold text-[var(--text-primary)]">${escape_html(store_get($$store_subs ??= {}, "$t", t)("quickDeploy.title"))}</h1> <p class="mt-1 text-sm text-[var(--text-secondary)]">${escape_html(store_get($$store_subs ??= {}, "$t", t)("quickDeploy.description"))}</p></div> <div class="rounded-xl border border-[var(--border-primary)] bg-[var(--surface-card)] p-6 shadow-[var(--shadow-sm)]"><h2 class="mb-4 text-base font-semibold text-[var(--text-primary)]">${escape_html(store_get($$store_subs ??= {}, "$t", t)("quickDeploy.step1"))}</h2> <div class="flex gap-3"><div class="flex-1">`);
|
||||
FormField($$renderer3, {
|
||||
label: store_get($$store_subs ??= {}, "$t", t)("quickDeploy.imageUrl"),
|
||||
name: "imageUrl",
|
||||
placeholder: "registry.example.com/org/app:tag",
|
||||
required: true,
|
||||
error: errors.imageUrl ?? "",
|
||||
helpText: store_get($$store_subs ??= {}, "$t", t)("quickDeploy.imageUrlHelp"),
|
||||
disabled: inspecting,
|
||||
get value() {
|
||||
return imageUrl;
|
||||
},
|
||||
set value($$value) {
|
||||
imageUrl = $$value;
|
||||
$$settled = false;
|
||||
}
|
||||
});
|
||||
$$renderer3.push(`<!----></div> <div class="flex items-start gap-2 pt-[26px]"><button type="button"${attr("title", store_get($$store_subs ??= {}, "$t", t)("quickDeploy.browseImages"))}${attr("aria-label", store_get($$store_subs ??= {}, "$t", t)("quickDeploy.browseImages"))} class="rounded-lg border border-[var(--border-primary)] p-2 text-[var(--text-secondary)] hover:bg-[var(--surface-card-hover)] hover:text-[var(--text-primary)] transition-colors">`);
|
||||
{
|
||||
$$renderer3.push("<!--[-1-->");
|
||||
IconSearch($$renderer3, { size: 16 });
|
||||
}
|
||||
$$renderer3.push(`<!--]--></button> <button${attr("disabled", !imageUrl.trim(), true)} class="inline-flex items-center gap-2 rounded-lg bg-[var(--color-info)] px-4 py-2 text-sm font-medium text-white transition-all duration-150 hover:bg-[var(--color-info-dark)] disabled:cursor-not-allowed disabled:opacity-50 active:animate-press">`);
|
||||
{
|
||||
$$renderer3.push("<!--[-1-->");
|
||||
IconSearch($$renderer3, { size: 16 });
|
||||
$$renderer3.push(`<!----> ${escape_html(store_get($$store_subs ??= {}, "$t", t)("quickDeploy.inspect"))}`);
|
||||
}
|
||||
$$renderer3.push(`<!--]--></button></div></div> `);
|
||||
EntityPicker($$renderer3, {
|
||||
items: imagePickerItems,
|
||||
current: imageUrl,
|
||||
title: store_get($$store_subs ??= {}, "$t", t)("quickDeploy.selectImage"),
|
||||
placeholder: store_get($$store_subs ??= {}, "$t", t)("entityPicker.search"),
|
||||
onselect: selectPickedImage,
|
||||
onclose: () => {
|
||||
showImagePicker = false;
|
||||
},
|
||||
get open() {
|
||||
return showImagePicker;
|
||||
},
|
||||
set open($$value) {
|
||||
showImagePicker = $$value;
|
||||
$$settled = false;
|
||||
}
|
||||
});
|
||||
$$renderer3.push(`<!----></div> `);
|
||||
{
|
||||
$$renderer3.push("<!--[-1-->");
|
||||
}
|
||||
$$renderer3.push(`<!--]--></div>`);
|
||||
}
|
||||
do {
|
||||
$$settled = true;
|
||||
$$inner_renderer = $$renderer2.copy();
|
||||
$$render_inner($$inner_renderer);
|
||||
} while (!$$settled);
|
||||
$$renderer2.subsume($$inner_renderer);
|
||||
if ($$store_subs) unsubscribe_stores($$store_subs);
|
||||
});
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
Reference in New Issue
Block a user