1.0.0-alpha.325

Former-commit-id: 7d8cfa2f7e3763da0ee1a9469b9c274082062360
TangShanKaiPing
wanggang 5 years ago
parent fac3fe100e
commit 4752918af7

@ -1,5 +1,4 @@
using System.Runtime.InteropServices;
using Xamarin.Essentials;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using XamarinApp.iOS;
@ -16,7 +15,7 @@ namespace XamarinApp.iOS
if (e.NewElement != null)
{
CustomUserAgent = $"{DeviceInfo.Manufacturer}~{DeviceInfo.Model}~{Device.RuntimePlatform}~{(Device.Idiom == TargetIdiom.Tablet ? "ipad" : "iphone")}";
CustomUserAgent = $"{DeviceInfo.Manufacturer} {DeviceInfo.Model} {Device.RuntimePlatform} {(Device.Idiom == TargetIdiom.Tablet ? "ipad" : "iphone")} Mac OS X";
}
}
}

@ -284,7 +284,7 @@ namespace Infrastructure.Web
{
if (!context.Request.IsAjax())
{
context.Response.Redirect("/Account/Login");
context.Response.Redirect("/UserCenter/Account/Login");
context.HandleResponse();
}
return Task.CompletedTask;

@ -58,9 +58,8 @@ namespace IoTCenter.Controllers
public IActionResult Logout()
{
var fullReturnUrl = Url.FullAction("Index", "Home");
var logoutUrl = this._cfg["usercenter:logout"];
var url = logoutUrl.SetParam("returnUrl", fullReturnUrl);
var url = logoutUrl.SetParam("returnUrl", "/IoTCenter/");
return Redirect(url);
}
@ -122,9 +121,8 @@ namespace IoTCenter.Controllers
[AllowAnonymous]
public IActionResult Login(string returnUrl = null)
{
var fullReturnUrl = Url.GetFullUrl(returnUrl ?? "~");
var loginUrl = this._cfg["usercenter:login"];
var url = loginUrl.SetParam(nameof(returnUrl), fullReturnUrl);
var url = loginUrl.SetParam(nameof(returnUrl), returnUrl ?? "/IoTCenter/");
return Redirect(url);
}

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<Version>1.0.0-alpha.317</Version>
<Version>1.0.0-alpha.325</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />

@ -60,6 +60,7 @@
var hubUrl = "@Url.Content("~")/hub?group=page";
var onMessage = null;
</script>
<script src="~/lib/WXInlinePlayer/prod.all.wasm.combine.js"></script>
<script src="~/lib/WXInlinePlayer/index.js"></script>
<script src="~/js/util.js"></script>
<script src="~/js/iot.js"></script>

@ -45,9 +45,9 @@
},
"usercenter": {
"key": "123456",
"login": "http://localhost:8010/Account/Login",
"logout": "http://localhost:8010/Account/Logout",
"register": "http://localhost:8010/Account/Register"
"login": "http://localhost/UserCenter/Account/Login",
"logout": "http://localhost/UserCenter/Account/Logout",
"register": "http://localhost/UserCenter/Account/Register"
},
"ConnectionStrings": {
"postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotdb;CommandTimeout=120",

@ -1,8 +1,8 @@
var time = '1d';
if (WXInlinePlayer.isSupport()) {
WXInlinePlayer.init({
asmUrl: '/lib/WXInlinePlayer/prod.all.asm.combine.js',
wasmUrl: '/lib/WXInlinePlayer/prod.all.wasm.combine.js'
asmUrl: baseUrl+'/lib/WXInlinePlayer/prod.all.asm.combine.js',
wasmUrl: baseUrl +'/lib/WXInlinePlayer/prod.all.wasm.combine.js'
});
}
function getDeviceDataValue(device, name) {
@ -46,67 +46,67 @@ function parseModel(response) {
return model;
}
Vue.component('iot-gateway', function (resolve, reject) {
axios.get("/pages/iot/device/gateway.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/gateway.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-light', function (resolve, reject) {
axios.get("/pages/iot/device/light.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/light.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-humiture', function (resolve, reject) {
axios.get("/pages/iot/device/humiture.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/humiture.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-smoke', function (resolve, reject) {
axios.get("/pages/iot/device/smoke.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/smoke.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-person', function (resolve, reject) {
axios.get("/pages/iot/device/person.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/person.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-curtain', function (resolve, reject) {
axios.get("/pages/iot/device/curtain.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/curtain.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-switch', function (resolve, reject) {
axios.get("/pages/iot/device/switch.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/switch.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-switch3', function (resolve, reject) {
axios.get("/pages/iot/device/switch3.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/switch3.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-socket', function (resolve, reject) {
axios.get("/pages/iot/device/socket.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/socket.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-ir', function (resolve, reject) {
axios.get("/pages/iot/device/ir.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/ir.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-color-light', function (resolve, reject) {
axios.get("/pages/iot/device/color-light.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/color-light.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-camera', function (resolve, reject) {
axios.get("/pages/iot/device/camera.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/camera.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('iot-serial-port', function (resolve, reject) {
axios.get("/pages/iot/device/serial-port.html").then(function (response) {
axios.get(baseUrl+"/pages/iot/device/serial-port.html").then(function (response) {
resolve(parseModel(response));
});
});

@ -5,26 +5,7 @@
</div>
<div class="card-body" style="padding:0;">
<div class="row video-container" style="width:320px;height:240px;margin: 0 auto;background-color:#333;position:relative;">
<video controls muted autoplay :class="device.number" v-if="isFlvSupported" v-on:volumechange="volumeChange($event)" style="width:100%;height:100%;object-fit:contain;"></video>
<template v-else>
<canvas width="1080" height="720" style="width:100%;height:100%;object-fit:contain;background: #333;margin:0 auto;" :class="device.number" v-on:click="showControls()"></canvas>
<div :class="'control '+device.number" style="position:absolute;height:30px;left:0;right:0;bottom:0;background-color:#333;display: none;">
<a href="javascript:;" v-on:click="play()" style="color: #fff; margin: 0 10px; line-height: 30px;">
<i class="ion ion-md-pause" v-if="playing"></i>
<i v-else class="ion ion-md-play"></i>
</a>
<template v-if="playing">
<a href="javascript:;" v-on:click="fullScreen()" style="color:#fff;margin:0 10px;line-height:30px;float:right;">
<i class="ion ion-md-expand"></i>
</a>
<a href="javascript:;" v-on:click="mute()" style="color:#fff;margin:0 10px;line-height:30px;float:right;">
<i class="ion ion-md-volume-off" v-if="muted"></i>
<i class="ion ion-md-volume-high" v-else></i>
</a>
<input type="range" min="0" max="1" step="0.1" :value="volume" style="-webkit-appearance:none;float:right;width:80px;height:4px;margin:13px 2px;background:#666;outline:none;" v-on:change=volumeChange2($event) />
</template>
</div>
</template>
<video controls muted autoplay :class="device.number" v-on:volumechange="volumeChange($event)" style="width:100%;height:100%;object-fit:contain;"></video>
</div>
<div style="box-sizing: border-box;width: 320px;margin: 5px auto;" :class="'row ptz '+ device.number">
<table style="width: 100%; height:100px;">
@ -85,7 +66,7 @@
this.playByFlvJs();
}
else {
this.playByWXInlinePlayer();
this.playHls();
}
},
destroyed: function () {
@ -98,9 +79,13 @@
this.wxInlinePlayer.stop();
}
else {
this.wxInlinePlayer.play();
}
},
playHls: function () {
$('video.' + this.device.number).attr('src', this.url);
},
playByFlvJs: function () {
var videoElement = $('video.' + this.device.number)[0];
var push = Enumerable.from(this.device.data).where(o => o.name === '推流').firstOrDefault();
@ -258,11 +243,16 @@
},
computed: {
url: function () {
return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv';
if (this.isFlvSupported) {
return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv';
}
else {
return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.m3u8';
}
//return getDeviceDataValue(this.device, 'flv');
},
isFlvSupported: function () {
return flvjs.isSupported();
return flvjs.isSupported() && window.navigator.userAgent.indexOf('Mac OS X') === -1;//AppleWebKit
},
ptz: function () {
if (getDeviceDataValue(this.device, '云台地址')) {

@ -102,7 +102,7 @@ namespace IoTNode
set.Add(new Setting { Name = "stream.rtmp", Value = stream });
set.Add(new Setting { Name = "stream.flv", Value = $"{stream})" });
set.Add(new Setting { Name = "stream.hls", Value = $"{stream})" });
set.Add(new Setting { Name = "ffmpeg.args", Value = " -y -threads {0}) -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1})\" -fflags +genpts -c copy -f flv \"{2})\"" });
set.Add(new Setting { Name = "ffmpeg.args", Value = " -y -threads {0} -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1}\" -fflags +genpts -c copy -f flv \"{2}\"" });
set.Add(new Setting { Name = "fbee.writelist", Value = "" });
set.Add(new Setting { Name = "camera.writelist", Value = "" });
dbContext.SaveChanges();

@ -161,9 +161,9 @@ namespace UserCenter
Icon = "/images/iotcenter.png",
Name = "物联网平台",
Description = "智能设备管控中心",
Home = $"http://{host}:8011/",
Login = $"http://{host}:8011/Account/JsonpLogin",
Logout = $"http://{host}:8011/Account/JsonpLogout",
Home = $"http://{host}/IoTCenter/",
Login = $"http://{host}/IoTCenter/Account/JsonpLogin",
Logout = $"http://{host}/IoTCenter/Account/JsonpLogout",
Key = "123456"
});
dbContext.Set<Site>().Add(new Site

@ -5,6 +5,8 @@
<title></title>
</head>
<body>
<a href="/IoTCenter">物联网平台</a>
<script>
window.location.href = "/IoTCenter";
</script>
</body>
</html>

@ -1,6 +1,5 @@
var config = (function(global){
global.apigateway = 'http://192.168.1.8'; // 设置通过API网关访问
//global.resourceUrl = 'http://192.168.3.118'; // 媒体文件资源
global.iotCenterUrl = global.apigateway + '/IoTCenter'; // IoT服务API
global.hubUrl = global.apigateway + '/IoTCenter/hub?group=page'; // 设备WebSocket访问地址
global.liverUrl = global.apigateway; // 流媒体服务器地址

@ -5,38 +5,19 @@
</div>
<div class="card-body" style="padding:0;">
<div class="row video-container" style="min-width:320px; min-height:240px; width:100%; height:auto; margin: 0 auto;background-color:#333;position:relative;">
<video controls muted autoplay :class="device.number" v-if="isFlvSupported" v-on:volumechange="volumeChange($event)" style="width:100%;height:100%;object-fit:contain;"></video>
<template v-else>
<canvas width="1080" height="720" style="width:100%;max-width:1080px;height:100%;object-fit:contain;background: #333;margin:0 auto;" :class="device.number" v-on:click="showControls()"></canvas>
<div :class="'control '+device.number" style="position:absolute;height:30px;left:0;right:0;bottom:0;background-color:#333;display: none;">
<a href="javascript:;" v-on:click="play()" style="color: #fff; margin: 0 10px; line-height: 30px;">
<i class="ion ion-md-pause" v-if="playing"></i>
<i v-else class="ion ion-md-play"></i>
</a>
<template v-if="playing">
<a href="javascript:;" v-on:click="fullScreen()" style="color:#fff;margin:0 10px;line-height:30px;float:right;">
<i class="ion ion-md-expand"></i>
</a>
<a href="javascript:;" v-on:click="mute()" style="color:#fff;margin:0 10px;line-height:30px;float:right;">
<i class="ion ion-md-volume-off" v-if="muted"></i>
<i class="ion ion-md-volume-high" v-else></i>
</a>
<input type="range" min="0" max="1" step="0.1" :value="volume" style="-webkit-appearance:none;float:right;width:80px;height:4px;margin:13px 2px;background:#666;outline:none;" v-on:change=volumeChange2($event) />
</template>
</div>
</template>
<video controls muted autoplay :class="device.number" v-on:volumechange="volumeChange($event)" style="width:100%;height:100%;object-fit:contain;"></video>
</div>
<div style="box-sizing: border-box; min-width: 320px;margin: 5px auto; padding:15px;position:relative;" :class="'row ptz '+ device.number">
<table style="width: 100%; max-width:320px; height: 100px; margin: 5px auto;">
<tr>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StartRecord')" style="margin: 5px;" >启动推流</button></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StartRecord')" style="margin: 5px;">启动推流</button></td>
<td></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StopRecord')" style="margin: 5px;" >停止推流</button></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StopRecord')" style="margin: 5px;">停止推流</button></td>
</tr>
<tr>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StartPush')" style="margin: 5px;" >开始录像</button></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StartPush')" style="margin: 5px;">开始录像</button></td>
<td></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StopPush')" style="margin: 5px;" >停止录像</button></td>
<td colspan="2" style="text-align:center;"><button class="weui-btn weui-btn_mini weui-btn_default" v-on:click="execApi(model.number,'/Onvif/StopPush')" style="margin: 5px;">停止录像</button></td>
</tr>
<template v-if="ptz">
<tr>
@ -48,15 +29,15 @@
</tr>
<tr>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomin')" :src="config.apigateway+'/IoTCenter/images/zoomin.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Left')" :src="config.apigateway+'/IoTCenter/images/left.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Stop')" :src="config.apigateway+'/IoTCenter/images/stop.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Right')" :src="config.apigateway+'/IoTCenter/images/right.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomout')" :src="config.apigateway+'/IoTCenter/images/zoomout.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Left')" :src="config.apigateway+'/IoTCenter/images/left.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Stop')" :src="config.apigateway+'/IoTCenter/images/stop.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Right')" :src="config.apigateway+'/IoTCenter/images/right.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomout')" :src="config.apigateway+'/IoTCenter/images/zoomout.png'" style="margin: 5px;" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Down')" :src="config.apigateway+'/IoTCenter/images/down.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Down')" :src="config.apigateway+'/IoTCenter/images/down.png'" style="margin: 5px;" /></td>
<td></td>
<td></td>
</tr>
@ -65,8 +46,8 @@
</div>
<div class="weui-panel weui-panel_access">
<div class="weui-panel__hd" >设备信息</div>
<div class="weui-panel__bd" >
<div class="weui-panel__hd">设备信息</div>
<div class="weui-panel__bd">
<code class="weui-cell" v-for="item in device.data" style="word-wrap:break-word; color:#212529">
{{item.name}}
{{item.value}}
@ -95,7 +76,7 @@
this.playByFlvJs();
}
else {
this.playByWXInlinePlayer();
this.playHls();
}
},
destroyed: function () {
@ -111,6 +92,9 @@
this.wxInlinePlayer.play();
}
},
playHls: function () {
$('video.' + this.device.number).attr('src', this.url);
},
playByFlvJs: function () {
var videoElement = $('video.' + this.device.number)[0];
var push = Enumerable.from(this.device.data).where(o => o.name === '推流').firstOrDefault();
@ -267,13 +251,16 @@
}
},
computed: {
url: function () {
//return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv';
return config.liverUrl + '/live/' + this.device.number + '.flv';
//return getDeviceDataValue(this.device, 'flv');
url: function () {
if (this.isFlvSupported) {
return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv';
}
else {
return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.m3u8';
}
},
isFlvSupported: function () {
return flvjs.isSupported();
return flvjs.isSupported() && window.navigator.userAgent.indexOf('Mac OS X') === -1;//AppleWebKit
},
ptz: function () {
if (getDeviceDataValue(this.device, '云台地址')) {

Loading…
Cancel
Save