Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed bugs related to query parameters not being loaded
- Loading branch information
Showing
11 changed files
with
2,197 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
npm-debug.log | ||
data/* | ||
lib/* | ||
webroot/status/js/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,49 @@ | ||
stubby = window.stubby ?= {} | ||
|
||
Handlebars.registerHelper 'queryParams', (request) -> | ||
result = "?" | ||
|
||
for key, value of request.query | ||
result += encodeURIComponent key | ||
result += "=" | ||
result += encodeURIComponent value | ||
result += "&" | ||
|
||
return result.replace /\&$/, '' | ||
|
||
Handlebars.registerHelper 'enumerate', (context, options) -> | ||
result = "" | ||
|
||
for key, value of context | ||
result += options.fn { key: key, value: value } | ||
|
||
return result | ||
|
||
ajax = null | ||
list = null | ||
template = null | ||
|
||
success = -> | ||
endpoints = JSON.parse ajax.responseText | ||
for endpoint in endpoints | ||
do (endpoint) -> | ||
endpoint.adminUrl = window.location.href.replace /status/, endpoint.id | ||
html = template endpoint | ||
list.innerHTML += html | ||
|
||
complete = (e) -> | ||
return unless ajax.readyState is 4 | ||
|
||
if ajax.status is 200 | ||
success() | ||
else | ||
console.error ajax.statusText | ||
|
||
stubby.status = -> | ||
console.log 'started!' | ||
template = Handlebars.compile document.getElementById('endpoint-template').innerText | ||
list = document.getElementById 'endpoints' | ||
|
||
ajax = new window.XMLHttpRequest() | ||
ajax.open 'GET', '/', true | ||
ajax.onreadystatechange = complete | ||
ajax.send null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
background: #333333; | ||
color: #DDDDDD; | ||
font-family: "Helvetica", "Arial", "sans serif" | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
font-weight: bold; | ||
color: #6EBEFF; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
color: green; | ||
} | ||
|
||
li { list-style: none; } | ||
|
||
#endpoints { | ||
width: 960px; | ||
margin: auto; | ||
} | ||
|
||
#endpoints > li { | ||
margin: 25px 0; | ||
border-radius: 6px; | ||
overflow: hidden; | ||
} | ||
|
||
table { | ||
border: 1px solid lightgray; | ||
width: 100%; | ||
border-collapse: collapse; | ||
} | ||
|
||
dd, dt { | ||
display: inline; | ||
} | ||
|
||
dt::after { | ||
content: ":"; | ||
} | ||
|
||
caption { | ||
text-align: left; | ||
padding: 10px; | ||
background: black; | ||
} | ||
|
||
th, td { | ||
border: 1px solid black; | ||
padding: 10px; | ||
} | ||
|
||
td { | ||
font-family: monospace; | ||
} | ||
|
||
th{ | ||
border-top: 1px solid #333333; | ||
vertical-align: top; | ||
background: black; | ||
color: #FCC971; | ||
width: 100px; | ||
text-align: right; | ||
} | ||
|
||
th.section { | ||
text-align: center; | ||
} | ||
|
||
.query-params li { | ||
margin: 0; | ||
} | ||
|
||
.query-params td, .query-params th { | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.