// Auto-extracted from backup-page.js (verbatim) — augments BackupPage.prototype. Loaded after the base.
Object.assign(BackupPage.prototype, {
renderLocFields(idx, suffixes, loc) {
if (typeof ConfigShared === 'undefined' || !ConfigShared.generateField) {
return `
Configuration system not loaded.
`;
}
const locValueLookup = {
NAME: loc.name, ENABLED: loc.enabled ? 'true' : 'false', TYPE: loc.type,
ENGINE: loc.engine || 'restic',
PATH_MODE: loc.path_mode || 'custom',
PATH: loc.path, URI: loc.uri, SSH_USER: loc.ssh_user, SSH_HOST: loc.ssh_host,
SSH_PORT: loc.ssh_port, SSH_PATH: loc.ssh_path,
SSH_AUTH: loc.ssh_auth || 'key', SSH_PASS: '',
S3_ACCESS_KEY: '', S3_SECRET_KEY: '',
B2_ACCOUNT_ID: '', B2_ACCOUNT_KEY: '',
APPEND_ONLY: loc.append_only ? 'true' : 'false',
CUSTOM_RETENTION: loc.custom_retention ? 'true' : 'false',
KEEP_LAST: loc.keep_last, KEEP_DAILY: loc.keep_daily,
KEEP_WEEKLY: loc.keep_weekly, KEEP_MONTHLY: loc.keep_monthly,
KEEP_YEARLY: loc.keep_yearly
};
// Field metadata comes from configs.json (window.configData) via
// locFieldMeta; the basic/advanced split is decided by the caller, which
// renders each group into its own tab (Connection vs Advanced).
let html = '
';
for (const suffix of suffixes) {
const m = this.locFieldMeta(idx, suffix);
if (!m.exists) continue;
const value = (locValueLookup[suffix] ?? '').toString();
html += ConfigShared.generateField(`config-${m.key}`, m.key, value, m.title, m.description, {}, {});
}
html += '