mirror of https://github.com/ospab/ostp.git
Add 'Use Built-in' DNS button in GUI
This commit is contained in:
parent
2ac66bec42
commit
b7911aabf0
|
|
@ -174,7 +174,10 @@
|
|||
|
||||
<div class="field-group">
|
||||
<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 class="field-group">
|
||||
|
|
|
|||
|
|
@ -381,6 +381,14 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|||
btnBack.addEventListener('click', () => showScreen('home'));
|
||||
btnImport.addEventListener('click', handleImport);
|
||||
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'; });
|
||||
importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue