index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-card">
  5. <div class="layui-card-header">
  6. <div class="layui-btn-group">
  7. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="$eb.createModalFrame('添加直播域名','{:Url('create')}',{w:800,h:560})"><i class="layui-icon">&#xe608;</i> 添加直播域名</button>
  8. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="window.location.reload()" style="margin-left: 5px;"><i class="layui-icon">&#xe669;</i> 刷新</button>
  9. </div>
  10. </div>
  11. <div class="layui-card-body">
  12. <div class="ibox-content">
  13. <div class="table-responsive">
  14. <table class="table table-striped table-bordered">
  15. <thead>
  16. <tr>
  17. <th class="text-center">域名</th>
  18. <th class="text-center">CNAME</th>
  19. <th class="text-center">业务类型</th>
  20. <th class="text-center">直播中心</th>
  21. <th class="text-center">状态</th>
  22. <th class="text-center">CDN 加速区域</th>
  23. <th class="text-center">推流域名</th>
  24. <th class="text-center">oss桶</th>
  25. <th class="text-center">主KEY</th>
  26. <th class="text-center">是否使用</th>
  27. <th class="text-center">操作</th>
  28. </tr>
  29. </thead>
  30. <tbody class="">
  31. {volist name="list" id="vo"}
  32. <tr>
  33. <td class="text-center">
  34. {$vo.domain_name}
  35. </td>
  36. <td class="text-center">
  37. {$vo.cname}
  38. <button class="btn btn-primary btn-xs configuring configuring{$vo.id}" data-id="{$vo.id}" data-domain_name="{$vo.domain_name}" data-cname="{$vo.cname}" type="button">配置</button>
  39. </td>
  40. <td class="text-center">
  41. {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
  42. 播流域名<br/>
  43. {else/}
  44. 推流域名<br/>
  45. {/if}
  46. </td>
  47. <td class="text-center">
  48. {if condition="$vo['region'] eq 'cn-beijing' "}
  49. 华北2(北京)<br/>
  50. {elseif condition="$vo['region'] eq 'cn-shanghai' "}
  51. 华东2(上海)<br/>
  52. {elseif condition="$vo['region'] eq 'cn-shenzhen' "}
  53. 华南1(深圳)<br/>
  54. {elseif condition="$vo['region'] eq 'cn-qingdao' "}
  55. 华北1(青岛)<br/>
  56. {elseif condition="$vo['region'] eq 'ap-southeast-1' "}
  57. 亚太东南1(新加坡)<br/>
  58. {elseif condition="$vo['region'] eq 'eu-central-1' "}
  59. 德国<br/>
  60. {elseif condition="$vo['region'] eq 'ap-northeast-1' "}
  61. 亚太东北1(东京)<br/>
  62. {elseif condition="$vo['region'] eq 'ap-south-1' "}
  63. 印度(孟买)<br/>
  64. {elseif condition="$vo['region'] eq 'ap-southeast-5' "}
  65. 印度尼西亚(雅加达)<br/>
  66. {/if}
  67. </td>
  68. <td class="text-center">
  69. {if condition="$vo['domain_status'] eq 'online'"}
  70. 正常运行<br/>
  71. {elseif condition="$vo['domain_status'] eq 'offline'"}
  72. 停用<br/>
  73. {else /}
  74. 配置中<br/>
  75. {/if}
  76. </td>
  77. <td class="text-center">
  78. {if condition="$vo['scope'] eq 'domestic' "}
  79. 中国大陆<br/>
  80. {elseif condition="$vo['scope'] eq 'overseas' "}
  81. 海外及港澳台加速<br/>
  82. {else/}
  83. 全球加速<br/>
  84. {/if}
  85. </td>
  86. <td class="text-center">
  87. {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
  88. {if condition="$vo['push_domain'] eq '' "}
  89. <button class="btn btn-primary btn-xs" onclick="$eb.createModalFrame(this.innerText,'{:Url('addStreaming',array('id'=>$vo['id']))}',{w:800,h:400})" type="button">添加推流域名</button>
  90. {else /}
  91. {$vo.push_domain}
  92. <button class="btn btn-primary btn-xs del_push_domain" data-url="{:Url('delStreaming',array('id'=>$vo['id']))}" type="button">删除</button>
  93. {/if}
  94. {else/}
  95. 不需要配置<br/>
  96. {/if}
  97. </td>
  98. <td class="text-center">
  99. {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
  100. {if condition="$vo['bucket_name'] eq '' "}
  101. <button class="btn btn-primary btn-xs" onclick="$eb.createModalFrame(this.innerText,'{:Url('toConfigure',array('id'=>$vo['id']))}',{w:800,h:400})" type="button">录制设置</button>
  102. {else /}
  103. {$vo.bucket_name}
  104. <button class="layui-btn layui-btn-danger layui-btn-xs del_app_record" data-url="{:Url('delLiveAppRecordConfig',array('id'=>$vo['id']))}" type="button"><i class="layui-icon">&#xe640;</i> 删除</button>
  105. {/if}
  106. {else/}
  107. 不需要配置<br/>
  108. {/if}
  109. </td>
  110. <td class="text-center">
  111. {$vo.auth_key1}
  112. </td>
  113. <td class="text-center">
  114. {if condition="$vo['is_use'] eq 1"}
  115. 使用中<br/>
  116. {else/}
  117. 未使用<br/>
  118. {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
  119. <button data-url="{:url('userLiveUse',['id'=>$vo['id']])}" class="j-success btn btn-primary btn-xs" type="button"><i class="fa fa-check"></i> 使用</button>
  120. {/if}
  121. {/if}
  122. </td>
  123. <td class="text-center">
  124. {if condition="$vo['domain_status'] eq 'online'"}
  125. <button class="btn btn-primary btn-xs offlines" data-url="{:Url('offlines',array('id'=>$vo['id']))}" type="button">停用</button>
  126. {elseif condition="$vo['domain_status'] eq 'offline'"}
  127. <button class="btn btn-primary btn-xs onlines" data-url="{:Url('onlines',array('id'=>$vo['id']))}" type="button">启用</button>
  128. {else /}
  129. <button class="btn btn-primary btn-xs" type="button">配置中</button>
  130. {/if}
  131. <button class="btn btn-primary btn-xs detail" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button">删除</button>
  132. </td>
  133. </tr>
  134. {/volist}
  135. </tbody>
  136. </table>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. {/block}
  143. {block name="script"}
  144. <script>
  145. $('.detail').on('click',function(){
  146. window.t = $(this);
  147. var _this = $(this),url =_this.data('url');
  148. $eb.$swal('delete',function(){
  149. $eb.axios.get(url).then(function(res){
  150. if(res.status == 200 && res.data.code == 200) {
  151. $eb.$swal('success',res.data.msg);
  152. _this.parents('tr').remove();
  153. }else
  154. return Promise.reject(res.data.msg || '删除失败')
  155. }).catch(function(err){
  156. $eb.$swal('error',err);
  157. });
  158. })
  159. });
  160. $('.offlines').on('click',function(){
  161. var url = $(this).data('url');
  162. $eb.$swal('delete',function(){
  163. $eb.axios.post(url).then(function(res){
  164. if(res.data.code == 200) {
  165. window.location.reload();
  166. $eb.$swal('success', res.data.msg);
  167. }else
  168. $eb.$swal('error',res.data.msg||'操作失败!');
  169. });
  170. },{
  171. title:'确定停用域名吗?',
  172. text:'域名停用,请谨慎操作!',
  173. confirm:'确认'
  174. });
  175. });
  176. $('.onlines').on('click',function(){
  177. var url = $(this).data('url');
  178. $eb.$swal('delete',function(){
  179. $eb.axios.post(url).then(function(res){
  180. if(res.data.code == 200) {
  181. window.location.reload();
  182. $eb.$swal('success', res.data.msg);
  183. }else
  184. $eb.$swal('error',res.data.msg||'操作失败!');
  185. });
  186. },{
  187. title:'确定启用域名吗?',
  188. text:'域名启用,请谨慎操作!',
  189. confirm:'确认'
  190. });
  191. });
  192. $('.del_push_domain').on('click',function(){
  193. var url = $(this).data('url');
  194. $eb.$swal('delete',function(){
  195. $eb.axios.post(url).then(function(res){
  196. if(res.data.code == 200) {
  197. window.location.reload();
  198. $eb.$swal('success', res.data.msg);
  199. }else
  200. $eb.$swal('error',res.data.msg||'操作失败!');
  201. });
  202. },{
  203. title:'确定要删除推流域名吗?',
  204. text:'删除推流域名,请谨慎操作!',
  205. confirm:'确认'
  206. });
  207. });
  208. $('.del_app_record').on('click',function(){
  209. var url = $(this).data('url');
  210. $eb.$swal('delete',function(){
  211. $eb.axios.post(url).then(function(res){
  212. if(res.data.code == 200) {
  213. window.location.reload();
  214. $eb.$swal('success', res.data.msg);
  215. }else
  216. $eb.$swal('error',res.data.msg||'操作失败!');
  217. });
  218. },{
  219. title:'确定要删除录制配置吗?',
  220. text:'删除录制配置,请谨慎操作!',
  221. confirm:'确认'
  222. });
  223. });
  224. $('.configuring').click(function () {
  225. var domain_name = $(this).data('domain_name');
  226. var cname = $(this).data('cname');
  227. var id = $(this).data('id');
  228. var arr= domain_name.split('.');
  229. layer.tips('<div style="color: #0092DC;margin-top: 5px;">解析推流域名:'+domain_name+'</div> '+
  230. '<div style="color: #0092DC;margin-top: 5px;">解析域名为:'+arr[0]+'</div>'+
  231. '<div style="color: #0092DC;margin-top: 5px;">解析值为:</div>'+
  232. '<div style="color: #0092DC;margin-top: 5px;">'+cname+'</div>'+
  233. '<div style="color: #0092DC;margin-top: 5px;">解析类型为: CNAME</div>', '.configuring'+id);
  234. });
  235. $('.j-success').click(function () {
  236. var url = $(this).data('url');
  237. $eb.$swal('delete',function(){
  238. $eb.axios.post(url).then(function(res){
  239. if(res.data.code == 200) {
  240. window.location.reload();
  241. $eb.$swal('success', res.data.msg);
  242. }else
  243. $eb.$swal('error',res.data.msg||'操作失败!');
  244. });
  245. },{
  246. title:'确定使用该直播域名吗?',
  247. text:'使用后无法撤销,请谨慎操作!',
  248. confirm:'确认'
  249. });
  250. });
  251. </script>
  252. {/block}