[TIC-Web] Apply generic resource pooling 85/118885/2
authorHeekyoung, Oh <heekyoung.oh@samsung.com>
Tue, 14 Mar 2017 10:13:35 +0000 (19:13 +0900)
committerHeekyoung, Oh <heekyoung.oh@samsung.com>
Wed, 15 Mar 2017 06:28:34 +0000 (15:28 +0900)
- Apply generic_pool with mariasql

Change-Id: Ie9059af1f48a31a5dc4189c1c94340313d852635
Signed-off-by: Heekyoung, Oh <heekyoung.oh@samsung.com>
14 files changed:
app.js
config.json
controller/dbpool.js [new file with mode: 0644]
controller/dbquery.js [moved from controller/mariadb.js with 80% similarity]
controller/router.js
controller/session.js
controller/ticcore.js
package.json
public/src/css/style.css
public/src/js/main.js
public/src/js/page/image.js
public/src/js/page/job.js
public/src/js/util.js
public/src/js/widget/ImageItem.js

diff --git a/app.js b/app.js
index a2c3c32..55ff958 100644 (file)
--- a/app.js
+++ b/app.js
@@ -5,11 +5,12 @@ var bodyParser = require('body-parser');
 var JL = require('jsnlog').JL;
 var jsnlog_nodejs = require('jsnlog-nodejs').jsnlog_nodejs;
 var logger = JL('app.js');
-var CONFIG = require('./config.json');
+var AppConfig = require('./config.json');
+
 
 var app = express();
 /* app config */
-app.set('port', process.env.PORT || CONFIG.TIC_WEB.PORT);
+app.set('port', process.env.PORT || AppConfig.TIC_WEB.PORT);
 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded({extended: true}));
 app.use(express.static(path.join(__dirname, '/public/src'))); //module directory
index dac2fd4..3db86ec 100644 (file)
@@ -4,10 +4,23 @@
         "PATH": "/var/tmp/tic-web/",
         "PATH_ABSTRACT": "/tic/",
         "LOG_FILE" : "/var/tmp/tic-web/tic-web.log",
-        "KS_FILE_NAME": "default.ks",
         "LOG_FILE_NAME": "mic.log",
         "IMAGE_FILE_NAME": "image.tar.gz"
     },
+    "DATABASE": {
+        "USERNAME": "tic",
+        "PASSWORD": "tic",
+        "DATABASE": "pdk",
+        "HOST": "localhost",
+        "TRACE": true,
+        "DIALECT": "mariasql",
+        "POOL": {
+            "MAX": 5,
+            "MIN": 1,
+            "IDLETIMEOUT": 500000,
+            "REAPINTERVAL": 500
+        }
+    },
     "TIC_CORE": {
         "PORT" : 8082
     },
