Major improvements to the Media Flow streaming detection module: Backend (RPCD): - Rewrite JSON handling to avoid subshell issues - Use jq for all JSON processing (more reliable) - Add delete_alert, clear_history, get_settings, set_settings methods - Expand streaming service patterns (more services detected) - Better bandwidth/quality estimation from netifyd data Data Collection: - Add media-flow-collector script for periodic data collection - Add init script with cron job management - History persists across service restarts - Configurable retention period Frontend: - Remove unused Theme imports - Fix history view to use correct field names - Add Clear History button - Add time period filter with refresh - Improved table display with category icons New streaming services detected: - Video: Peacock, Paramount+, Crunchyroll, Funimation - Audio: Amazon Music, YouTube Music - Video calls: FaceTime, WhatsApp Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
96 lines
2.0 KiB
JavaScript
96 lines
2.0 KiB
JavaScript
'use strict';
|
|
'require baseclass';
|
|
'require rpc';
|
|
|
|
var callStatus = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'status',
|
|
expect: { }
|
|
});
|
|
|
|
var callGetActiveStreams = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_active_streams',
|
|
expect: { streams: [] }
|
|
});
|
|
|
|
var callGetStreamHistory = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_stream_history',
|
|
params: ['hours'],
|
|
expect: { history: [] }
|
|
});
|
|
|
|
var callGetStatsByService = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_stats_by_service',
|
|
expect: { services: {} }
|
|
});
|
|
|
|
var callGetStatsByClient = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_stats_by_client',
|
|
expect: { clients: {} }
|
|
});
|
|
|
|
var callGetServiceDetails = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_service_details',
|
|
params: ['service'],
|
|
expect: { }
|
|
});
|
|
|
|
var callSetAlert = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'set_alert',
|
|
params: ['service', 'threshold_hours', 'action'],
|
|
expect: { }
|
|
});
|
|
|
|
var callDeleteAlert = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'delete_alert',
|
|
params: ['alert_id'],
|
|
expect: { }
|
|
});
|
|
|
|
var callListAlerts = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'list_alerts',
|
|
expect: { alerts: [] }
|
|
});
|
|
|
|
var callClearHistory = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'clear_history',
|
|
expect: { }
|
|
});
|
|
|
|
var callGetSettings = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'get_settings',
|
|
expect: { }
|
|
});
|
|
|
|
var callSetSettings = rpc.declare({
|
|
object: 'luci.media-flow',
|
|
method: 'set_settings',
|
|
params: ['enabled', 'history_retention', 'refresh_interval'],
|
|
expect: { }
|
|
});
|
|
|
|
return baseclass.extend({
|
|
getStatus: callStatus,
|
|
getActiveStreams: callGetActiveStreams,
|
|
getStreamHistory: callGetStreamHistory,
|
|
getStatsByService: callGetStatsByService,
|
|
getStatsByClient: callGetStatsByClient,
|
|
getServiceDetails: callGetServiceDetails,
|
|
setAlert: callSetAlert,
|
|
deleteAlert: callDeleteAlert,
|
|
listAlerts: callListAlerts,
|
|
clearHistory: callClearHistory,
|
|
getSettings: callGetSettings,
|
|
setSettings: callSetSettings
|
|
});
|