You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
9.1 KiB

require(["splunkjs/mvc","app/DA-ITSI-CP-aws-dashboards/js/libs/underscore","app/DA-ITSI-CP-aws-dashboards/js/swc-aws/index","splunkjs/mvc/tokenforwarder","splunkjs/mvc/simplexml/ready!","splunkjs/mvc/multidropdownview"],function(t,e,n,r,i,o){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=t,n.c=e,n.p="stage/",n(0)}({0:function(t,e,n){var r,i;n.p=function(){function t(t,e){if(window.$C&&window.$C.hasOwnProperty(t))return window.$C[t];if(void 0!==e)return e;throw new Error("getConfigValue - "+t+" not set, no default provided")}return function(){for(var e,n,r="",i=0,o=arguments.length;i<o;i++)(n=(e=arguments[i].toString()).length)>1&&"/"==e.charAt(n-1)&&(e=e.substring(0,n-1)),"/"!=e.charAt(0)?r+="/"+e:r+=e;if("/"!=r){var s=r.split("/"),u=s[1];if("static"==u||"modules"==u){var a=r.substring(u.length+2,r.length);r="/"+u,window.$C.BUILD_NUMBER&&(r+="/@"+window.$C.BUILD_NUMBER),window.$C.BUILD_PUSH_NUMBER&&(r+="."+window.$C.BUILD_PUSH_NUMBER),"app"==s[2]&&(r+=":"+t("APP_BUILD",0)),r+="/"+a}}var l=t("MRSPARKLE_ROOT_PATH","/"),c=t("DJANGO_ROOT_PATH",""),f=t("LOCALE","en-US"),d="";return d=c&&r.substring(0,c.length)===c?r.replace(c,c+"/"+f.toLowerCase()):"/"+f+r,""==l||"/"==l?d:l+d}("/static/app/DA-ITSI-CP-aws-dashboards")+"/"}(),r=[n(34),n(105),n(49),n(42)],void 0===(i=function(t){t.resetTokenValue("region","form.instances",void 0)}.apply(e,r))||(t.exports=i)},2:function(e,n){e.exports=t},4:function(t,n){t.exports=e},8:function(t,e){t.exports=n},34:function(t,e,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r=[n(2),n(35),n(8)],void 0===(i=function(t,e,n){"use strict";n.utils,n.splunkd_utils;var r=/\$PREFIX\$/g,i='timechart span=1d sum(cost) as "Cost"',s={USD:"$",CNY:"¥",JPY:"¥",EUR:"€"},u=t.Components.getInstance("default");t.setFilter("currency2Symbol",function(t){if(t)return t in s?s[t]:""}),["countspl","costspl"].forEach(function(e){t.setFilter("groupby2"+e,function(t){var n="countspl"===e?'timechart sum(count) as "Instance Hours" span=1d':i,r="countspl"===e?"instance_hour":"detailed_billing";if(!(t&&t.length>0))return t;switch(t){case"none":return"by _time span=1d | "+n;case"reservation":return'by _time instance_hour.ReservedInstance span=1d | eval Reserved=if(\'instance_hour.ReservedInstance\'="Y", count, 0) | eval count=if(\'instance_hour.ReservedInstance\'="N", count, 0) | fields _time count Reserved | timechart sum(count) as "On-demand" sum(Reserved) as Reserved span=1d';default:return"by _time "+r+"."+t+" span=1d | eval "+r+"."+t+"=if('"+r+"."+t+'\'=="", "No Value", \''+r+"."+t+"') | "+n+" by "+r+"."+t}}),t.setFilter("curgroupby2"+e,function(t){var n="countspl"===e?'timechart sum(count) as "Instance Hours" span=1d':i,r="countspl"===e?"instance_hour_cur":"detailed_billing_cur";if(!(t&&t.length>0))return t;switch(t){case"none":return"by _time span=1d | "+n;case"reservation":return'by _time instance_hour_cur.ReservedInstance span=1d | eval Reserved=if(\'instance_hour_cur.ReservedInstance\'="Y", count, 0) | eval count=if(\'instance_hour_cur.ReservedInstance\'="N", count, 0) | fields _time count Reserved | timechart sum(count) as "On-demand" sum(Reserved) as Reserved span=1d';default:return"by _time "+r+"."+t+" span=1d | eval "+r+"."+t+"=if('"+r+"."+t+'\'=="", "No Value", \''+r+"."+t+"') | "+n+" by "+r+"."+t}})}),t.setFilter("costbygroups",function(t){if(t&&t.length>0){var e=t.split("|");return"by "+e.map(function(t){return"detailed_billing."+t}).join(" ")+" | rename "+e.map(function(t){return"detailed_billing."+t+" as "+t}).join(", ")}return t}),t.setFilter("curcostbygroups",function(t){if(t&&t.length>0){var e=t.split("|");return"by "+e.map(function(t){return"detailed_billing_cur."+t}).join(" ")+" | rename "+e.map(function(t){return"detailed_billing_cur."+t+" as "+t}).join(", ")}return t});var a=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:",",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" OR ";return function(i){if(i&&i.length>0){var o=i.split(n).map(t).join(r);return e(o)}return i}};return t.setFilter("id2InstanceId",a(function(t){return'metric_dimensions="InstanceId=['+t+']"'},function(t){return"("+t+")"})),t.setFilter("id2VolumeId",a(function(t){return'metric_dimensions="VolumeId=['+t+']"'},function(t){return"("+t+")"})),t.setFilter("id2description",a(function(t){return'id="'+t+'"'},function(t){return"("+t+")"})),t.setFilter("VolumeId2description",a(function(t){return'VolumeId="'+t+'"'},function(t){return"("+t+")"})),t.setFilter("InstanceId2description",a(function(t){return'InstanceId="'+t+'"'},function(t){return"("+t+")"})),["tag2description","tag2config"].forEach(function(e){t.setFilter(e,a(function(t){return t.replace(r,"tags.")},function(t){return"|search "+t},"||"," AND "))}),t.setFilter("ebstag2description",function(t){if(t.length>0){for(var e=t.replaceAll("$PREFIX$",""),n=e.split(" "),r=[],i=0;i<n.length;i++)"AND"==n[i]?r.push("AND"):"OR"==n[i]&&r.push("OR");var o=e.split(" OR "),s=[];for(i=0;i<o.length;i++){var u=o[i].split(" AND ");s.push(u)}s=s.toString().split(","),t="";for(i=0;i<s.length;i++){var a=s[i].toString().split("="),l=a[1].slice(0,a[1].length-1)+'\\"';i==s.length-1?t+='tagskeyvalue="{\\"Key\\": \\"'+a[0]+'\\", \\"Value\\": \\'+l+'}"':t+='tagskeyvalue="{\\"Key\\": \\"'+a[0]+'\\", \\"Value\\": \\'+l+'}" '+r[i]+" "}return"| search "+t}return t}),t.setFilter("tag2notification",a(function(t){return t.replace(r,"configurationItem.tags.")},function(t){return"|search "+t},"||"," AND ")),t.setFilter("tag2billing",a(function(t){return'"'+(t=t.replace(r,"user:"))+'"'},function(t){return"|search "+t},"||"," AND ")),t.setFilter("tag2detailed_billing",a(function(t){return t.replace(r,"detailed_billing.")},function(t){return t},"||"," AND ")),t.setFilter("tag2detailed_billing_cur",a(function(t){return t.replace(r,"detailed_billing_cur.")},function(t){return t},"||"," AND ")),t.setFilter("tag2instance_hour",a(function(t){return t.replace(r,"instance_hour.")},function(t){return t},"||"," AND ")),t.setFilter("tag2instance_hour_cur",a(function(t){return t.replace(r,"instance_hour_cur.")},function(t){return t},"||"," AND ")),t.setFilter("tag2topology",function(t){if(t&&t.length>0){for(var e=t.split(" OR "),n='| fillnull value="" tags | search ',i=0;i<e.length;i++){var o=e[i].replace(r,""),s=o.split("="),u=s[0],a=s[1],l=!1,c=!1;if("NOT"===u.substr(0,3)?(c=!0,u=u.substr(4)):"*"===a[1]&&"*"===a[a.length-2]&&(l=!0),a=a.substring(1,a.length-1),l)n+='tags="\\S*'+u+",\\S*"+(a=a.substring(1,a.length-1))+'\\S*"';else if(c)n+='tags="^(?!.*'+u+',)"';else{var f=o.split("=");if(-1==o.search("AND")&&(n+='(tags="*'+f[0]+","+f[1].slice(1,f[1].length-1)+'*")'),-1!=o.search("AND"))for(var d=o.split(" AND "),p=0;p<d.length;p++){var g=d[p].split("=");n+='(tags="*'+g[0]+","+g[1].slice(1,g[1].length-1)+'*")',p!=d.length-1&&(n+=" AND ")}}i!=e.length-1&&(n+=" OR ")}return n}return t}),{createLocalStorageToken:function(t,n,r){if(u.get("disableLocalToken"))return null;u.on("change:"+n,function(e,n){void 0!==(void 0===n?"undefined":o(n))&&void 0!==n||(n="*"),localStorage.setItem(t,n)});var i=localStorage.getItem(t)||"*",s=new URLSearchParams(location.search).get(n);void 0!==(void 0===s?"undefined":o(s))&&void 0!==s&&null!==s?u.set(t,s):u.set(t,i),new e(["$"+t+"$"],"$"+n+"$",r)},resetTokenValue:function(t,e,n){u.on("change:"+t,function(){u.set(e,n)})}}}.apply(e,r))||(t.exports=i)},35:function(t,e){t.exports=r},42:function(t,e){t.exports=i},49:function(t,e,n){var r,i;r=[n(4),n(2),n(8),n(50),n(52)],void 0===(i=function(t,e,n,r,i){"use strict";var o=i.list_of_ids_with_all,s=i.list_of_ids_without_all;Object.keys(e.Components.attributes).forEach(function(t){for(var n=e.Components.get(t),i=t,u=0;u<o.length;u++)-1!=i.search(o[u])&&(n.val=r.multiSelectVal_persist_all);for(var a=0;a<s.length;a++)-1!=i.search(s[a])&&(n.val=r.multiSelectVal)})}.apply(e,r))||(t.exports=i)},50:function(t,e,n){var r,i;r=[n(4),n(51)],void 0===(i=function(t,e){return{multiSelectVal:function(){var n=arguments[0];if(t.isArray(n)&&n.length>1){var r=n.indexOf("*");0===r?n=t.without(n,"*"):r===n.length-1&&(n=["*"]),arguments[0]=n}return e.prototype.val.apply(this,arguments)},multiSelectVal_persist_all:function(){var n=arguments[0];if(t.isArray(n)&&0==n.length&&(arguments[0]="*"),t.isArray(n)&&n.length>1){var r=n.indexOf("*");0===r?n=t.without(n,"*"):r===n.length-1&&(n=["*"]),arguments[0]=n}return e.prototype.val.apply(this,arguments)}}}.apply(e,r))||(t.exports=i)},51:function(t,e){t.exports=o},52:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.list_of_ids_without_all=["ip1","ip2","ip3","region","account"],e.list_of_ids_with_all=["input1_all","input2_all","recommendation_filter","select_severity"]},105:function(t,e,n){var r,i;r=[n(34),n(42)],void 0===(i=function(t){"use strict";t.createLocalStorageToken("localAccountId","form.accountId",function(t){return t?t.split(","):TokenForwarder.NO_CHANGE}),t.createLocalStorageToken("localRegions","form.region",function(t){return t?t.split(","):TokenForwarder.NO_CHANGE})}.apply(e,r))||(t.exports=i)}})});