decompile.blade.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @extends('admin.layouts')
  2. @section('content')
  3. <div class="page-content container-fluid">
  4. <div class="panel">
  5. <div class="panel-heading">
  6. <h2 class="panel-title">反解析</h2>
  7. </div>
  8. <div class="panel-body">
  9. <div class="row">
  10. <div class="col-md-6">
  11. <textarea class="form-control" rows="25" name="content" id="content" placeholder="请填入要反解析的ShadowsocksR链接,一行一条" autofocus></textarea>
  12. </div>
  13. <div class="col-md-6">
  14. <textarea class="form-control" rows="25" name="result" id="result" readonly="readonly"></textarea>
  15. </div>
  16. <div class="col-md-6">
  17. <button class="btn btn-block btn-primary" onclick="Decompile()">反解析</button>
  18. </div>
  19. <div class="col-md-6">
  20. <a href="{{route('admin.tools.download', ['type' => 2])}}" class="btn btn-block btn-danger">下 载</a>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. @endsection
  27. @section('javascript')
  28. <script type="text/javascript">
  29. // 转换
  30. function Decompile() {
  31. const content = $('#content').val();
  32. if (content.trim() === '') {
  33. swal.fire({title: '请填入要反解析的链接信息', icon: 'warning', timer: 1000, showConfirmButton: false});
  34. return;
  35. }
  36. swal.fire({
  37. title: '确定继续反解析吗?',
  38. icon: 'question',
  39. allowEnterKey: false,
  40. showCancelButton: true,
  41. cancelButtonText: '{{trans('home.ticket_close')}}',
  42. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  43. }).then((result) => {
  44. if (result.value) {
  45. $.ajax({
  46. method: 'POST',
  47. url: '{{route('admin.tools.decompile')}}',
  48. async: false,
  49. data: {_token: '{{csrf_token()}}', content: content},
  50. dataType: 'json',
  51. success: function(ret) {
  52. if (ret.status === 'success') {
  53. $('#result').val(ret.data);
  54. } else {
  55. $('#result').val(ret.message);
  56. }
  57. },
  58. });
  59. }
  60. });
  61. return false;
  62. }
  63. </script>
  64. @endsection