redis_config.blade.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('REDIS设置'))
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. padding-left: 20px;
  8. border-radius: 10px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. padding-bottom:20px;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background-color:#fff;
  28. position:relative;
  29. }
  30. .con .setting .block{
  31. padding:10px;
  32. margin-bottom:10px;
  33. border-radius: 8px;
  34. }
  35. .con .setting .block .title{
  36. font-size:18px;
  37. margin-bottom:15px;
  38. display:flex;
  39. align-items:center;
  40. }
  41. .el-form-item__label{
  42. margin-right:30px;
  43. }
  44. .confirm-btn{
  45. width: calc(100% - 266px);
  46. position:fixed;
  47. bottom:0;
  48. right:0;
  49. margin-right:10px;
  50. line-height:63px;
  51. background-color: #ffffff;
  52. box-shadow: 0px 8px 23px 1px
  53. rgba(51, 51, 51, 0.3);
  54. background-color:#fff;
  55. text-align:center;
  56. }
  57. b{
  58. font-size:14px;
  59. }
  60. </style>
  61. <div id='re_content' >
  62. @include('layouts.newTabs')
  63. <div class="con">
  64. <div class="setting">
  65. <el-form ref="form" :model="form" label-width="15%">
  66. <div class="block">
  67. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>REDIS设置</b></div>
  68. <el-form-item label="域名(redis_host)" v-if="framework">
  69. <el-input v-model="form.host" placeholder="" style="width:70%;"></el-input>
  70. <div style="font-size:12px;">为空时默认为127.0.0.1</div>
  71. </el-form-item>
  72. <el-form-item label="密码(redis_password)" v-if="framework">
  73. <el-input v-model="form.password" placeholder="" style="width:70%;" type="password"></el-input>
  74. <div style="font-size:12px;">redis没设置密码时此行不用填写,为空时默认为NULL</div>
  75. </el-form-item>
  76. <el-form-item label="端口(port)" v-if="framework">
  77. <el-input v-model="form.port" placeholder="" style="width:70%;"></el-input>
  78. <div style="font-size:12px;">为空时默认为6379</div>
  79. </el-form-item>
  80. <el-form-item label="库(database)">
  81. <el-input v-model="form.database" placeholder="" style="width:70%;"></el-input>
  82. <div style="font-size:12px;">为空时默认为0</div>
  83. </el-form-item>
  84. <el-form-item label="cache库(cache_database)">
  85. <el-input v-model="form.cache_database" placeholder="" style="width:70%;"></el-input>
  86. <div style="font-size:12px;">为空时默认为1</div>
  87. </el-form-item>
  88. </div>
  89. </div>
  90. <div class="confirm-btn">
  91. <el-button @click="submit" type="primary">提交</el-button>
  92. </div>
  93. </el-form>
  94. </div>
  95. </div>
  96. <script>
  97. var vm = new Vue({
  98. el: "#re_content",
  99. delimiters: ['[[', ']]'],
  100. data() {
  101. let data = {!! $set ?: '{}' !!}
  102. return {
  103. activeName: 'first',
  104. framework : {{(config('app.APP_Framework', false) == 'platform')?1:0}},
  105. form:{
  106. host : data.host ? data.host : '',
  107. password :data.password ? data.password : '',
  108. port : data.port ? data.port : '',
  109. database : data.database ? data.database : '',
  110. cache_database : data.cache_database ? data.cache_database : '',
  111. },
  112. }
  113. },
  114. mounted () {
  115. // this.getData();
  116. },
  117. methods: {
  118. submit() {
  119. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  120. this.$http.post('{!! yzWebFullUrl('siteSetting.index.redis-config') !!}',{'redis':this.form}).then(function (response){
  121. if (response.data.result) {
  122. this.$message({message: response.data.msg,type: 'success'});
  123. }else {
  124. this.$message({message: response.data.msg,type: 'error'});
  125. }
  126. loading.close();
  127. location.reload();
  128. },function (response) {
  129. this.$message({message: response.data.msg,type: 'error'});
  130. })
  131. },
  132. getData(){
  133. this.$http.post('{!! yzWebFullUrl('siteSetting.index.redis-config') !!}').then(function (response){
  134. if (response.data.result) {
  135. if(response.data.data.set){
  136. for(let i in response.data.data.set){
  137. this.form[i]=response.data.data.set[i]
  138. }
  139. }
  140. }else {
  141. this.$message({message: response.data.msg,type: 'error'});
  142. }
  143. },function (response) {
  144. this.$message({message: response.data.msg,type: 'error'});
  145. })
  146. }
  147. },
  148. });
  149. </script>
  150. @endsection