diff --git a/controller/dbpool.js b/controller/dbpool.js
new file mode 100644 (file)
index 0000000..3dac94e
--- /dev/null
@@ -0,0 +1,126 @@
+'use strict'
+
+var generic_pool = require('generic-pool');
+var mariasql = require('mariasql');
+var JL = require('jsnlog').JL;
+var logger = JL('dbpool.js');
+
+var AppConfig = require('../config.json');
+
+
+function dbPool () {
+    var self = this;
+    
+    self.configMariasql = {
+        host: AppConfig.DATABASE.HOST,
+        user: AppConfig.DATABASE.USERNAME,
+        password: AppConfig.DATABASE.PASSWORD,
+        db: AppConfig.DATABASE.DATABASE,
+        trace: AppConfig.DATABASE.TRACE,
+        pingInactive: 1000,
+        metadata: false
+    };
+
+    self.pool = generic_pool.createPool({
+        name: AppConfig.DATABASE.DIALECT,
+
+        create: function (callback) {
+            return new Promise(function (resolve, reject) {
+                var mariasqlClient = new mariasql(self.configMariasql);
+                mariasqlClient.connect(function (err) {
+                    if (err) {
+                        logger.error('DB Connection Error !');
+                        logger.error(err);
+                        reject(err);
+                    }
+
+                    logger.info('DB Connection Success !');
+                    resolve(mariasqlClient);
+                });
+
+                // mariasqlClient.on('connect', function () {
+                //     logger.info('DB - connect');
+                //     resolve(client);
+                // })
+                // .on('error', function (err) {
+                //     logger.info('DB - error');
+                //     reject(err);
+                // }).on('close', function (hadError) {
+                //     logger.info('DB - close');
+                //     resolve();
+                // }).on('ready', function () {
+                //     logger.info('DB - ready');
+                //     resolve(mariasqlClient);
+                // });
+            });
+        },
+
+        destroy: function (client) {
+            return new Promise(function (resolve, reject) {
+                client.on('end', function () {
+                    resolve();
+                });
+                client.disconnect();
+            });
+            // cliend.end();
+            // client._handle = null;
+        },
+
+        validate: function (client) {
+            return client.connected;
+        },
+
+        max: AppConfig.DATABASE.POOL.MAX,
+
+        min: AppConfig.DATABASE.POOL.MIN,
+
+        idleTimeoutMillis: AppConfig.DATABASE.POOL.IDLETIMEOUT,
+
+        reapIntervalMillis: AppConfig.DATABASE.POOL.REAPINTERVAL,
+
+        returnToHead: true
+    });
+
+    // self.pool.drain().then(function () {
+    //     self.pool.clear();
+    // });
+
+    
+};
+
+dbPool.prototype.query = function query (query, params) {
+    var mariaPool = this.pool;
+    return new Promise (function (resolve, reject) {
+        mariaPool.acquire().then(function (client) {
+            var meta = {
+                result: []
+            };
+
+            client.query(query, params, {
+                metadata: false
+            }, function (err, rows) {
+                if (err) {
+                    mariaPool.destroy(client);
+                    meta.result = err;
+                    return reject(meta);
+                }
+
+                meta.result = rows;
+                mariaPool.release(client);
+                logger.info(JSON.stringify(meta));
+                return resolve(meta);
+            });
+        }).catch(function (err) {
+            return reject(err);
+        });
+    });
+};
+
+
+// process.on('exit', function () {
+//     dbPool.drain(function () {
+//         dbpool.clear();
+//     });
+// });
+
+module.exports = dbPool;
\ No newline at end of file
similarity index 80%
rename from controller/mariadb.js
rename to controller/dbquery.js
index d02aaee..4c8b5fb 100644 (file)
@@ -2,9 +2,25 @@
 
 var mariaSql = require('mariasql');
 var JL = require('jsnlog').JL;
-var logger = JL('mariadb.js');
+var logger = JL('dbquery.js');
 var _ = require('lodash');
 
+// var sequelize = require('./dbpool');
+var dbpool = require('./dbpool');
+
+var pool = new dbpool({});
+// function fnCallback() {};
+// setInterval(function () {
+//     pool.query('show tables', {});
+//     console.log(process.memoryUsage());
+// }, 1000);
+
+process.on('exit', function () {
+    pool.drain(function () {
+        pool.clear();
+    });
+});
+
 /**
  * Client
  */
@@ -103,8 +119,8 @@ mariadb.queries = {
     ]
 };
 
