2019-02-24 05:28:01 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Administrative dashboard configuration.
|
|
|
|
*/
|
|
|
|
|
2022-01-07 08:26:40 +00:00
|
|
|
use App\Enums\StationPermissions;
|
2019-02-24 05:28:01 +00:00
|
|
|
|
2020-07-08 07:03:50 +00:00
|
|
|
return function (App\Event\BuildStationMenu $e) {
|
2021-01-11 11:08:06 +00:00
|
|
|
$request = $e->getRequest();
|
2019-02-24 05:28:01 +00:00
|
|
|
$station = $e->getStation();
|
2021-01-11 11:08:06 +00:00
|
|
|
|
|
|
|
$router = $request->getRouter();
|
|
|
|
$backend = $request->getStationBackend();
|
|
|
|
$frontend = $request->getStationFrontend();
|
2019-02-24 05:28:01 +00:00
|
|
|
|
2022-02-25 00:00:49 +00:00
|
|
|
$willDisconnectMessage = __('Restart broadcasting? This will disconnect any current listeners.');
|
|
|
|
$willNotDisconnectMessage = __('Reload broadcasting? Current listeners will not be disconnected.');
|
|
|
|
|
|
|
|
$reloadSupported = $frontend->supportsReload();
|
|
|
|
$reloadMessage = $reloadSupported ? $willNotDisconnectMessage : $willDisconnectMessage;
|
2022-02-21 07:26:08 +00:00
|
|
|
|
2021-02-03 04:17:57 +00:00
|
|
|
$settings = $e->getSettings();
|
2020-05-27 07:36:30 +00:00
|
|
|
|
2021-01-03 06:23:07 +00:00
|
|
|
$e->merge(
|
|
|
|
[
|
2022-02-21 07:26:08 +00:00
|
|
|
'start_station' => [
|
|
|
|
'label' => __('Start Station'),
|
|
|
|
'title' => __('Ready to start broadcasting? Click to start your station.'),
|
|
|
|
'icon' => 'refresh',
|
2022-02-25 00:00:49 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:reload'),
|
2022-02-21 07:26:08 +00:00
|
|
|
'class' => 'api-call text-success',
|
|
|
|
'confirm' => $reloadMessage,
|
|
|
|
'visible' => !$station->getHasStarted(),
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Broadcasting,
|
2019-09-30 00:01:15 +00:00
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
'restart_station' => [
|
2022-02-21 07:26:08 +00:00
|
|
|
'label' => __('Reload to Apply Changes'),
|
|
|
|
'title' => __('Click to restart your station and apply configuration changes.'),
|
|
|
|
'icon' => 'refresh',
|
2022-02-25 00:00:49 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:reload'),
|
2022-02-21 07:26:08 +00:00
|
|
|
'class' => 'api-call text-warning btn-restart-station '
|
2021-12-15 13:19:56 +00:00
|
|
|
. (!$station->getNeedsRestart() ? 'd-none' : ''),
|
2022-02-25 00:00:49 +00:00
|
|
|
'confirm' => $reloadMessage,
|
2022-02-21 07:26:08 +00:00
|
|
|
'visible' => $station->getHasStarted(),
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Broadcasting,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
'profile' => [
|
2021-01-03 06:23:07 +00:00
|
|
|
'label' => __('Profile'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'icon' => 'image',
|
|
|
|
'url' => (string)$router->fromHere('stations:profile:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
'public' => [
|
|
|
|
'label' => __('Public Page'),
|
|
|
|
'icon' => 'public',
|
|
|
|
'url' => (string)$router->named('public:index', ['station_id' => $station->getShortName()]),
|
2021-01-03 06:23:07 +00:00
|
|
|
'external' => true,
|
2022-02-27 23:41:39 +00:00
|
|
|
'visible' => $station->getEnablePublicPage(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
'media' => [
|
|
|
|
'label' => __('Media'),
|
|
|
|
'icon' => 'library_music',
|
|
|
|
'items' => [
|
|
|
|
'files' => [
|
|
|
|
'label' => __('Music Files'),
|
|
|
|
'icon' => 'library_music',
|
|
|
|
'url' => (string)$router->fromHere('stations:files:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2022-02-27 23:41:39 +00:00
|
|
|
'permission' => StationPermissions::Media,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 01:06:14 +00:00
|
|
|
'reports_duplicates' => [
|
|
|
|
'label' => __('Duplicate Songs'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted',
|
2022-02-27 01:06:14 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index') . '#special:duplicates',
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_unprocessable' => [
|
2022-02-27 01:06:14 +00:00
|
|
|
'label' => __('Unprocessable Files'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted',
|
2022-02-27 01:06:14 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index') . '#special:unprocessable',
|
|
|
|
'visible' => $backend->supportsMedia(),
|
|
|
|
],
|
|
|
|
'reports_unassigned' => [
|
|
|
|
'label' => __('Unassigned Files'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted',
|
2022-02-27 01:06:14 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index') . '#special:unassigned',
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
'ondemand' => [
|
|
|
|
'label' => __('On-Demand Media'),
|
|
|
|
'class' => 'text-muted',
|
|
|
|
'icon' => 'cloud_download',
|
|
|
|
'url' => (string)$router->named('public:ondemand', ['station_id' => $station->getShortName()]),
|
|
|
|
'external' => true,
|
|
|
|
'visible' => $station->getEnableOnDemand(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'sftp_users' => [
|
2022-02-27 23:41:39 +00:00
|
|
|
'label' => __('SFTP Users'),
|
|
|
|
'class' => 'text-muted',
|
|
|
|
'url' => (string)$router->fromHere('stations:sftp_users:index'),
|
|
|
|
'visible' => App\Service\SftpGo::isSupportedForStation($station),
|
|
|
|
'permission' => StationPermissions::Media,
|
|
|
|
],
|
|
|
|
|
|
|
|
'playlists' => [
|
|
|
|
'label' => __('Playlists'),
|
|
|
|
'icon' => 'queue_music',
|
|
|
|
'url' => (string)$router->fromHere('stations:playlists:index'),
|
|
|
|
'visible' => $backend->supportsMedia(),
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Media,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
|
2021-01-03 06:23:07 +00:00
|
|
|
'automation' => [
|
2022-02-27 23:41:39 +00:00
|
|
|
'label' => __('Automated Assignment'),
|
|
|
|
'class' => 'text-muted',
|
|
|
|
'url' => (string)$router->fromHere('stations:automation:index'),
|
|
|
|
'visible' => $backend->supportsMedia(),
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Automation,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'podcasts' => [
|
|
|
|
'label' => __('Podcasts'),
|
|
|
|
'icon' => 'cast',
|
|
|
|
'url' => (string)$router->fromHere('stations:podcasts:index'),
|
|
|
|
'permission' => StationPermissions::Podcasts,
|
|
|
|
],
|
|
|
|
|
|
|
|
'live_streaming' => [
|
|
|
|
'label' => __('Live Streaming'),
|
|
|
|
'icon' => 'mic',
|
|
|
|
'items' => [
|
|
|
|
'streamers' => [
|
|
|
|
'label' => __('Streamer/DJ Accounts'),
|
|
|
|
'icon' => 'mic',
|
|
|
|
'url' => (string)$router->fromHere('stations:streamers:index'),
|
|
|
|
'visible' => $backend->supportsStreamers(),
|
|
|
|
'permission' => StationPermissions::Streamers,
|
|
|
|
],
|
|
|
|
|
|
|
|
'web_dj' => [
|
|
|
|
'label' => __('Web DJ'),
|
|
|
|
'icon' => 'surround_sound',
|
|
|
|
'url' => (string)$router->named(
|
|
|
|
'public:dj',
|
|
|
|
['station_id' => $station->getShortName()],
|
|
|
|
[],
|
|
|
|
true
|
|
|
|
)
|
|
|
|
->withScheme('https'),
|
|
|
|
'visible' => $station->getEnablePublicPage() && $station->getEnableStreamers(),
|
|
|
|
'external' => true,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'webhooks' => [
|
|
|
|
'label' => __('Web Hooks'),
|
|
|
|
'icon' => 'code',
|
|
|
|
'url' => (string)$router->fromHere('stations:webhooks:index'),
|
|
|
|
'permission' => StationPermissions::WebHooks,
|
|
|
|
],
|
|
|
|
|
|
|
|
'reports' => [
|
|
|
|
'label' => __('Reports'),
|
|
|
|
'icon' => 'assignment',
|
|
|
|
'permission' => StationPermissions::Reports,
|
|
|
|
'items' => [
|
|
|
|
'reports_overview' => [
|
|
|
|
'label' => __('Statistics Overview'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:overview'),
|
|
|
|
],
|
|
|
|
'reports_listeners' => [
|
|
|
|
'label' => __('Listeners'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:listeners'),
|
|
|
|
],
|
|
|
|
'reports_requests' => [
|
|
|
|
'label' => __('Song Requests'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:requests'),
|
|
|
|
'visible' => $station->getEnableRequests(),
|
|
|
|
],
|
|
|
|
'reports_timeline' => [
|
|
|
|
'label' => __('Song Playback Timeline'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:timeline'),
|
|
|
|
],
|
|
|
|
'reports_performance' => [
|
|
|
|
'label' => __('Song Listener Impact'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:performance'),
|
|
|
|
'visible' => $backend->supportsMedia(),
|
|
|
|
],
|
|
|
|
'reports_soundexchange' => [
|
|
|
|
'label' => __('SoundExchange Royalties'),
|
|
|
|
'url' => (string)$router->fromHere('stations:reports:soundexchange'),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'broadcasting' => [
|
|
|
|
'label' => __('Broadcasting'),
|
|
|
|
'icon' => 'wifi_tethering',
|
|
|
|
'items' => [
|
|
|
|
'mounts' => [
|
|
|
|
'label' => __('Mount Points'),
|
|
|
|
'icon' => 'wifi_tethering',
|
|
|
|
'url' => (string)$router->fromHere('stations:mounts:index'),
|
|
|
|
'visible' => $frontend->supportsMounts(),
|
|
|
|
'permission' => StationPermissions::MountPoints,
|
|
|
|
],
|
|
|
|
'remotes' => [
|
|
|
|
'label' => __('Remote Relays'),
|
|
|
|
'icon' => 'router',
|
|
|
|
'url' => (string)$router->fromHere('stations:remotes:index'),
|
|
|
|
'permission' => StationPermissions::RemoteRelays,
|
|
|
|
],
|
2022-02-28 02:16:48 +00:00
|
|
|
'fallback' => [
|
|
|
|
'label' => __('Custom Fallback File'),
|
|
|
|
'class' => 'text-muted',
|
|
|
|
'url' => (string)$router->fromHere('stations:fallback'),
|
|
|
|
'permission' => StationPermissions::Broadcasting,
|
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
'ls_config' => [
|
|
|
|
'label' => __('Edit Liquidsoap Configuration'),
|
|
|
|
'class' => 'text-muted',
|
|
|
|
'url' => (string)$router->fromHere('stations:util:ls_config'),
|
|
|
|
'visible' => $settings->getEnableAdvancedFeatures()
|
2021-02-03 04:17:57 +00:00
|
|
|
&& $backend instanceof App\Radio\Backend\Liquidsoap,
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Broadcasting,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-25 00:00:49 +00:00
|
|
|
'queue' => [
|
|
|
|
'label' => __('Upcoming Song Queue'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted',
|
2022-02-25 00:00:49 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:queue:index'),
|
|
|
|
'permission' => StationPermissions::Broadcasting,
|
|
|
|
],
|
|
|
|
'reload' => [
|
|
|
|
'label' => __('Reload Configuration'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted api-call',
|
2022-02-25 00:00:49 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:reload'),
|
|
|
|
'confirm' => $willNotDisconnectMessage,
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Broadcasting,
|
2022-02-25 00:00:49 +00:00
|
|
|
'visible' => $reloadSupported,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2022-02-25 00:00:49 +00:00
|
|
|
'restart' => [
|
2022-02-21 07:26:08 +00:00
|
|
|
'label' => __('Restart Broadcasting'),
|
2022-02-27 23:41:39 +00:00
|
|
|
'class' => 'text-muted api-call',
|
2022-02-21 07:26:08 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:restart'),
|
2022-02-25 00:00:49 +00:00
|
|
|
'confirm' => $willDisconnectMessage,
|
2022-01-07 08:26:40 +00:00
|
|
|
'permission' => StationPermissions::Broadcasting,
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2019-02-24 05:28:01 +00:00
|
|
|
],
|
2019-09-30 00:01:15 +00:00
|
|
|
],
|
2022-02-27 23:41:39 +00:00
|
|
|
|
|
|
|
'help' => [
|
|
|
|
'label' => __('Help'),
|
|
|
|
'icon' => 'support',
|
|
|
|
'url' => (string)$router->fromHere('stations:logs:index'),
|
|
|
|
'permission' => StationPermissions::Logs,
|
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
]
|
|
|
|
);
|
2019-03-10 08:05:16 +00:00
|
|
|
};
|