Skip to content
Permalink
Browse files

Add Error Messages

  • Loading branch information...
Insax committed Aug 5, 2017
1 parent 297cc09 commit fe2aa78e778bf68edee95b46bd056da84c774954
@@ -2,16 +2,25 @@
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Http\Request;
class StaticsController extends Controller
{
public function index()
{
return view('statics.index');
}
public function error()
public function error(Request $request)
{
return view('statics.error');
if($request->input('type') === 'vid')
return view('error.errorVid');
else if($request->input('type') === 'yt')
return view('error.errorYT');
else
Redirect::route('index');
}
public function converter()
@@ -63,7 +63,6 @@ public function handle()
dispatch((new ConvertVideo($this->loc, $this->name, $this->sound, $this->res, $this->limit, $this->start, $this->end))->onQueue('convert'));
}
public function failed(){
// 420 = error
DB::table('data')->where('guid', $this->name)->update(['progress' => 420]);
DB::table('data')->where('guid', $this->name)->update(['progress' => 421]);
}
}
@@ -11,8 +11,10 @@ $(function () {
}).done(function (data) {
if (data === 'error') {
document.location.href = '/';
} else if(data === '420'){
document.location.href = '/error';
} else if(data === '420') {
document.location.href = '/error?type=vid';
} else if(data === '421') {
document.location.href = '/error?type=yt';
} else {
$('#bar').width(data + '%').html(data + '%');
if (data === '100') {

This file was deleted.

@@ -0,0 +1,11 @@
@extends('layouts.app')
@section('content')

<div class="container text-center">
<div class="jumbotron">
<div class="row">
<h1>Fehler beim Konvertieren, der pr0verter kann dein Video nicht richtig Verarbeiten ¯\_(ツ)_/¯</h1>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,11 @@
@extends('layouts.app')
@section('content')

<div class="container text-center">
<div class="jumbotron">
<div class="row">
<h1>Fehler beim Download, der pr0verter kann das Video nicht von Youtube laden ¯\_(ツ)_/¯</h1>
</div>
</div>
</div>
@endsection
@@ -20,11 +20,9 @@
Route::get('faq', 'StaticsController@faq')->name('faq');
Route::get('contact', 'StaticsController@contact')->name('contact');
Route::get('subtitle', 'SubtitleController@index')->name('subtitle');
Route::get('error', 'StaticsController@error')->name('error');
});
Route::group(['prefix' => 'error', 'middleware' => 'web'], function () {
Route::get('', 'StaticsController@error')->name('error');
});
/*
* Dynamic content

0 comments on commit fe2aa78

Please sign in to comment.
You can’t perform that action at this time.