decompile.blade.php 2.4 KB

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