8889841cDashboardManager/BlockDashboardManager.php000064400000000444150515574400014604 0ustar00renderTemplatePart('DashboardManager'); } }DashboardManager/Boxes/BlockDashboardReview.php000064400000001234150515574400015551 0ustar00get('free', 'rated')) { $modelSliders = new ModelSliders($this); if ($modelSliders->getSlidersCount() >= 3) { $this->renderTemplatePart('DashboardReview'); } } } }DashboardManager/Boxes/BlockDashboardUpgradePro.php000064400000002066150515574400016364 0ustar00get('free', 'upgrade-pro')) { $this->renderTemplatePart('DashboardUpgradePro'); } } /** * @return bool */ public function hasDismiss() { return $this->hasDismiss; } /** * @param bool $hasDismiss */ public function setHasDismiss($hasDismiss) { $this->hasDismiss = $hasDismiss; } /** * @return string */ public function getSource() { return $this->source; } /** * @param string $source */ public function setSource($source) { $this->source = $source; } }DashboardManager/Boxes/DashboardUpgradePro.php000064400000011306150515574400015406 0ustar00
hasDismiss()): ?>
hasDismiss()): ?> DashboardManager/Boxes/DashboardReview.php000064400000011516150515574400014602 0ustar00
DashboardManager/Boxes/BlockDashboardNewsletter.php000064400000001051150515574400016441 0ustar00get('free', 'subscribeOnImport') && !$storage->get('free', 'dismissNewsletterDashboard')) { $this->renderTemplatePart('DashboardNewsletter'); } } }DashboardManager/Boxes/DashboardNewsletter.php000064400000005435150515574400015500 0ustar00
DashboardManager/DashboardManager.php000064400000001561150515574400013632 0ustar00
display(); $review = new BlockDashboardReview($this); $review->display(); $newsletter = new BlockDashboardNewsletter($this); $newsletter->display(); ?>
DashboardInfo/BlockDashboardInfo.php000064400000000554150515574400013450 0ustar00renderTemplatePart('DashboardInfo'); } }DashboardInfo/DashboardInfo.php000064400000003647150515574400012503 0ustar00
display(); ?>
Smart Slider
getRouter() ->setMultiSite(); $checkForUpdateUrl = $this->getUrlUpdateDownload(); $this->getRouter() ->unSetMultiSite(); ?>
$apps->all(), 'port' => config('websockets.dashboard.port', 6001), ]); } } Http/Controllers/SendMessage.php000066600000002206150515663710012715 0ustar00validate([ 'appId' => ['required', new AppId()], 'key' => 'required', 'secret' => 'required', 'channel' => 'required', 'event' => 'required', 'data' => 'json', ]); $this->getPusherBroadcaster($validated)->broadcast( [$validated['channel']], $validated['event'], json_decode($validated['data'], true) ); return 'ok'; } protected function getPusherBroadcaster(array $validated): PusherBroadcaster { $pusher = new Pusher( $validated['key'], $validated['secret'], $validated['appId'], config('broadcasting.connections.pusher.options', []) ); return new PusherBroadcaster($pusher); } } Http/Controllers/AuthenticateDashboard.php000066600000001676150515663710014757 0ustar00header('x-app-id')); $broadcaster = new PusherBroadcaster(new Pusher( $app->key, $app->secret, $app->id, [] )); /* * Since the dashboard itself is already secured by the * Authorize middleware, we can trust all channel * authentication requests in here. */ return $broadcaster->validAuthenticationResponse($request, []); } } Http/Controllers/DashboardApiController.php000066600000002520150515663710015103 0ustar00latest()->limit(120)->get(); $statisticData = $statistics->map(function ($statistic) { return [ 'timestamp' => (string) $statistic->created_at, 'peak_connection_count' => $statistic->peak_connection_count, 'websocket_message_count' => $statistic->websocket_message_count, 'api_message_count' => $statistic->api_message_count, ]; })->reverse(); return [ 'peak_connections' => [ 'x' => $statisticData->pluck('timestamp'), 'y' => $statisticData->pluck('peak_connection_count'), ], 'websocket_message_count' => [ 'x' => $statisticData->pluck('timestamp'), 'y' => $statisticData->pluck('websocket_message_count'), ], 'api_message_count' => [ 'x' => $statisticData->pluck('timestamp'), 'y' => $statisticData->pluck('api_message_count'), ], ]; } } Http/Middleware/Authorize.php000066600000000446150515663710012244 0ustar00user()]) ? $next($request) : abort(403); } } DashboardLogger.php000066600000006005150515663710010322 0ustar00httpRequest; static::log($connection->app->id, static::TYPE_CONNECTION, [ 'details' => "Origin: {$request->getUri()->getScheme()}://{$request->getUri()->getHost()}", 'socketId' => $connection->socketId, ]); } public static function occupied(ConnectionInterface $connection, string $channelName) { static::log($connection->app->id, static::TYPE_OCCUPIED, [ 'details' => "Channel: {$channelName}", ]); } public static function subscribed(ConnectionInterface $connection, string $channelName) { static::log($connection->app->id, static::TYPE_SUBSCRIBED, [ 'socketId' => $connection->socketId, 'details' => "Channel: {$channelName}", ]); } public static function clientMessage(ConnectionInterface $connection, stdClass $payload) { static::log($connection->app->id, static::TYPE_CLIENT_MESSAGE, [ 'details' => "Channel: {$payload->channel}, Event: {$payload->event}", 'socketId' => $connection->socketId, 'data' => json_encode($payload), ]); } public static function disconnection(ConnectionInterface $connection) { static::log($connection->app->id, static::TYPE_DISCONNECTION, [ 'socketId' => $connection->socketId, ]); } public static function vacated(ConnectionInterface $connection, string $channelName) { static::log($connection->app->id, static::TYPE_VACATED, [ 'details' => "Channel: {$channelName}", ]); } public static function apiMessage($appId, string $channel, string $event, string $payload) { static::log($appId, static::TYPE_API_MESSAGE, [ 'details' => "Channel: {$channel}, Event: {$event}", 'data' => $payload, ]); } public static function log($appId, string $type, array $attributes = []) { $channelName = static::LOG_CHANNEL_PREFIX.$type; $channel = app(ChannelManager::class)->find($appId, $channelName); optional($channel)->broadcast([ 'event' => 'log-message', 'channel' => $channelName, 'data' => [ 'type' => $type, 'time' => date('H:i:s'), ] + $attributes, ]); } }