mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-13 20:08:05 +08:00
51 lines
1.5 KiB
JavaScript
51 lines
1.5 KiB
JavaScript
'use strict';
|
|
/* SPDX-License-Identifier: Apache-2.0 */
|
|
/* Copyright 2025-2026 Lucas Albers <lucas.b.albers@gmail.com> */
|
|
'require baseclass';
|
|
|
|
/**
|
|
* Shared view constants for luci-app-fwlive.
|
|
* LuCI modules must return baseclass.extend(...) — plain objects fail Class.isSubclass.
|
|
*/
|
|
return baseclass.extend({
|
|
/* Keep in sync with openwrt-feed/luci-app-fwlive/Makefile PKG_VERSION. */
|
|
APP_VERSION: '0.1.41',
|
|
ROW_LIMIT_OPTIONS: [25, 50, 100, 250, 500, 1000, 2000],
|
|
DEFAULT_ROW_LIMIT: 100,
|
|
/* Row pass/deny tint: classic green/red default; accessible teal/orange */
|
|
ROW_TINT_OPTIONS: ['off', 'classic', 'accessible'],
|
|
DEFAULT_ROW_TINT: 'classic',
|
|
FETCH_LINES_MAX: 2000 /* ubus poll / logd ring cap (~2000 lines ≈ typical ring) */,
|
|
/* DOM budget: ~250 new/updated rows painted per second on typical LuCI routers */
|
|
RENDER_CAP_PER_SEC: 250,
|
|
/* Sustained 4x-throttled evidence keeps this cap within the frame/task budget. */
|
|
WEAK_DEVICE_DISPLAY_ROW_CAP: 250,
|
|
/* Layer 2 — measured client RTT → poll cadence (seconds). */
|
|
POLL_CADENCE_FAST_S: 1,
|
|
POLL_CADENCE_MID_S: 2,
|
|
POLL_CADENCE_SLOW_S: 5,
|
|
POLL_RTT_FAST_MS: 300,
|
|
POLL_RTT_SLOW_MS: 1500,
|
|
POLL_RTT_STREAK: 3,
|
|
VIEW_MODES: ['simple', 'detailed'],
|
|
COLUMN_SETS: {
|
|
simple: ['action', 'time', 'iface', 'flow', 'proto', 'rule'],
|
|
detailed: [
|
|
'time',
|
|
'action',
|
|
'rule',
|
|
'iface_in',
|
|
'iface_out',
|
|
'dir',
|
|
'proto',
|
|
'src',
|
|
'sport',
|
|
'dst',
|
|
'dport',
|
|
'flags',
|
|
'len',
|
|
'message'
|
|
]
|
|
}
|
|
});
|