Commit fa32fcfd authored by Leo Iannacone's avatar Leo Iannacone

Merge remote-tracking branch 'github/master' into portable

parents fae96602 e9bdc5f6
# 0.4.2 (2014-06-15)
* [fix] calculate pidfile for debomatic status check after merging configurations
# 0.4.1 (2014-06-13)
* [fix] preview file using a fixed max-height on new content
* [fix] show and hide correctly debomatic status when build packages
......
......@@ -130,9 +130,9 @@ function __handler_get_file(socket, data) {
socket.emit(event_name, data);
});
if (config.web.file.preview.indexOf(data.file.name) >= 0 && !data.file.force)
__send_file(_e.file.set, socket, data, config.web.file.num_lines);
__send_file(_e.file, socket, data, config.web.file.num_lines);
else
__send_file(_e.file.set, socket, data);
__send_file(_e.file, socket, data);
}
function Client(socket) {
......@@ -142,21 +142,21 @@ function Client(socket) {
utils.send_distributions(socket);
// init events
socket.on(_e.distribution_packages.get, function (data) {
socket.on(_e.distribution_packages, function (data) {
if (!utils.check_data_distribution(data))
return;
var distribution_path = path.join(config.debomatic.path, data.distribution.name, 'pool');
utils.generic_handler_watcher(_e.distribution_packages.set, socket, data, distribution_path, __send_distribution_packages);
utils.generic_handler_watcher(_e.distribution_packages, socket, data, distribution_path, __send_distribution_packages);
});
socket.on(_e.package_files_list.get, function (data) {
socket.on(_e.package_files_list, function (data) {
if (!utils.check_data_package(data))
return;
var package_path = utils.get_package_path(data);
utils.generic_handler_watcher(_e.package_files_list.set, socket, data, package_path, __send_package_files_list);
utils.generic_handler_watcher(_e.package_files_list, socket, data, package_path, __send_package_files_list);
});
socket.on(_e.file.get, function (data) {
socket.on(_e.file, function (data) {
if (!utils.check_data_file(data))
return;
__handler_get_file(socket, data);
......
......@@ -67,22 +67,7 @@ config.web.preferences.debug = 0; // debug level - 0 means disabled
// DO NOT TOUCH these ones
config.version = '0.4.1';
// A simple function to quickly have
// get and set strings for client events
function _event_get_set(event_name) {
return {
set: event_name,
get: 'get_' + event_name
};
}
config.debomatic.pidfile = "/var/run/debomatic-" +
require('crypto')
.createHash('sha256')
.update(config.debomatic.path)
.digest('hex');
config.version = '0.4.2';
config.events = {};
config.events.error = 'error';
......@@ -92,10 +77,10 @@ config.events.broadcast.status_update = 'status_update';
config.events.broadcast.status_debomatic = 'status_debomatic';
config.events.client = {};
config.events.client.distribution_packages = _event_get_set('distribution_packages');
config.events.client.distribution_packages = 'distribution_packages';
config.events.client.distribution_packages.status = 'package_status';
config.events.client.package_files_list = _event_get_set('package_files_list');
config.events.client.file = _event_get_set('file');
config.events.client.package_files_list = 'package_files_list';
config.events.client.file = 'file';
config.events.client.file_newcontent = 'file_newcontent';
config.events.client.status = 'status';
......@@ -151,5 +136,13 @@ try {
config.web.events = config.events;
config.web.status = config.status;
config.web.host = config.host;
// calculate pidfile
config.debomatic.pidfile = "/var/run/debomatic-" +
require('crypto')
.createHash('sha256')
.update(config.debomatic.path)
.digest('hex');
module.exports = config;
}
......@@ -159,8 +159,8 @@ function Page_Distrubion(socket) {
if (Utils.check_view_distribution(view)) {
var query_data = {};
query_data.distribution = view.distribution;
debug_socket('emit', _e.distribution_packages.get, query_data);
socket.emit(_e.distribution_packages.get, query_data);
debug_socket('emit', _e.distribution_packages, query_data);
socket.emit(_e.distribution_packages, query_data);
}
},
select: function () {
......@@ -256,8 +256,8 @@ function Page_Distrubion(socket) {
var query_data = {};
query_data.distribution = view.distribution;
query_data.package = view.package;
debug_socket('emit', _e.package_files_list.get, query_data);
socket.emit(_e.package_files_list.get, query_data);
debug_socket('emit', _e.package_files_list, query_data);
socket.emit(_e.package_files_list, query_data);
}
},
select: function () {
......@@ -331,8 +331,8 @@ function Page_Distrubion(socket) {
// get a feedback to user while downloading file
$('#file pre').html('Downloading file, please wait a while ...');
$('#file').show();
debug_socket('emit', _e.file.get, query_data);
socket.emit(_e.file.get, query_data);
debug_socket('emit', _e.file, query_data);
socket.emit(_e.file, query_data);
}
},
set_preview: function (preview) {
......@@ -584,13 +584,13 @@ function Page_Distrubion(socket) {
welcome.set(socket_data);
});
socket.on(_e.distribution_packages.set, function (socket_data) {
debug_socket('received', _e.distribution_packages.set, socket_data);
socket.on(_e.distribution_packages, function (socket_data) {
debug_socket('received', _e.distribution_packages, socket_data);
packages.set(socket_data);
});
socket.on(_e.distribution_packages.status, function (socket_data) {
debug_socket('received', _e.distribution_packages.set, socket_data);
debug_socket('received', _e.distribution_packages, socket_data);
packages.set_status(socket_data);
sticky.set_status(socket_data);
});
......@@ -600,13 +600,13 @@ function Page_Distrubion(socket) {
sticky.set_status(socket_data);
});
socket.on(_e.package_files_list.set, function (socket_data) {
debug_socket('received', _e.package_files_list.set, socket_data);
socket.on(_e.package_files_list, function (socket_data) {
debug_socket('received', _e.package_files_list, socket_data);
files.set(socket_data);
});
socket.on(_e.file.set, function (socket_data) {
debug_socket('received', _e.file.set, socket_data);
socket.on(_e.file, function (socket_data) {
debug_socket('received', _e.file, socket_data);
file.set(socket_data);
});
......@@ -648,7 +648,7 @@ function Page_Distrubion(socket) {
// when page is loaded sidebar has offset().top
// equals 0. This is because html is loaded on socket
// events. Sleep a while and call stiky.reset()
setTimeout(sticky.reset, 500);
setTimeout(sticky.r, 500);
// WORKAROUND:
// On incoming hundred of lines browser goes crazy.
......
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