Commit e880c23c authored by Leo Iannacone's avatar Leo Iannacone

added event status on config

parent 8a01690a
......@@ -37,6 +37,7 @@ config.events.client.distribution_packages = __build_get_set('distribution_packa
config.events.client.package_files_list = __build_get_set('package_files_list')
config.events.client.file = __build_get_set('file')
config.events.client.file_newcontent = 'file_newcontent'
config.events.client.status = 'status'
config.web.paths = config.routes
config.web.events = config.events
......
function Page_Generic()
{
var socket;
var c = config.status.classes
var i = config.status.icons
var e = config.events
function __get_status_html(status_package) {
c = config.status.classes
i = config.status.icons
s = status_package
li = $('<li></li>')
var s = status_package
var li = $('<li></li>')
li.attr('id', 'status-' + s.distribution + "-" + s.package)
button = $('<a></a>')
var button = $('<a></a>')
button.addClass('btn btn-xs')
button.addClass(s.status)
button.attr('title', s.status + ': ' + s.distribution + ' > ' + s.package)
button.attr('href', config.paths.distribution + '#' + s.distribution + '/' + s.package.replace('_', '/') + '/datestamp')
// button.html(s.package)
button.html(s.package.split('_')[0])
var button_class = null
var icon = null
if (s.status == 'building') {
button_class = c.building
icon = i.building
......@@ -31,7 +33,7 @@ function Page_Generic()
button.addClass('btn-' + button_class)
button.html(button.html() + ' <span class="icon glyphicon glyphicon-' + icon + '"></span>')
li.html(button)
result = $('<div></div>')
var result = $('<div></div>')
result.html(li)
return result.html()
}
......@@ -72,17 +74,20 @@ function Page_Generic()
socket = mysocket
// update distributions
socket.on(config.events.broadcast.distributions, function(distributions) {
socket.on(e.broadcast.distributions, function(distributions) {
update.distributions(distributions)
});
socket.on('error', function(data) { console.error(data) });
socket.on('status', function(data_status) {
socket.on(e.client.status, function(data_status) {
status.set(data_status)
})
socket.on(config.events.broadcast.status_update, function(data) {
socket.on(e.broadcast.status_update, function(data) {
// this is how to fadeout and remove
// setTimeout(function() {$('#id-status').remove();}, 3500);
// $($("li[id='id-status']")[0]).delay(3200).fadeOut(300)
console.log('status_update')
console.log(data)
})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment