/*****************************************************************************/ /* tips.js Tooltips, includes both the tooltip code and the tip text. COPYRIGHT --------- Copyright (C) 2014-2018 Mark G.Daniel This program, comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or any later version. http://www.gnu.org/licenses/gpl.txt VERSION ------- 05-MAR-2014 MGD initial */ /*****************************************************************************/ var alam_ToolTipDisabled = false, // set to true to disable tooltips alam_ToolTipDelay = 800, // mSecs alam_ToolTipOutDelay = 200; // mSecs ////////// // TIPS // ////////// function alamToolTipInit () { if (alam_ToolTipArray.length) return; ///////////// // control // ///////////// alamToolTipAdd('controlCollect','Collect server data.'); alamToolTipAdd('controlUpdate', 'Update displayed data. Deselecting this option allows the displayed data \ to examined without change while maintaining collection for update \ when reselected.'); alamToolTipAdd('controlAlerts', 'Display alerts. Normally enabled but can be disabled if overloaded.'); alamToolTipAdd('controlDetail','Display additional server detail.'); alamToolTipAdd('controlTips', 'These  things.'); alamToolTipAdd('controlHistory', 'Display activity history (line) graphs, 5 minutes by default, \ 15 minutes selectable.'); alamToolTipAdd('controlInstance', 'Display server process data.'); alamToolTipAdd('controlMinutes', 'Store and display 5 (default) or 15 minutes of activity data.'); alamToolTipAdd('controlProxy','Display proxy data.'); alamToolTipAdd('controlRequest','Display the latest request processed.'); alamToolTipAdd('controlScript', 'Display DCL and DECnet based scripting data.'); alamToolTipAdd('controlStatus','Display instance status report.'); alamToolTipAdd('controlWebDav','Display WebDAV data.'); ///////////// // summary // ///////////// alamToolTipAdd('sumConnect', 'Current network connections, then peak, then total.'); alamToolTipAdd('sumProcess', 'Current requests being processed, then peak, then total.'); alamToolTipAdd('sumBytesRx','Total bytes received.'); alamToolTipAdd('sumBytesTx','Total bytes transmitted.'); alamToolTipAdd('sumHTTP2', 'HTTP/2 requests. First value is current processing, then peak processed, \ and finally total processed. Percentage of total in parentheses.'); alamToolTipAdd('sumHTTP1', 'HTTP/1.1 and HTTP/1.0 requests. First value is current processing, then peak processed, \ and finally total processed. Percentage of total in parentheses.'); alamToolTipAdd('sumSSL', 'Secure Socket Layer (TLS) requests processed, \ percentage of total in parentheses.'); alamToolTipAdd('sumFile','Total requests that had a file transferred.'); alamToolTipAdd('sumScript','Total requests that had a script activated.'); alamToolTipAdd('sumProxy', 'Total requests proxied in some fashion (i.e. explicit proxy, reverse proxy).'); alamToolTipAdd('sumWebDAV','Total requests involving a WebDAV action.'); alamToolTipAdd('sumOther', 'Total requests not involving file transfer, script activation, \ or proxy access (e.g. directory listing, server administration).'); alamToolTipAdd('sumThrottle', 'Throttled requests. First value is total number throttled, then queued, \ and finally busy. Percentage of total for each in parentheses.'); // status alamToolTipAdd('nn1','Total informational responses \ (e.g. 100 continue, 101 upgrade required), \ percentage of total in parentheses.'); alamToolTipAdd('nn2', 'Total success responses (e.g. 200 OK, 204 no content), \ percentage of total in parentheses.'); alamToolTipAdd('nn3', 'Total redirection responses (e.g. 302 found here, \ 304 not modified), percentage of total in parentheses.'); alamToolTipAdd('nn4', 'Total client error responses (e.g. 400 bad request, \ 404 not found), percentage of total in parentheses.'); alamToolTipAdd('nn5', 'Total server error responses (e.g. 500 internal error, \ 503 service unavailable), percentage of total in parentheses.'); ///////////// // history // ///////////// alamToolTipAdd('bar', 'Bar graphs display maximum, instantaneous and \ average values (as applicable) for each collected datum. The history of \ these values is displayed in line graphs opened using the History \ checkbox.'); alamToolTipAdd('bioHist','System buffered I/Os.'); alamToolTipAdd('connectHist', 'Server network connections, where green is the total (including persistent) \ and blue the number currently being processed.'); alamToolTipAdd('cpuHist', 'System CPU consumed, where the green value is total CPU \ and the red value non-USER modes (S+E+K).'); alamToolTipAdd('diskHist', 'System disk operations (File Control Primitives - FCPs), \ where green is total (reads + writes) and red is writes.'); alamToolTipAdd('fileHist', 'Server file requests, where green is total \ and blue is not modified (304 response, with no content transferred).'); alamToolTipAdd('netHist', 'System network interface (NI) bytes per second, \ where green is the total of system traffic and blue is server (web) traffic. \
Clicking displays the mean datagram size graph.
'); alamToolTipAdd('dgramHist','System network interface (NI) average size \ of datagram (the bytes during the interval divided by the number of \ datagrams). Transmitted displayed in green, received in blue. \
Clicking displays the Web server average block size per second.
'); alamToolTipAdd('blockHist','Server average size of read and write blocks \ (the bytes during the interval divided by the number of blocks). \ Data blocks written is displayed in green, blocks read in blue. \
Clicking displays the NI bytes per second.
'); alamToolTipAdd('scriptHist', 'Server script requests processed, where green is the total, \ blue the number of persistent scripts (CGIplus and RTE) and red \ the number of CGI (heavyweight). \
Clicking displays the system process graph.
'); alamToolTipAdd('processHist', 'Process counts, where green is system total and blue is WASD server(s) \ plus current scripting processes (both DCL and DECnet). \
Clicking displays the server scripting graph.
'); alamToolTipAdd('otherHist', 'Server requests processed other than the files, scripts, \ and proxy requests (reported separately).'); alamToolTipAdd('proxyHist', 'Server proxy requests processed, where green is the total, blue the \ number read from cache, and red the number written to cache.'); alamToolTipAdd('requestHist', 'Server requests processed, where green is the total and red the number \ with a non-success status (zero, 4nn and 5nn). \
Clicking displays the HTTP protocol graph.
'); alamToolTipAdd('httpHist', 'HTTP protocol, where green is the total, \ blue the number of HTTP/2 requests \ and red the number of HTTP/1.n requests. \
Clicking displays the request graph.
'); alamToolTipAdd('scriptHistCREPRC', 'DCL process creation and deletion. All scripting that is not DECnet based. \ Green line is process creation. Blue line is process deletion.'); alamToolTipAdd('scriptHistDECnet', 'DECnet scripting. Green line is all DECnet scripts (CGI + OSU). \ Blue line is CGI scripts. Red line is OSU scripts.'); alamToolTipAdd('scriptHistCGIplusRTE', 'Persistent scripting. Green line is total persistent scripts \ (RTE + CGIplus). Blue line is reused script processes.'); alamToolTipAdd('throttleHist', 'Throttled request processing, where green is the total under throttle \ control, blue the number initially queued, and red the number too busy \ (generating a 503 response).'); alamToolTipAdd('webdavHist', 'WebDAV processing, where green is the total requests (read, write, lock, \ prop, etc.), blue resources read, and red resources written (put, move, \ (copy, mkcol, etc.)'); } ///////////// // TOOLTIP // ///////////// var alam_ToolTipArray = new Array(); var alam_ToolTipTimer = null, alam_ToolTipCurrent = null; var alam_ToolTipX = 0, alam_ToolTipY = 0, alam_ToolTipXguard = 20, alam_ToolTipYguard = 10; // add an element's tip to the lookup array function alamToolTipAdd (id,tip) { if (tip.substr(0,1) == '[') alamToolTipSet(id,alam_ToolTipArray[tip.substr(1,tip.length-2)]); else alamToolTipSet(id,(alam_ToolTipArray[id] = tip)); } // set a tool tip against an element function alamToolTipSet (id,tip) { if (typeof tip == 'undefined') tip = '[' + id + ']'; var idobj = $byId(id); if (!idobj) { alert('TIP ' + id + ' undefined!'); return; } idobj.setAttribute('onmousemove','alamToolTip(event,"' + tip + '")'); idobj.setAttribute('onmouseout','alamToolTip(event)'); } // the mouse event on the element triggers a tooltip function alamToolTip(evnt,tip) { if (!$byId("checkboxTips").checked) return; var div = document.getElementById('divToolTip'); if (div == null) { // create the div for the tooltip text just the once var body = document.getElementsByTagName('body')[0]; var div = document.createElement('div'); div.setAttribute('id','divToolTip'); div.setAttribute('style','display:none;'); // makes it easier on touch devices (e.g. iPad) div.setAttribute('onclick','this.style.display="none";'); body.appendChild(div); } if (evnt.type == 'mousemove') { alam_ToolTipX = evnt.pageX; alam_ToolTipY = evnt.pageY; if (div && div.style.display == 'none') { // tooltip is not (yet) displayed if (alam_ToolTipTimer) return; // delay the appearance of the tooltip var callback = function(tip) { // timeout for initial tooltip just expired alam_ToolTipTimer = null; div.style.display = 'inline-block'; var pseudoEvent = { type : 'mousemove', pageX : alam_ToolTipX, pageY : alam_ToolTipY }; setTimeout(alamToolTip, 10, pseudoEvent, tip); alam_ToolTipCurrent = tip; if (tip.substr(0,1) == '[') tip = alam_ToolTipArray[tip.substr(1,tip.length-2)]; document.getElementById('divToolTip').innerHTML = tip; }; alam_ToolTipTimer = setTimeout(callback, alam_ToolTipDelay, tip); } else { // tooltip is currently displayed, just move it if (div.scrollWidth + alam_ToolTipX + alam_ToolTipXguard > window.innerWidth) div.style.left = (alam_ToolTipX - div.scrollWidth - 5) + 'px'; else div.style.left = (alam_ToolTipX + 5) + 'px'; if (div.scrollHeight + alam_ToolTipY + alam_ToolTipYguard > window.innerHeight) div.style.top = (alam_ToolTipY - div.scrollHeight - 5) + 'px'; else div.style.top = (alam_ToolTipY + 5) + 'px'; if (tip != alam_ToolTipCurrent) { alam_ToolTipCurrent = tip; if (tip.substr(0,1) == '[') tip = alam_ToolTipArray[tip.substr(1,tip.length-2)]; div.innerHTML = tip; } if (alam_ToolTipTimer) clearTimeout(alam_ToolTipTimer); alam_ToolTipTimer = null; } } else if (evnt.type == 'mouseout') { // delay the disappearance of the tooltip just slightly var callback = function (tip) { clearTimeout(alam_ToolTipTimer); alam_ToolTipTimer = null; div.style.display = 'none'; } clearTimeout(alam_ToolTipTimer); alam_ToolTipTimer = setTimeout(callback, alam_ToolTipOutDelay, tip); } else { // tooltip no longer current clearTimeout(alam_ToolTipTimer); alam_ToolTipTimer = alam_ToolTipCurrent = null; div.style.display = 'none'; } } /*****************************************************************************/