define([
- 'lodash',
- 'js/logger'
+ 'lodash'
], function (
- _,
- Logger
+ _
) {
'use strict';
- var logger = Logger('model/JobStatusModel.js');
-
// define the default status
var DEFAULT_STATUS = 'READY';
function _update(pageNum) {
ModelImageList = [];
- ModelImagePaging;
function _updateView(arrImages) {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve, reject) {
logger.info('_updatePagingModel');
- var totalCount, pagingCount;
-
// initialize
- totalCount = 0;
+ var totalCount = 0;
$('#tic-image-list-pagination').empty();
// set totalCount
function _update(pageNum) {
ModelJobList = [];
- ModelJobPaging;
function _updateView (arrJobs) {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve, reject) {
logger.info('_updatePagingModel');
- var totalCount, pagingCount;
-
// initialize
- totalCount = 0;
+ var totalCount = 0;
$('#tic-job-list-pagination').empty();
// set totalCount
if (_.isEmpty(ModelJobPaging)) {
ModelJobPaging = new JobPagingModel({
totalCount: totalCount,
- currentPageNum: pageNum
+ currentPageNum: pageNum
})
}
* AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FINISH = 'ws/fs/image/add/finish'
*/
client.on(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FINISH, function (dataObj) {
- var jobId, imageName, logItem1, logItem2, msgObj;
+ var jobId, imageName;
// jobId
jobId = dataObj.jobId;
imageName = imageName.substring(imageName.lastIndexOf('/')+1);
// log
- logItem1 = new JobLog(dataObj);
+ new JobLog(dataObj);
// log
- logItem2 = new JobLog({
+ new JobLog({
msg: 'Image created successfully.',
jobId: jobId
});
* AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FAIL = 'ws/fs/image/add/fail'
*/
client.on(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FAIL, function (dataObj) {
- var jobId, logItem, msgObj;
+ var jobId, msgObj;
// jobId
jobId = dataObj.jobId;
// log
- logItem = new JobLog(dataObj);
+ new JobLog(dataObj);
// log
- logItem = new JobLog({
+ new JobLog({
msg: 'Failed to create image.',
jobId: jobId
});
function onSuccessGetRecipeFile(responseObj) {
var msgObj, strKsName, strKsPath, strArch;
- if (responseObj && responseObj.result === "false") {
+ if (!_.isEmpty(responseObj) && responseObj.result === "false") {
logger.error(responseObj.message);
throw responseObj;
}
getAppConfig();
}
- function readLog () {
+ function readLog(linkid) {
POST(config.EVENT.JOB.JOB_READ_LOG + linkid)
.then(function (line) {
$('#log-view-content-body').append(line);
});
}
- function getClientWidth () {
+ function getClientWidth() {
return (window.innerWidth) ? window.innerWidth : document.documentElement.clientWidth || document.body.clientWidth || 0;
}
- function getClientHeight () {
+ function getClientHeight() {
return(window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight || document.body.clientHeight || 0;
}
define([
'jquery',
'lodash',
- 'js/util',
- 'js/logger'
+ 'js/util'
], function (
$,
_,
- Util,
- Logger
+ Util
) {
'use strict';
- var logger = Logger('widget/ImageEmptyItem.js');
-
var strEmptyItem = [
'<li class="list-group-item">',
'<p>There is no data.</p>',
define([
'jquery',
'lodash',
- 'js/util',
- 'js/logger'
+ 'js/util'
], function (
$,
_,
- Util,
- Logger
+ Util
) {
'use strict';
- var logger = Logger('widget/ImageItem.js');
-
// config
var AppConfig = null;
var ImageItem = function (modelObj) {
this.model = modelObj;
- this.template;
+ this.template = null;
this.init(this.model);
define([
'jquery',
'lodash',
- 'js/util',
- 'js/logger'
+ 'js/util'
], function (
$,
_,
- Util,
- Logger
+ Util
) {
'use strict';
- var logger = Logger('widget/JobLog.js');
-
var strLog = [
'<p><%= log %></p>'
];
define([
'jquery',
'lodash',
- 'js/util',
- 'js/logger'
+ 'js/util'
], function (
$,
_,
- Util,
- Logger
+ Util
) {
'use strict';
- var logger = Logger('widget/JobTableEmptyItem.js');
-
var strEmptyRow = [
'<tr id="job_table_row_<%= rowNum %>">',
'<td colspan="9">There is no data.</td>',
define([
'jquery',
'lodash',
- 'js/util',
- 'js/logger'
+ 'js/util'
], function (
$,
_,
- Util,
- Logger
+ Util
) {
'use strict';
- var logger = Logger('widget/JobTableItem.js');
-
var strRow = [
'<tr id="job_table_row_<%= jobNum %>">',
'<td><%= jobNum %></td>',
var JobTableItem = function (modelObj) {
this.model = modelObj;
- this.template;
+ this.template = null;
this.init();
};