Skip to content

Commit

Permalink
update router
Browse files Browse the repository at this point in the history
  • Loading branch information
Recca Tsai committed Feb 24, 2016
1 parent e76eeff commit 2a3e591
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion resources/views/panel.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", filename);
link.setAttribute("id", id)
link.setAttribute("id", id);
var head = document.getElementsByTagName('head');
if (head.length > 0) {
Expand Down
10 changes: 3 additions & 7 deletions src/Http/Controllers/TerminalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public function __construct(ConsoleKernel $consoleKernel)
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Session\SessionManager $sessionManager
* @param \Illuminate\Http\Request $request
* @param bool $panel
* @param string $view
*
* @return mixed
*/
public function index(
ApplicationContract $app,
SessionManager $sessionManager,
Request $request,
$panel = false
$view = 'index'
) {
$session = $sessionManager->driver();
if ($session->isStarted() === false) {
Expand Down Expand Up @@ -68,11 +68,7 @@ public function index(
],
]);

if ($panel === true) {
return view('terminal::panel', compact('options', 'resources'));
}

return view('terminal::index', compact('options', 'resources'));
return view('terminal::'.$view, compact('options', 'resources'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

// Route::controller('/', 'TerminalController');
Route::get('/', 'TerminalController@index');
Route::get('/{view?}', 'TerminalController@index');
Route::post('/endpoint', 'TerminalController@endPoint');
Route::get('/media/{file}', 'TerminalController@media')
->where(['file' => '.+']);

0 comments on commit 2a3e591

Please sign in to comment.