|
|
|
@ -35,7 +35,7 @@ var f7params = isApp? {
|
|
|
|
|
routes: [],
|
|
|
|
|
name: 'My App',
|
|
|
|
|
id: 'com.myapp.test',
|
|
|
|
|
theme: 'ios',
|
|
|
|
|
theme: 'ios'
|
|
|
|
|
}:null;
|
|
|
|
|
//
|
|
|
|
|
//log
|
|
|
|
@ -112,7 +112,7 @@ function loadData() {
|
|
|
|
|
function updateItem(list, item) {
|
|
|
|
|
var update = false;
|
|
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
|
|
if (list[i].id == item.id) {
|
|
|
|
|
if (list[i].id === item.id) {
|
|
|
|
|
update = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -126,7 +126,7 @@ function updateItem(list, item) {
|
|
|
|
|
}
|
|
|
|
|
function deleteItem(list, item) {
|
|
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
|
|
if (list[i].id == item.id) {
|
|
|
|
|
if (list[i].id === item.id) {
|
|
|
|
|
list.splice(i, 1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -253,9 +253,9 @@ function getCode1(code) {
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
function hsvToRgb(h, s, v) {
|
|
|
|
|
if (h == "") h = 0;
|
|
|
|
|
if (s == "") s = 0;
|
|
|
|
|
if (v == "") v = 0;
|
|
|
|
|
if (h === "") h = 0;
|
|
|
|
|
if (s === "") s = 0;
|
|
|
|
|
if (v === "") v = 0;
|
|
|
|
|
h = parseFloat(h);
|
|
|
|
|
s = parseFloat(s);
|
|
|
|
|
v = parseFloat(v);
|
|
|
|
@ -269,7 +269,7 @@ function hsvToRgb(h, s, v) {
|
|
|
|
|
v /= 100.0;
|
|
|
|
|
C = v * s;
|
|
|
|
|
hh = h / 60.0;
|
|
|
|
|
X = C * (1.0 - Math.abs((hh % 2) - 1.0));
|
|
|
|
|
X = C * (1.0 - Math.abs(hh % 2 - 1.0));
|
|
|
|
|
r = g = b = 0;
|
|
|
|
|
if (hh >= 0 && hh < 1) {
|
|
|
|
|
r = C;
|
|
|
|
@ -315,7 +315,7 @@ function hsvToRgb(h, s, v) {
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
function ajax(url, data, type) {
|
|
|
|
|
url = baseUrl + url
|
|
|
|
|
url = baseUrl + url;
|
|
|
|
|
console.log(url);
|
|
|
|
|
type = type || 'get';
|
|
|
|
|
$('.overlay').show();
|
|
|
|
@ -349,68 +349,6 @@ function AjaxCallBack(response) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
function hsvToRgb(h, s, v) {
|
|
|
|
|
if (h == "") h = 0;
|
|
|
|
|
if (s == "") s = 0;
|
|
|
|
|
if (v == "") v = 0;
|
|
|
|
|
h = parseFloat(h);
|
|
|
|
|
s = parseFloat(s);
|
|
|
|
|
v = parseFloat(v);
|
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
|
if (s < 0) s = 0;
|
|
|
|
|
if (v < 0) v = 0;
|
|
|
|
|
if (h >= 360) h = 359;
|
|
|
|
|
if (s > 100) s = 100;
|
|
|
|
|
if (v > 100) v = 100;
|
|
|
|
|
s /= 100.0;
|
|
|
|
|
v /= 100.0;
|
|
|
|
|
C = v * s;
|
|
|
|
|
hh = h / 60.0;
|
|
|
|
|
X = C * (1.0 - Math.abs((hh % 2) - 1.0));
|
|
|
|
|
r = g = b = 0;
|
|
|
|
|
if (hh >= 0 && hh < 1) {
|
|
|
|
|
r = C;
|
|
|
|
|
g = X;
|
|
|
|
|
}
|
|
|
|
|
else if (hh >= 1 && hh < 2) {
|
|
|
|
|
r = X;
|
|
|
|
|
g = C;
|
|
|
|
|
}
|
|
|
|
|
else if (hh >= 2 && hh < 3) {
|
|
|
|
|
g = C;
|
|
|
|
|
b = X;
|
|
|
|
|
}
|
|
|
|
|
else if (hh >= 3 && hh < 4) {
|
|
|
|
|
g = X;
|
|
|
|
|
b = C;
|
|
|
|
|
}
|
|
|
|
|
else if (hh >= 4 && hh < 5) {
|
|
|
|
|
r = X;
|
|
|
|
|
b = C;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
r = C;
|
|
|
|
|
b = X;
|
|
|
|
|
}
|
|
|
|
|
m = v - C;
|
|
|
|
|
r += m;
|
|
|
|
|
g += m;
|
|
|
|
|
b += m;
|
|
|
|
|
r *= 255.0;
|
|
|
|
|
g *= 255.0;
|
|
|
|
|
b *= 255.0;
|
|
|
|
|
r = Math.round(r);
|
|
|
|
|
g = Math.round(g);
|
|
|
|
|
b = Math.round(b);
|
|
|
|
|
hex = r * 65536 + g * 256 + b;
|
|
|
|
|
hex = hex.toString(16, 6);
|
|
|
|
|
len = hex.length;
|
|
|
|
|
if (len < 6)
|
|
|
|
|
for (i = 0; i < 6 - len; i++)
|
|
|
|
|
hex = '0' + hex;
|
|
|
|
|
return '#' + hex;
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
function changeTime(t) {
|
|
|
|
|
time = t;
|
|
|
|
|
UpdateChart();
|
|
|
|
@ -430,7 +368,7 @@ function UpdateChart(deviceNumber) {
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
toastr.error(error)
|
|
|
|
|
toastr.error(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -441,7 +379,7 @@ function UpdateChartInternal(canvas, title, data) {
|
|
|
|
|
if (instance.chart.canvas.id === canvas.id) {
|
|
|
|
|
chart = instance;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
if (chart) {
|
|
|
|
|
chart.data = data;
|
|
|
|
|
chart.update();
|
|
|
|
@ -451,7 +389,7 @@ function UpdateChartInternal(canvas, title, data) {
|
|
|
|
|
var options = {
|
|
|
|
|
responsive: true,
|
|
|
|
|
legend: {
|
|
|
|
|
position: 'bottom',
|
|
|
|
|
position: 'bottom'
|
|
|
|
|
},
|
|
|
|
|
title: {
|
|
|
|
|
display: false,
|
|
|
|
@ -461,7 +399,7 @@ function UpdateChartInternal(canvas, title, data) {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var chart = new Chart(ctx, {
|
|
|
|
|
chart = new Chart(ctx, {
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: data,
|
|
|
|
|
options: options
|
|
|
|
@ -546,7 +484,7 @@ function playFlv(videoElement) {
|
|
|
|
|
livePlayer.muted = muted;
|
|
|
|
|
timer = setInterval(function () {
|
|
|
|
|
console.log('.');
|
|
|
|
|
if (livePlayer.statisticsInfo.speed == 0) {
|
|
|
|
|
if (livePlayer.statisticsInfo.speed === 0) {
|
|
|
|
|
console.log('reload1');
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|
playFlv(videoElement);
|
|
|
|
@ -556,7 +494,7 @@ function playFlv(videoElement) {
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|
playFlv(videoElement);
|
|
|
|
|
}
|
|
|
|
|
else if (livePlayer.buffered.end(0) - livePlayer.currentTime > 1) {
|
|
|
|
|
else if (livePlayer.buffered.length>0&&livePlayer.buffered.end(0) - livePlayer.currentTime > 1) {
|
|
|
|
|
console.log('reset currentTime');
|
|
|
|
|
livePlayer.currentTime = livePlayer.buffered.end(0) - 0.001;
|
|
|
|
|
}
|
|
|
|
@ -573,7 +511,7 @@ function closePlayer(livePlayer) {
|
|
|
|
|
if (timer) {
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|
}
|
|
|
|
|
if (livePlayer != null) {
|
|
|
|
|
if (livePlayer !== null) {
|
|
|
|
|
try {
|
|
|
|
|
livePlayer.pause();
|
|
|
|
|
} catch (e) {
|
|
|
|
@ -590,7 +528,7 @@ function closePlayer(livePlayer) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$(document).on('change', '#camera', function (e) {
|
|
|
|
|
UpdateCamera()
|
|
|
|
|
UpdateCamera();
|
|
|
|
|
});
|
|
|
|
|
$(document).on('mousedown touchstart', 'img.camera.ajax', function (e) {
|
|
|
|
|
var number = $('#camera').val();
|
|
|
|
|