puppetboard: Commit the current code.
This is all the code after a week and a bit hacking on this project. It's in a rather experimental state but should work with a little effort.
This commit is contained in:
17
puppetboard/static/coffeescript/lists.coffee
Normal file
17
puppetboard/static/coffeescript/lists.coffee
Normal file
@@ -0,0 +1,17 @@
|
||||
$ = jQuery
|
||||
$ ->
|
||||
$('input.filter-list').parent('div').removeClass('hide')
|
||||
$("input.filter-list").on "keyup", (e) ->
|
||||
rex = new RegExp($(this).val(), "i")
|
||||
|
||||
$(".searchable li").hide()
|
||||
$(".searchable li").filter( ->
|
||||
rex.test $(this).text()
|
||||
).show()
|
||||
|
||||
if e.keyCode is 27
|
||||
$(e.currentTarget).val ""
|
||||
ev = $.Event("keyup")
|
||||
ev.keyCode = 13
|
||||
$(e.currentTarget).trigger(ev)
|
||||
e.currentTarget.blur()
|
||||
28
puppetboard/static/coffeescript/tables.coffee
Normal file
28
puppetboard/static/coffeescript/tables.coffee
Normal file
@@ -0,0 +1,28 @@
|
||||
$ = jQuery
|
||||
$ ->
|
||||
$('.nodes').tablesorter(
|
||||
headers:
|
||||
3:
|
||||
sorter: false
|
||||
sortList: [[0,0]]
|
||||
)
|
||||
|
||||
$('.facts').tablesorter(
|
||||
sortList: [[0,0]]
|
||||
)
|
||||
|
||||
$('input.filter-table').parent('div').removeClass('hide')
|
||||
$("input.filter-table").on "keyup", (e) ->
|
||||
rex = new RegExp($(this).val(), "i")
|
||||
|
||||
$(".searchable tr").hide()
|
||||
$(".searchable tr").filter( ->
|
||||
rex.test $(this).text()
|
||||
).show()
|
||||
|
||||
if e.keyCode is 27
|
||||
$(e.currentTarget).val ""
|
||||
ev = $.Event("keyup")
|
||||
ev.keyCode = 13
|
||||
$(e.currentTarget).trigger(ev)
|
||||
e.currentTarget.blur()
|
||||
51
puppetboard/static/css/puppetboard.css
Normal file
51
puppetboard/static/css/puppetboard.css
Normal file
@@ -0,0 +1,51 @@
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
||||
th.headerSortUp {
|
||||
position: relative
|
||||
}
|
||||
th.headerSortDown {
|
||||
position: relative
|
||||
}
|
||||
th.header {
|
||||
position: relative
|
||||
}
|
||||
th.header:after {
|
||||
content: "\f0dc";
|
||||
font-family: FontAwesome;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
text-decoration: inherit;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
padding-right: 0.5em;
|
||||
float:right;
|
||||
}
|
||||
th.headerSortUp:after {
|
||||
content: "\f0de";
|
||||
font-family: FontAwesome;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
text-decoration: inherit;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
padding-right: 0.5em;
|
||||
float:right;
|
||||
}
|
||||
th.headerSortDown:after {
|
||||
content: "\f0dd";
|
||||
font-family: FontAwesome;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
text-decoration: inherit;
|
||||
color: #000;
|
||||
font-size: 18px;
|
||||
padding-right: 0.5em;
|
||||
float:right;
|
||||
}
|
||||
.stat {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.navbar .brand:hover {
|
||||
color: #fff;
|
||||
}
|
||||
27
puppetboard/static/js/lists.js
Normal file
27
puppetboard/static/js/lists.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var $;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$(function() {});
|
||||
|
||||
$('input.filter-list').parent('div').removeClass('hide');
|
||||
|
||||
$("input.filter-list").on("keyup", function(e) {
|
||||
var ev, rex;
|
||||
rex = new RegExp($(this).val(), "i");
|
||||
$(".searchable li").hide();
|
||||
$(".searchable li").filter(function() {
|
||||
return rex.test($(this).text());
|
||||
}).show();
|
||||
if (e.keyCode === 27) {
|
||||
$(e.currentTarget).val("");
|
||||
ev = $.Event("keyup");
|
||||
ev.keyCode = 13;
|
||||
$(e.currentTarget).trigger(ev);
|
||||
return e.currentTarget.blur();
|
||||
}
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
1400
puppetboard/static/js/moment.js
Normal file
1400
puppetboard/static/js/moment.js
Normal file
File diff suppressed because it is too large
Load Diff
40
puppetboard/static/js/tables.js
Normal file
40
puppetboard/static/js/tables.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var $;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$(function() {});
|
||||
|
||||
$('.nodes').tablesorter({
|
||||
headers: {
|
||||
3: {
|
||||
sorter: false
|
||||
}
|
||||
},
|
||||
sortList: [[0, 0]]
|
||||
});
|
||||
|
||||
$('.facts').tablesorter({
|
||||
sortList: [[0, 0]]
|
||||
});
|
||||
|
||||
$('input.filter-table').parent('div').removeClass('hide');
|
||||
|
||||
$("input.filter-table").on("keyup", function(e) {
|
||||
var ev, rex;
|
||||
rex = new RegExp($(this).val(), "i");
|
||||
$(".searchable tr").hide();
|
||||
$(".searchable tr").filter(function() {
|
||||
return rex.test($(this).text());
|
||||
}).show();
|
||||
if (e.keyCode === 27) {
|
||||
$(e.currentTarget).val("");
|
||||
ev = $.Event("keyup");
|
||||
ev.keyCode = 13;
|
||||
$(e.currentTarget).trigger(ev);
|
||||
return e.currentTarget.blur();
|
||||
}
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
23
puppetboard/static/js/timestamps.js
Normal file
23
puppetboard/static/js/timestamps.js
Normal file
@@ -0,0 +1,23 @@
|
||||
jQuery(function ($) {
|
||||
var localise_timestamp = function(timestamp){
|
||||
if (timestamp === "None"){
|
||||
return '';
|
||||
};
|
||||
d = moment.utc(timestamp);
|
||||
d.local();
|
||||
return d;
|
||||
};
|
||||
|
||||
$("[rel=utctimestamp]").each(
|
||||
function(index, timestamp){
|
||||
var tstamp = $(timestamp);
|
||||
var tstring = tstamp.text().trim();
|
||||
var result = localise_timestamp(tstring);
|
||||
if (result == '') {
|
||||
tstamp.text('Unknown');
|
||||
} else {
|
||||
tstamp.text(localise_timestamp(tstring).format('LLLL'));
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user