Archived
1.0.6 - interfejs mobilny i potwierdzenie
Wydanie WGTools-Extended / release (push) Successful in 9s
Wydanie WGTools-Extended / release (push) Successful in 9s
This commit is contained in:
1 parent
f4929c7cac
commit
97f73a6277
8 files changed
+49
-10
No files matched your search
@@ -427,3 +427,28 @@ html[data-theme="light"] .topbar-theme-icon .theme-icon-moon{display:block}
|
||||
.sidebar-collapse-button.is-collapsed svg{transform:scaleX(-1)}
|
||||
html.sidebar-pref-collapsed .sidebar-collapse-caption,body.sidebar-collapsed .sidebar-collapse-caption{display:none}
|
||||
@media(max-width:760px){.sidebar-collapse-caption{display:none}.topbar-audit-toggle{width:29px;height:29px;flex-basis:29px}}
|
||||
|
||||
/* Przekierowania: czytelne pola i potwierdzenie użytkownika. */
|
||||
.forward-restrict{margin-top:18px;min-height:32px}
|
||||
.forward-section-title{margin:26px 0 10px;font-size:15px}
|
||||
.forward-warning{margin-top:14px;padding:15px 17px;border-left:4px solid #e88732;border-radius:4px;background:#80431b;color:#fff;line-height:1.55;font-size:13px}
|
||||
.forward-warning b{font-size:14px}.forward-warning p{margin:10px 0 0}
|
||||
.forward-confirmation-example{margin-top:12px;padding:14px 15px;border:1px solid var(--border);border-radius:5px;background:var(--panel-2);color:var(--muted);font-size:13px;line-height:1.55;user-select:none;-webkit-user-select:none;overflow-wrap:anywhere}
|
||||
.forward-confirmation-input{margin-bottom:18px}.forward-confirmation-input textarea{min-height:76px;resize:vertical;font:inherit;font-size:14px;line-height:1.5}
|
||||
#extended-forward-form>.btn{margin-top:16px}
|
||||
#extended-forward-list{border-top:1px solid var(--border)}
|
||||
@media(max-width:760px){
|
||||
html.sidebar-pref-collapsed body,body,body.sidebar-collapsed{padding-left:0;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
|
||||
.sidebar,html.sidebar-pref-collapsed .sidebar,body.sidebar-collapsed .sidebar{position:fixed;top:auto;right:0;bottom:0;width:100%;height:auto;transform:none;overflow:visible;border-right:0;border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom);z-index:25}
|
||||
.sidebar nav{display:flex;padding:0;width:100%}
|
||||
.sidebar .nav-item,html.sidebar-pref-collapsed .nav-item,body.sidebar-collapsed .nav-item{flex:1;min-width:0;height:64px;display:flex;flex-direction:column;justify-content:center;gap:3px;padding:5px 2px;border-left:0;border-top:2px solid transparent;font-size:10px}
|
||||
.sidebar .nav-item.active{border-top-color:var(--accent);background:#313942}
|
||||
.sidebar .nav-label,html.sidebar-pref-collapsed .nav-label,body.sidebar-collapsed .nav-label{display:block;opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
|
||||
.sidebar-bottom{display:none}.topbar{padding:0 12px;gap:8px}.brand{gap:7px;min-width:0}.brand-title{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand-mark{width:32px;height:32px;flex:0 0 32px}
|
||||
.topbar-right{gap:5px;min-width:0}.interface-switcher-wrap{min-width:0}.interface-switcher-button.top-status{max-width:130px}.user-chip{padding-left:5px}.content{padding:16px 12px}.page-head h1{font-size:22px}
|
||||
.card-head{align-items:flex-start;flex-wrap:wrap}.card-head>*{min-width:0}.settings-tabs,.server-editor-tabs,.client-editor-tabs{max-width:100%;overflow-x:auto}
|
||||
.modal-backdrop{padding:10px;align-items:center}.modal-card{max-height:calc(100dvh - 20px)}.modal-actions{flex-wrap:wrap}.interface-manager-action{display:flex;flex-wrap:wrap}.interface-manager-row{grid-template-columns:13px minmax(0,1fr);align-items:start}.interface-manager-action{grid-column:2;justify-self:start}
|
||||
.setup-grid input,.setup-grid select,.field-block input,.field-block textarea{font-size:16px}.forward-warning{padding:13px 14px}.forward-confirmation-input textarea{font-size:16px}
|
||||
.group-row,.group-row>div{min-width:0;overflow-wrap:anywhere}.group-row .action-row{flex-wrap:wrap}
|
||||
}
|
||||
@media(max-width:480px){.brand-title{display:none}.interface-switcher-button.top-status{max-width:112px}.topbar-right{gap:4px}.topbar-help{display:none}}
|
||||
@@ -1105,12 +1105,18 @@
|
||||
$('forward-service-confirmation').required=on;
|
||||
};
|
||||
$('forward-service-select').addEventListener('change',syncService);
|
||||
const reset=()=>{editing='';$('extended-forward-form').reset();$('extended-forward-restrict').checked=false;syncSources();$('extended-forward-submit').textContent='Dodaj przekierowanie';$('extended-forward-cancel').hidden=true;syncService();};
|
||||
const confirmation=$('forward-service-confirmation');
|
||||
const example=$('forward-confirmation-example');
|
||||
const validateConfirmation=()=>confirmation.setCustomValidity(confirmation.value && confirmation.value!==example.textContent?'Przepisz dokładnie podany tekst.':'');
|
||||
confirmation.addEventListener('input',validateConfirmation);
|
||||
['paste','drop'].forEach(name=>confirmation.addEventListener(name,e=>e.preventDefault()));
|
||||
['copy','cut','dragstart','contextmenu'].forEach(name=>example.addEventListener(name,e=>e.preventDefault()));
|
||||
const reset=()=>{editing='';$('extended-forward-form').reset();confirmation.setCustomValidity('');$('extended-forward-restrict').checked=false;syncSources();$('extended-forward-submit').textContent='Dodaj przekierowanie';$('extended-forward-cancel').hidden=true;syncService();};
|
||||
const syncSources=()=>{const enabled=$('extended-forward-restrict').checked;$('extended-forward-sources-wrap').hidden=!enabled;$('extended-forward-sources').required=enabled;};
|
||||
const loadForwards=async()=>{const r=await fetch(appUrl('/api/extended/forwardings'));const d=await r.json();if(!r.ok)throw new Error(d.error);forwards=d.forwards||[];servicePolicy=d.service_policy||servicePolicy;const sel=$('forward-service-select');sel.innerHTML='<option value="">Wybierz usługę</option>'+servicePolicy.services.map(x=>`<option value="${esc(x)}">${esc(x)}</option>`).join('')+(servicePolicy.mode==='combo'?'<option value="__other__">Inna</option>':'');syncService();const current=$('extended-forward-public').value;$('extended-forward-public').innerHTML=(d.addresses||[]).map(ip=>`<option value="${esc(ip)}">${esc(ip)}</option>`).join('');if((d.addresses||[]).includes(current))$('extended-forward-public').value=current;$('extended-forward-list').innerHTML=forwards.map(f=>`<div class="group-row"><div><span>${esc(f.public_ip)}:${Number(f.public_port)} / ${esc(f.protocol)} → ${esc(f.target_ip)}:${Number(f.target_port)}</span><p>${f.allowed_sources?.length?'Dozwolone adresy: '+esc(f.allowed_sources.join(', ')):'Dostęp ze wszystkich adresów'}</p></div><div class="action-row"><button class="btn small" type="button" data-ext-forward-edit="${esc(f.id)}">Edytuj</button><button class="btn small danger" type="button" data-ext-forward-delete="${esc(f.id)}">Usuń</button></div></div>`).join('')||'<p>Brak przekierowań.</p>';};
|
||||
$('extended-forward-restrict').addEventListener('change',syncSources);$('extended-forward-cancel').addEventListener('click',reset);
|
||||
$('extended-forward-form').addEventListener('submit',async e=>{e.preventDefault();const restricted=$('extended-forward-restrict').checked;const payload={public_ip:$('extended-forward-public').value,public_port:Number($('extended-forward-public-port').value),target_ip:$('extended-forward-target').value,target_port:Number($('extended-forward-target-port').value),protocol:$('extended-forward-protocol').value,service:servicePolicy.enabled?(servicePolicy.mode==='custom'||$('forward-service-select').value==='__other__' ? $('forward-service-custom').value : $('forward-service-select').value):'',confirmation:servicePolicy.enabled?$('forward-service-confirmation').value:'',restrict_sources:restricted,allowed_sources:restricted?$('extended-forward-sources').value.split(',').map(x=>x.trim()).filter(Boolean):[]};if(editing)payload.id=editing;const button=$('extended-forward-submit');button.disabled=true;try{const r=await fetch(appUrl(editing?'/api/extended/forwardings/update':'/api/extended/forwardings'),{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(payload)});const d=await r.json();if(!r.ok)throw new Error(d.error);reset();await loadForwards();operationStatus('extended-forward-status','Zapisano przekierowanie.','success');}catch(err){operationStatus('extended-forward-status',err.message,'error');}finally{button.disabled=false;}});
|
||||
$('extended-forward-list').addEventListener('click',async e=>{const edit=e.target.closest('[data-ext-forward-edit]'),del=e.target.closest('[data-ext-forward-delete]');if(edit){const f=forwards.find(x=>x.id===edit.dataset.extForwardEdit);if(!f)return;editing=f.id;$('extended-forward-public').value=f.public_ip;$('extended-forward-public-port').value=f.public_port;$('extended-forward-target').value=f.target_ip;$('extended-forward-target-port').value=f.target_port;$('extended-forward-protocol').value=f.protocol;const custom=servicePolicy.mode==='custom'||!servicePolicy.services.includes(f.service);$('forward-service-select').value=custom?'__other__':(f.service||'');$('forward-service-custom').value=custom?(f.service||''):'';$('forward-service-confirmation').value='';syncService();$('extended-forward-restrict').checked=Boolean(f.allowed_sources?.length);$('extended-forward-sources').value=(f.allowed_sources||[]).join(', ');syncSources();$('extended-forward-submit').textContent='Zapisz zmiany';$('extended-forward-cancel').hidden=false;operationStatus('extended-forward-status','Edytujesz przekierowanie.','working');$('extended-forward-form').scrollIntoView({behavior:'smooth',block:'center'});return;}if(!del||!confirm('Usunąć przekierowanie?'))return;try{const r=await fetch(appUrl('/api/extended/forwardings/delete'),{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({id:del.dataset.extForwardDelete})});const d=await r.json();if(!r.ok)throw new Error(d.error);if(editing===del.dataset.extForwardDelete)reset();await loadForwards();}catch(err){operationStatus('extended-forward-status',err.message,'error');}});
|
||||
$('extended-forward-list').addEventListener('click',async e=>{const edit=e.target.closest('[data-ext-forward-edit]'),del=e.target.closest('[data-ext-forward-delete]');if(edit){const f=forwards.find(x=>x.id===edit.dataset.extForwardEdit);if(!f)return;editing=f.id;$('extended-forward-public').value=f.public_ip;$('extended-forward-public-port').value=f.public_port;$('extended-forward-target').value=f.target_ip;$('extended-forward-target-port').value=f.target_port;$('extended-forward-protocol').value=f.protocol;const custom=servicePolicy.mode==='custom'||!servicePolicy.services.includes(f.service);$('forward-service-select').value=custom?'__other__':(f.service||'');$('forward-service-custom').value=custom?(f.service||''):'';$('forward-service-confirmation').value='';confirmation.setCustomValidity('');syncService();$('extended-forward-restrict').checked=Boolean(f.allowed_sources?.length);$('extended-forward-sources').value=(f.allowed_sources||[]).join(', ');syncSources();$('extended-forward-submit').textContent='Zapisz zmiany';$('extended-forward-cancel').hidden=false;operationStatus('extended-forward-status','Edytujesz przekierowanie.','working');$('extended-forward-form').scrollIntoView({behavior:'smooth',block:'center'});return;}if(!del||!confirm('Usunąć przekierowanie?'))return;try{const r=await fetch(appUrl('/api/extended/forwardings/delete'),{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({id:del.dataset.extForwardDelete})});const d=await r.json();if(!r.ok)throw new Error(d.error);if(editing===del.dataset.extForwardDelete)reset();await loadForwards();}catch(err){operationStatus('extended-forward-status',err.message,'error');}});
|
||||
loadForwards().catch(err=>operationStatus('extended-forward-status',err.message,'error'));
|
||||
}
|
||||
if(page==='server' && $('extended-listen-form')){
|
||||
|
||||
@@ -21,16 +21,19 @@
|
||||
<label><span>Port klienta</span><input id="extended-forward-target-port" type="number" min="1" max="65535" required></label>
|
||||
<label><span>Protokół</span><select id="extended-forward-protocol"><option value="tcp">TCP</option><option value="udp">UDP</option><option value="both">TCP i UDP</option></select></label>
|
||||
</div>
|
||||
<label class="check-label"><input id="extended-forward-restrict" type="checkbox"><span>Ogranicz dostęp do wybranych adresów IP</span></label>
|
||||
<label class="check-label forward-restrict"><input id="extended-forward-restrict" type="checkbox"><span>Ogranicz dostęp do wybranych adresów IP</span></label>
|
||||
<label id="extended-forward-sources-wrap" class="field-block" hidden><span>Dozwolone adresy IPv4, oddzielone przecinkami</span><input id="extended-forward-sources" placeholder="89.144.32.110, 89.144.32.172"><small>Pozostałe adresy nie uzyskają dostępu do tego przekierowania.</small></label>
|
||||
<div id="forward-service-section" hidden>
|
||||
<div class="inline-note warn-note"><b>Co udostępniasz publicznie?</b><p>Opisz oprogramowanie lub serwer gry, który udostępniasz. Nie wpisuj „test” ani przypadkowych znaków. Może to spowodować wyłączenie tunelu lub zablokowanie konta.</p></div>
|
||||
<h3 class="forward-section-title">Opis usługi</h3>
|
||||
<div class="setup-grid section-space-small">
|
||||
<label id="forward-service-select-wrap"><span>Opis usługi (wymagane)</span><select id="forward-service-select"></select><small>Wybierz usługę z listy lub, jeśli dostępna, opcję „Inna”.</small></label>
|
||||
<label id="forward-service-custom-wrap"><span>Nazwa usługi (wymagane)</span><input id="forward-service-custom" maxlength="120" placeholder="Np. serwer gry"></label>
|
||||
</div>
|
||||
<div class="inline-note warn-note"><b>Korzystaj odpowiedzialnie</b><p>{{ branding.name or 'Panel' }}: usług nie wolno używać do złośliwego oprogramowania, phishingu, spamu, nieuprawnionego dostępu ani innych zabronionych działań. Niektóre programy są zabronione niezależnie od intencji, także w celach edukacyjnych lub badawczych.</p><p>Naruszenia skutkują trwałym zawieszeniem konta i utratą prawa do zwrotu. Aby kontynuować, wpisz dokładnie:</p><strong>Nie będę używać tego tunelu do złośliwego oprogramowania, nadużyć ani niedozwolonych usług.</strong></div>
|
||||
<label class="field-block"><span>Potwierdzenie odpowiedzialności (wymagane)</span><input id="forward-service-confirmation" maxlength="200" autocomplete="off"></label>
|
||||
<div class="forward-warning"><b>Co udostępniasz publicznie?</b><p>Opisz oprogramowanie lub serwer gry, który udostępniasz.</p><p>Nie wpisuj „test” ani przypadkowych znaków. Może to spowodować wyłączenie tunelu lub zablokowanie konta.</p></div>
|
||||
<h3 class="forward-section-title">Potwierdzenie odpowiedzialności</h3>
|
||||
<div class="forward-warning"><b>Korzystaj odpowiedzialnie</b><p>{{ branding.name or 'Panel' }}: usług nie wolno używać do złośliwego oprogramowania, phishingu, spamu, nieuprawnionego dostępu ani innych zabronionych działań. Niektóre programy są zabronione niezależnie od intencji, także w celach edukacyjnych lub badawczych.</p><p>Naruszenia skutkują trwałym zawieszeniem konta i utratą prawa do zwrotu.</p><p>Aby kontynuować, przepisz dokładnie poniższe potwierdzenie.</p></div>
|
||||
<div class="forward-confirmation-example" id="forward-confirmation-example">Nie będę używać tego tunelu do złośliwego oprogramowania, nadużyć ani niedozwolonych usług.</div>
|
||||
<label class="field-block forward-confirmation-input"><span>Przepisz potwierdzenie (wymagane)</span><textarea id="forward-service-confirmation" maxlength="200" rows="3" autocomplete="off" spellcheck="false" placeholder="Wpisz tekst widoczny powyżej"></textarea></label>
|
||||
</div>
|
||||
<button class="btn primary" type="submit" id="extended-forward-submit">Dodaj przekierowanie</button>
|
||||
<button class="btn" type="button" id="extended-forward-cancel" hidden>Anuluj edycję</button>
|
||||
|
||||
Reference in new issue
Block a user