Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
controllers.controller('HealthCtrl', ['$scope', '$http', '$config', '$location','$timeout', '$route', '$barkChart', '$rootScope', function ($scope, $http, $config, $location, $timeout, $route, $barkChart, $rootScope) {
console.log('health controller');
// var url="/js/controllers/heatmap.json";
var echarts = require('echarts');
var formatUtil = echarts.format;
$scope.isIE = function() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){
return true;
}
else {
return false;
}
}
pageInit();
$scope.orgs = [];
$scope.dataData = [];
controllers.controller('DetailCtrl', ['$scope', '$http', '$config', '$location','$timeout', '$route', '$barkChart', '$rootScope','$routeParams', function ($scope, $http, $config, $location, $timeout, $route, $barkChart, $rootScope,$routeParams) {
console.log('detail controller');
// var url="/js/controllers/heatmap.json";
var echarts = require('echarts');
var formatUtil = echarts.format;
if($rootScope.showBigChart==undefined)
{
$rootScope.showBigChart = function(option) {
$scope.selectedModel = option.title.text;
$('#bigChartContainer').show();
// $('#mainWindow').hide();
$rootScope.bigChart.clear();
$rootScope.bigChart.setOption(option);
}
}
var showBig = function(metricName){
var metricDetailUrl = $config.uri.metricdetail + '/' + metricName;
$http.get(metricDetailUrl).success(function (data){
$rootScope.showBigChart($barkChart.getOptionBig(data));
getVirtulData(time, data) {// eslint-disable-line
const { rows = [] } = data;
const date = +echarts.number.parseDate(time[0]);
const end = +echarts.number.parseDate(time[time.length - 1]);
const dayTime = 3600 * 24 * 1000;
const dd = [];
for (let time = date; time <= end; time += dayTime) {
const formatTime = echarts.format.formatTime('yyyy-MM-dd', time);
let value = [0, 0];
for (let v of rows) {
const { date, match, unmatch } = v;
if (date === formatTime) {
value = [match, unmatch];
break;
}
}
dd.push([
formatTime,
].concat(value));
}
return dd;
}
getSeries(dataRange, scatterData) {
getVirtulData(time, data) {// eslint-disable-line
const { rows = [] } = data;
const date = +echarts.number.parseDate(time[0]);
const end = +echarts.number.parseDate(time[time.length - 1]);
const dayTime = 3600 * 24 * 1000;
const dd = [];
for (let time = date; time <= end; time += dayTime) {
const formatTime = echarts.format.formatTime('yyyy-MM-dd', time);
let value = [0, 0];
for (let v of rows) {
const { date, match, unmatch } = v;
if (date === formatTime) {
value = [match, unmatch];
break;
}
}
dd.push([
formatTime,
].concat(value));
}
return dd;
}
getSeries(dataRange, scatterData) {
function getVirtulData() {
var date = +echarts.number.parseDate('2017-02-01');
var end = +echarts.number.parseDate('2017-03-01');
var dayTime = 3600 * 24 * 1000;
var data = [];
for (var time = date; time < end; time += dayTime) {
data.push([
echarts.format.formatTime('yyyy-MM-dd', time),
Math.floor(Math.random() * 10000)
]);
}
return data;
}
formatter: (name) => {
return echarts.format.truncateText(name, 35, '10px Microsoft Yahei', '…');
},
tooltip: {
{
value: 8,
name: 'GenericAddressHandler.addresshandler',
path: 'Recents/Plugins/GenericAddressHandler.addresshandler',
},
{
value: 12,
name: 'MapsRecents.addresshandler',
path: 'Recents/Plugins/MapsRecents.addresshandler',
},
],
},
],
},
]
let formatUtil = echarts.format
function getLevelOption() {
return [
{
itemStyle: {
normal: {
borderWidth: 0,
gapWidth: 5,
},
},
},
{
itemStyle: {
normal: {
gapWidth: 1,
},
},
getVirtulData = (year) => {
year = year || '2017';
const date = +echarts.number.parseDate(year + '-01-01');
const end = +echarts.number.parseDate((+year + 1) + '-01-01');
const dayTime = 3600 * 24 * 1000;
const data = [];
for (let time = date; time < end; time += dayTime) {
data.push([
echarts.format.formatTime('yyyy-MM-dd', time),
Math.floor(Math.random() * 1000)
]);
}
return data;
};
getOption = () => {
import echarts from 'echarts';
import * as React from 'react';
import { ngInjector, ENV } from '@waldur/core/services';
import { connectAngularComponent } from '@waldur/store/connect';
const formatUtil = echarts.format;
function getLevelOption() {
return [
{
itemStyle: {
normal: {
borderColor: '#777',
borderWidth: 0,
gapWidth: 1,
},
},
upperLabel: {
normal: {
show: false,
},
},