secubox-openwrt/package/secubox/luci-app-bandwidth-manager/htdocs/luci-static/resources/view/bandwidth-manager/settings.js
CyberMind-FR 31a87c5d7a feat(structure): reorganize luci-app packages into package/secubox/ + appstore migration
Major structural reorganization and feature additions:

## Folder Reorganization
- Move 17 luci-app-* packages to package/secubox/ (except luci-app-secubox core hub)
- Update all tooling to support new structure:
  - secubox-tools/quick-deploy.sh: search both locations
  - secubox-tools/validate-modules.sh: validate both directories
  - secubox-tools/fix-permissions.sh: fix permissions in both locations
  - .github/workflows/test-validate.yml: build from both paths
- Update README.md links to new package/secubox/ paths

## AppStore Migration (Complete)
- Add catalog entries for all remaining luci-app packages:
  - network-tweaks.json: Network optimization tools
  - secubox-bonus.json: Documentation & demos hub
- Total: 24 apps in AppStore catalog (22 existing + 2 new)
- New category: 'documentation' for docs/demos/tutorials

## VHost Manager v2.0 Enhancements
- Add profile activation system for Internal Services and Redirects
- Implement createVHost() API wrapper for template-based deployment
- Fix Virtual Hosts view rendering with proper LuCI patterns
- Fix RPCD backend shell script errors (remove invalid local declarations)
- Extend backend validation for nginx return directives (redirect support)
- Add section_id parameter for named VHost profiles
- Add Remove button to Redirects page for feature parity
- Update README to v2.0 with comprehensive feature documentation

## Network Tweaks Dashboard
- Close button added to component details modal

Files changed: 340+ (336 renames with preserved git history)
Packages affected: 19 luci-app, 2 secubox-app, 1 theme, 4 tools

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 14:59:38 +01:00

116 lines
3.6 KiB
JavaScript

'use strict';
'require view';
'require secubox-theme/theme as Theme';
'require form';
'require network';
return L.view.extend({
load: function() {
return network.getDevices();
},
render: function(devices) {
var m = new form.Map('bandwidth', _('Bandwidth Manager Settings'),
_('Global settings and SQM/CAKE configuration'));
var s = m.section(form.NamedSection, 'global', 'global', _('Global Settings'));
s.anonymous = false;
s.addremove = false;
var o;
o = s.option(form.Flag, 'enabled', _('Enable Bandwidth Manager'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.ListValue, 'interface', _('Interface'));
devices.forEach(function(dev) {
var name = dev.getName();
o.value(name, name);
});
o.default = 'br-lan';
o.rmempty = false;
o = s.option(form.Flag, 'sqm_enabled', _('Enable SQM'));
o.description = _('Smart Queue Management with CAKE qdisc');
o.default = o.disabled;
// SQM Configuration
var sqm = m.section(form.NamedSection, 'sqm', 'sqm', _('SQM/CAKE Configuration'));
sqm.anonymous = false;
sqm.addremove = false;
o = sqm.option(form.Value, 'download_speed', _('Download Speed (kbit/s)'));
o.datatype = 'uinteger';
o.placeholder = '100000';
o.description = _('Your internet download speed in kbit/s');
o.depends('global.sqm_enabled', '1');
o = sqm.option(form.Value, 'upload_speed', _('Upload Speed (kbit/s)'));
o.datatype = 'uinteger';
o.placeholder = '50000';
o.description = _('Your internet upload speed in kbit/s');
o.depends('global.sqm_enabled', '1');
o = sqm.option(form.ListValue, 'qdisc', _('Queue Discipline'));
o.value('cake', 'CAKE (Recommended)');
o.value('fq_codel', 'FQ_CoDel');
o.value('htb', 'HTB');
o.default = 'cake';
o.depends('global.sqm_enabled', '1');
o = sqm.option(form.Flag, 'nat', _('NAT Mode'));
o.description = _('Enable if router performs NAT');
o.default = o.enabled;
o.depends('global.sqm_enabled', '1');
o = sqm.option(form.ListValue, 'overhead', _('Link Overhead'));
o.value('0', _('None'));
o.value('18', 'Ethernet (18 bytes)');
o.value('22', 'PPPoE (22 bytes)');
o.value('40', 'VLAN + PPPoE (40 bytes)');
o.default = '0';
o.depends('global.sqm_enabled', '1');
// Traffic Tracking
var tracking = m.section(form.NamedSection, 'tracking', 'tracking', _('Traffic Tracking'));
tracking.anonymous = false;
tracking.addremove = false;
o = tracking.option(form.Flag, 'iptables_tracking', _('Enable iptables Tracking'));
o.description = _('Track per-client bandwidth usage with iptables counters');
o.default = o.enabled;
o = tracking.option(form.Value, 'history_retention', _('History Retention (days)'));
o.datatype = 'range(1,90)';
o.default = '30';
o.description = _('How long to keep usage history');
// Alerts
var alerts = m.section(form.NamedSection, 'alerts', 'alerts', _('Alert Settings'));
alerts.anonymous = false;
alerts.addremove = false;
o = alerts.option(form.Flag, 'enabled', _('Enable Alerts'));
o.default = o.disabled;
o = alerts.option(form.Value, 'quota_threshold', _('Quota Alert Threshold (%)'));
o.datatype = 'range(50,100)';
o.default = '90';
o.description = _('Send alert when quota usage exceeds this percentage');
o.depends('enabled', '1');
o = alerts.option(form.Value, 'email', _('Alert Email'));
o.datatype = 'email';
o.placeholder = 'admin@example.com';
o.depends('enabled', '1');
return m.render().then(function(rendered) {
return E('div', {}, [
E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox-theme/secubox-theme.css') }),
rendered
]);
});
}
});