Select Git revision
cronlog-renderer.class.php
-
Hahn Axel (hahn) authoredHahn Axel (hahn) authored
functions.js 7.61 KiB
/*
*/
// ----------------------------------------------------------------------
// CONSTANTS
// ----------------------------------------------------------------------
const AM_RESULTS={
0: 'OK',
1: 'unknown',
2: 'warning',
3: 'error'
};
const OUT_ID_APPS='app-section';
const OUT_ID_TAGS='tag-section';
const ID_TAGINPUT='E_TAGS';
// ----------------------------------------------------------------------
// VARS
// ----------------------------------------------------------------------
var AM_TAGURL=false;
var AM_PRETTYURL=false;
var AM_TIMER=false;
// ----------------------------------------------------------------------
// FUNCTIONS
// ----------------------------------------------------------------------
function _getAMApiUrl(sPath){
return AM_PRETTYURL
? AM_SERVER_URL+sPath
: AM_SERVER_URL+'/index.php?request='+sPath
;
}
/**
* get url to fetch the tags
* @returns string
*/
function _getUrlForTags(){
return _getAMApiUrl('/v1/apps/tags');
}
/**
* get url to fetch all applications with given tags
* @param {string} tags list of tags - separated by comma
* @returns
*/
function _getUrlWithTags(tags){
return _getAMApiUrl('/v1/apps/tags/'+tags+'/all');
}
/**
* helper: get a table row with data of an application
* @param {string} sLabel
* @param {string} sText
* @returns string
*/
function _appItem(sLabel,sText){
return '<tr><td>'+sLabel+' </td><td>'+sText+'</td></tr>'
}
/**
* helper: get a 2 digit count
* @param {int} i