mirror of https://github.com/ospab/ostp.git
Add 'Use Built-in' DNS button in GUI
This commit is contained in:
parent
0334322aae
commit
cb797c42d0
|
|
@ -174,7 +174,10 @@
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<label class="field-label" for="in-dns" data-i18n="label_dns">DNS Server</label>
|
<label class="field-label" for="in-dns" data-i18n="label_dns">DNS Server</label>
|
||||||
<input id="in-dns" class="field-input" type="text" placeholder="1.1.1.1" />
|
<div style="display: flex; gap: 8px;">
|
||||||
|
<input id="in-dns" class="field-input" type="text" placeholder="1.1.1.1" style="flex: 1;" />
|
||||||
|
<button id="btn-use-builtin-dns" class="btn" style="padding: 0 12px; white-space: nowrap; cursor: pointer;" data-i18n="btn_use_builtin_dns">Use Built-in</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
|
|
|
||||||
|
|
@ -381,6 +381,14 @@ window.addEventListener('DOMContentLoaded', async () => {
|
||||||
btnBack.addEventListener('click', () => showScreen('home'));
|
btnBack.addEventListener('click', () => showScreen('home'));
|
||||||
btnImport.addEventListener('click', handleImport);
|
btnImport.addEventListener('click', handleImport);
|
||||||
btnPeekKey.addEventListener('click', togglePeek);
|
btnPeekKey.addEventListener('click', togglePeek);
|
||||||
|
const btnUseBuiltinDns = $('btn-use-builtin-dns');
|
||||||
|
if (btnUseBuiltinDns) {
|
||||||
|
btnUseBuiltinDns.addEventListener('click', () => {
|
||||||
|
inDns.value = '10.1.0.1';
|
||||||
|
saveConfig();
|
||||||
|
showToast('DNS set to built-in server (10.1.0.1)', 'success');
|
||||||
|
});
|
||||||
|
}
|
||||||
inTun.addEventListener('change', () => { groupTunStack.style.display = inTun.checked ? 'block' : 'none'; });
|
inTun.addEventListener('change', () => { groupTunStack.style.display = inTun.checked ? 'block' : 'none'; });
|
||||||
importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); });
|
importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); });
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue