secubox-openwrt/package/secubox/luci-app-cdn-cache/htdocs/luci-static/resources/view/cdn-cache/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

149 lines
4.0 KiB
JavaScript

'use strict';
'require view';
'require form';
'require uci';
'require rpc';
'require cdn-cache/nav as CdnNav';
var callSetEnabled = rpc.declare({
object: 'luci.cdn-cache',
method: 'set_enabled',
params: ['enabled']
});
return view.extend({
load: function() {
return uci.load('cdn-cache');
},
render: function() {
var m, s, o;
m = new form.Map('cdn-cache', 'CDN Cache Settings',
'Configure the local CDN caching proxy to optimize bandwidth and accelerate content delivery.');
// Main settings
s = m.section(form.TypedSection, 'cdn_cache', 'General Settings');
s.anonymous = true;
o = s.option(form.Flag, 'enabled', 'Enable CDN Cache',
'Enable or disable the caching proxy service');
o.rmempty = false;
o = s.option(form.Value, 'cache_dir', 'Cache Directory',
'Directory where cached files are stored');
o.default = '/var/cache/cdn';
o.rmempty = false;
o = s.option(form.Value, 'cache_size', 'Maximum Cache Size (MB)',
'Maximum total size of the cache in megabytes');
o.datatype = 'uinteger';
o.default = '1024';
o.rmempty = false;
o = s.option(form.Value, 'max_object_size', 'Maximum Object Size (MB)',
'Maximum size of a single cached object');
o.datatype = 'uinteger';
o.default = '512';
o = s.option(form.Value, 'cache_valid', 'Default Cache Duration (minutes)',
'How long objects are considered fresh by default');
o.datatype = 'uinteger';
o.default = '1440';
o = s.option(form.Value, 'listen_port', 'Proxy Port',
'Port on which the proxy listens');
o.datatype = 'port';
o.default = '3128';
o = s.option(form.Flag, 'transparent', 'Transparent Proxy',
'Enable transparent proxying (requires firewall rules)');
o.default = '0';
o = s.option(form.ListValue, 'log_level', 'Log Level');
o.value('debug', 'Debug');
o.value('info', 'Info');
o.value('warn', 'Warning');
o.value('error', 'Error');
o.default = 'warn';
// Cache Policies
s = m.section(form.TableSection, 'cache_policy', 'Cache Policies',
'Define caching rules for specific domains and file types');
s.addremove = true;
s.anonymous = true;
s.sortable = true;
o = s.option(form.Flag, 'enabled', 'Enabled');
o.default = '1';
o.width = '10%';
o = s.option(form.Value, 'name', 'Name');
o.width = '15%';
o = s.option(form.Value, 'domains', 'Domains',
'Space-separated list of domains (* for all)');
o.width = '20%';
o = s.option(form.Value, 'extensions', 'Extensions',
'Space-separated file extensions to cache');
o.width = '20%';
o = s.option(form.Value, 'cache_time', 'Duration (min)');
o.datatype = 'uinteger';
o.default = '1440';
o.width = '12%';
o = s.option(form.Value, 'max_size', 'Max Size (MB)');
o.datatype = 'uinteger';
o.default = '512';
o.width = '12%';
o = s.option(form.Value, 'priority', 'Priority');
o.datatype = 'uinteger';
o.default = '5';
o.width = '10%';
// Exclusions
s = m.section(form.TableSection, 'exclusion', 'Exclusions',
'Domains that should never be cached');
s.addremove = true;
s.anonymous = true;
o = s.option(form.Flag, 'enabled', 'Enabled');
o.default = '1';
o.width = '10%';
o = s.option(form.Value, 'name', 'Name');
o.width = '20%';
o = s.option(form.Value, 'domains', 'Domains',
'Keywords to match in domain names');
o.width = '35%';
o = s.option(form.Value, 'reason', 'Reason');
o.width = '35%';
// Statistics settings
s = m.section(form.TypedSection, 'statistics', 'Statistics Settings');
s.anonymous = true;
o = s.option(form.Value, 'retention_days', 'Stats Retention (days)',
'How long to keep statistics data');
o.datatype = 'uinteger';
o.default = '30';
o = s.option(form.Value, 'sample_interval', 'Sample Interval (seconds)',
'How often to sample statistics');
o.datatype = 'uinteger';
o.default = '60';
return E('div', { 'class': 'cdn-settings-page' }, [
E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox-theme/secubox-theme.css') }),
E('link', { 'rel': 'stylesheet', 'href': L.resource('cdn-cache/common.css') }),
CdnNav.renderTabs('settings'),
m.render()
]);
}
});