国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
7.5KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>云服务设置</title>
  7. <link rel="stylesheet" href="/static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/web/css/admin.css">
  10. <script src="/static/web/js/jquery.min.js"></script>
  11. <script src="/static/web/js/bootstrap.min.js"></script>
  12. <script src="/static/web/js/admin.main.js"></script>
  13. </head>
  14. <body>
  15. <table align="center" class="table maintable my-3">
  16. <tr>
  17. <td bgcolor="#f5f5f5" colspan="4">云服务设置</td>
  18. </tr>
  19. <tr>
  20. <td colspan="4">
  21. <ul class="nav nav-tabs" id="myTab" role="tablist">
  22. <li class="nav-item" role="presentation">
  23. <button class="nav-link active" id="aliyun-tab" data-toggle="tab" data-target="#aliyun" type="button" role="tab" aria-controls="aliyun" aria-selected="true">阿里云</button>
  24. </li>
  25. <li class="nav-item" role="presentation">
  26. <button class="nav-link" id="huaweicloud-tab" data-toggle="tab" data-target="#huaweicloud" type="button" role="tab" aria-controls="huaweicloud" aria-selected="false">华为云</button>
  27. </li>
  28. <li class="nav-item" role="presentation">
  29. <button class="nav-link" id="tencent-tab" data-toggle="tab" data-target="#tencent" type="button" role="tab" aria-controls="tencent" aria-selected="false">腾讯云</button>
  30. </li>
  31. </ul>
  32. <div class="tab-content py-3" id="myTabContent">
  33. <div class="tab-pane fade show active" id="aliyun" role="tabpanel" aria-labelledby="aliyun-tab">
  34. <div class="form-group">
  35. <label for="iptAppID">描述</label>
  36. <p>阿里巴巴集团旗下公司,是全球领先的云计算及人工智能科技公司之一。提供免费试用、云服务器、云数据库、云安全、云企业应用等云计算服务,以及大数据、人工智能服务、精准定制基于场景的行业解决方案。免费备案,7x24小时售后支持,助企业无忧上云。</p>
  37. </div>
  38. <div class="form-group">
  39. <label for="iptAliyunAccessKeyID">AccessKey ID</label>
  40. <input type="text" class="form-control" id="iptAliyunAccessKeyID">
  41. </div>
  42. <div class="form-group">
  43. <label for="iptAliyunAccessKeySecret ">AccessKey Secret</label>
  44. <input type="text" class="form-control" id="iptAliyunAccessKeySecret">
  45. </div>
  46. <div class="form-group form-check">
  47. <input type="checkbox" class="form-check-input" id="cloudType1">
  48. <label class="form-check-label" for="cloudType1">是否启用</label>
  49. </div>
  50. </div>
  51. <div class="tab-pane fade" id="huaweicloud" role="tabpanel" aria-labelledby="huaweicloud-tab">
  52. <div class="form-group">
  53. <label for="iptAppID">描述</label>
  54. <p>华为云提供稳定可靠、安全可信、可持续发展的云服务,致力于让云无处不在,让智能无所不及,共建智能世界云底座。助力企业降本增效,全球300万客户的共同选择。7x24小时专业服务支持,5天内无理由退订,免费快速备案。</p>
  55. </div>
  56. <div class="form-group">
  57. <label for="iptHuaweicloudAccessKeyId">Access Key Id</label>
  58. <input type="text" class="form-control" id="iptHuaweicloudAccessKeyId">
  59. </div>
  60. <div class="form-group">
  61. <label for="iptHuaweicloudSecretAccessKey">Secret Access Key</label>
  62. <input type="text" class="form-control" id="iptHuaweicloudSecretAccessKey">
  63. </div>
  64. <div class="form-group form-check">
  65. <input type="checkbox" class="form-check-input" id="cloudType2">
  66. <label class="form-check-label" for="cloudType2">是否启用</label>
  67. </div>
  68. </div>
  69. <div class="tab-pane fade" id="tencent" role="tabpanel" aria-labelledby="tencent-tab">
  70. <div class="form-group">
  71. <label for="iptAppID">描述</label>
  72. <p>腾讯云为数百万的企业和开发者提供安全稳定的云计算服务,涵盖云服务器、云数据库、云存储、视频与CDN、域名注册等全方位云服务和各行业解决方案。</p>
  73. </div>
  74. <div class="form-group">
  75. <label for="iptTencentSecretId">SecretId</label>
  76. <input type="text" class="form-control" id="iptTencentSecretId">
  77. </div>
  78. <div class="form-group">
  79. <label for="iptTencentSecretKey">SecretKey</label>
  80. <input type="text" class="form-control" id="iptTencentSecretKey">
  81. </div>
  82. <div class="form-group form-check">
  83. <input type="checkbox" class="form-check-input" id="cloudType3">
  84. <label class="form-check-label" for="cloudType3">是否启用</label>
  85. </div>
  86. </div>
  87. <button id="btnSave" type="submit" class="btn btn-success">保存</button>
  88. </div>
  89. </td>
  90. </tr>
  91. </table>
  92. <script>
  93. var cloudConfig = {
  94. aliyun_enabled: false,
  95. aliyun_access_key_id: '',
  96. aliyun_access_key_secret: '',
  97. huaweicloud_enabled: false,
  98. huawei_access_key_id: '',
  99. huawei_secret_access_key: '',
  100. tencent_enabled: false,
  101. tencent_secret_id: '',
  102. tencent_secret_key: '',
  103. };
  104. function LoadConfig() {
  105. $.get("sys_cloud.php?dopost=cloud_get", function(data) {
  106. try {
  107. rs = JSON.parse(data);
  108. if (rs.code === 0) {
  109. cloudConfig = JSON.parse(rs.data);
  110. if (cloudConfig.aliyun_enabled) {
  111. $("#cloudType1").prop("checked", true);
  112. } else {
  113. $("#cloudType1").prop("checked", false);
  114. }
  115. $("#iptAliyunAccessKeyID").val(cloudConfig.aliyun_access_key_id);
  116. $("#iptAliyunAccessKeySecret").val(cloudConfig.aliyun_access_key_secret);
  117. if (cloudConfig.huaweicloud_enabled) {
  118. $("#cloudType2").prop("checked", true);
  119. } else {
  120. $("#cloudType2").prop("checked", false);
  121. }
  122. $("#iptHuaweicloudAccessKeyId").val(cloudConfig.huawei_access_key_id);
  123. $("#iptHuaweicloudSecretAccessKey").val(cloudConfig.huawei_secret_access_key);
  124. if (cloudConfig.tencent_enabled) {
  125. $("#cloudType3").prop("checked", true);
  126. } else {
  127. $("#cloudType3").prop("checked", false);
  128. }
  129. $("#iptTencentSecretId").val(cloudConfig.tencent_secret_id);
  130. $("#iptTencentSecretKey").val(cloudConfig.tencent_secret_key);
  131. }
  132. } catch (error) {
  133. console.log("解析配置失败")
  134. }
  135. });
  136. }
  137. $(document).ready(function() {
  138. $("#btnSave").click(function() {
  139. if ($("#cloudType1").is(":checked")) {
  140. cloudConfig.aliyun_enabled = true;
  141. } else {
  142. cloudConfig.aliyun_enabled = false;
  143. }
  144. cloudConfig.aliyun_access_key_id = $("#iptAliyunAccessKeyID").val();
  145. cloudConfig.aliyun_access_key_secret = $("#iptAliyunAccessKeySecret").val();
  146. if ($("#cloudType2").is(":checked")) {
  147. cloudConfig.huaweicloud_enabled = true;
  148. } else {
  149. cloudConfig.huaweicloud_enabled = false;
  150. }
  151. cloudConfig.huawei_access_key_id = $("#iptHuaweicloudAccessKeyId").val();
  152. cloudConfig.huawei_secret_access_key = $("#iptHuaweicloudSecretAccessKey").val();
  153. if ($("#cloudType3").is(":checked")) {
  154. cloudConfig.tencent_enabled = true;
  155. } else {
  156. cloudConfig.tencent_enabled = false;
  157. }
  158. cloudConfig.tencent_secret_id = $("#iptTencentSecretId").val();
  159. cloudConfig.tencent_secret_key = $("#iptTencentSecretKey").val();
  160. $.post("sys_cloud.php?dopost=cloud_set", cloudConfig, function(result) {
  161. let data = JSON.parse(result);
  162. if (data.code === 0) {
  163. ShowMsg("云服务设置成功");
  164. LoadConfig();
  165. } else {
  166. ShowMsg("设置失败,请检查服务是否正确");
  167. }
  168. });
  169. });
  170. LoadConfig();
  171. });
  172. </script>
  173. </body>
  174. </html>