Fixed bug with dashboard editing. Add IE support.
This commit is contained in:
parent
7cd8b2b346
commit
0bdf246383
@ -20,7 +20,7 @@ export default class DataAggregator {
|
|||||||
this.onDataCb = onDataCb;
|
this.onDataCb = onDataCb;
|
||||||
this.tsKeyNames = tsKeyNames;
|
this.tsKeyNames = tsKeyNames;
|
||||||
this.dataBuffer = {};
|
this.dataBuffer = {};
|
||||||
for (var k in tsKeyNames) {
|
for (var k = 0; k < tsKeyNames.length; k++) {
|
||||||
this.dataBuffer[tsKeyNames[k]] = [];
|
this.dataBuffer[tsKeyNames[k]] = [];
|
||||||
}
|
}
|
||||||
this.startTs = startTs;
|
this.startTs = startTs;
|
||||||
@ -143,7 +143,7 @@ export default class DataAggregator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateData() {
|
updateData() {
|
||||||
for (var k in this.tsKeyNames) {
|
for (var k = 0; k < this.tsKeyNames.length; k++) {
|
||||||
this.dataBuffer[this.tsKeyNames[k]] = [];
|
this.dataBuffer[this.tsKeyNames[k]] = [];
|
||||||
}
|
}
|
||||||
for (var key in this.aggregationMap) {
|
for (var key in this.aggregationMap) {
|
||||||
@ -193,7 +193,7 @@ function processAggregatedData(data, isCount, noAggregation) {
|
|||||||
aggregationMap[key] = aggKeyData;
|
aggregationMap[key] = aggKeyData;
|
||||||
}
|
}
|
||||||
var keyData = data[key];
|
var keyData = data[key];
|
||||||
for (var i in keyData) {
|
for (var i = 0; i < keyData.length; i++) {
|
||||||
var kvPair = keyData[i];
|
var kvPair = keyData[i];
|
||||||
var timestamp = kvPair[0];
|
var timestamp = kvPair[0];
|
||||||
var value = convertValue(kvPair[1], noAggregation);
|
var value = convertValue(kvPair[1], noAggregation);
|
||||||
@ -217,7 +217,7 @@ function updateAggregatedData(aggregationMap, isCount, noAggregation, aggFunctio
|
|||||||
aggregationMap[key] = aggKeyData;
|
aggregationMap[key] = aggKeyData;
|
||||||
}
|
}
|
||||||
var keyData = data[key];
|
var keyData = data[key];
|
||||||
for (var i in keyData) {
|
for (var i = 0; i < keyData.length; i++) {
|
||||||
var kvPair = keyData[i];
|
var kvPair = keyData[i];
|
||||||
var timestamp = kvPair[0];
|
var timestamp = kvPair[0];
|
||||||
var value = convertValue(kvPair[1], noAggregation);
|
var value = convertValue(kvPair[1], noAggregation);
|
||||||
|
|||||||
@ -44,7 +44,7 @@ function DatasourceService($timeout, $filter, $log, telemetryWebsocketService, t
|
|||||||
}
|
}
|
||||||
|
|
||||||
var subscriptionDataKeys = [];
|
var subscriptionDataKeys = [];
|
||||||
for (var d in datasource.dataKeys) {
|
for (var d = 0; d < datasource.dataKeys.length; d++) {
|
||||||
var dataKey = datasource.dataKeys[d];
|
var dataKey = datasource.dataKeys[d];
|
||||||
var subscriptionDataKey = {
|
var subscriptionDataKey = {
|
||||||
name: dataKey.name,
|
name: dataKey.name,
|
||||||
@ -295,7 +295,7 @@ function DatasourceSubscription(datasourceSubscription, telemetryWebsocketServic
|
|||||||
}
|
}
|
||||||
subscriber.onReconnected = function() {
|
subscriber.onReconnected = function() {
|
||||||
var newSubsTw = null;
|
var newSubsTw = null;
|
||||||
for (var i2 in listeners) {
|
for (var i2 = 0; i2 < listeners.length; i2++) {
|
||||||
var listener = listeners[i2];
|
var listener = listeners[i2];
|
||||||
if (!newSubsTw) {
|
if (!newSubsTw) {
|
||||||
newSubsTw = listener.updateRealtimeSubscription();
|
newSubsTw = listener.updateRealtimeSubscription();
|
||||||
@ -454,7 +454,7 @@ function DatasourceSubscription(datasourceSubscription, telemetryWebsocketServic
|
|||||||
var value = dataKey.func(time, prevSeries[1]);
|
var value = dataKey.func(time, prevSeries[1]);
|
||||||
series.push(value);
|
series.push(value);
|
||||||
datasourceData[dataKey.key].data = [series];
|
datasourceData[dataKey.key].data = [series];
|
||||||
for (var i in listeners) {
|
for (var i = 0; i < listeners.length; i++) {
|
||||||
var listener = listeners[i];
|
var listener = listeners[i];
|
||||||
listener.dataUpdated(datasourceData[dataKey.key],
|
listener.dataUpdated(datasourceData[dataKey.key],
|
||||||
listener.datasourceIndex,
|
listener.datasourceIndex,
|
||||||
@ -566,7 +566,7 @@ function DatasourceSubscription(datasourceSubscription, telemetryWebsocketServic
|
|||||||
}
|
}
|
||||||
if (datasourceSubscription.type === types.widgetType.timeseries.value) {
|
if (datasourceSubscription.type === types.widgetType.timeseries.value) {
|
||||||
var series, time, value;
|
var series, time, value;
|
||||||
for (var i in keyData) {
|
for (var i = 0; i < keyData.length; i++) {
|
||||||
series = keyData[i];
|
series = keyData[i];
|
||||||
time = series[0];
|
time = series[0];
|
||||||
value = convertValue(series[1]);
|
value = convertValue(series[1]);
|
||||||
@ -593,7 +593,7 @@ function DatasourceSubscription(datasourceSubscription, telemetryWebsocketServic
|
|||||||
}
|
}
|
||||||
if (update) {
|
if (update) {
|
||||||
datasourceData[datasourceKey].data = data;
|
datasourceData[datasourceKey].data = data;
|
||||||
for (var i2 in listeners) {
|
for (var i2 = 0; i2 < listeners.length; i2++) {
|
||||||
var listener = listeners[i2];
|
var listener = listeners[i2];
|
||||||
if (angular.isFunction(listener))
|
if (angular.isFunction(listener))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -160,7 +160,7 @@ function DeviceService($http, $q, $filter, userService, telemetryWebsocketServic
|
|||||||
|
|
||||||
function devicesToDevicesInfo(devices) {
|
function devicesToDevicesInfo(devices) {
|
||||||
var devicesInfo = [];
|
var devicesInfo = [];
|
||||||
for (var d in devices) {
|
for (var d = 0; d < devices.length; d++) {
|
||||||
devicesInfo.push(deviceToDeviceInfo(devices[d]));
|
devicesInfo.push(deviceToDeviceInfo(devices[d]));
|
||||||
}
|
}
|
||||||
return devicesInfo;
|
return devicesInfo;
|
||||||
@ -376,7 +376,7 @@ function DeviceService($http, $q, $filter, userService, telemetryWebsocketServic
|
|||||||
if (query) {
|
if (query) {
|
||||||
var dataKeys = response.data;
|
var dataKeys = response.data;
|
||||||
var lowercaseQuery = angular.lowercase(query);
|
var lowercaseQuery = angular.lowercase(query);
|
||||||
for (var i in dataKeys) {
|
for (var i=0; i<dataKeys.length;i++) {
|
||||||
if (angular.lowercase(dataKeys[i]).indexOf(lowercaseQuery) === 0) {
|
if (angular.lowercase(dataKeys[i]).indexOf(lowercaseQuery) === 0) {
|
||||||
result.push(dataKeys[i]);
|
result.push(dataKeys[i]);
|
||||||
}
|
}
|
||||||
@ -526,7 +526,7 @@ function DeviceService($http, $q, $filter, userService, telemetryWebsocketServic
|
|||||||
function saveDeviceAttributes(deviceId, attributeScope, attributes) {
|
function saveDeviceAttributes(deviceId, attributeScope, attributes) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var attributesData = {};
|
var attributesData = {};
|
||||||
for (var a in attributes) {
|
for (var a=0; a<attributes.length;a++) {
|
||||||
attributesData[attributes[a].key] = attributes[a].value;
|
attributesData[attributes[a].key] = attributes[a].value;
|
||||||
}
|
}
|
||||||
var url = '/api/plugins/telemetry/' + deviceId + '/' + attributeScope;
|
var url = '/api/plugins/telemetry/' + deviceId + '/' + attributeScope;
|
||||||
|
|||||||
@ -94,7 +94,7 @@ function TelemetryWebsocketService($rootScope, $websocket, $timeout, $window, ty
|
|||||||
}
|
}
|
||||||
if (isReconnect) {
|
if (isReconnect) {
|
||||||
isReconnect = false;
|
isReconnect = false;
|
||||||
for (var r in reconnectSubscribers) {
|
for (var r=0; r<reconnectSubscribers.length;r++) {
|
||||||
var reconnectSubscriber = reconnectSubscribers[r];
|
var reconnectSubscriber = reconnectSubscribers[r];
|
||||||
if (reconnectSubscriber.onReconnected) {
|
if (reconnectSubscriber.onReconnected) {
|
||||||
reconnectSubscriber.onReconnected();
|
reconnectSubscriber.onReconnected();
|
||||||
@ -136,7 +136,7 @@ function TelemetryWebsocketService($rootScope, $websocket, $timeout, $window, ty
|
|||||||
if (!data.data) {
|
if (!data.data) {
|
||||||
data.data = {};
|
data.data = {};
|
||||||
}
|
}
|
||||||
for (var k in keys) {
|
for (var k = 0; k < keys.length; k++) {
|
||||||
var key = keys[k];
|
var key = keys[k];
|
||||||
if (!data.data[key]) {
|
if (!data.data[key]) {
|
||||||
data.data[key] = [];
|
data.data[key] = [];
|
||||||
|
|||||||
@ -157,18 +157,14 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, toas
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resolveRefreshTokenQueue(data) {
|
function resolveRefreshTokenQueue(data) {
|
||||||
for (var q in refreshTokenQueue) {
|
for (var q=0; q < refreshTokenQueue.length;q++) {
|
||||||
if (isNaN(q))
|
|
||||||
continue;
|
|
||||||
refreshTokenQueue[q].resolve(data);
|
refreshTokenQueue[q].resolve(data);
|
||||||
}
|
}
|
||||||
refreshTokenQueue = [];
|
refreshTokenQueue = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function rejectRefreshTokenQueue(message) {
|
function rejectRefreshTokenQueue(message) {
|
||||||
for (var q in refreshTokenQueue) {
|
for (var q=0;q<refreshTokenQueue.length;q++) {
|
||||||
if (isNaN(q))
|
|
||||||
continue;
|
|
||||||
refreshTokenQueue[q].reject(message);
|
refreshTokenQueue[q].reject(message);
|
||||||
}
|
}
|
||||||
refreshTokenQueue = [];
|
refreshTokenQueue = [];
|
||||||
@ -246,7 +242,7 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, toas
|
|||||||
dashboardService.getCustomerDashboards(currentUser.customerId, pageLink).then(
|
dashboardService.getCustomerDashboards(currentUser.customerId, pageLink).then(
|
||||||
function success(result) {
|
function success(result) {
|
||||||
var dashboards = result.data;
|
var dashboards = result.data;
|
||||||
for (var d in dashboards) {
|
for (var d=0;d<dashboards.length;d++) {
|
||||||
allowedDashboardIds.push(dashboards[d].id.id);
|
allowedDashboardIds.push(dashboards[d].id.id);
|
||||||
}
|
}
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
|
|||||||
@ -13,6 +13,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import './ie.support';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import ngMaterial from 'angular-material';
|
import ngMaterial from 'angular-material';
|
||||||
import ngMdIcons from 'angular-material-icons';
|
import ngMdIcons from 'angular-material-icons';
|
||||||
|
|||||||
@ -24,7 +24,6 @@
|
|||||||
<div ng-class="vm.dashboardClass" id="gridster-background" style="height: auto; min-height: 100%;">
|
<div ng-class="vm.dashboardClass" id="gridster-background" style="height: auto; min-height: 100%;">
|
||||||
<div id="gridster-child" gridster="vm.gridsterOpts">
|
<div id="gridster-child" gridster="vm.gridsterOpts">
|
||||||
<ul>
|
<ul>
|
||||||
<!-- ng-click="widgetClicked($event, widget)" -->
|
|
||||||
<li gridster-item="vm.widgetItemMap" class="tb-noselect" ng-repeat="widget in vm.widgets">
|
<li gridster-item="vm.widgetItemMap" class="tb-noselect" ng-repeat="widget in vm.widgets">
|
||||||
<md-menu md-position-mode="target target" tb-mousepoint-menu>
|
<md-menu md-position-mode="target target" tb-mousepoint-menu>
|
||||||
<div tb-expand-fullscreen
|
<div tb-expand-fullscreen
|
||||||
|
|||||||
@ -76,7 +76,7 @@ function DetailsSidenav($timeout) {
|
|||||||
detailsButtons: '?detailsButtons'
|
detailsButtons: '?detailsButtons'
|
||||||
},
|
},
|
||||||
scope: {
|
scope: {
|
||||||
headerTitle: '=',
|
headerTitle: '@',
|
||||||
headerSubtitle: '@',
|
headerSubtitle: '@',
|
||||||
headerHeightPx: '@',
|
headerHeightPx: '@',
|
||||||
isReadOnly: '=',
|
isReadOnly: '=',
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
</md-virtual-repeat-container>
|
</md-virtual-repeat-container>
|
||||||
</div>
|
</div>
|
||||||
<tb-details-sidenav
|
<tb-details-sidenav
|
||||||
header-title="vm.getItemTitleFunc(vm.operatingItem())"
|
header-title="{{vm.getItemTitleFunc(vm.operatingItem())}}"
|
||||||
header-subtitle="{{vm.itemDetailsText()}}"
|
header-subtitle="{{vm.itemDetailsText()}}"
|
||||||
is-read-only="vm.isDetailsReadOnly(vm.operatingItem())"
|
is-read-only="vm.isDetailsReadOnly(vm.operatingItem())"
|
||||||
is-open="vm.detailsConfig.isDetailsOpen"
|
is-open="vm.detailsConfig.isDetailsOpen"
|
||||||
|
|||||||
@ -341,9 +341,9 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
|
|||||||
$scope.legendConfig.showTotal === true);
|
$scope.legendConfig.showTotal === true);
|
||||||
|
|
||||||
if (widget.type !== types.widgetType.rpc.value && widget.type !== types.widgetType.static.value) {
|
if (widget.type !== types.widgetType.rpc.value && widget.type !== types.widgetType.static.value) {
|
||||||
for (var i in widgetContext.datasources) {
|
for (var i = 0; i < widgetContext.datasources.length; i++) {
|
||||||
var datasource = widgetContext.datasources[i];
|
var datasource = widgetContext.datasources[i];
|
||||||
for (var a in datasource.dataKeys) {
|
for (var a = 0; a < datasource.dataKeys.length; a++) {
|
||||||
var dataKey = datasource.dataKeys[a];
|
var dataKey = datasource.dataKeys[a];
|
||||||
dataKey.pattern = angular.copy(dataKey.label);
|
dataKey.pattern = angular.copy(dataKey.label);
|
||||||
var datasourceData = {
|
var datasourceData = {
|
||||||
@ -723,7 +723,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
|
|||||||
function checkSubscriptions() {
|
function checkSubscriptions() {
|
||||||
if (widget.type !== types.widgetType.rpc.value) {
|
if (widget.type !== types.widgetType.rpc.value) {
|
||||||
var subscriptionsChanged = false;
|
var subscriptionsChanged = false;
|
||||||
for (var i in datasourceListeners) {
|
for (var i = 0; i < datasourceListeners.length; i++) {
|
||||||
var listener = datasourceListeners[i];
|
var listener = datasourceListeners[i];
|
||||||
var deviceId = null;
|
var deviceId = null;
|
||||||
var aliasName = null;
|
var aliasName = null;
|
||||||
@ -748,7 +748,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
|
|||||||
|
|
||||||
function unsubscribe() {
|
function unsubscribe() {
|
||||||
if (widget.type !== types.widgetType.rpc.value) {
|
if (widget.type !== types.widgetType.rpc.value) {
|
||||||
for (var i in datasourceListeners) {
|
for (var i = 0; i < datasourceListeners.length; i++) {
|
||||||
var listener = datasourceListeners[i];
|
var listener = datasourceListeners[i];
|
||||||
datasourceService.unsubscribeFromDatasource(listener);
|
datasourceService.unsubscribeFromDatasource(listener);
|
||||||
}
|
}
|
||||||
@ -805,7 +805,7 @@ export default function WidgetController($scope, $timeout, $window, $element, $q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var index = 0;
|
var index = 0;
|
||||||
for (var i in widgetContext.datasources) {
|
for (var i = 0; i < widgetContext.datasources.length; i++) {
|
||||||
var datasource = widgetContext.datasources[i];
|
var datasource = widgetContext.datasources[i];
|
||||||
if (angular.isFunction(datasource))
|
if (angular.isFunction(datasource))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -153,7 +153,7 @@
|
|||||||
</tb-dashboard>
|
</tb-dashboard>
|
||||||
</div>
|
</div>
|
||||||
<tb-details-sidenav class="tb-widget-details-sidenav"
|
<tb-details-sidenav class="tb-widget-details-sidenav"
|
||||||
header-title="vm.editingWidget.config.title"
|
header-title="{{vm.editingWidget.config.title}}"
|
||||||
header-subtitle="{{vm.editingWidgetSubtitle}}"
|
header-subtitle="{{vm.editingWidgetSubtitle}}"
|
||||||
is-read-only="false"
|
is-read-only="false"
|
||||||
is-open="vm.isEditingWidget"
|
is-open="vm.isEditingWidget"
|
||||||
@ -175,7 +175,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</tb-details-sidenav>
|
</tb-details-sidenav>
|
||||||
<tb-details-sidenav ng-if="!vm.widgetEditMode" class="tb-select-widget-sidenav"
|
<tb-details-sidenav ng-if="!vm.widgetEditMode" class="tb-select-widget-sidenav"
|
||||||
header-title="'dashboard.select-widget-title' | translate"
|
header-title="{{'dashboard.select-widget-title' | translate}}"
|
||||||
header-height-px="120"
|
header-height-px="120"
|
||||||
is-read-only="true"
|
is-read-only="true"
|
||||||
is-open="vm.isAddingWidget"
|
is-open="vm.isAddingWidget"
|
||||||
@ -249,7 +249,6 @@
|
|||||||
class="md-headline tb-absolute-fill">widget.select-widgets-bundle</span>
|
class="md-headline tb-absolute-fill">widget.select-widgets-bundle</span>
|
||||||
</div>
|
</div>
|
||||||
</tb-details-sidenav>
|
</tb-details-sidenav>
|
||||||
<!-- </section> -->
|
|
||||||
<section layout="row" layout-wrap class="tb-footer-buttons md-fab" layout-align="start end">
|
<section layout="row" layout-wrap class="tb-footer-buttons md-fab" layout-align="start end">
|
||||||
<md-fab-speed-dial ng-disabled="loading" ng-show="!vm.isAddingWidget && vm.isEdit && !vm.widgetEditMode"
|
<md-fab-speed-dial ng-disabled="loading" ng-show="!vm.isAddingWidget && vm.isEdit && !vm.widgetEditMode"
|
||||||
md-open="vm.addItemActionsOpen" class="md-scale" md-direction="up">
|
md-open="vm.addItemActionsOpen" class="md-scale" md-direction="up">
|
||||||
|
|||||||
@ -275,7 +275,7 @@ export default function AttributeTableDirective($compile, $templateCache, $rootS
|
|||||||
dataKeys: []
|
dataKeys: []
|
||||||
}
|
}
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (var attr in scope.selectedAttributes) {
|
for (var attr =0; attr < scope.selectedAttributes.length;attr++) {
|
||||||
var attribute = scope.selectedAttributes[attr];
|
var attribute = scope.selectedAttributes[attr];
|
||||||
var dataKey = {
|
var dataKey = {
|
||||||
name: attribute.key,
|
name: attribute.key,
|
||||||
|
|||||||
29
ui/src/app/ie.support.js
Normal file
29
ui/src/app/ie.support.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2016-2017 The Thingsboard Authors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
if (!String.prototype.startsWith) {
|
||||||
|
String.prototype.startsWith = function(searchString, position) {
|
||||||
|
position = position || 0;
|
||||||
|
return this.indexOf(searchString, position) === position;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (!String.prototype.endsWith) {
|
||||||
|
String.prototype.endsWith = function (suffix) {
|
||||||
|
return this.indexOf(suffix, this.length - suffix.length) !== -1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})();
|
||||||
@ -25,8 +25,8 @@
|
|||||||
md-is-locked-open="vm.isLockSidenav"
|
md-is-locked-open="vm.isLockSidenav"
|
||||||
layout="column">
|
layout="column">
|
||||||
<header class="tb-nav-header">
|
<header class="tb-nav-header">
|
||||||
<md-toolbar md-scroll-shrink class="tb-nav-header-toolbar">
|
<md-toolbar class="tb-nav-header-toolbar">
|
||||||
<div flex layout="row" layout-align="start center" class="md-toolbar-tools inset">
|
<div flex layout="row" layout-align="start start" class="md-toolbar-tools inset">
|
||||||
<md-icon md-svg-src="{{vm.logoSvg}}" aria-label="logo" class="tb-logo-title"></md-icon>
|
<md-icon md-svg-src="{{vm.logoSvg}}" aria-label="logo" class="tb-logo-title"></md-icon>
|
||||||
</div>
|
</div>
|
||||||
</md-toolbar>
|
</md-toolbar>
|
||||||
|
|||||||
@ -33,7 +33,7 @@ export default class TbFlot {
|
|||||||
this.chartType = chartType || 'line';
|
this.chartType = chartType || 'line';
|
||||||
|
|
||||||
var colors = [];
|
var colors = [];
|
||||||
for (var i in ctx.data) {
|
for (var i = 0; i < ctx.data.length; i++) {
|
||||||
var series = ctx.data[i];
|
var series = ctx.data[i];
|
||||||
colors.push(series.dataKey.color);
|
colors.push(series.dataKey.color);
|
||||||
var keySettings = series.dataKey.settings;
|
var keySettings = series.dataKey.settings;
|
||||||
@ -61,7 +61,7 @@ export default class TbFlot {
|
|||||||
}
|
}
|
||||||
ctx.tooltip = $('#flot-series-tooltip');
|
ctx.tooltip = $('#flot-series-tooltip');
|
||||||
if (ctx.tooltip.length === 0) {
|
if (ctx.tooltip.length === 0) {
|
||||||
ctx.tooltip = $("<div id=flot-series-tooltip' class='flot-mouse-value'></div>");
|
ctx.tooltip = $("<div id='flot-series-tooltip' class='flot-mouse-value'></div>");
|
||||||
ctx.tooltip.css({
|
ctx.tooltip.css({
|
||||||
fontSize: "12px",
|
fontSize: "12px",
|
||||||
fontFamily: "Roboto",
|
fontFamily: "Roboto",
|
||||||
@ -85,7 +85,7 @@ export default class TbFlot {
|
|||||||
divElement.css({
|
divElement.css({
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center"
|
justifyContent: "flex-start"
|
||||||
});
|
});
|
||||||
var lineSpan = $('<span></span>');
|
var lineSpan = $('<span></span>');
|
||||||
lineSpan.css({
|
lineSpan.css({
|
||||||
@ -147,7 +147,7 @@ export default class TbFlot {
|
|||||||
fontWeight: "700"
|
fontWeight: "700"
|
||||||
});
|
});
|
||||||
content += dateDiv.prop('outerHTML');
|
content += dateDiv.prop('outerHTML');
|
||||||
for (var i in hoverInfo.seriesHover) {
|
for (var i = 0; i < hoverInfo.seriesHover.length; i++) {
|
||||||
var seriesHoverInfo = hoverInfo.seriesHover[i];
|
var seriesHoverInfo = hoverInfo.seriesHover[i];
|
||||||
if (tbFlot.ctx.tooltipIndividual && seriesHoverInfo.index !== seriesIndex) {
|
if (tbFlot.ctx.tooltipIndividual && seriesHoverInfo.index !== seriesIndex) {
|
||||||
continue;
|
continue;
|
||||||
@ -333,7 +333,7 @@ export default class TbFlot {
|
|||||||
this.ctx.pieData = angular.copy(this.ctx.data);
|
this.ctx.pieData = angular.copy(this.ctx.data);
|
||||||
this.ctx.pieRenderedData = [];
|
this.ctx.pieRenderedData = [];
|
||||||
this.ctx.pieTargetData = [];
|
this.ctx.pieTargetData = [];
|
||||||
for (i in this.ctx.data) {
|
for (i = 0; i < this.ctx.data.length; i++) {
|
||||||
this.ctx.pieTargetData[i] = (this.ctx.data[i].data && this.ctx.data[i].data[0])
|
this.ctx.pieTargetData[i] = (this.ctx.data[i].data && this.ctx.data[i].data[0])
|
||||||
? this.ctx.data[i].data[0][1] : 0;
|
? this.ctx.data[i].data[0][1] : 0;
|
||||||
}
|
}
|
||||||
@ -929,7 +929,7 @@ export default class TbFlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pieDataRendered() {
|
pieDataRendered() {
|
||||||
for (var i in this.ctx.pieTargetData) {
|
for (var i = 0; i < this.ctx.pieTargetData.length; i++) {
|
||||||
var value = this.ctx.pieTargetData[i] ? this.ctx.pieTargetData[i] : 0;
|
var value = this.ctx.pieTargetData[i] ? this.ctx.pieTargetData[i] : 0;
|
||||||
this.ctx.pieRenderedData[i] = value;
|
this.ctx.pieRenderedData[i] = value;
|
||||||
if (!this.ctx.pieData[i].data[0]) {
|
if (!this.ctx.pieData[i].data[0]) {
|
||||||
@ -943,7 +943,7 @@ export default class TbFlot {
|
|||||||
if (start) {
|
if (start) {
|
||||||
this.finishPieDataAnimation();
|
this.finishPieDataAnimation();
|
||||||
this.ctx.pieAnimationStartTime = this.ctx.pieAnimationLastTime = Date.now();
|
this.ctx.pieAnimationStartTime = this.ctx.pieAnimationLastTime = Date.now();
|
||||||
for (var i in this.ctx.data) {
|
for (var i = 0; i < this.ctx.data.length; i++) {
|
||||||
this.ctx.pieTargetData[i] = (this.ctx.data[i].data && this.ctx.data[i].data[0])
|
this.ctx.pieTargetData[i] = (this.ctx.data[i].data && this.ctx.data[i].data[0])
|
||||||
? this.ctx.data[i].data[0][1] : 0;
|
? this.ctx.data[i].data[0][1] : 0;
|
||||||
}
|
}
|
||||||
@ -968,7 +968,7 @@ export default class TbFlot {
|
|||||||
this.finishPieDataAnimation();
|
this.finishPieDataAnimation();
|
||||||
} else {
|
} else {
|
||||||
if (elapsed >= 40) {
|
if (elapsed >= 40) {
|
||||||
for (var i in this.ctx.pieTargetData) {
|
for (var i = 0; i < this.ctx.pieTargetData.length; i++) {
|
||||||
var prevValue = this.ctx.pieRenderedData[i];
|
var prevValue = this.ctx.pieRenderedData[i];
|
||||||
var targetValue = this.ctx.pieTargetData[i];
|
var targetValue = this.ctx.pieTargetData[i];
|
||||||
var value = prevValue + (targetValue - prevValue) * progress;
|
var value = prevValue + (targetValue - prevValue) * progress;
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export default class TbGoogleMap {
|
|||||||
function success() {
|
function success() {
|
||||||
gmGlobals.gmApiKeys[tbMap.apiKey].loaded = true;
|
gmGlobals.gmApiKeys[tbMap.apiKey].loaded = true;
|
||||||
initGoogleMap();
|
initGoogleMap();
|
||||||
for (var p in gmGlobals.gmApiKeys[tbMap.apiKey].pendingInits) {
|
for (var p = 0; p < gmGlobals.gmApiKeys[tbMap.apiKey].pendingInits.length; p++) {
|
||||||
var pendingInit = gmGlobals.gmApiKeys[tbMap.apiKey].pendingInits[p];
|
var pendingInit = gmGlobals.gmApiKeys[tbMap.apiKey].pendingInits[p];
|
||||||
pendingInit();
|
pendingInit();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -364,7 +364,7 @@ export default class TbMapWidget {
|
|||||||
var bounds = tbMap.map.createBounds();
|
var bounds = tbMap.map.createBounds();
|
||||||
tbMap.locations = [];
|
tbMap.locations = [];
|
||||||
var dataMap = toLabelValueMap(data);
|
var dataMap = toLabelValueMap(data);
|
||||||
for (var l in tbMap.locationsSettings) {
|
for (var l=0; l < tbMap.locationsSettings.length; l++) {
|
||||||
var locationSettings = tbMap.locationsSettings[l];
|
var locationSettings = tbMap.locationsSettings[l];
|
||||||
var latIndex = -1;
|
var latIndex = -1;
|
||||||
var lngIndex = -1;
|
var lngIndex = -1;
|
||||||
@ -398,7 +398,7 @@ export default class TbMapWidget {
|
|||||||
var locationsChanged = false;
|
var locationsChanged = false;
|
||||||
var bounds = tbMap.map.createBounds();
|
var bounds = tbMap.map.createBounds();
|
||||||
var dataMap = toLabelValueMap(data);
|
var dataMap = toLabelValueMap(data);
|
||||||
for (var p in tbMap.locations) {
|
for (var p = 0; p < tbMap.locations.length; p++) {
|
||||||
var location = tbMap.locations[p];
|
var location = tbMap.locations[p];
|
||||||
locationsChanged |= updateLocation(location, data, dataMap);
|
locationsChanged |= updateLocation(location, data, dataMap);
|
||||||
if (location.polyline) {
|
if (location.polyline) {
|
||||||
@ -421,11 +421,11 @@ export default class TbMapWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var tooltips = this.map.getTooltips();
|
var tooltips = this.map.getTooltips();
|
||||||
for (var t in tooltips) {
|
for (var t=0; t < tooltips.length; t++) {
|
||||||
var tooltip = tooltips[t];
|
var tooltip = tooltips[t];
|
||||||
var text = tooltip.pattern;
|
var text = tooltip.pattern;
|
||||||
var replaceInfo = tooltip.replaceInfo;
|
var replaceInfo = tooltip.replaceInfo;
|
||||||
for (var v in replaceInfo.variables) {
|
for (var v = 0; v < replaceInfo.variables.length; v++) {
|
||||||
var variableInfo = replaceInfo.variables[v];
|
var variableInfo = replaceInfo.variables[v];
|
||||||
var txtVal = '';
|
var txtVal = '';
|
||||||
if (variableInfo.dataKeyIndex > -1) {
|
if (variableInfo.dataKeyIndex > -1) {
|
||||||
@ -451,11 +451,11 @@ export default class TbMapWidget {
|
|||||||
this.map.invalidateSize();
|
this.map.invalidateSize();
|
||||||
if (this.locations && this.locations.size > 0) {
|
if (this.locations && this.locations.size > 0) {
|
||||||
var bounds = this.map.createBounds();
|
var bounds = this.map.createBounds();
|
||||||
for (var m in this.markers) {
|
for (var m = 0; m < this.markers.length; m++) {
|
||||||
this.map.extendBoundsWithMarker(bounds, this.markers[m]);
|
this.map.extendBoundsWithMarker(bounds, this.markers[m]);
|
||||||
}
|
}
|
||||||
if (this.polylines) {
|
if (this.polylines) {
|
||||||
for (var p in this.polylines) {
|
for (var p = 0; p < this.polylines.length; p++) {
|
||||||
this.map.extendBounds(bounds, this.polylines[p]);
|
this.map.extendBounds(bounds, this.polylines[p]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -343,7 +343,7 @@ export default function WidgetEditorController(widgetService, userService, types
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (var i in config.datasources) {
|
for (var i = 0; i < config.datasources.length; i++) {
|
||||||
var datasource = config.datasources[i];
|
var datasource = config.datasources[i];
|
||||||
datasource.type = vm.widget.type;
|
datasource.type = vm.widget.type;
|
||||||
if (vm.widget.type !== types.widgetType.timeseries.value && datasource.intervalSec) {
|
if (vm.widget.type !== types.widgetType.timeseries.value && datasource.intervalSec) {
|
||||||
@ -455,7 +455,7 @@ export default function WidgetEditorController(widgetService, userService, types
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onDividerDrag() {
|
function onDividerDrag() {
|
||||||
for (var i in ace_editors) {
|
for (var i = 0; i < ace_editors.length; i++) {
|
||||||
var ace = ace_editors[i];
|
var ace = ace_editors[i];
|
||||||
ace.resize();
|
ace.resize();
|
||||||
ace.renderer.updateFull();
|
ace.renderer.updateFull();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user