update
This commit is contained in:
@@ -27,12 +27,9 @@ function populateConfigForm(config) {
|
||||
|
||||
// HTTP配置
|
||||
document.getElementById('http-port')?.value = config.HTTPServer.Port || 8080;
|
||||
document.getElementById('http-host')?.value = config.HTTPServer.Host || '0.0.0.0';
|
||||
document.getElementById('http-api-enabled')?.checked = config.HTTPServer.APIEnabled !== false;
|
||||
|
||||
// 屏蔽配置
|
||||
document.getElementById('shield-local-rules-file')?.value = config.Shield.LocalRulesFile || './rules.txt';
|
||||
document.getElementById('shield-remote-rules-urls')?.value = (config.Shield.RemoteRulesURLs || []).join('\n');
|
||||
document.getElementById('shield-update-interval')?.value = config.Shield.UpdateInterval || 3600;
|
||||
document.getElementById('shield-hosts-file')?.value = config.Shield.HostsFile || '/etc/hosts';
|
||||
document.getElementById('shield-block-method')?.value = config.Shield.BlockMethod || '0.0.0.0';
|
||||
@@ -69,19 +66,16 @@ function collectFormData() {
|
||||
Port: parseInt(document.getElementById('dns-port')?.value) || 53,
|
||||
UpstreamServers: document.getElementById('dns-upstream-servers')?.value.split(',').map(s => s.trim()).filter(Boolean) || [],
|
||||
Timeout: parseInt(document.getElementById('dns-timeout')?.value) || 5,
|
||||
StatsFile: document.getElementById('dns-stats-file')?.value || './stats.json',
|
||||
StatsFile: document.getElementById('dns-stats-file')?.value || './data/stats.json',
|
||||
SaveInterval: parseInt(document.getElementById('dns-save-interval')?.value) || 300
|
||||
},
|
||||
HTTPServer: {
|
||||
Port: parseInt(document.getElementById('http-port')?.value) || 8080,
|
||||
Host: document.getElementById('http-host')?.value || '0.0.0.0',
|
||||
APIEnabled: document.getElementById('http-api-enabled')?.checked !== false
|
||||
Port: parseInt(document.getElementById('http-port')?.value) || 8080
|
||||
},
|
||||
Shield: {
|
||||
LocalRulesFile: document.getElementById('shield-local-rules-file')?.value || './rules.txt',
|
||||
RemoteRulesURLs: document.getElementById('shield-remote-rules-urls')?.value.split('\n').map(s => s.trim()).filter(Boolean) || [],
|
||||
LocalRulesFile: document.getElementById('shield-local-rules-file')?.value || './data/rules.txt',
|
||||
UpdateInterval: parseInt(document.getElementById('shield-update-interval')?.value) || 3600,
|
||||
HostsFile: document.getElementById('shield-hosts-file')?.value || '/etc/hosts',
|
||||
HostsFile: document.getElementById('shield-hosts-file')?.value || './data/hosts.txt',
|
||||
BlockMethod: document.getElementById('shield-block-method')?.value || '0.0.0.0'
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user