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

Function refreshBillingTemplateSelect

static/js/payment.js:792–806  ·  view source on GitHub ↗
(selectedId = "")

Source from the content-addressed store, hash-verified

790}
791
792function refreshBillingTemplateSelect(selectedId = "") {
793 const selectEl = document.getElementById("billing-template-select");
794 if (!selectEl) return;
795 const templates = getBillingTemplates();
796
797 const options = ['<option value="">-- 选择已保存模板 --</option>'];
798 templates.forEach((tpl) => {
799 options.push(`<option value="${escapeHtml(tpl.id)}">${escapeHtml(tpl.name)}</option>`);
800 });
801 selectEl.innerHTML = options.join("");
802
803 if (selectedId && templates.some((tpl) => tpl.id === selectedId)) {
804 selectEl.value = selectedId;
805 }
806}
807
808function saveCurrentAsTemplate() {
809 const name = getInputValue("billing-template-name");

Callers 5

saveCurrentAsTemplateFunction · 0.85
applySelectedTemplateFunction · 0.85
deleteSelectedTemplateFunction · 0.85
payment.jsFile · 0.85

Calls 2

getBillingTemplatesFunction · 0.85
escapeHtmlFunction · 0.70

Tested by

no test coverage detected