From f72a2ffe24b3e17a65c68dcbbb93441e75445819 Mon Sep 17 00:00:00 2001 From: "Heekyoung, Oh" Date: Tue, 28 Mar 2017 19:22:22 +0900 Subject: [PATCH] [TIC-Web] Update The Login Module - Add the function for the job page - Add the function for the image page - And, Fixed header of table on the job page Change-Id: I00f6c277bc722b4d2cecd4b656e8e1ef3efc08d1 Signed-off-by: Heekyoung, Oh --- public/src/css/style.css | 63 +++++++++++++++++++++++++++++++++++++++++++-- public/src/index.html | 2 +- public/src/js/page/image.js | 14 ++++++---- public/src/js/page/job.js | 29 ++++----------------- public/src/js/page/login.js | 24 +++++++++++++++-- 5 files changed, 98 insertions(+), 34 deletions(-) diff --git a/public/src/css/style.css b/public/src/css/style.css index 09189af..348c77a 100644 --- a/public/src/css/style.css +++ b/public/src/css/style.css @@ -173,7 +173,6 @@ body { display: inline-block; width: 100%; text-align: center; - overflow: auto; } #tic-job-section .panel-heading .pull-right { margin-top: -20px; @@ -237,13 +236,73 @@ tr.extended_job_table_row:hover { tr.extended_job_table_row:hover td { background-color: transparent; } -#tic-job-table th { + +.tic-job-table { + height: calc(100vh - 285px); + width: 100%; text-align: center; + table-layout: fixed; + border-collpase: collapse; +} +.tic-job-table thead { + width: 100%; + min-width: 480px; + display: block; +} +.tic-job-table tbody { + min-width: 480px; + display: block; + overflow-y: auto; + overflow-x: hidden; + height: calc(100vh - 323px); +} +.tic-job-table th { height: 38px; + white-space: nowrap; vertical-align: middle; background-color: rgba(51, 122, 183, 0.12); color: steelblue; } +.tic-job-table th, .tic-job-table td { + width: 100%; + text-overflow: ellipsis; +} +.tic-job-table th:nth-child(1), +.tic-job-table td:nth-child(1) { + width: 41px; + min-width: 41px; + display:table-cell; +} +.tic-job-table th:nth-child(2), +.tic-job-table td:nth-child(2) { + width: 60px; + min-width: 60px; +} +.tic-job-table th:nth-child(3), +.tic-job-table td:nth-child(3) { + width: 90px; + min-width: 90px; +} +.tic-job-table th:nth-child(4), +.tic-job-table td:nth-child(4) { + width: 90px; + min-width: 90px; +} +.tic-job-table th:nth-child(5), +.tic-job-table td:nth-child(5) { + width: 160px; + min-width: 160px; +} +.tic-job-table th:nth-child(6), +.tic-job-table td:nth-child(6) { + width: 90px; + min-width: 90px; +} +.tic-job-table th:nth-child(7), +.tic-job-table td:nth-child(7) { + width: 90px; + min-width: 90px; +} #tic-job-list-pagination { float: right; diff --git a/public/src/index.html b/public/src/index.html index c41a300..3f0a32e 100644 --- a/public/src/index.html +++ b/public/src/index.html @@ -208,7 +208,7 @@
- +
diff --git a/public/src/js/page/image.js b/public/src/js/page/image.js index 4ff916f..1b5bf38 100644 --- a/public/src/js/page/image.js +++ b/public/src/js/page/image.js @@ -26,6 +26,9 @@ define([ // config var AppConfig; + // User + var UserInfo; + // the list for the image var ModelImageList = []; @@ -157,23 +160,24 @@ define([ gotoPageNum(pageNum); } - function init() { - logger.info('init'); + function updateImageInfo (user) { + logger.info('updateImageInfo'); Util.getAppConfig().then(function (data) { AppConfig = data; + UserInfo = user; updateList(); }); } - init(); - return { /** * Update list in image page * @method updateList */ - updateList: updateList + updateList: updateList, + + updateImageInfo: updateImageInfo } }); diff --git a/public/src/js/page/job.js b/public/src/js/page/job.js index 918981f..cfd31a0 100644 --- a/public/src/js/page/job.js +++ b/public/src/js/page/job.js @@ -357,22 +357,6 @@ define([ } /** - * @name updateUserInfo - * @desc Set the user info. - */ - function updateUserInfo () { - /** - * TODO - * - * To be improved. - */ - Util.GET('api/session') - .then(function (user) { - UserInfo = user; - }); - } - - /** * @name doCreateAnImage * @param paramObj { * jobId: '1', @@ -411,20 +395,17 @@ define([ gotoPageNum(pageNum); } - function init() { - logger.info('init'); + function updateJobInfo (user) { + logger.info('updateJobInfo'); - // set the config information for the app Util.getAppConfig().then(function (data) { AppConfig = data; _initSocket(Util.getWebSocket()); + UserInfo = user; updateList(); - updateUserInfo(); }); } - init(); - return { /** * Update list in job page @@ -439,9 +420,9 @@ define([ doCreateAnImage: doCreateAnImage, /** - * Set the user info. + * Update */ - updateUserInfo: updateUserInfo + updateJobInfo: updateJobInfo } }); \ No newline at end of file diff --git a/public/src/js/page/login.js b/public/src/js/page/login.js index d174ee2..f85709c 100644 --- a/public/src/js/page/login.js +++ b/public/src/js/page/login.js @@ -2,12 +2,16 @@ define([ 'jquery', 'bootstrap-validator', 'js/util', - 'js/logger' + 'js/logger', + './job', + './image' ], function ( $, BootstrapValidator, Util, - Logger + Logger, + Job, + Image ) { 'use strict'; @@ -113,6 +117,20 @@ define([ } /** + * Permission control in job page + */ + function _updateJobPage (user) { + Job.updateJobInfo(user); + } + + /** + * Permission control in image page + */ + function _updateImagePage (user) { + Image.updateImageInfo(user); + } + + /** * Permission control of group */ function updatePermission() { @@ -120,6 +138,8 @@ define([ .then(function (user) { _updateLogin(user); _updatePackagePage(user.group); + _updateJobPage(user); + _updateImagePage(user); }); } -- 2.7.4
#