123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- {extend name="public/container"}
- {block name="content"}
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-header">
- <div class="layui-btn-group">
- <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"></i> 添加直播域名</button>
- <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="window.location.reload()" style="margin-left: 5px;"><i class="layui-icon"></i> 刷新</button>
- </div>
- </div>
- <div class="layui-card-body">
- <div class="ibox-content">
- <div class="table-responsive">
- <table class="table table-striped table-bordered">
- <thead>
- <tr>
- <th class="text-center">域名</th>
- <th class="text-center">CNAME</th>
- <th class="text-center">业务类型</th>
- <th class="text-center">直播中心</th>
- <th class="text-center">状态</th>
- <th class="text-center">CDN 加速区域</th>
- <th class="text-center">推流域名</th>
- <th class="text-center">oss桶</th>
- <th class="text-center">主KEY</th>
- <th class="text-center">是否使用</th>
- <th class="text-center">操作</th>
- </tr>
- </thead>
- <tbody class="">
- {volist name="list" id="vo"}
- <tr>
- <td class="text-center">
- {$vo.domain_name}
- </td>
- <td class="text-center">
- {$vo.cname}
- <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>
- </td>
- <td class="text-center">
- {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
- 播流域名<br/>
- {else/}
- 推流域名<br/>
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['region'] eq 'cn-beijing' "}
- 华北2(北京)<br/>
- {elseif condition="$vo['region'] eq 'cn-shanghai' "}
- 华东2(上海)<br/>
- {elseif condition="$vo['region'] eq 'cn-shenzhen' "}
- 华南1(深圳)<br/>
- {elseif condition="$vo['region'] eq 'cn-qingdao' "}
- 华北1(青岛)<br/>
- {elseif condition="$vo['region'] eq 'ap-southeast-1' "}
- 亚太东南1(新加坡)<br/>
- {elseif condition="$vo['region'] eq 'eu-central-1' "}
- 德国<br/>
- {elseif condition="$vo['region'] eq 'ap-northeast-1' "}
- 亚太东北1(东京)<br/>
- {elseif condition="$vo['region'] eq 'ap-south-1' "}
- 印度(孟买)<br/>
- {elseif condition="$vo['region'] eq 'ap-southeast-5' "}
- 印度尼西亚(雅加达)<br/>
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['domain_status'] eq 'online'"}
- 正常运行<br/>
- {elseif condition="$vo['domain_status'] eq 'offline'"}
- 停用<br/>
- {else /}
- 配置中<br/>
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['scope'] eq 'domestic' "}
- 中国大陆<br/>
- {elseif condition="$vo['scope'] eq 'overseas' "}
- 海外及港澳台加速<br/>
- {else/}
- 全球加速<br/>
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
- {if condition="$vo['push_domain'] eq '' "}
- <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>
- {else /}
- {$vo.push_domain}
- <button class="btn btn-primary btn-xs del_push_domain" data-url="{:Url('delStreaming',array('id'=>$vo['id']))}" type="button">删除</button>
- {/if}
- {else/}
- 不需要配置<br/>
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
- {if condition="$vo['bucket_name'] eq '' "}
- <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>
- {else /}
- {$vo.bucket_name}
- <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"></i> 删除</button>
- {/if}
- {else/}
- 不需要配置<br/>
- {/if}
- </td>
- <td class="text-center">
- {$vo.auth_key1}
- </td>
- <td class="text-center">
- {if condition="$vo['is_use'] eq 1"}
- 使用中<br/>
- {else/}
- 未使用<br/>
- {if condition="$vo['live_domain_type'] eq 'liveVideo' "}
- <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>
- {/if}
- {/if}
- </td>
- <td class="text-center">
- {if condition="$vo['domain_status'] eq 'online'"}
- <button class="btn btn-primary btn-xs offlines" data-url="{:Url('offlines',array('id'=>$vo['id']))}" type="button">停用</button>
- {elseif condition="$vo['domain_status'] eq 'offline'"}
- <button class="btn btn-primary btn-xs onlines" data-url="{:Url('onlines',array('id'=>$vo['id']))}" type="button">启用</button>
- {else /}
- <button class="btn btn-primary btn-xs" type="button">配置中</button>
- {/if}
- <button class="btn btn-primary btn-xs detail" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button">删除</button>
- </td>
- </tr>
- {/volist}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $('.detail').on('click',function(){
- window.t = $(this);
- var _this = $(this),url =_this.data('url');
- $eb.$swal('delete',function(){
- $eb.axios.get(url).then(function(res){
- if(res.status == 200 && res.data.code == 200) {
- $eb.$swal('success',res.data.msg);
- _this.parents('tr').remove();
- }else
- return Promise.reject(res.data.msg || '删除失败')
- }).catch(function(err){
- $eb.$swal('error',err);
- });
- })
- });
- $('.offlines').on('click',function(){
- var url = $(this).data('url');
- $eb.$swal('delete',function(){
- $eb.axios.post(url).then(function(res){
- if(res.data.code == 200) {
- window.location.reload();
- $eb.$swal('success', res.data.msg);
- }else
- $eb.$swal('error',res.data.msg||'操作失败!');
- });
- },{
- title:'确定停用域名吗?',
- text:'域名停用,请谨慎操作!',
- confirm:'确认'
- });
- });
- $('.onlines').on('click',function(){
- var url = $(this).data('url');
- $eb.$swal('delete',function(){
- $eb.axios.post(url).then(function(res){
- if(res.data.code == 200) {
- window.location.reload();
- $eb.$swal('success', res.data.msg);
- }else
- $eb.$swal('error',res.data.msg||'操作失败!');
- });
- },{
- title:'确定启用域名吗?',
- text:'域名启用,请谨慎操作!',
- confirm:'确认'
- });
- });
- $('.del_push_domain').on('click',function(){
- var url = $(this).data('url');
- $eb.$swal('delete',function(){
- $eb.axios.post(url).then(function(res){
- if(res.data.code == 200) {
- window.location.reload();
- $eb.$swal('success', res.data.msg);
- }else
- $eb.$swal('error',res.data.msg||'操作失败!');
- });
- },{
- title:'确定要删除推流域名吗?',
- text:'删除推流域名,请谨慎操作!',
- confirm:'确认'
- });
- });
- $('.del_app_record').on('click',function(){
- var url = $(this).data('url');
- $eb.$swal('delete',function(){
- $eb.axios.post(url).then(function(res){
- if(res.data.code == 200) {
- window.location.reload();
- $eb.$swal('success', res.data.msg);
- }else
- $eb.$swal('error',res.data.msg||'操作失败!');
- });
- },{
- title:'确定要删除录制配置吗?',
- text:'删除录制配置,请谨慎操作!',
- confirm:'确认'
- });
- });
- $('.configuring').click(function () {
- var domain_name = $(this).data('domain_name');
- var cname = $(this).data('cname');
- var id = $(this).data('id');
- var arr= domain_name.split('.');
- layer.tips('<div style="color: #0092DC;margin-top: 5px;">解析推流域名:'+domain_name+'</div> '+
- '<div style="color: #0092DC;margin-top: 5px;">解析域名为:'+arr[0]+'</div>'+
- '<div style="color: #0092DC;margin-top: 5px;">解析值为:</div>'+
- '<div style="color: #0092DC;margin-top: 5px;">'+cname+'</div>'+
- '<div style="color: #0092DC;margin-top: 5px;">解析类型为: CNAME</div>', '.configuring'+id);
- });
- $('.j-success').click(function () {
- var url = $(this).data('url');
- $eb.$swal('delete',function(){
- $eb.axios.post(url).then(function(res){
- if(res.data.code == 200) {
- window.location.reload();
- $eb.$swal('success', res.data.msg);
- }else
- $eb.$swal('error',res.data.msg||'操作失败!');
- });
- },{
- title:'确定使用该直播域名吗?',
- text:'使用后无法撤销,请谨慎操作!',
- confirm:'确认'
- });
- });
- </script>
- {/block}
|