info.blade.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container">
  7. <div class="panel">
  8. <div class="panel-heading">
  9. <h2 class="panel-title">@isset($Dv) 编辑 @else 添加 @endisset域名证书</h2>
  10. </div>
  11. <div class="panel-body">
  12. <form class="form-horizontal" onsubmit="return Submit()">
  13. <div class="form-group row">
  14. <label for="domain" class="col-md-3 col-form-label">域名</label>
  15. <div class="col-md-9">
  16. <input type="text" class="form-control" name="domain" id="domain" @isset($Dv) value="{{$Dv->domain}}" @endisset>
  17. </div>
  18. </div>
  19. <div class="form-group row">
  20. <label for="key" class="col-md-3 col-form-label">Key</label>
  21. <div class="col-md-9">
  22. <textarea type="text" rows="10" class="form-control" name="key" id="key" placeholder="域名证书的KEY值,允许为空,VNET-V2Ray后端支持自动签证书">@isset($Dv) {{$Dv->key}} @endisset</textarea>
  23. </div>
  24. </div>
  25. <div class="form-group row">
  26. <label for="pem" class="col-md-3 col-form-label">Pem</label>
  27. <div class="col-md-9">
  28. <textarea type="text" rows="10" class="form-control" name="pem" id="pem" placeholder="域名证书的PEM值,允许为空,VNET-V2Ray后端支持自动签证书">@isset($Dv) {{$Dv->pem}} @endisset</textarea>
  29. </div>
  30. </div>
  31. <div class="form-actions">
  32. <button type="submit" class="btn btn-success">提 交</button>
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. </div>
  38. @endsection
  39. @section('script')
  40. <script type="text/javascript">
  41. // 添加域名证书
  42. function Submit() {
  43. $.ajax({
  44. method: @isset($Dv) 'PUT' @else 'POST' @endisset,
  45. url: @isset($Dv) '{{route('admin.node.cert.update', $Dv->id)}}' @else '{{route('admin.node.cert.store')}}' @endisset,
  46. async: false,
  47. data: {_token: '{{csrf_token()}}', domain: $('#domain').val(), key: $('#key').val(), pem: $('#pem').val()},
  48. dataType: 'json',
  49. success: function(ret) {
  50. if (ret.status === 'success') {
  51. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.href = '{{route('admin.node.cert.index')}}');
  52. }
  53. else {
  54. swal.fire({title: '[错误 | Error]', text: ret.message, type: 'error'});
  55. }
  56. },
  57. });
  58. return false;
  59. }
  60. </script>
  61. @endsection