File indexing completed on 2026-04-09 07:58:26
0001
0002
0003
0004
0005
0006
0007 $(function () {
0008 "use strict";
0009
0010
0011
0012
0013
0014 function draw_chartist(group_types, group_types_name, chartist_name, labels, num_monthly) {
0015 $(group_types_name).empty();
0016 $.each(group_types, function(i) {
0017 var new_li = '<li class="ps-3"><h5><i class="fa fa-circle me-1 ';
0018 new_li += 'view_chartist_lable_' + i + '"></i>' + group_types[i]+ '</h5>';
0019 new_li += '</li>';
0020 $(group_types_name).append(new_li);
0021 });
0022
0023 new Chartist.Line(chartist_name, {
0024 labels: labels,
0025 series: num_monthly
0026 },
0027 {top: 0,
0028 low: 1,
0029 showPoint: true,
0030 fullWidth: true,
0031 plugins: [
0032 Chartist.plugins.tooltip()
0033 ],
0034 axisY: {
0035 labelInterpolationFnc: function (value) {
0036
0037 if (value > 1000000000000000) {
0038 return (value / 1000000000000000) + 'P';
0039 } else if (value > 1000000000000) {
0040 return (value / 1000000000000) + 'T';
0041 } else if (value > 1000000000) {
0042 return (value / 1000000000) + 'G';
0043 } else if (value > 1000000) {
0044 return (value / 1000000) + 'M';
0045 } else if (value > 1000) {
0046 return (value / 1000) + 'K';
0047 } else {
0048 return value;
0049 }
0050 }
0051 },
0052 showArea: false
0053 });
0054 }
0055
0056 function draw_chartist1(labels, data, group_types_name, chartist_name, group_types_select) {
0057 var g_types = Object.keys(data);
0058
0059 var select_option = $(group_types_select + " option").filter(':selected').text();
0060 select_option = $.trim(select_option);
0061
0062 $(group_types_select).empty();
0063 if (select_option === 'All'){
0064 var all_option = '<option value="All" selected="selected">All</option>';
0065 $(group_types_select).append(all_option);
0066 } else {
0067 var all_option = '<option value="All">All</option>';
0068 $(group_types_select).append(all_option);
0069 }
0070 $.each(g_types, function(i) {
0071 if (select_option === g_types[i]){
0072 var new_opt = '<option value="' + g_types[i] + '" selected="selected">' + g_types[i] + '</option>';
0073 $(group_types_select).append(new_opt);
0074 } else {
0075 var new_opt = '<option value="' + g_types[i] + '">' + g_types[i] + '</option>';
0076 $(group_types_select).append(new_opt);
0077 }
0078 });
0079
0080 if (select_option === 'All'){
0081 var num_monthly = Object.keys(data).map(function(key){
0082 var mnum_monthly_status = Object.keys(data[key]).map(function(key1){
0083 return data[key][key1];
0084 });
0085 return mnum_monthly_status;
0086 });
0087 draw_chartist(g_types, group_types_name, chartist_name, labels, num_monthly);
0088 } else {
0089 var num_monthly = Object.keys(data[select_option]).map(function(key){
0090 return data[select_option][key];
0091 });
0092 num_monthly = [num_monthly];
0093 draw_chartist([select_option], group_types_name, chartist_name, labels, num_monthly);
0094 }
0095 }
0096
0097 function draw_chartist_status(data) {
0098
0099
0100 var labels = Object.keys(data.month_acc_status.Total);
0101 draw_chartist1(labels, data.month_acc_status, '#view_chartist_labels', '#view_chartist', "#view_chartist_labels_select");
0102 }
0103
0104 var sparklineLogin = function () {
0105 var iddsAPI_request = appConfig.iddsAPI_request;
0106 var iddsAPI_transform = appConfig.iddsAPI_transform;
0107 var iddsAPI_processing = appConfig.iddsAPI_processing;
0108
0109 $.getJSON(iddsAPI_request, function(data){
0110 $('#totalrequests span').text(data.total);
0111 draw_chartist_status(data);
0112
0113
0114 var month_requests = Object.keys(data.month_status.Total).map(function(key){
0115 return data.month_status.Total[key];
0116 });
0117
0118 $('#totalrequestslinedash').sparkline(month_requests, {
0119 type: 'bar',
0120 height: '30',
0121 barWidth: '4',
0122 resize: true,
0123 barSpacing: '5',
0124 barColor: '#7ace4c'
0125 });
0126 });
0127
0128 $.getJSON(iddsAPI_transform, function(data){
0129 $('#totaltransforms span').text(data.total);
0130 var month_transforms = Object.keys(data.month_status.Total).map(function(key){
0131 return data.month_status.Total[key];
0132 });
0133 $('#totaltransformslinedash').sparkline(month_transforms, {
0134 type: 'bar',
0135 height: '30',
0136 barWidth: '4',
0137 resize: true,
0138 barSpacing: '5',
0139 barColor: '#7460ee'
0140 });
0141 });
0142
0143 $.getJSON(iddsAPI_processing, function(data){
0144 $('#totalprocessings span').text(data.total);
0145 var month_processings = Object.keys(data.month_status.Total).map(function(key){
0146 return data.month_status.Total[key];
0147 });
0148 $('#totalprocessingslinedash').sparkline(month_processings, {
0149 type: 'bar',
0150 height: '30',
0151 barWidth: '4',
0152 resize: true,
0153 barSpacing: '5',
0154 barColor: '#11a0f8'
0155 });
0156 });
0157 }
0158
0159 var sparkResize;
0160 $(window).on("resize", function (e) {
0161 clearTimeout(sparkResize);
0162 sparkResize = setTimeout(sparklineLogin, 500);
0163 });
0164 sparklineLogin();
0165
0166 $("select").on("change", function() {
0167
0168 sparklineLogin();
0169 });
0170 });
0171
0172