You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
3.8 KiB
Cheetah
100 lines
3.8 KiB
Cheetah
{{template "head.tmpl" .}}
|
|
<div class="content-header">
|
|
<div class="container-fluid">
|
|
<div class="row mb-2">
|
|
<div class="col-sm-6">
|
|
<h1 class="m-0 text-dark">添加流</h1>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<ol class="breadcrumb float-sm-right">
|
|
<li class="breadcrumb-item"><a href="/">首页</a></li>
|
|
<li class="breadcrumb-item active">添加流</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div><!-- /.container-fluid -->
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
<div class="container-fluid">
|
|
<div class="row" id="streams-form-wrapper">
|
|
|
|
<div class="col-12">
|
|
<div class="card card-primary">
|
|
<div class="card-header">
|
|
<h3 class="card-title">主通道<small> 参数</small></h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<form class="stream-form main-form">
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">流名称</label>
|
|
<input type="text" class="form-control" name="stream-name" placeholder="输入流名称" id="stream-name">
|
|
<small class="form-text text-muted">您可以为流选择任何名称,例如"我的房间"或"客厅"</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="exampleInputPassword1">流地址</label>
|
|
<input type="text" name="stream-url" class="form-control" placeholder="输入流地址">
|
|
<small class="form-text text-muted">按照摄像头说明输入rtsp地址。格式如 <code>rtsp://<ip>:<port>/path </code> </small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="inputStatus">流类型</label>
|
|
<select class="form-control custom-select" name="stream-ondemand">
|
|
<option selected disabled><small>请选择</small></option>
|
|
<option value="1">按需连接</option>
|
|
<option value="0">持续连接</option>
|
|
</select>
|
|
<small class="form-text text-muted">持续连接时,服务器会持续从摄像头获取数据。按需连接时,服务器只在您点击播放按钮时才从摄像头获取数据 </small>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="custom-control custom-switch">
|
|
<input type="checkbox" class="custom-control-input" name="debug" id="debug-switch">
|
|
<label class="custom-control-label" for="debug-switch">启用调试</label>
|
|
</div>
|
|
<small class="form-text text-muted">如果您想获取更多关于流的数据,请选择此选项 </small>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mb-3">
|
|
<div class="col-12">
|
|
<button type="button" onclick="addChannel()" class="btn btn-secondary">添加通道</button>
|
|
<button type="button" onclick="addStreamSubmit()" class="btn btn-primary">保存流</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{{template "foot.tmpl" .}}
|
|
|
|
<script>
|
|
function addStreamSubmit(){
|
|
var params = {
|
|
uuid:randomUuid(),
|
|
name:$('#stream-name').val(),
|
|
channels:{}
|
|
}
|
|
|
|
$('.stream-form').each(function(i){
|
|
params.channels[i]={
|
|
url:$(this).find('input[name="stream-url"]').val(),
|
|
on_demand:Boolean(parseInt($(this).find('select[name="stream-ondemand"]').val())),
|
|
debug:Boolean($(this).find('input[name="debug"]').prop('checked')),
|
|
}
|
|
if(params.channels[i].on_demand==null){
|
|
params.channels[i].on_demand==true;
|
|
}
|
|
});
|
|
goRequest('add', params.uuid, params);
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|