Warning, /iDDS/monitor/data/js/pages/dashboards/dashboard1.js.back is written in an unsupported language. File is not indexed.
0001 /*
0002 Template Name: Admin Pro Admin
0003 Author: Wrappixel
0004 Email: niravjoshi87@gmail.com
0005 File: js
0006 */
0007 $(function () {
0008 "use strict";
0009 // ==============================================================
0010 // Newsletter
0011 // ==============================================================
0012
0013 //ct-visits
0014 new Chartist.Line('#ct-visits', {
0015 labels: ['2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015'],
0016 series: [
0017 [5, 2, 7, 4, 5, 3, 5, 4]
0018 , [2, 5, 2, 6, 2, 5, 2, 4]
0019 , [2, 5, 2, 6, 2, 5, 3, 8]
0020 ]
0021 }, {
0022 top: 0,
0023 low: 1,
0024 showPoint: true,
0025 fullWidth: true,
0026 plugins: [
0027 Chartist.plugins.tooltip()
0028 ],
0029 axisY: {
0030 labelInterpolationFnc: function (value) {
0031 return (value / 1) + 'k';
0032 }
0033 },
0034 showArea: true
0035 });
0036
0037
0038 var chart = [chart];
0039
0040 var get_idds_data = function () {
0041 var iddsAPI = "https://aipanda160.cern.ch:443/idds/monitor/null/null";
0042 $.getJSON( iddsAPI, function(data) {console.log(data);})
0043 .done(function( data ) {return data})
0044 .fail(function() {window.alert("err");});
0045 }
0046
0047 function get_json(url){
0048 var data = $.getJSON(url, function(data) { return data;});
0049 // $.each(data, function(i) {alert(i)});
0050 return data;
0051 }
0052
0053 function draw_request_chartist(data) {
0054
0055 /*var req_status = {};
0056 $.each(data, function(i) {
0057 var req = data[i];
0058 if !(req.status in req_status) {
0059 req_status[req.status] = {};
0060 };
0061 });*/
0062
0063 new Chartist.Line('#requests_view_chartist', {
0064 labels: ['2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015'],
0065 series: [
0066 [5, 2, 7, 4, 5, 3, 5, 4],
0067 [2, 5, 2, 6, 2, 5, 2, 4],
0068 [2, 5, 2, 6, 2, 5, 3, 8]
0069 ]
0070 },
0071 {top: 0,
0072 low: 1,
0073 showPoint: true,
0074 fullWidth: true,
0075 plugins: [
0076 Chartist.plugins.tooltip()
0077 ],
0078 axisY: {
0079 labelInterpolationFnc: function (value) {
0080 return (value / 1) + 'k';
0081 }
0082 },
0083 showArea: true
0084 });
0085 }
0086
0087 var sparklineLogin = function () {
0088 var iddsAPI_request = appConfig.iddsAPI_request;
0089 var iddsAPI_transform = appConfig.iddsAPI_transform;
0090 var iddsAPI_processing = appConfig.iddsAPI_processing;
0091
0092 $.getJSON(iddsAPI_request, function(data){
0093 $('#totalrequests span').text(data.total);
0094 draw_request_chartist(data);
0095 });
0096
0097 $.getJSON(iddsAPI_transform, function(data){
0098 $('#totaltransforms span').text(data.total);
0099 });
0100
0101 $.getJSON(iddsAPI_processing, function(data){
0102 $('#totalprocessings span').text(data.total);
0103 });
0104
0105 $('#sparklinedash').sparkline([0, 5, 6, 10, 9, 12, 4, 25], {
0106 type: 'bar',
0107 height: '30',
0108 barWidth: '4',
0109 resize: true,
0110 barSpacing: '5',
0111 barColor: '#7ace4c'
0112 });
0113 $('#sparklinedash2').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
0114 type: 'bar',
0115 height: '30',
0116 barWidth: '4',
0117 resize: true,
0118 barSpacing: '5',
0119 barColor: '#7460ee'
0120 });
0121 $('#sparklinedash3').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
0122 type: 'bar',
0123 height: '30',
0124 barWidth: '4',
0125 resize: true,
0126 barSpacing: '5',
0127 barColor: '#11a0f8'
0128 });
0129 $('#sparklinedash4').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
0130 type: 'bar',
0131 height: '30',
0132 barWidth: '4',
0133 resize: true,
0134 barSpacing: '5',
0135 barColor: '#f33155'
0136 });
0137 }
0138 var sparkResize;
0139 $(window).on("resize", function (e) {
0140 clearTimeout(sparkResize);
0141 sparkResize = setTimeout(sparklineLogin, 500);
0142 });
0143 sparklineLogin();
0144
0145 });
0146
0147