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 function draw_chartist(group_types, group_types_name, chartist_name, labels, num_monthly) {
0014
0015
0016 $(group_types_name).empty();
0017 $.each(group_types, function(i) {
0018 var new_li = '<li class="ps-3"><h5><i class="fa fa-circle me-1 ';
0019 new_li += 'view_chartist_lable_' + i + '"></i>' + group_types[i]+ '</h5>';
0020 new_li += '</li>';
0021 $(group_types_name).append(new_li);
0022 });
0023
0024 new Chartist.Line(chartist_name, {
0025 labels: labels,
0026 series: num_monthly
0027 },
0028 {top: 0,
0029 low: 1,
0030 showPoint: true,
0031 fullWidth: true,
0032 plugins: [
0033 Chartist.plugins.tooltip()
0034 ],
0035 axisY: {
0036 labelInterpolationFnc: function (value) {
0037
0038
0039 if (value > 1000000000000000) {
0040 return (value / 1000000000000000) + 'P';
0041 } else if (value > 1000000000000) {
0042 return (value / 1000000000000) + 'T';
0043 } else if (value > 1000000000) {
0044 return (value / 1000000000) + 'G';
0045 } else if (value > 1000000) {
0046 return (value / 1000000) + 'M';
0047 } else if (value > 1000) {
0048 return (value / 1000) + 'K';
0049 } else {
0050 return value;
0051 }
0052 }
0053 },
0054 showArea: false
0055 });
0056 }
0057
0058 function draw_chartist1(labels, data, group_types_name, chartist_name, group_types_select) {
0059 var g_types = Object.keys(data);
0060
0061 var select_option = $(group_types_select + " option").filter(':selected').text();
0062 select_option = $.trim(select_option);
0063
0064 $(group_types_select).empty();
0065 if (select_option === 'All'){
0066 var all_option = '<option value="All" selected="selected">All</option>';
0067 $(group_types_select).append(all_option);
0068 } else {
0069 var all_option = '<option value="All">All</option>';
0070 $(group_types_select).append(all_option);
0071 }
0072 $.each(g_types, function(i) {
0073 if (select_option === g_types[i]){
0074 var new_opt = '<option value="' + g_types[i] + '" selected="selected">' + g_types[i] + '</option>';
0075 $(group_types_select).append(new_opt);
0076 } else {
0077 var new_opt = '<option value="' + g_types[i] + '">' + g_types[i] + '</option>';
0078 $(group_types_select).append(new_opt);
0079 }
0080 });
0081
0082 if (select_option === 'All'){
0083 var num_monthly = Object.keys(data).map(function(key){
0084 var mnum_monthly_status = Object.keys(data[key]).map(function(key1){
0085 return data[key][key1];
0086 });
0087 return mnum_monthly_status;
0088 });
0089 draw_chartist(g_types, group_types_name, chartist_name, labels, num_monthly);
0090 } else {
0091 var num_monthly = Object.keys(data[select_option]).map(function(key){
0092 return data[select_option][key];
0093 });
0094 num_monthly = [num_monthly];
0095 draw_chartist([select_option], group_types_name, chartist_name, labels, num_monthly);
0096 }
0097 }
0098
0099 function draw_chartist2(labels, data, group_types_name, chartist_name, group_types_select) {
0100 var g_types = Object.keys(data);
0101
0102 var select_option = $(group_types_select + " option").filter(':selected').text();
0103 select_option = $.trim(select_option);
0104
0105 $(group_types_select).empty();
0106 if (select_option === 'All'){
0107 var all_option = '<option value="All" selected="selected">All</option>';
0108 $(group_types_select).append(all_option);
0109 } else {
0110 var all_option = '<option value="All">All</option>';
0111 $(group_types_select).append(all_option);
0112 }
0113 $.each(g_types, function(i) {
0114 if (select_option === g_types[i]){
0115 var new_opt = '<option value="' + g_types[i] + '" selected="selected">' + g_types[i] + '</option>';
0116 $(group_types_select).append(new_opt);
0117 } else {
0118 var new_opt = '<option value="' + g_types[i] + '">' + g_types[i] + '</option>';
0119 $(group_types_select).append(new_opt);
0120 }
0121 });
0122
0123 if (select_option === 'All'){
0124 var num_monthly = Object.keys(data).map(function(key){
0125 var mnum_monthly_status = Object.keys(data[key].Total).map(function(key1){
0126 return data[key].Total[key1];
0127 });
0128 return mnum_monthly_status;
0129 });
0130 draw_chartist(g_types, group_types_name, chartist_name, labels, num_monthly);
0131 } else {
0132 var num_monthly = Object.keys(data[select_option].Total).map(function(key){
0133 return data[select_option].Total[key];
0134 });
0135 num_monthly = [num_monthly];
0136 draw_chartist([select_option], group_types_name, chartist_name, labels, num_monthly);
0137 }
0138 }
0139
0140 function draw_chartist_status(data) {
0141
0142
0143 var labels = Object.keys(data.month_acc_status.Total);
0144
0145 draw_chartist1(labels, data.month_acc_status, '#view_chartist_labels_status', '#view_chartist_status', "#view_chartist_labels_status_select");
0146 }
0147
0148 function draw_chartist_files(data) {
0149
0150 var labels = Object.keys(data.month_acc_processed_files.Total);
0151 draw_chartist1(labels, data.month_acc_processed_files, '#view_chartist_labels_files', '#view_chartist_files', "#view_chartist_labels_files_select");
0152 }
0153
0154 function draw_chartist_bytes(data) {
0155
0156 var labels = Object.keys(data.month_acc_processed_bytes.Total);
0157 draw_chartist1(labels, data.month_acc_processed_bytes, '#view_chartist_labels_bytes', '#view_chartist_bytes', "#view_chartist_labels_bytes_select");
0158 }
0159
0160 function draw_chartist_status_type(data) {
0161
0162 var labels = Object.keys(data.month_acc_status.Total);
0163
0164 draw_chartist2(labels, data.month_acc_status_dict_by_type, '#view_chartist_labels_type', '#view_chartist_type', "#view_chartist_labels_type_select");
0165 }
0166
0167 function draw_chartist_files_type(data) {
0168
0169 var labels = Object.keys(data.month_acc_status.Total);
0170 draw_chartist2(labels, data.month_acc_processed_files_by_type, '#view_chartist_labels_files_type', '#view_chartist_files_type', "#view_chartist_labels_files_type_select");
0171 }
0172
0173 function draw_chartist_bytes_type(data) {
0174
0175 var labels = Object.keys(data.month_acc_status.Total);
0176 draw_chartist2(labels, data.month_acc_processed_files_by_type, '#view_chartist_labels_bytes_type', '#view_chartist_bytes_type', "#view_chartist_labels_bytes_type_select");
0177 }
0178
0179
0180 var sparklineLogin = function () {
0181 var iddsAPI_request = appConfig.iddsAPI_request;
0182 var iddsAPI_transform = appConfig.iddsAPI_transform;
0183 var iddsAPI_processing = appConfig.iddsAPI_processing;
0184
0185 $.getJSON(iddsAPI_transform, function(data){
0186 $('#totaltransforms span').text(data.total);
0187 var month_transforms = Object.keys(data.month_status.Total).map(function(key){
0188 return data.month_status.Total[key];
0189 });
0190 $('#totaltransformslinedash').sparkline(month_transforms, {
0191 type: 'bar',
0192 height: '30',
0193 barWidth: '4',
0194 resize: true,
0195 barSpacing: '5',
0196 barColor: '#7460ee'
0197 });
0198
0199 $('#totalfiles span').text(data.total_files);
0200 var month_files = Object.keys(data.month_processed_files.Total).map(function(key){
0201 return data.month_processed_files.Total[key];
0202 });
0203 $('#totalfileslinedash').sparkline(month_files, {
0204 type: 'bar',
0205 height: '30',
0206 barWidth: '4',
0207 resize: true,
0208 barSpacing: '5',
0209 barColor: '#7460ee'
0210 });
0211
0212 $('#totalbytes span').text(Math.round(data.total_bytes/1000/1000/1000/1000));
0213 var month_bytes = Object.keys(data.month_processed_bytes.Total).map(function(key){
0214 return data.month_processed_bytes.Total[key];
0215 });
0216 $('#totalbyteslinedash').sparkline(month_bytes, {
0217 type: 'bar',
0218 height: '30',
0219 barWidth: '4',
0220 resize: true,
0221 barSpacing: '5',
0222 barColor: '#7460ee'
0223 });
0224
0225 draw_chartist_status(data);
0226 draw_chartist_files(data);
0227 draw_chartist_bytes(data);
0228 draw_chartist_status_type(data);
0229 draw_chartist_files_type(data);
0230 draw_chartist_bytes_type(data);
0231 });
0232
0233 }
0234
0235 var sparkResize;
0236 $(window).on("resize", function (e) {
0237 clearTimeout(sparkResize);
0238 sparkResize = setTimeout(sparklineLogin, 500);
0239 });
0240 sparklineLogin();
0241
0242 $("select").on("change", function() {
0243
0244 sparklineLogin();
0245 });
0246 });
0247
0248