All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.sonar-accessor-min.js Maven / Gradle / Ivy

AJS.$.namespace("AJS.sonar.accessor");AJS.sonar.accessor.JSON_FORMAT="json";AJS.sonar.accessor.FORCE_SERVLET_QUERY=false;AJS.sonar.accessor.PARSE_JSON_RESPONSES=false;AJS.sonar.accessor.generateServerResourceApiUrl=function(){return"/api/resources?format="+AJS.sonar.accessor.JSON_FORMAT};AJS.sonar.accessor.generateServerMetricsApiUrl=function(){return"/api/metrics?format="+AJS.sonar.accessor.JSON_FORMAT};AJS.sonar.accessor.generateApiUrl=function(A,C){var D="";if(C!==""){D="&metrics="+C}var B="";if(A!==""){B="&resource="+A}return AJS.sonar.accessor.generateServerResourceApiUrl()+D+B+"&includetrends=true&includealerts=true"};AJS.sonar.accessor.getAjaxOptions=function(E,D,C,A){var B={type:"GET",dataTpe:AJS.sonar.accessor.JSON_FORMAT};if(A!==undefined){B.error=A}if(E.secured||AJS.sonar.accessor.FORCE_SERVLET_QUERY){B.url=E.baseUrl+"/plugins/servlet/sonar/querySonar";B.data={username:E.username,password:E.password,host:E.host,apiUrl:D};if(C!==undefined){if(AJS.sonar.accessor.PARSE_JSON_RESPONSES){B.success=function(F){C(JSON.parse(F))}}else{if(C!==undefined){B.success=C}}}}else{B.url=E.host+D;if(C!==undefined){B.success=C}}return B};AJS.sonar.accessor.parseSonarServer=function(A,C){var B=C.match(/(http|https):\/\/(.*):(.*)@(.*)/);if(B!==null){return{baseUrl:A,username:B[2],password:B[3],host:B[1]+"://"+B[4],secured:true}}else{return{baseUrl:A,host:C,secured:false}}};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy