save.blade.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  5. <style>
  6. .for_area {
  7. display: inline-block;
  8. width: 200px;
  9. }
  10. .upload_img {
  11. height: 150px;
  12. }
  13. </style>
  14. @endsection
  15. @section('content')
  16. <body class="gray-bg">
  17. <div class="wrapper wrapper-content animated fadeInRight">
  18. <div class="row">
  19. <div class="col-sm-12">
  20. <div class="ibox float-e-margins">
  21. <div class="ibox-content">
  22. <form class="form-horizontal" id="form">
  23. <div class="form-group">
  24. <label class="col-sm-2 control-label" for="server_name">服务器名称</label>
  25. <div class="col-sm-8">
  26. <input type="text" class="form-control" id="server_name" name="server_name"
  27. value="{{$data->server_name ?? ''}}">
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="col-sm-2 control-label" for="server_ip">服务器Ip:</label>
  32. <div class="col-sm-8">
  33. <input type="text" class="form-control" id="server_ip" name="server_ip"
  34. value="{{$data->server_ip ?? ''}}">
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-2 control-label" for="server_user_name">服务器用户名:</label>
  39. <div class="col-sm-8">
  40. <input type="text" class="form-control" id="server_user_name"
  41. name="server_user_name"
  42. value="{{$data->server_user_name??''}}">
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="col-sm-2 control-label" for="server_passwd">服务器密码:</label>
  47. <div class="col-sm-8">
  48. <input type="text" class="form-control" id="server_passwd" name="server_passwd"
  49. value="{{$data->server_passwd??''}}">
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-2 control-label" for="server_description">描述:</label>
  54. <div class="col-sm-8">
  55. <textarea class="form-control" id="server_description"
  56. name="server_description">{{$data->server_description??''}}</textarea>
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-sm-2 control-label" for="server_type">服务器类型:</label>
  61. <div class="col-sm-4">
  62. <select name="server_type" id="server_type" class="form-control">
  63. <option value="">请选择</option>
  64. @foreach(\App\Http\Models\Server::SERVER_TYPE as $inx=>$val)
  65. <option value="{{$inx}}" @if(($data->server_type??null)==$inx) selected @endif>
  66. {{$val}}
  67. </option>
  68. @endforeach
  69. </select>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label class="col-sm-2 control-label" for="mysql_user_name">mysql用户名:</label>
  74. <div class="col-sm-8">
  75. <input type="text" class="form-control" id="mysql_user_name" name="mysql_user_name"
  76. value="{{$data->mysql_user_name??''}}">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-sm-2 control-label" for="mysql_passwd">mysql密码:</label>
  81. <div class="col-sm-8">
  82. <input type="text" class="form-control" id="mysql_passwd" name="mysql_passwd"
  83. value="{{$data->mysql_passwd??''}}">
  84. </div>
  85. </div>
  86. <div class="hr-line-dashed"></div>
  87. <div class="form-group">
  88. <div class="col-sm-4 col-sm-offset-2">
  89. <button class="btn btn-primary" type="button" onclick="units.save()">
  90. 保存
  91. </button>
  92. <button class="btn btn-white closeLayer" type="button">取消</button>
  93. </div>
  94. </div>
  95. </form>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </body>
  102. @endsection
  103. @section('footer')
  104. <script>
  105. var units = {
  106. save: function () {
  107. var data = tips.getFormValues('#form');
  108. var config = {
  109. url: '/admin/servers/' + "{{$data->server_id??0}}",
  110. type: 'put',
  111. data: data,
  112. success: function (result) {
  113. layer.msg(result.message, {icon: 6, time: 1500},function () {
  114. tips.closeParentLayer();
  115. window.parent.tips.tableRefresh('#table');
  116. });
  117. }
  118. };
  119. tips.ajax(config);
  120. }
  121. };
  122. </script>
  123. @endsection