mirror of https://github.com/ospab/ostp.git
fix(gui): remove tun stack selection, default to ostp; fix(flutter): add missing ic_launcher_background.xml for icon build
This commit is contained in:
parent
6c2417232a
commit
61aa883cbc
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#fff</color>
|
||||
</resources>
|
||||
|
|
@ -257,13 +257,6 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field-group" id="group-tun-stack">
|
||||
<label class="field-label" for="in-tun-stack" data-i18n="label_tun_stack">TUN Stack</label>
|
||||
<select id="in-tun-stack" class="field-input">
|
||||
<option value="system">System (tun2socks)</option>
|
||||
<option value="ostp">OSTP (Native)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="toggle-row">
|
||||
<div class="toggle-text">
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ const inPbk = $('in-pbk');
|
|||
const inSid = $('in-sid');
|
||||
const inMtu = $('in-mtu');
|
||||
const inTun = $('in-tun-mode');
|
||||
const inTunStack = $('in-tun-stack');
|
||||
const groupTunStack = $('group-tun-stack');
|
||||
const inMux = $('in-mux-mode');
|
||||
const inMuxSessions = $('in-mux-sessions');
|
||||
const inDebug = $('in-debug');
|
||||
|
|
@ -245,13 +243,10 @@ async function loadConfigIntoForm() {
|
|||
inPbk.value = c.reality?.pbk || '';
|
||||
inSid.value = c.reality?.sid || '';
|
||||
inMtu.value = c.mtu || '';
|
||||
inTun.checked = !!c.tun?.enable;
|
||||
inTunStack.value = c.tun?.stack || 'system';
|
||||
inTun.checked = !!c.tun?.enabled;
|
||||
inMux.checked = !!c.mux?.enabled;
|
||||
inMuxSessions.value = c.mux?.sessions || '';
|
||||
|
||||
groupTunStack.style.display = inTun.checked ? 'block' : 'none';
|
||||
|
||||
// owndns: detect if saved dns is 10.1.0.1
|
||||
const savedDns = c.tun?.dns || '';
|
||||
const isOwndns = savedDns === '10.1.0.1';
|
||||
|
|
@ -322,13 +317,11 @@ async function handleSave(silent = false) {
|
|||
delete rawConfig.mux;
|
||||
}
|
||||
|
||||
if (!rawConfig.tun) {
|
||||
rawConfig.tun = { wintun_path: './wintun.dll', ipv4_address: '10.1.0.2/24' };
|
||||
}
|
||||
rawConfig.tun = rawConfig.tun || {};
|
||||
rawConfig.tun.enable = inTun.checked;
|
||||
rawConfig.tun.stack = 'ostp';
|
||||
// owndns: if toggle is on, always write 10.1.0.1; otherwise use the custom field
|
||||
rawConfig.tun.dns = inOwndns.checked ? '10.1.0.1' : (inDns.value.trim() || null);
|
||||
rawConfig.tun.stack = inTunStack.value;
|
||||
|
||||
rawConfig.exclude = {
|
||||
domains: splitLines(inDomains.value),
|
||||
|
|
@ -479,7 +472,6 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|||
updateDnsVisibility();
|
||||
scheduleAutoSave();
|
||||
});
|
||||
inTun.addEventListener('change', () => { groupTunStack.style.display = inTun.checked ? 'block' : 'none'; });
|
||||
importInput.addEventListener('keydown', e => { if (e.key === 'Enter') handleImport(); });
|
||||
|
||||
// Auto-save wiring
|
||||
|
|
|
|||
Loading…
Reference in New Issue