feat: 1.4.6 unban from the UI, operator allows, day-counter fallback for long windows
Release / Publish tags (push) Successful in 16s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 23s
CI / Format and vet (push) Successful in 27s
CI / Tests (Linux, race detector) (push) Successful in 1m20s
CI / Dependency audit (push) Successful in 31s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 16s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 23s
CI / Format and vet (push) Successful in 27s
CI / Tests (Linux, race detector) (push) Successful in 1m20s
CI / Dependency audit (push) Successful in 31s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ef5a0ce9f
commit
da333d70f1
25 files changed
+841
-33
No files matched your search
@@ -94,6 +94,16 @@
|
||||
'df.en.act.ban': 'Blocked',
|
||||
'df.en.act.would_ban': 'Would block',
|
||||
'df.en.act.skip': 'Not blocked',
|
||||
'df.en.act.unban': 'Unbanned',
|
||||
'df.en.skip.operator_allow': 'Released by you',
|
||||
'df.en.allows': 'Operator releases',
|
||||
'df.en.allows.hint': 'Addresses you unbanned and asked not to block again for a while. The system will not block them until the time ends.',
|
||||
'df.en.allows.none': 'No active releases.',
|
||||
'df.en.allows.until': 'Until',
|
||||
'df.en.allows.end': 'End release',
|
||||
'df.en.allows.ended': 'Release ended',
|
||||
'df.en.allows.err': 'Could not end the release.',
|
||||
'df.en.allows.unwritable': 'The unban file is not writable, so unbanning will fail.',
|
||||
'df.en.src.local': 'this server',
|
||||
'df.en.src.peer': 'peer {n}',
|
||||
'df.en.skip.trusted': 'Trusted address (your own list)',
|
||||
@@ -200,6 +210,16 @@
|
||||
'df.en.act.ban': 'Bloqueado',
|
||||
'df.en.act.would_ban': 'Bloquearia',
|
||||
'df.en.act.skip': 'Não bloqueado',
|
||||
'df.en.act.unban': 'Desbanido',
|
||||
'df.en.skip.operator_allow': 'Liberado por você',
|
||||
'df.en.allows': 'Liberações do operador',
|
||||
'df.en.allows.hint': 'Endereços que você desbaniu e pediu para não bloquear de novo por um tempo. O sistema não os bloqueia até o prazo acabar.',
|
||||
'df.en.allows.none': 'Nenhuma liberação ativa.',
|
||||
'df.en.allows.until': 'Até',
|
||||
'df.en.allows.end': 'Encerrar',
|
||||
'df.en.allows.ended': 'Liberação encerrada',
|
||||
'df.en.allows.err': 'Não foi possível encerrar a liberação.',
|
||||
'df.en.allows.unwritable': 'O arquivo de desban não é gravável, então desbanir vai falhar.',
|
||||
'df.en.src.local': 'este servidor',
|
||||
'df.en.src.peer': 'parceiro {n}',
|
||||
'df.en.skip.trusted': 'Endereço confiável (sua própria lista)',
|
||||
@@ -387,7 +407,7 @@
|
||||
k(U.ui.metric(t('df.en.c.already'), nf(cn.already_blocked || 0)));
|
||||
np.body.appendChild(kp);
|
||||
var skl = el('ul', { class: 'df-skips' });
|
||||
['trusted', 'private', 'crawler', 'legit_visitor', 'peer'].forEach(function (key) {
|
||||
['trusted', 'private', 'crawler', 'legit_visitor', 'peer', 'operator_allow'].forEach(function (key) {
|
||||
if (!sk[key]) return;
|
||||
skl.appendChild(el('li', null, el('span', { class: 'num' }, nf(sk[key])), ' ' + t('df.en.skip.' + key)));
|
||||
});
|
||||
@@ -401,8 +421,9 @@
|
||||
var cols = [{ label: t('df.en.col.time') }, { label: t('df.en.col.ip'), cls: 'mono' }, { label: t('df.en.col.cc') }, { label: t('df.en.col.reason') },
|
||||
{ label: t('df.en.col.score'), cls: 'num' }, { label: t('df.en.col.ttl'), cls: 'num' }, { label: t('df.en.col.action') }, { label: t('df.en.col.src') }];
|
||||
rp.body.appendChild(tbl(cols, rec.map(function (r) {
|
||||
var act = /^(ban|would_ban|skip)$/.test(r.action) ? r.action : 'skip';
|
||||
var act = /^(ban|would_ban|skip|unban)$/.test(r.action) ? r.action : 'skip';
|
||||
var actNode = el('span', { class: 'df-act' }, U.ui.badge(t('df.en.act.' + act), act === 'ban' ? 'ok' : act === 'would_ban' ? 'warn' : 'neutral'));
|
||||
if (act === 'ban') actNode.appendChild(el('button', { type: 'button', class: 'btn btn-sm df-unban', onclick: function () { U.unbanDialog(r.ip, loadEnforce); } }, t('unban.btn')));
|
||||
if (act === 'skip' && r.skip_reason) {
|
||||
var sk2 = 'df.en.skip.' + r.skip_reason;
|
||||
actNode.appendChild(el('small', { class: 'df-skipwhy' }, t(sk2) !== sk2 ? t(sk2) : r.skip_reason));
|
||||
@@ -414,6 +435,20 @@
|
||||
})));
|
||||
}
|
||||
grid.appendChild(rp);
|
||||
var ap = U.ui.panel({ title: t('df.en.allows'), hint: t('df.en.allows.hint'), cls: 'span-12', variant: 'list' });
|
||||
var als = e.allows || [];
|
||||
if (e.unban_log_writable === false) ap.body.appendChild(el('p', { class: 'state-warn' }, t('df.en.allows.unwritable')));
|
||||
if (!als.length) ap.body.appendChild(U.ui.empty(t('df.en.allows.none')));
|
||||
else {
|
||||
ap.body.appendChild(tbl([{ label: t('df.en.col.ip'), cls: 'mono' }, { label: t('df.en.allows.until') }, { label: '' }], als.map(function (a) {
|
||||
return [el('a', { href: U.href('ip', [a.ip]) }, a.ip), U.fmt.date ? U.fmt.date(a.until) : String(a.until),
|
||||
el('button', { type: 'button', class: 'btn btn-sm', onclick: function () {
|
||||
U.apiSend('DELETE', '/api/v1/enforce/allow?ip=' + encodeURIComponent(a.ip)).then(function () { U.toast(t('df.en.allows.ended')); loadEnforce(); },
|
||||
function () { U.toast(t('df.en.allows.err')); });
|
||||
} }, t('df.en.allows.end'))];
|
||||
})));
|
||||
}
|
||||
grid.appendChild(ap);
|
||||
enBox.appendChild(grid);
|
||||
}
|
||||
function loadEnforce() {
|
||||
|
||||
Reference in new issue
Block a user