修复出口显示问题

This commit is contained in:
本间白猫 committed 2026-10-05 18:47:24 +08:00
1 parent 86609fccfb
commit b45228188f
4 files changed
+12 -11

No files matched your search

+3 -5
View File
@@ -1585,8 +1585,6 @@ class AsyncProxyServer:
return rotated
async def _replace_soonest(self) -> bool:
if not self._expiry_enabled():
return False
roster = self._workers.roster
if not roster:
return False
@@ -1594,7 +1592,7 @@ class AsyncProxyServer:
return await self._replace_exit(soonest)
async def _maintain_exit_pool(self, force_fetch=False, rotate=False,
max_fill=None) -> MaintenanceOutcome:
max_fill=None, force_rotate=False) -> MaintenanceOutcome:
async with self._refill_lock:
filled = await self._fill_from_standby(max_fill)
@@ -1608,7 +1606,7 @@ class AsyncProxyServer:
fetched = False
gained = 0
if ((deficient or (rotate and expired))
if ((deficient or force_rotate or (rotate and expired))
and (force_fetch or self._fetch_allowed(current_time))):
self.last_switch_attempt = current_time
result = await self._fetch_into_standby()
@@ -3367,7 +3365,7 @@ class AsyncProxyServer:
return {'cooldown': remaining}
self._standby.clear()
await self._maintain_exit_pool(force_fetch=True)
await self._maintain_exit_pool(force_fetch=True, force_rotate=True)
async with self._refill_lock:
await self._replace_soonest()
return bool(self.proxies)
+1
View File
@@ -417,6 +417,7 @@ body[data-tab="tab-pool"] .sb-sub { display: flex; }
.exit-row .exit-load { color: var(--text-soft); flex-shrink: 0; min-width: 54px; text-align: right; }
.exit-row .exit-left { color: var(--text-soft); flex-shrink: 0; min-width: 52px; text-align: right; }
.exit-head { color: var(--text-faint); font-weight: 650; }
.exit-empty { color: var(--text-faint); justify-content: center; padding: 8px 0; }
.exit-flag { color: var(--warn-text); font-size: 11px; flex-shrink: 0; }
.exit-fails {
flex-shrink: 0; font-size: 10px; font-weight: 700; line-height: 1.6;
+6 -4
View File
@@ -665,7 +665,11 @@ function _sinceText(iso) {
function renderExitRows(exits, cm) {
var $list = $('#exit-list'), $rows = $('#exit-rows');
if (!exits || !exits.length) { $rows.empty(); $list.hide(); return; }
if (!exits || !exits.length) {
$rows.html('<div class="exit-row exit-empty">' + escapeHtml(T().exit_no_data) + '</div>');
$list.show();
return;
}
$rows.html(exits.map(function (e) {
var load = e.capacity > 0
? escapeHtml(e.active) + '/' + escapeHtml(e.capacity)
@@ -711,10 +715,8 @@ function updateStatusAndGauge() {
var exitList = d.active_proxies || [];
var exitText = fillTemplate(
d.elastic_active ? T().upstream_exits_expanding : T().upstream_exits, exitList.length);
if (exitList.length > 1) $('#tag-exits').show().text(exitText);
else $('#tag-exits').hide();
$('#tag-exits').show().text(exitText);
renderExitRows(exitList, cm);
if (!exitList.length) closeExitPop();
if (cm === 'per_request') { $('#tag-interval').text(T().pool_per_request_swap); $('#tip-zero').show(); }
else if (cm === 'request_count') { $('#tag-interval').text((parseInt(d.request_interval) || 0) + ' ' + T().times); $('#tip-zero').hide(); }
else { $('#tag-interval').text(iv + T().seconds); $('#tip-zero').hide(); }
+2 -2
View File
@@ -400,7 +400,7 @@ var translations = {
'exit_served': '已服务 {} 次', 'exit_failures': '失败 {} 次', 'exit_suspect': '连续失败,即将被替换',
'source_error_ago': '({}前)',
'exit_load_unlimited': '{}/不限', 'pool_rotate_waiting': '待请求更换',
'pool_waiting_exits': '等待补货',
'pool_waiting_exits': '等待补货', 'exit_no_data': '暂无出口',
'pool_tab': '代理池', 'pool_config_tab': '池设置',
'pool_stat_total': '代理总数', 'pool_stat_valid': '有效代理',
@@ -838,7 +838,7 @@ var translations = {
'exit_served': '{} requests served', 'exit_failures': '{} failures', 'exit_suspect': 'Failing repeatedly, about to be replaced',
'source_error_ago': ' ({} ago)',
'exit_load_unlimited': '{}/unlimited', 'pool_rotate_waiting': 'on next request',
'pool_waiting_exits': 'awaiting exits',
'pool_waiting_exits': 'awaiting exits', 'exit_no_data': 'No exits',
'pool_tab': 'Proxy Pool', 'pool_config_tab': 'Pool Settings',
'pool_stat_total': 'Total', 'pool_stat_valid': 'Valid',