path()), $request->except(['username', 'password'])); $output = $vars['graph_type'] ?? Config::get('webui.graph_type', 'default'); if (\Auth::check()) { // only allow debug for logged in users Debug::set(! empty($vars['debug'])); } try { $graph = Graph::get($vars); if (Debug::isEnabled()) { return response('graph'); } $headers = [ 'Content-type' => $graph->imageType(), ]; if ($output == 'base64') { return response($graph, 200, $headers); } return response($graph->data(), 200, $headers); } catch (RrdGraphException $e) { if (Debug::isEnabled()) { throw $e; } return response($e->generateErrorImage(), 500, ['Content-type' => Graph::imageType()]); } } }