-mariadb.doQuery = function doQuery(queryString, callback) {
-    return mariaSqlClient.query(queryString, callback);
+mariadb.doQuery = function doQuery(queryString) {
+    return pool.query(queryString, []);
 };
 
 /**
@@ -117,14 +133,9 @@ mariadb.editJob = function editJob(req, res) {
     var queryString, strJobId, reqParam,
     job_status, job_deleted, job_hasksfile, job_image_id, job_ks, job_arch;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-
+    function onSuccess(rows) {
         logger.info('editJob.success');
-        res.json(rows);
+        res.json(rows.result);
     }
 
     strJobId = req.params.id;
@@ -161,7 +172,8 @@ mariadb.editJob = function editJob(req, res) {
 
     logger.info('editJob: query = ' + queryString);
 
-    this.doQuery(queryString, onSuccess);
+    // call
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -170,15 +182,10 @@ mariadb.editJob = function editJob(req, res) {
 mariadb.addJob = function addJob(req, res) {
     var queryString;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-
-        logger.info('addJob.success: {job_id: ' + rows.info.insertId + '}');
+    function onSuccess(rows) {
+        logger.info('addJob.success: {job_id: ' + rows.result.info.insertId + '}');
         res.json({
-            job_id: rows.info.insertId
+            job_id: rows.result.info.insertId
         });
     }
 
@@ -187,7 +194,7 @@ mariadb.addJob = function addJob(req, res) {
     logger.info('addJob: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -196,12 +203,8 @@ mariadb.addJob = function addJob(req, res) {
 mariadb.getJobById = function getJobById(req, res) {
     var queryString, strJobId;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-        res.json(rows);
+    function onSuccess(rows) {
+        res.json(rows.result);
     }
 
     strJobId = req.params.id;
@@ -213,7 +216,7 @@ mariadb.getJobById = function getJobById(req, res) {
     logger.info('getJobById: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -222,12 +225,8 @@ mariadb.getJobById = function getJobById(req, res) {
 mariadb.getJobsTotalCount = function getJobsTotalCount(req, res) {
     var queryString;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-        res.json(rows);
+    function onSuccess(rows) {
+        res.json(rows.result);
     }
 
     queryString = _.join(this.queries['getJobsTotalCount'], '');
@@ -235,7 +234,7 @@ mariadb.getJobsTotalCount = function getJobsTotalCount(req, res) {
     logger.info('getJobsTotalCount: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -244,12 +243,8 @@ mariadb.getJobsTotalCount = function getJobsTotalCount(req, res) {
 mariadb.getJobsAllList = function getJobsAllList(req, res) {
     var queryString, reqParam, pageNum, startNum;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-        res.json(rows);
+    function onSuccess(rows) {
+        res.json(rows.result);
     }
 
     // strNum
@@ -264,7 +259,7 @@ mariadb.getJobsAllList = function getJobsAllList(req, res) {
     logger.info('getJobsAllList: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 
@@ -278,12 +273,8 @@ mariadb.getJobsAllList = function getJobsAllList(req, res) {
 mariadb.getImagesAllList = function getImagesAllList(req, res) {
     var queryString, reqParam, pageNum, startNum;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-        res.json(rows);
+    function onSuccess(rows) {
+        res.json(rows.result);
     }
 
     // strNum
@@ -298,7 +289,7 @@ mariadb.getImagesAllList = function getImagesAllList(req, res) {
     logger.info('getImagesAllList: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -307,12 +298,8 @@ mariadb.getImagesAllList = function getImagesAllList(req, res) {
 mariadb.getImagesTotalCount = function getImagesTotalCount(req, res) {
     var queryString;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-        res.json(rows);
+    function onSuccess(rows) {
+        res.json(rows.result);
     }
 
     queryString = _.join(this.queries['getImagesTotalCount'], '');
@@ -320,7 +307,9 @@ mariadb.getImagesTotalCount = function getImagesTotalCount(req, res) {
     logger.info('getImagesTotalCount: query = ' + queryString);
 
     // call
-    this.doQuery(queryString, onSuccess);
+    this.doQuery(queryString).then(onSuccess);
+    
+    
 };
 
 /**
@@ -329,15 +318,11 @@ mariadb.getImagesTotalCount = function getImagesTotalCount(req, res) {
 mariadb.addImage = function addImage (req, res) {
     var queryString, paramObj;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-
-        logger.info('addJob: result = {image_id: ' + rows.info.insertId + '}');
+    function onSuccess(rows) {
+        var result = rows.result;
+        logger.info('addJob: result = {image_id: ' + result.info.insertId + '}');
         res.json({
-            image_id: rows.info.insertId
+            image_id: result.info.insertId
         });
     }
 
@@ -352,7 +337,7 @@ mariadb.addImage = function addImage (req, res) {
     logger.info('addJob: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 
@@ -360,14 +345,9 @@ mariadb.editImage = function editImage(req, res) {
     var queryString, strJobId, reqParam,
     job_status, job_deleted, job_hasksfile, job_image_id;
 
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            throw err;
-        }
-
+    function onSuccess(rows) {
         logger.info('editJob.success');
-        res.json(rows);
+        res.json(rows.result);
     }
 
     strJobId = req.params.id;
@@ -396,7 +376,8 @@ mariadb.editImage = function editImage(req, res) {
 
     logger.info('editJob: query = ' + queryString);
 
-    this.doQuery(queryString, onSuccess);
+    // call
+    this.doQuery(queryString).then(onSuccess);
 };
 
 
@@ -410,19 +391,14 @@ mariadb.editImage = function editImage(req, res) {
  * @desc get user information
  */
 mariadb.getUser = function getUser(query, success, error) {
-    function onSuccess(err, rows) {
-        if (err) {
-            logger.error(err);
-            error(err);
-        } else {
-            var resultObj = {
-                data: null
-            };
-            if (rows.length !== NO_DATA) {
-                resultObj.data = rows[0];
-            }
-            success(resultObj);
+    function onSuccess(rows) {
+        var resultObj = {
+            data: null
+        };
+        if (rows && rows.result && rows.result.length !== NO_DATA) {
+            resultObj.data = rows.result[0];
         }
+        success(resultObj);
     }
 
     var queryString = _.template(_.join(this.queries['getUser'], ''))({
@@ -433,7 +409,7 @@ mariadb.getUser = function getUser(query, success, error) {
     logger.info('getUser: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -458,7 +434,7 @@ mariadb.hasUser = function hasUser(query, success, error) {
     logger.info('hasUser: query = ' + queryString);
 
     // call
-    this.doQuery(queryStringonSuccess);
+    this.doQuery(queryString).then(onSuccess);
 };
 
 /**
@@ -517,6 +493,6 @@ mariadb.init = function init() {
     .then(self.connectToClient);
 };
 
-mariadb.init();
+// mariadb.init();
 
 module.exports = mariadb;
index 402cecd..2e61f71 100644 (file)
@@ -3,7 +3,7 @@ var router = express.Router();
 var http = require('http');
 
 var core = require('./ticcore');
-var client = require('./mariadb');
+var client = require('./dbquery');
 var session = require('./session');
 var config = require('../config.json');
 var filesystem = require('./filesystem');
index d205c22..21a5ad1 100644 (file)
@@ -1,6 +1,6 @@
 'use strict';
 
-var mariadb = require('./mariadb');
+var dbquery = require('./dbquery');
 var JL = require('jsnlog').JL;
 
 var logger = JL('session.js');
@@ -18,13 +18,13 @@ Session.prototype.postSession = function(req, res) {
     if (req.session) {
         // check email and password
         if (req.body.email) {
-            mariadb.getUser({
+            dbquery.getUser({
                 email: req.body.email,
                 password: req.body.password
             }, function success(user) {
                 if (user.data === null) {
                     // check email
-                    mariadb.hasUser({
+                    dbquery.hasUser({
                         email: req.body.email
                     }, function success(result) {
                         // email validation
index 0b35ea3..f59f449 100644 (file)
@@ -2,7 +2,7 @@
 
 var mariaSql = require('mariasql');
 var JL = require('jsnlog').JL;
-var logger = JL('mariadb.js');
+var logger = JL('ticcore.js');
 var http = require('http');
 var AppConfig = require('../config.json');
 var _ = require('lodash');
index 6dbb7dc..b04e808 100644 (file)
@@ -40,6 +40,7 @@
     "moment": "~2.17.1",
     "tree-kill": "https://github.com/leechwin/node-tree-kill.git#master",
     "mariasql": "~0.2.6",
+    "generic-pool": "~3.7.1",
     "request": "~2.79.0",
     "express-session": "~1.15.1"
   },
index ba48e98..7d7e642 100644 (file)
@@ -312,8 +312,8 @@ tr.extended_job_table_row:hover td {
     width: 100%;
     float: left;
     display: table;
-    margin-top: 12px;
-    height: 3vh;
+    padding-top: 20px;
+    height: 4vh;
 }
 #tic-image-list-content {
     height: calc(100vh - 320px);
@@ -385,6 +385,7 @@ tr.extended_job_table_row:hover td {
     background-color: #f9f9f9;
     border: 1px solid #ccc;
     border-radius: 5px;
+    position: fixed;
 }
 .log-view-content-header {
     border-bottom-color: #ccc;
index 6a1eb5b..e1e6561 100644 (file)
@@ -46,6 +46,11 @@ define([
         // initially, hide the log view
         // in job and image section
         $('#log-view-content').hide();
+        $('.log-view-content .log-view-content-close').on('click', function (e) {
+            e.preventDefault();
+            $('#log-view-content-body').empty();
+            $('#log-view-content').hide();
+        });
 
     }
 
index 28aff91..b9031d6 100644 (file)
@@ -49,6 +49,12 @@ define([
                     _.forEach(arrImages, function (value, index) {
                         targetBody.append(new ImageItem(value, index).getTemplate());
                     });
+
+                    // bind events
+                    $('#tic-image-list a.btnbiglog').on('click', function (e) {
+                        e.preventDefault();
+                        Util.showBigLogView(this);
+                    });
                 }
             });
         }
index fc10927..fa1fbe5 100644 (file)
@@ -52,49 +52,6 @@ define([
         ModelJobList = [];
         ModelJobPaging;
 
-        function _hideLogView () {
-            logger.info('_hideLogView');
-
-        }
-        function _readLog (jobId) {
-            logger.info('JOB_READ_LOG: ' + jobId);
-
-            Util.POST(AppConfig.EVENT.JOB.JOB_READ_LOG + jobId)
-            .then(function (line) {
-                 $('#log-view-content-body').append(line);
-            });
-        }
-
-        function _showLogView (btn) {
-            var linkid, linkurl, currentPosition, currentWidth, currentHeight;
-
-            logger.info('_showLogView');
-
-            linkid = $(btn).data('jobid');
-            linkurl = $(btn).data('link');
-
-            logger.info('(job_id:' + linkid + ') the url of link is ' + linkurl);
-
-            // get value
-            currentPosition = $('#tic-job-list').offset();
-            currentWidth = $('#tic-job-list').width();
-            currentHeight = $('#tic-job-list').height();
-
-            // set value
-            $('#log-view-content').width(currentWidth);
-            $('#log-view-content').height(currentHeight);
-            $('#log-view-content').offset({
-                top: currentPosition.top,
-                left: currentPosition.left
-            });
-
-            // show
-            $('#log-view-content-body').empty();
-            $('#log-view-content-download').attr('href', linkurl);
-            $('#log-view-content').show();
-            _readLog(linkid);
-        }
-
         function _updateView (arrJobs) {
             return new Promise(function (resolve, reject) {
                 logger.info('_updateView');
@@ -112,7 +69,7 @@ define([
                     // bind events
                     $('#tic-job-list a.btnbiglog').on('click', function (e) {
                         e.preventDefault();
-                        _showLogView(this);
+                        Util.showBigLogView(this);
                     });
                 }
             });
@@ -422,12 +379,6 @@ define([
             _initSocket(Util.getWebSocket());
             updateList();
         });
-
-        $('.log-view-content .log-view-content-close').on('click', function (e) {
-            e.preventDefault();
-            $('#log-view-content-body').empty();
-            $('#log-view-content').hide();
-        });
     }
 
     init();
index c67dbec..2a6fcd5 100644 (file)
@@ -8,6 +8,55 @@ define([
     var socket = null;
     var config = null;
 
+    function showBigLogView(btn) {
+        var linkid, linkurl, logViewTop, logViewLeft, logViewWidth, logViewHeight;
+
+        if (config === null) {
+            getAppConfig();
+        }
+
+        function readLog () {
+            POST(config.EVENT.JOB.JOB_READ_LOG + linkid)
+            .then(function (line) {
+                 $('#log-view-content-body').append(line);
+            });
+        }
+
+        function getClientWidth () {
+            return (window.innerWidth) ? window.innerWidth : document.documentElement.clientWidth || document.body.clientWidth || 0;
+        }
+
+        function getClientHeight () {
+            return(window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight || document.body.clientHeight || 0;
+        }
+
+        linkid = $(btn).data('jobid');
+        linkurl = $(btn).data('link');
+
+        console.log('Util.showBigLogView: job_id="' + linkid + '", log_url="' + linkurl + '"');
+
+        // get value
+        logViewWidth = getClientWidth() - 18;
+        logViewHeight = getClientHeight() - 50;
+        logViewTop = 50;
+        logViewLeft = 0;
+
+        // set value
+        $('#log-view-content').width(logViewWidth);
+        $('#log-view-content').height(logViewHeight);
+        $('#log-view-content').offset({
+            top: logViewTop,
+            left: logViewLeft
+        });
+
+        // show
+        $('#log-view-content-body').empty();
+        $('#log-view-content-download').attr('href', linkurl);
+        $('#log-view-content').show();
+
+        readLog(linkid);
+    }
+
     function setAnimateScroll() {
         $('a.tic-page-scroll').bind('click', function(event) {
             var body = $('html, body');
@@ -148,6 +197,13 @@ define([
 
     return {
         /**
+         * Display the mic.log
+         * @method showBigLogView
+         * @param {object} btn for Log Button Element
+         */
+        showBigLogView: showBigLogView,
+
+        /**
          * Set smooth scrolling, one page websites
          * @method setAnimateScroll
          */
index af22ae6..a228e41 100644 (file)
@@ -22,7 +22,7 @@ define([
                 '<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 class="image-list-name-btndownload"><a class="image-list-btndownload btnbiglog" data-link="<%= logPath %>" data-jobid="<%= jobId %>" title="Log" date-name="<%= logFileName %>">Log</a></div>',
             '</div>',
             '<div class="image-item-info">',
                 '<p class="image-list-detail"><b>Job ID:</b> <%= jobId %></p>',
@@ -65,7 +65,7 @@ define([
             fileSize: item.getImageSize(),
             fileTime: item.getImageUptime(),
             imageFileName: item.getImageName(),
-            ksFileName: item.getImageKs(),
+            ksFileName: item.getImageKs() || 'None',
             logFileName: AppConfig.TIC_WEB.LOG_FILE_NAME,
             imagePath: item.getJobAbsImagePath(),
             classJobKsPath: item.getImageHasKsFile() === '0' ? 'btnnotactive' : '',