browse.html revision c6511e859c35b12de4e6fb5f58d7258d9de3b8f2
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek<!DOCTYPE html>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek<html>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek<head>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek <title>Journal</title>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek <style type="text/css">
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek div#divlogs, div#diventry {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek font-family: monospace;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek font-size: 8pt;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek background-color: #ffffff;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek padding: 1em;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek margin: 2em 0em;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek border-radius: 10px 10px 10px 10px;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek border: 1px solid threedshadow;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek white-space: nowrap;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek overflow-x: scroll;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek div#diventry {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek display: none;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek div#divlogs {
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering display: block;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek body {
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering background-color: #ededed;
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering color: #313739;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek font: message-box;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek margin: 5em;
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering }
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering td.timestamp {
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering text-align: right;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek border-right: 1px dotted lightgrey;
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering padding-right: 5px;
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering }
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering td.process {
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek border-right: 1px dotted lightgrey;
6bedfcbb2970e06a4d3280c8fb62083d252ede73Lennart Poettering padding-left: 5px;
2cf4172a71860c6e44edd27a3b68047ae062d7fcLennart Poettering padding-right: 5px;
24882e06c135584f16f31ba8a00fecde8b7f6fadLennart Poettering }
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering td.message {
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering padding-left: 5px;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
799a8f39d8eb9ea725e85a598c0f5dbd658c8ba7Zbigniew Jędrzejewski-Szmek td.message > a:link, td.message > a:visited {
799a8f39d8eb9ea725e85a598c0f5dbd658c8ba7Zbigniew Jędrzejewski-Szmek text-decoration: none;
799a8f39d8eb9ea725e85a598c0f5dbd658c8ba7Zbigniew Jędrzejewski-Szmek color: #313739;
50a0b0717563d08c027a16a896bff8d7754eab9eZbigniew Jędrzejewski-Szmek }
29fc0ddcd737af906986d4029579d4dfe838ba02Zbigniew Jędrzejewski-Szmek td.message-error {
2cf4172a71860c6e44edd27a3b68047ae062d7fcLennart Poettering padding-left: 5px;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek color: red;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek font-weight: bold;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek td.message-error > a:link, td.message-error > a:visited {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek text-decoration: none;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek color: red;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek td.message-highlight {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek padding-left: 5px;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek font-weight: bold;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek td.message-highlight > a:link, td.message-highlight > a:visited {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek text-decoration: none;
2cf4172a71860c6e44edd27a3b68047ae062d7fcLennart Poettering color: #313739;
2cf4172a71860c6e44edd27a3b68047ae062d7fcLennart Poettering }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek td > a:hover, td > a:active {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek text-decoration: underline;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek color: #c13739;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek table#tablelogs, table#tableentry {
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek border-collapse: collapse;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek td.field {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek text-align: right;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek border-right: 1px dotted lightgrey;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek padding-right: 5px;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek td.data {
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek padding-left: 5px;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek </style>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek</head>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek<body>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <!-- TODO:
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek - show red lines for reboots
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek - show contents of entries -->
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <h1 id="title"></h1>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="os"></div>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="virtualization"></div>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="cutoff"></div>
c33b329709ebe2755181980a050d02ec7c81ed87Michal Schmidt <div id="machine"></div>
c33b329709ebe2755181980a050d02ec7c81ed87Michal Schmidt <div id="usage"></div>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="showing"></div>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="divlogs"><table id="tablelogs"></table></div>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <a name="entry"></a>
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek <div id="diventry"><table id="tableentry"></table></div>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <form>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="head" type="button" value="|&lt;" onclick="entriesLoadHead();"/>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="previous" type="button" value="&lt;&lt;" onclick="entriesLoadPrevious();"/>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="next" type="button" value="&gt;&gt;" onclick="entriesLoadNext();"/>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="tail" type="button" value="&gt;|" onclick="entriesLoadTail();"/>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek &nbsp;&nbsp;&nbsp;&nbsp;
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="more" type="button" value="More" onclick="entriesMore();"/>
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek <input id="less" type="button" value="Less" onclick="entriesLess();"/>
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt </form>
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt <script type="text/javascript">
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek var first_cursor = null;
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek var last_cursor = null;
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt function setCookie(name, value, msec) {
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt var d = new Date();
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek d.setMilliseconds(d.getMilliseconds() + msec);
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek var v = escape(value) + "; expires=" + d.toUTCString();
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek document.cookie = name + "=" + value;
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek }
d71839afd88589247d8dd42b2b09d024f521749dZbigniew Jędrzejewski-Szmek
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function getCookie(name) {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek var i, l;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek l = document.cookie.split(";");
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek for (i in l) {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek var x, y, j;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek j = l[i].indexOf("=");
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek x = l[i].substr(0, j);
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek y = l[i].substr(j+1);
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek if (x == name)
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek return unescape(y);
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek return null;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function getNEntries() {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek var n;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek n = getCookie("n_entries");
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering if (n == null)
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering return 50;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering return parseInt(n);
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function showNEntries(n) {
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering var showing = document.getElementById("showing");
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek showing.innerHTML = "Showing <b>" + n.toString() + "</b> entries.";
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering function setNEntries(n) {
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering if (n < 10)
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering n = 10;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering else if (n > 1000)
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering n = 1000;
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek setCookie("n_entries", n.toString(), 30*24*60*60*1000);
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering showNEntries(n);
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function machineLoad() {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek var request = new XMLHttpRequest();
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek request.open("GET", "/machine");
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek request.onreadystatechange = machineOnResult;
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek request.setRequestHeader("Accept", "application/json");
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek request.send(null);
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function formatBytes(u) {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek if (u >= 1024*1024*1024*1024)
36d4739a68c3edafe4d145d525a26de4ef0b8e5aZbigniew Jędrzejewski-Szmek return (u/1024/1024/1024/1024).toFixed(1) + " TiB";
36d4739a68c3edafe4d145d525a26de4ef0b8e5aZbigniew Jędrzejewski-Szmek else if (u >= 1024*1024*1024)
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt return (u/1024/1024/1024).toFixed(1) + " GiB";
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt else if (u >= 1024*1024)
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt return (u/1024/1024).toFixed(1) + " MiB";
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt else if (u >= 1024)
36d4739a68c3edafe4d145d525a26de4ef0b8e5aZbigniew Jędrzejewski-Szmek return (u/1024).toFixed(1) + " KiB";
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek else
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek return u.toString() + " B";
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek }
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek function machineOnResult(event) {
722b6795655149a68277b3cffeba711e1d440e5aZbigniew Jędrzejewski-Szmek if ((event.currentTarget.readyState != 4) ||
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek (event.currentTarget.status != 200 && event.currentTarget.status != 0))
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek return;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var d = JSON.parse(event.currentTarget.responseText);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var title = document.getElementById("title");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek title.innerHTML = 'Journal of ' + d.hostname;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek document.title = 'Journal of ' + d.hostname;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var machine = document.getElementById("machine");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek machine.innerHTML = 'Machine ID is <b>' + d.machine_id + '</b>, current boot ID is <b>' + d.boot_id + '</b>.';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var cutoff = document.getElementById("cutoff");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var from = new Date(parseInt(d.cutoff_from_realtime) / 1000);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var to = new Date(parseInt(d.cutoff_to_realtime) / 1000);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek cutoff.innerHTML = 'Journal begins at <b>' + from.toLocaleString() + '</b> and ends at <b>' + to.toLocaleString() + '</b>.';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var usage = document.getElementById("usage");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek usage.innerHTML = 'Disk usage is <b>' + formatBytes(parseInt(d.usage)) + '</b>.';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var os = document.getElementById("os");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek os.innerHTML = 'Operating system is <b>' + d.os_pretty_name + '</b>.';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var virtualization = document.getElementById("virtualization");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek virtualization.innerHTML = d.virtualization == "bare" ? "Running on <b>bare metal</b>." : "Running on virtualization <b>" + d.virtualization + "</b>.";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function entriesLoad(range) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var request = new XMLHttpRequest();
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.open("GET", "/entries");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.onreadystatechange = entriesOnResult;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.setRequestHeader("Accept", "application/json");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.setRequestHeader("Range", "entries=" + range + ":" + getNEntries().toString());
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.send(null);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function entriesLoadNext() {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (last_cursor == null)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad("");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad(last_cursor + ":1");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function entriesLoadPrevious() {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (first_cursor == null)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad("");
b88a40a7e592e0a4a2e6e8eb1ed3721989ba5d0ePhilippe De Swert else
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek entriesLoad(first_cursor + ":-" + getNEntries().toString());
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek function entriesLoadHead() {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek entriesLoad("");
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek }
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek function entriesLoadTail() {
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek entriesLoad(":-" + getNEntries().toString());
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function entriesOnResult(event) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if ((event.currentTarget.readyState != 4) ||
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek (event.currentTarget.status != 200 && event.currentTarget.status != 0))
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek return;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var logs = document.getElementById("tablelogs");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var lc = null;
5dabb1e04e4521abf040e77a8322b70e7acdc7b0Zbigniew Jędrzejewski-Szmek var fc = null;
5dabb1e04e4521abf040e77a8322b70e7acdc7b0Zbigniew Jędrzejewski-Szmek
5dabb1e04e4521abf040e77a8322b70e7acdc7b0Zbigniew Jędrzejewski-Szmek var i;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var l = event.currentTarget.responseText.split('\n');
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (l.length <= 1) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek logs.innerHTML = '<tbody><tr><td colspan="3"><i>No further entries...</i></td></tr></tbody>';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek return;
29fc0ddcd737af906986d4029579d4dfe838ba02Zbigniew Jędrzejewski-Szmek }
799a8f39d8eb9ea725e85a598c0f5dbd658c8ba7Zbigniew Jędrzejewski-Szmek
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek var buf = '';
29fc0ddcd737af906986d4029579d4dfe838ba02Zbigniew Jędrzejewski-Szmek
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek for (i in l) {
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek if (l[i] == '')
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek continue;
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek var d = JSON.parse(l[i]);
8847551bcbfa8265bae04f567bb1aadc7b480325Zbigniew Jędrzejewski-Szmek if (d.MESSAGE == undefined || d.__CURSOR == undefined)
29fc0ddcd737af906986d4029579d4dfe838ba02Zbigniew Jędrzejewski-Szmek continue;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek if (fc == null)
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek fc = d.__CURSOR;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek lc = d.__CURSOR;
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek
7449bc1f34c206e3ff8e274cd74e2db950d492a1Zbigniew Jędrzejewski-Szmek var priority;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (d.PRIORITY != undefined)
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek priority = parseInt(d.PRIORITY);
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek else
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek priority = 6;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek if (priority <= 3)
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek clazz = "message-error";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else if (priority <= 5)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek clazz = "message-highlight";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek clazz = "message";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += '<tr><td class="timestamp">';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (d.__REALTIME_TIMESTAMP != undefined) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var timestamp = new Date(parseInt(d.__REALTIME_TIMESTAMP) / 1000);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += timestamp.toLocaleString();
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += '</td><td class="process">';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (d.SYSLOG_IDENTIFIER != undefined)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += d.SYSLOG_IDENTIFIER;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else if (d._COMM != undefined)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += d._COMM;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (d._PID != undefined)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += "[" + d._PID + "]";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else if (d.SYSLOG_PID != undefined)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += "[" + d.SYSLOG_PID + "]";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += '</td><td class="' + clazz + '"><a href="#entry" onclick="onMessageClick(\'' + lc + '\');">';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (d.MESSAGE == null)
1fa2f38f0f011010bf57522b42fcc168856a7003Zbigniew Jędrzejewski-Szmek buf += "[blob data]";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else if (d.MESSAGE instanceof Array)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += "[" + formatBytes(d.MESSAGE.length) + " blob data]";
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek else
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += d.MESSAGE;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek buf += '</a></td></tr>';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek logs.innerHTML = '<tbody>' + buf + '</tbody>';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt if (fc != null)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek first_cursor = fc;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if (lc != null)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek last_cursor = lc;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function entriesMore() {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek setNEntries(getNEntries() + 10);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad(first_cursor);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek function entriesLess() {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek setNEntries(getNEntries() - 10);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad(first_cursor);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function onResultMessageClick(event) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek if ((event.currentTarget.readyState != 4) ||
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek (event.currentTarget.status != 200 && event.currentTarget.status != 0))
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek return;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var d = JSON.parse(event.currentTarget.responseText);
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek document.getElementById("diventry").style.display = "block";
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek entry = document.getElementById("tableentry");
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek var buf = "";
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek for (var key in d){
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek buf += '<tr><td class="field">' + key + '</td><td class="data">' + d[key] + '</td></tr>';
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek }
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek
8201af08fa09c2bd0f005fbe262f27e2c5bd2d86Zbigniew Jędrzejewski-Szmek entry.innerHTML = '<tbody>' + buf + '</tbody>';
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek function onMessageClick(t) {
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek var request = new XMLHttpRequest();
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.open("GET", "/entries?discrete");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.onreadystatechange = onResultMessageClick;
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.setRequestHeader("Accept", "application/json");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.setRequestHeader("Range", "entries=" + t + ":0:1");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek request.send(null);
e1ad6e245dcf63faa8f183063eb97678f4f9ac94Lukas Nykryn }
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek machineLoad();
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek entriesLoad("");
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek showNEntries(getNEntries());
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek </script>
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidt</body>
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidt</html>
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek