MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / applySelectedTemplate

Function applySelectedTemplate

static/js/payment.js:854–870  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

852}
853
854function applySelectedTemplate() {
855 const selectEl = document.getElementById("billing-template-select");
856 if (!selectEl || !selectEl.value) {
857 toast.warning("请先选择模板");
858 return;
859 }
860 const templates = getBillingTemplates();
861 const selected = templates.find((tpl) => tpl.id === selectEl.value);
862 if (!selected) {
863 toast.warning("模板不存在或已删除");
864 refreshBillingTemplateSelect();
865 return;
866 }
867 fillBillingForm(selected.data || {});
868 setInputValue("billing-template-name", selected.name || "");
869 toast.success(`已应用模板: ${selected.name}`);
870}
871
872async function deleteSelectedTemplate() {
873 const selectEl = document.getElementById("billing-template-select");

Callers

nothing calls this directly

Calls 6

getBillingTemplatesFunction · 0.85
fillBillingFormFunction · 0.85
setInputValueFunction · 0.85
warningMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected