'use strict';
// connected socket object
- var client,
+ var client;
- // the list of checked pakages
- checkedPackagesList,
+ // the list of checked pakages
+ var checkedPackagesList;
- // template for the URL
- URL_EXPORTS = '<%= protocol %>//<%= hostname %>:<%= port %>/exports',
-
- // the path for ks
- PATH_TIC_KS = '/tmp/tic/ks/',
-
- // the path for images
- PATH_TIC_IMAGES = '/tmp/tic/images/';
+ // template for the URL
+ var URL_EXPORTS = '<%= protocol %>//<%= hostname %>:<%= port %>/exports';
+ // the path for ks
+ var PATH_TIC_KS = '/tmp/tic/ks/';
+ // the path for images
+ var PATH_TIC_IMAGES = '/tmp/tic/images/';
function updateList(socket) {
+ if (!_.isEmpty(socket)) {
+ client = socket;
+ }
+
var msgData = {
path: PATH_TIC_IMAGES
};
- client = socket;
-
client.emit('ws/fs/image/list/from', msgData);
client.on('ws/fs/image/list/to', function (data) {
list = data.list;
tableDomElem = $('#tic-image-list');
+ tableDomElem.empty();
list.forEach(function (file) {
var liElem, aElem, spanElem, fileName, hrefPath;
$('#tic-image-new-container').hide();
// upate the list of images
- updateList();
+ updateList(null);
});
}