secubox-openwrt/luci-app-bandwidth-manager/htdocs/luci-static/resources/bandwidth-manager/api.js
CyberMind-FR 4bdda363a0 fix: Standardize all plugins to v0.0.9 with unified patterns
- Update all 13 plugins maintainer to CyberMind <contact@cybermind.fr>
- Set version to 0.0.9 for internal release
- Fix API modules to use baseclass.extend() pattern (6 plugins)
- Ensure all RPCD scripts use luci.* prefix
- Validate menu/view/ACL coherence across all modules

Affected plugins:
- luci-app-auth-guardian
- luci-app-bandwidth-manager
- luci-app-cdn-cache
- luci-app-client-guardian
- luci-app-crowdsec-dashboard
- luci-app-ksm-manager
- luci-app-media-flow
- luci-app-netdata-dashboard
- luci-app-netifyd-dashboard
- luci-app-network-modes
- luci-app-traffic-shaper
- luci-app-vhost-manager
- luci-app-wireguard-dashboard

Validation: All modules pass validate-modules.sh checks

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 16:33:03 +01:00

97 lines
2.0 KiB
JavaScript

'use strict';
'require baseclass';
'require rpc';
var callStatus = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'status',
expect: {}
});
var callListRules = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'list_rules',
expect: { rules: [] }
});
var callAddRule = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'add_rule',
params: ['name', 'type', 'target', 'limit_down', 'limit_up', 'priority'],
expect: {}
});
var callDeleteRule = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'delete_rule',
params: ['rule_id'],
expect: {}
});
var callListQuotas = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'list_quotas',
expect: { quotas: [] }
});
var callGetQuota = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'get_quota',
params: ['mac'],
expect: {}
});
var callSetQuota = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'set_quota',
params: ['mac', 'name', 'limit_mb', 'action', 'reset_day'],
expect: {}
});
var callResetQuota = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'reset_quota',
params: ['mac'],
expect: {}
});
var callGetUsageRealtime = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'get_usage_realtime',
expect: { clients: [] }
});
var callGetUsageHistory = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'get_usage_history',
params: ['timeframe', 'mac'],
expect: { history: [] }
});
var callGetMedia = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'get_media',
expect: { media: [] }
});
var callGetClasses = rpc.declare({
object: 'luci.bandwidth-manager',
method: 'get_classes',
expect: { classes: [] }
});
return baseclass.extend({
getStatus: callStatus,
listRules: callListRules,
addRule: callAddRule,
deleteRule: callDeleteRule,
listQuotas: callListQuotas,
getQuota: callGetQuota,
setQuota: callSetQuota,
resetQuota: callResetQuota,
getUsageRealtime: callGetUsageRealtime,
getUsageHistory: callGetUsageHistory,
getMedia: callGetMedia,
getClasses: callGetClasses
});