diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index a55a48c1a..0bf49da89 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -440,4 +440,29 @@ class AdminController extends Controller $redirect = $news->published_at ? $news->permalink() : $news->editUrl(); return redirect($redirect); } + + public function diagnosticsHome(Request $request) + { + return view('admin.diagnostics.home'); + } + + public function diagnosticsDecrypt(Request $request) + { + $this->validate($request, [ + 'payload' => 'required' + ]); + + $key = 'exception_report:'; + $decrypted = decrypt($request->input('payload')); + + if(!starts_with($decrypted, $key)) { + abort(403, 'Can only decrypt error diagnostics'); + } + + $res = [ + 'decrypted' => substr($decrypted, strlen($key)) + ]; + + return response()->json($res); + } } diff --git a/resources/views/admin/diagnostics/home.blade.php b/resources/views/admin/diagnostics/home.blade.php new file mode 100644 index 000000000..d4031b442 --- /dev/null +++ b/resources/views/admin/diagnostics/home.blade.php @@ -0,0 +1,111 @@ +@extends('admin.partial.template') + +@include('admin.settings.sidebar') + +@section('section') +
+

Diagnostics

+

Instance diagnostics

+
+ +
+

+ Information + Copy +

+ +
+
+
+
+ + +

The payload is from the "Something went wrong" page, anyone can copy the payload for you to decrypt.
Contents are encrypted due to potential sensitive information.

+
+
+ + +
+
+ +
+
+
+@endsection + +@push('scripts') + + +@endpush diff --git a/resources/views/admin/partial/sidenav.blade.php b/resources/views/admin/partial/sidenav.blade.php index 85ba069c7..88b291eb5 100644 --- a/resources/views/admin/partial/sidenav.blade.php +++ b/resources/views/admin/partial/sidenav.blade.php @@ -64,6 +64,13 @@ + + + +