-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
110 lines (84 loc) · 3.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<!-- habitat: view -->
<!-- http://habitat.habhub.org -->
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8"/>
<title>habitat | monocle</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<link rel="stylesheet" type="text/css" href="/homepage/t/css/base.css" />
<link rel="stylesheet" type="text/css" href="/homepage/t/css/skeleton.css" />
<link rel="stylesheet" type="text/css" href="/homepage/t/css/layout.css" />
<link rel="stylesheet" type="text/css" href="idea.css" />
<style>
#grey-section { margin-bottom: 0; }
</style>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="/homepage/t/images/favicon.ico" />
</head>
<body>
<div id="top">
<header>
<div class="container">
<div class="sixteen columns">
<h1 class="no-margin">
<a href="http://habitat.habhub.org/" alt="habitat">
<img src="/homepage/t/images/header_logo.jpg" alt="habitat" title="habitat"/>
</a>
</h1>
<span id="app_name"><b>monocle</b></span>
</div>
</div>
</header>
<div id="grey-section">
<div class="container">
<div class="sixteen columns">
<h3 class="remove-bottom" id="page_title">JSON for gentlemen</h3>
<p class="remove-bottom" id="page_subtitle"></p>
</div>
</div>
</div>
</div>
<div id="data-container">
<div class="container">
<div class="sixteen columns">
<pre id="data"><code class="json">Loading...<code></pre>
</div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="highlight.pack.js"></script>
<script>
$(document).ready(function() {
var host = window.location.protocol + "//" + window.location.host + "/";
var base = window.location.href.split('?')[0] + "?uri=";
var status_base = "http://habitat.habhub.org/habitat/_design/payload_telemetry/_view/payload_time?limit=1&descending=true&include_docs=true&startkey=";
var uri = decodeURIComponent(window.location.search.split('=')[1]);
if(!uri.startsWith("http")) {
var uri = host + uri;
}
$("#page_subtitle").text(uri);
$.getJSON(uri, function(data) {
var elm = $("#data code");
if(data.type === "payload_configuration") {
var html = $("#page_subtitle").html();
var status_url = base + encodeURIComponent(status_base + "[%22"+data._id+"%22,{}]");
html += '<br><a href="' + status_url + '">Latest parse status</a>';
$("#page_subtitle").html(html);
}
var html = JSON.stringify(data, null, 4);
html = html.replace(/"([a-f0-9]{32,})"/gi, function(a,x) {
return "\"<a href='"+base+encodeURIComponent(host+"habitat/"+x)+"'>"+x+"</a>\"";
});
elm.html(html);
hljs.highlightBlock(elm.get(0));
});
});
</script>
</body>
</html>