[TIC-Web] Update Job List 71/118271/3
authorHeekyoung, Oh <heekyoung.oh@samsung.com>
Thu, 9 Mar 2017 15:41:59 +0000 (00:41 +0900)
committerHeekyoung, Oh <heekyoung.oh@samsung.com>
Fri, 10 Mar 2017 05:59:42 +0000 (14:59 +0900)
- Using The Name Of Image
- Then distinguish them.
- DB field added, (job_ks, job_arch)

Change-Id: I18a573caef123959dbbf7ab04d2001c9c3bb74cf
Signed-off-by: Heekyoung, Oh <heekyoung.oh@samsung.com>
controller/mariadb.js
controller/mic.js
public/src/css/style.css
public/src/js/model/ImageModel.js
public/src/js/model/JobModel.js
public/src/js/page/job.js
public/src/js/page/package.js
public/src/js/widget/ImageItem.js
public/src/js/widget/JobTableItem.js

index 527cd6c..d02aaee 100644 (file)
@@ -48,6 +48,8 @@ mariadb.queries = {
             'tic_image.image_name job_image_name, ',
             'tic_image.image_size job_image_size, ',
             'tic_job.job_hasksfile job_hasksfile, ',
+            'tic_job.job_ks job_ks, ',
+            'tic_job.job_arch job_arch, ',
             'tic_job.job_uptime job_uptime ',
         'from tic_job ',
         'left join tic_image on tic_job.job_image_id = tic_image.image_id ',
@@ -57,12 +59,14 @@ mariadb.queries = {
     ],
     'getImagesAllList': [
         'select tic_job.job_image_id image_id, ',
-        'tic_job.job_id image_job_id, ',
-        'tic_image.image_name image_name, ',
-        'tic_image.image_size image_size, ',
-        'tic_job.job_hasksfile image_hasksfile, ',
-        'tic_job.job_status image_status, ',
-        'tic_job.job_uptime image_uptime ',
+            'tic_job.job_id image_job_id, ',
+            'tic_image.image_name image_name, ',
+            'tic_image.image_size image_size, ',
+            'tic_job.job_hasksfile image_hasksfile, ',
+            'tic_job.job_ks image_ks, ',
+            'tic_job.job_arch image_arch, ',
+            'tic_job.job_status image_status, ',
+            'tic_job.job_uptime image_uptime ',
         'from tic_job inner join tic_image ',
         'where tic_job.job_image_id = tic_image.image_id ',
         'and tic_job.job_deleted = false ',
@@ -109,9 +113,9 @@ mariadb.doQuery = function doQuery(queryString, callback) {
 /**
  * Edit the Job By Id
  */
-mariadb.editJob = function addJob(req, res) {
+mariadb.editJob = function editJob(req, res) {
     var queryString, strJobId, reqParam,
-    job_status, job_deleted, job_hasksfile, job_image_id;
+    job_status, job_deleted, job_hasksfile, job_image_id, job_ks, job_arch;
 
     function onSuccess(err, rows) {
         if (err) {
@@ -129,6 +133,8 @@ mariadb.editJob = function addJob(req, res) {
     job_deleted = reqParam.job_deleted;
     job_hasksfile = reqParam.job_hasksfile;
     job_image_id = reqParam.job_image_id;
+    job_ks = reqParam.job_ks;
+    job_arch = reqParam.job_arch;
 
     queryString = 'update tic_job set';
     if (job_image_id) {
@@ -143,6 +149,12 @@ mariadb.editJob = function addJob(req, res) {
     if (job_hasksfile) {
         queryString += ' job_hasksfile = ' + job_hasksfile + ',';
     }
+    if (job_ks) {
+        queryString += ' job_ks = "' + job_ks + '",';
+    }
+    if (job_arch) {
+        queryString += ' job_arch = "' + job_arch + '",';
+    }
     queryString += ' job_updater = "tic",';
     queryString += ' job_uptime = now()';
     queryString += ' where job_id = ' + strJobId + ';';
index 013d851..46a8cae 100644 (file)
@@ -46,14 +46,33 @@ Mic.process = function process(command, callback) {
     ps.on('exit', callback.exit);
 };
 
+/**
+ * paramObj = {
+ *   jobId: '',
+ *   pathKsFile: '',
+ *   pathOutput: '',
+ *   imageName: ''
+ *   imageArch: ''
+ * };
+ */
 Mic.create = function create(paramObj, io) {
+    var micCommand, strLogfile, strOutdir, strArch, strRecordPkgs, strPackto;
+
     logger.info('MIC Create: paramObj = ' + JSON.stringify(paramObj));
 
-    var micCommand = 'sudo mic create loop ' + paramObj.pathKsFile +
-        util.format(' --arch %s', 'armv7l') +
-        util.format(' --outdir %s', paramObj.pathOutput) +
-        util.format(' --logfile %s', paramObj.pathOutput + AppConfig.TIC_WEB.LOG_FILE_NAME) +
-        util.format(' --pack-to %s', AppConfig.TIC_WEB.IMAGE_FILE_NAME);
+    strLogfile = paramObj.pathOutput + AppConfig.TIC_WEB.LOG_FILE_NAME;
+    strOutdir = paramObj.pathOutput;
+    strArch = paramObj.imageArch;
+    strRecordPkgs = 'name';
+    strPackto = paramObj.imageName;
+
+    micCommand = 'sudo mic create loop '
+        + paramObj.pathKsFile
+        + util.format(' --logfile %s', strLogfile)
+        + util.format(' --outdir %s', strOutdir)
+        + util.format(' --arch %s', strArch)
+        + util.format(' --record-pkgs %s', strRecordPkgs)
+        + util.format(' --pack-to %s', strPackto);
 
     function sendMsg(path, msgObj) {
         io.sockets.emit(path, msgObj);
@@ -88,6 +107,7 @@ Mic.create = function create(paramObj, io) {
                     sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FINISH, {
                         msg: 'Terminated (' + code + ')',
                         jobId: paramObj.jobId,
+                        imageName: strPackto
                     });
                 } else {
                     sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FAIL, {
index 6d4dd6e..ba48e98 100644 (file)
@@ -273,6 +273,7 @@ tr.extended_job_table_row:hover td {
     color: #31708f;
     float: left;
     margin-bottom: 8px;
+    width: 75%;
 }
 .image-list-name-btndownload {
     float: left;
@@ -284,8 +285,8 @@ tr.extended_job_table_row:hover td {
     font-size: smaller;
     text-overflow: ellipsis;
     white-space:nowrap;
-    display:inline-block;
     overflow: hidden;
+    display: table-cell;
 }
 .image-list-btndownload {
     min-width: 10px;
@@ -302,7 +303,6 @@ tr.extended_job_table_row:hover td {
 }
 .image-item {
     overflow: hidden;
-    height: 7vh;
 }
 .image-item-title {
     width: 100%;
@@ -311,6 +311,9 @@ tr.extended_job_table_row:hover td {
 .image-item-info {
     width: 100%;
     float: left;
+    display: table;
+    margin-top: 12px;
+    height: 3vh;
 }
 #tic-image-list-content {
     height: calc(100vh - 320px);
index 33053e3..1d061ee 100644 (file)
@@ -34,10 +34,11 @@ define([
         this.imageStatus = null;
 
         this.imageJobId = null;
-        this.imageJobPath = null;
 
+        this.imageKs = null;
         this.imageHasKsFile = null;
         this.imageIsDownload = false;
+        this.imageArch = null;
 
         // for the href on a tag
         this.jobAbsPath = null;
@@ -53,20 +54,20 @@ define([
     ImageModel.prototype.init = function init(obj) {
         logger.info('init: ' + JSON.stringify(obj));
 
+        this.setImageJobId(obj.image_job_id);
+        this.setJobAbsPath();
         this.setImageId(obj.image_id);
+
         this.setImageName(obj.image_name);
         this.setImageSize(obj.image_size);
         this.setImageUptime(obj.image_uptime);
         this.setImageStatus(obj.image_status);
 
-        this.setImageJobId(obj.image_job_id);
-
+        this.setImageKs(obj.image_ks);
         this.setImageHasKsFile(obj.image_hasksfile);
         this.setImageIsDownload(obj.image_status);
+        this.setImageArch(obj.image_arch);
 
-        this.setJobAbsPath();
-        this.setJobAbsImagePath();
-        this.setJobAbsKsPath();
         this.setJobAbsLogPath();
     };
 
@@ -78,12 +79,12 @@ define([
         this.jobAbsLogPath = this.getJobAbsPath() + AppConfig.TIC_WEB.LOG_FILE_NAME;
     };
 
-    ImageModel.prototype.getJobAbsKsPath = function getJobAbsKsPath(value) {
-        return this.jobAbsKsPath = value;
+    ImageModel.prototype.getJobAbsKsPath = function getJobAbsKsPath() {
+        return this.jobAbsKsPath;
     };
 
     ImageModel.prototype.setJobAbsKsPath = function setJobAbsKsPath(value) {
-        this.jobAbsKsPath = value || this.getJobAbsPath() + AppConfig.TIC_WEB.KS_FILE_NAME;
+        this.jobAbsKsPath = value || this.getJobAbsPath() + this.getImageKs();
     };
 
     ImageModel.prototype.getJobAbsImagePath = function getJobAbsImagePath() {
@@ -118,6 +119,19 @@ define([
         this.imageIsDownload = isDownloadable;
     };
 
+    ImageModel.prototype.getImageArch = function getImageArch() {
+        return this.imageArch;
+    };
+
+    ImageModel.prototype.setImageArch = function setImageArch(value) {
+        /**
+         * FIXME
+         *
+         * Confirm default value . armv7l right?
+         */
+        this.imageArch = value || 'armv7l';
+    };
+
     ImageModel.prototype.getImageHasKsFile = function getImageHasKsFile() {
         return this.imageHasKsFile;
     };
@@ -126,6 +140,16 @@ define([
         this.imageHasKsFile = value || false;
     };
 
+    ImageModel.prototype.getImageKs = function getImageKs() {
+        return this.imageKs;
+    };
+
+    ImageModel.prototype.setImageKs = function setImageKs(value) {
+        this.imageKs = value || '';
+
+        this.setJobAbsKsPath();
+    };
+
     ImageModel.prototype.getImageJobId = function getImageJobId() {
         return this.imageJobId;
     };
@@ -164,6 +188,8 @@ define([
 
     ImageModel.prototype.setImageName = function setImageName(value) {
         this.imageName = value || '-';
+
+        this.setJobAbsImagePath();
     };
 
     ImageModel.prototype.getImageId = function getImageId() {
index b9e2694..4fbf389 100644 (file)
@@ -38,8 +38,10 @@ define([
         this.jobPath = null;
         this.jobImagePath = null;
         this.jobHasKsFile = false;
+        this.jobKs = null;
         this.jobKsPath = null;
         this.jobLogPath = null;
+        this.jobArch = null;
         this.isDownload = false;
 
         // for the href on a tag
@@ -58,19 +60,19 @@ define([
         logger.info('init: ' + JSON.stringify(obj));
 
         this.setJobId(obj.job_id);
+        this.setJobAbsPath();
+        this.setJobPath();
+
         this.setJobStatus(obj.job_status);
         this.setJobImageName(obj.job_image_name);
         this.setJobImageSize(obj.job_image_size);
 
-        this.setJobPath();
-        this.setJobImagePath();
         this.setJobHasKsFile(obj.job_hasksfile);
-        this.setJobKsPath();
+        this.setJobKs(obj.job_ks);
+
         this.setJobLogPath();
+        this.setJobArch(obj.job_arch);
 
-        this.setJobAbsPath();
-        this.setJobAbsImagePath();
-        this.setJobAbsKsPath();
         this.setJobAbsLogPath();
 
         this.setJobUptime(obj.job_uptime);
@@ -100,6 +102,19 @@ define([
         this.jobLogPath = this.getJobPath() + AppConfig.TIC_WEB.LOG_FILE_NAME;
     };
 
+    JobModel.prototype.getJobArch = function () {
+        return this.jobArch;
+    };
+
+    JobModel.prototype.setJobArch = function (value) {
+        /**
+         * FIXME
+         *
+         * Confirm default value . armv7l right?
+         */
+        this.jobArch = value || 'armv7l';
+    };
+
     JobModel.prototype.getJobAbsLogPath = function () {
         return this.jobAbsLogPath;
     };
@@ -113,7 +128,7 @@ define([
     };
 
     JobModel.prototype.setJobKsPath = function () {
-        this.jobKsPath = this.getJobPath() + AppConfig.TIC_WEB.KS_FILE_NAME;
+        this.jobKsPath = this.getJobPath() + this.getJobKs();
     };
 
     JobModel.prototype.getJobAbsKsPath = function () {
@@ -121,7 +136,7 @@ define([
     };
 
     JobModel.prototype.setJobAbsKsPath = function () {
-        this.jobAbsKsPath = this.getJobAbsPath() + AppConfig.TIC_WEB.KS_FILE_NAME;
+        this.jobAbsKsPath = this.getJobAbsPath() + this.getJobKs();
     };
 
     JobModel.prototype.getJobHasKsFile = function () {
@@ -132,6 +147,17 @@ define([
         this.jobHasKsFile = value || false;
     };
 
+    JobModel.prototype.getJobKs = function () {
+        return this.jobKs;
+    };
+
+    JobModel.prototype.setJobKs = function (value) {
+        this.jobKs = value || '';
+
+        this.setJobKsPath();
+        this.setJobAbsKsPath();
+    };
+
     JobModel.prototype.getJobImagePath = function () {
         return this.jobImagePath;
     };
@@ -177,7 +203,10 @@ define([
     };
 
     JobModel.prototype.setJobImageName = function (value) {
-        this.jobImageName = value ? value : '-';
+        this.jobImageName = value || '-';
+
+        this.setJobImagePath();
+        this.setJobAbsImagePath();
     };
 
     JobModel.prototype.getJobStatusText = function () {
index 2be911d..fc10927 100644 (file)
@@ -218,7 +218,9 @@ define([
      * @param paramObj {
      *      jobId: '1',
      *      pathKsFile: '/var/tmp/tic-web/1/default.ks',
-     *      pathOutput: '/var/tmp/tic-web/1/'
+     *      pathOutput: '/var/tmp/tic-web/1/',
+     *      imageName: 'default',
+     *      imageArch: 'armv7l'
      * }
      */
     function doCreateAnImage(paramObj) {
@@ -229,7 +231,9 @@ define([
         msgData = {
             jobId: paramObj.jobId,
             pathKsFile: paramObj.pathKsFile,
-            pathOutput: paramObj.pathOutput
+            pathOutput: paramObj.pathOutput,
+            imageName: paramObj.pathOutput + paramObj.imageName,
+            imageArch: paramObj.imageArch
         };
 
         client.emit(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FROM, msgData);
@@ -267,11 +271,15 @@ define([
          * 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, logItem1, logItem2, msgObj;
+            var jobId, imageName, logItem1, logItem2, msgObj;
 
             // jobId
             jobId = dataObj.jobId;
 
+            // imageName
+            imageName = dataObj.imageName;
+            imageName = imageName.substring(imageName.lastIndexOf('/')+1);
+
             // log
             logItem1 = new JobLog(dataObj);
 
@@ -326,24 +334,31 @@ define([
              */
             function addAnImage(arrFileInfo) {
                 return new Promise(function (resolve, reject) {
+                    var imageInfo, msgObj;
                     /**
-                     * imageInfo
-                     * @type {Object}
+                     * imageInfo @type {Object}
+                     * imageInfo = {
+                     *      mtime: "Thu, 09 Mar 2017 13:06:01 GMT",
+                     *      name: "default.tar.gz",
+                     *      size: 127013,
+                     *      type: "file"
+                     * }
                      */
-                    var imageInfo = _.find(arrFileInfo, {name: AppConfig.TIC_WEB.IMAGE_FILE_NAME});
+                    imageInfo = _.find(arrFileInfo, {name: imageName});
                     logger.info('IMAGE_ADD_FINISH.addAnImage: ' + JSON.stringify(imageInfo));
 
-                    if (imageInfo.type !== 'file') {
+                    if (imageInfo && imageInfo.type === 'file') {
+                        msgObj = {
+                            image_name: imageInfo.name,
+                            image_type: 'external',
+                            image_size: imageInfo.size
+                        };
+
+                        Util.POST(AppConfig.EVENT.IMAGE.IMAGE_ADD_ONE, msgObj)
+                        .then(resolve, reject);
+                    } else {
                         reject('This is not a valid image file');
                     }
-                    var msgObj = {
-                        image_name: imageInfo.name,
-                        image_type: 'external',
-                        image_size: imageInfo.size
-                    };
-
-                    Util.POST(AppConfig.EVENT.IMAGE.IMAGE_ADD_ONE, msgObj)
-                    .then(resolve, reject);
                 });
             }
 
index 116acde..c380cdf 100644 (file)
@@ -62,6 +62,7 @@ define([
         }
 
         function doCreateAnImage() {
+            var pathKsFile, imageName;
             logger.info('onClickHandlerForImgCreationBtn.doCreateAnImage');
 
             // scroll
@@ -69,11 +70,23 @@ define([
                 scrollTop: $('#tic-job-section').offset().top
             }, 500);
 
+            // get the name of image
+            pathKsFile = newJobModel.getJobKsPath();
+            imageName = pathKsFile.substring(pathKsFile.lastIndexOf('/')+1, pathKsFile.lastIndexOf('.'));
+
+            /**
+             * FIXME
+             *
+             * imageArch
+             */
+
             // options for the creation
             var msgData = {
                 jobId: newJobModel.getJobId(),
-                pathKsFile: newJobModel.getJobKsPath(),
-                pathOutput: newJobModel.getJobPath()
+                pathKsFile: pathKsFile,
+                pathOutput: newJobModel.getJobPath(),
+                imageName: imageName + '.tar.gz',
+                imageArch: newJobModel.getJobArch()
             };
 
             // create
@@ -94,13 +107,18 @@ define([
 
             logger.info('onClickHandlerForImgCreationBtn.getRecipeFile: job_path = ' + newJobModel.getJobPath());
 
+            /**
+             * FIXME
+             *
+             * filename will be removed.
+             * filenmae generated by ticcore
+             */
             msgData = {
                 recipe: {
                     name: 'default'
                 },
                 packages: _.map(checkedPackagesList, 'name'),
-                outdir: newJobModel.getJobPath(),
-                filename: AppConfig.TIC_WEB.KS_FILE_NAME
+                outdir: newJobModel.getJobPath()
             };
 
             function onErrorGetRecipeFile(err) {
@@ -110,12 +128,27 @@ define([
                 throw err;
             }
 
-            function onSuccessGetRecipeFile(result) {
-                var msgObj;
-                logger.info('onClickHandlerForImgCreationBtn.onSuccessGetRecipeFile: ' + result.data);
+            function onSuccessGetRecipeFile(responseObj) {
+                var msgObj, strKsName, strKsPath, strArch;
+
+                if (responseObj && responseObj.result === "false") {
+                    logger.error(responseObj.message);
+                    throw responseObj;
+                }
+                strKsPath = responseObj.data.kspath;
+                strKsName = strKsPath.substring(strKsPath.lastIndexOf('/') + 1);
+                strArch = responseObj.data.arch;
+
+                // update
+                newJobModel.setJobKs(strKsName);
+                newJobModel.setJobArch(strArch);
+
+                logger.info('onClickHandlerForImgCreationBtn.onSuccessGetRecipeFile: ' + responseObj.data.kspath);
                 msgObj = {
                     job_status: JOB_STATUS_INPROGRESS,
-                    job_hasksfile: true
+                    job_hasksfile: true,
+                    job_ks: strKsName,
+                    job_arch: strArch
                 };
                 return Util.POST(AppConfig.EVENT.JOB.JOB_EDIT_ONE + newJobModel.getJobId(), msgObj);
             }
index c834cab..af22ae6 100644 (file)
@@ -19,15 +19,18 @@ define([
     var strItem = [
         '<li class="list-group-item image-item">',
             '<div class="image-item-title">',
-                '<div class="image-list-name" title="<%= jobId %>_<%= imageFileName %>">( <%= jobId %> ) <%= imageFileName %></div>',
-                '<div class="image-list-name-btndownload"><a class="image-list-btndownload" href="<%= imagePath %>" date-name="<%= imageFileName %>">Download</a></div>',
-                '<div class="image-list-name-btndownload"><a class="image-list-btndownload <%= classJobKsPath %>" href="<%= ksPath %>" date-name="<%= ksFileName %>">KS</a></div>',
-                '<div class="image-list-name-btndownload"><a class="image-list-btndownload" href="<%= logPath %>" date-name="<%= logFileName %>">Log</a></div>',
+                '<div class="image-list-name" title="<%= jobId %>_<%= imageFileName %>">#<%= jobId %>.  <%= imageFileName %></div>',
+                '<div class="image-list-name-btndownload"><a class="image-list-btndownload" href="<%= imagePath %>" title="<%= imageFileName %>" date-name="<%= imageFileName %>">Download</a></div>',
+                '<div class="image-list-name-btndownload"><a class="image-list-btndownload <%= classJobKsPath %>" href="<%= ksPath %>" title="<%= ksFileName %>" date-name="<%= ksFileName %>">KS</a></div>',
+                '<div class="image-list-name-btndownload"><a class="image-list-btndownload" href="<%= logPath %>" title="Log" date-name="<%= logFileName %>">Log</a></div>',
             '</div>',
             '<div class="image-item-info">',
-                '<p class="image-list-detail">Job ID: <%= jobId %></p>',
-                '<p class="image-list-detail">Size: <%= fileSize %></p>',
-                '<p class="image-list-detail">Updated: <%= fileTime %></p>',
+                '<p class="image-list-detail"><b>Job ID:</b> <%= jobId %></p>',
+                '<p class="image-list-detail"><b>Name:</b> <%= imageFileName %></p>',
+                '<p class="image-list-detail"><b>Size:</b> <%= fileSize %></p>',
+                '<p class="image-list-detail"><b>Arch:</b> <%= fileArch %></p>',
+                '<p class="image-list-detail"><b>KS:</b> <%= ksFileName %></p>',
+                '<p class="image-list-detail"><b>Updated:</b> <%= fileTime %></p>',
             '</div>',
         '</li>'
     ];
@@ -62,12 +65,13 @@ define([
             fileSize: item.getImageSize(),
             fileTime: item.getImageUptime(),
             imageFileName: item.getImageName(),
-            ksFileName: AppConfig.TIC_WEB.KS_FILE_NAME,
+            ksFileName: item.getImageKs(),
             logFileName: AppConfig.TIC_WEB.LOG_FILE_NAME,
             imagePath: item.getJobAbsImagePath(),
             classJobKsPath: item.getImageHasKsFile() === '0' ? 'btnnotactive' : '',
             ksPath: item.getJobAbsKsPath(),
-            logPath: item.getJobAbsLogPath()
+            logPath: item.getJobAbsLogPath(),
+            fileArch: item.getImageArch()
         });
     };
 
index da2144d..ae31304 100644 (file)
@@ -17,7 +17,7 @@ define([
         '<tr id="job_table_row_<%= jobNum %>">',
             '<td><%= jobNum %></td>',
             '<td class="<%= classJobStatus %>" title="<%= jobStatus %>"></td>',
-            '<td><a class="tic-job-list-btn btndownload <%= classJobImageDownload %>" href="<%= jobImagePath %>" title="<%= jobImageName %> Download">Download</a></td>',
+            '<td><a class="tic-job-list-btn btndownload <%= classJobImageDownload %>" href="<%= jobImagePath %>" title="<%= jobImageName %>">Download</a></td>',
             '<td><%= jobImageSize %></td>',
             '<td><%= jobUptime %></td>',
             '<td><a class="tic-job-list-btn btncancel <%= classJobCancel %>" title="Cancel">Cancel</a></td>',
@@ -77,7 +77,7 @@ define([
                 'jobImageSize': data.getJobImageSize(),
                 'jobImagePath': data.getJobAbsImagePath(),
                 'classJobImageDownload': data.getJobStatus() === JOB_STATUS_DONE ? '' : 'btnnotactive',
-                'classJobCancel': statusValue === JOB_STATUS_DONE ? 'btnnotactive' : '',
+                'classJobCancel': statusValue === JOB_STATUS_INPROGRESS ? '' : 'btnnotactive' ,
                 'classJobKsPath': data.getJobHasKsFile() === '0' ? 'btnnotactive' : '',
                 'jobKsPath': data.getJobAbsKsPath(),
                 'jobLogPath': data.getJobAbsLogPath(),
@@ -94,7 +94,7 @@ define([
                 'jobImageName': data.getJobImageName(),
                 'jobImageSize': data.getJobImageSize(),
                 'jobImagePath': data.getJobAbsImagePath(),
-                'classJobCancel': statusValue === JOB_STATUS_DONE ? 'btnnotactive' : '',
+                'classJobCancel': statusValue === JOB_STATUS_INPROGRESS ? '' : 'btnnotactive' ,
                 'classJobKsPath': data.getJobHasKsFile() === '0' ? 'btnnotactive' : '',
                 'jobKsPath': data.getJobAbsKsPath(),
                 'jobLogPath': data.getJobAbsLogPath(),