for channel in ${channels}
do
httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null -X POST --data-urlencode \
- "payload={\"channel\": \"#${channel}\", \"username\": \"${username}\", \"text\": \"${hostname} ${status_message} about ${author} ${raised_for} - click <${goto_url}|here> to view the netdata dashboard.\", \"icon_url\": \"${image}\", \"attachments\": [{\"fallback\": \"${alarm} - ${info}\", \"color\": \"${color}\", \"title\": \"${alarm}\", \"title_link\": \"${goto_url}\", \"text\": \"${info}\", \"footer\": \"netdata\", \"footer_icon\": \"${NETDATA_REGISTRY_URL}/images/seo-performance-128.png\", \"ts\": ${when}}]}" \
+ "payload={\"channel\": \"#${channel}\", \"username\": \"${username}\", \"text\": \"${hostname} ${status_message} - ${author} ${raised_for} - click <${goto_url}|here> to view the netdata dashboard.\", \"icon_url\": \"${image}\", \"attachments\": [{\"fallback\": \"${alarm} - ${info}\", \"color\": \"${color}\", \"title\": \"${alarm}\", \"title_link\": \"${goto_url}\", \"text\": \"${info}\", \"footer\": \"netdata\", \"footer_icon\": \"${NETDATA_REGISTRY_URL}/images/seo-performance-128.png\", \"ts\": ${when}}]}" \
"${webhook}")
if [ "${httpcode}" == "200" ]
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <script>var netdataRegistry = true;</script>
+ <script>
+ var netdataRegistry = true;
+ var netdataTheme = 'slate';
+ var netdataShowHelp = true;
+ </script>
<script type="text/javascript" src="dashboard.js?v46"></script>
<script>
chart: null,
family: null,
hasProperty: function(property) {
- // console.log('checking property ' + property + ' of type ' + typeof(this[property]));
return typeof this[property] !== 'undefined';
}
};
if(urlOptions.hasProperty(p[0]) && typeof p[1] !== 'undefined')
urlOptions[p[0]] = p[1];
}
-
- console.log(urlOptions);
}
function netdataURL(url) {
- return url + '#' + urlOptions.family;
+ return url + '#top;show_alarms=true;chart=' + urlOptions.chart + ';family=' + urlOptions.family;
}
var gotoServerValidateRemaining = 0;
var gotoServerMiddleClick = false;
var gotoServerStop = false;
function gotoServerValidateUrl(id, guid, url) {
- console.log(id);
- console.log(guid);
- console.log(url);
-
var penaldy = 0;
if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
// we penalize https only if the current url is http
NETDATA.registry.hello(url, function(data) {
if (data) {
- // console.log('OK ' + id + ' URL: ' + url);
document.getElementById(guid + '-' + id + '-status').innerHTML = "OK";
if(!gotoServerStop) {
document.getElementById('gotoServerResponse').innerHTML = '<b>Opening new window to ' + NETDATA.registry.machines[guid].name + '<br/><a href="' + finalURL + '">' + url + '</a></b><br/>(check your pop-up blocker if it fails)';
}
else
- document.location = finalURL;
+ console.log(document.location); // = finalURL;
}
}
else {
var len = machines_array.length;
while(len--) {
if(machines_array[len].name === urlOptions.host) {
- console.log(machines_array[len]);
-
var ulen = machines_array[len].alternate_urls.length;
gotoServerValidateRemaining = ulen;
while(ulen--)
gotoServerValidateUrl(ulen, machines_array[len].guid, machines_array[len].alternate_urls[ulen]);
-
return;
}
}
</head>
<body>
<div class="container" id="">
- <div id="bodylog" style="padding-top: 40px; font-size: 18px;">
+ <div id="bodylog" style="padding-top: 10vh; font-size: 2vh;">
Please wait...
<div style="padding-top: 20px;">
- <table id="gotoServerList">
+ <table id="gotoServerList" class="table">
</table>
</div>
<p style="padding-top: 10px;"><small>
after: 0,
before: 0,
nowelcome: 0,
+ show_alarms: 0,
+ chart: null,
+ family: null,
hasProperty: function(property) {
// console.log('checking property ' + property + ' of type ' + typeof(this[property]));
return typeof this[property] !== 'undefined';
// index the chart in the menu/submenu
menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
+
+ // console.log(urlOptions.chart + ' === ' + c);
+ if(urlOptions.chart === c) {
+ urlOptions.hash = '#' + name2id(charts[c].menu + '_' + charts[c].submenu)
+ // console.log('hash = ' + urlOptions.hash);
+ }
}
// propagate the descriptive subname given to QoS
active += '<tr><th class="text-center" colspan="2"><h4>' + family + '</h4></th></tr>';
}
count_active++;
- active += alarm_to_html(alarm, false);
+ active += alarm_to_html(alarm, true);
}
count_all++;
}, 2000);
}
else notifyForUpdate();
+
+ if(urlOptions.show_alarms === 'true')
+ setTimeout(function() { $('#alarmsModal').modal('show'); }, 1000);
}
function resetDashboardOptions() {