margin-bottom: 0px;
}
#tic-job-list .tic-job-list-btn {
- float: right;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
height: calc(100vh - 320px);
text-overflow: ellipsis;
text-align: center;
+ table-layout: auto;
}
-#tic-job-filter {
- width: 100%;
- float: left;
+#tic-job-table th {
+ text-align: center;
+ height: 38px;
+ vertical-align: middle;
+}
+#tic-job-table tr {
+ height: 38px;
+}
+#tic-job-table td {
+ height: 38px;
+ vertical-align: middle;
+ padding: 2px;
}
#tic-job-list-pagination {
overflow: auto;
}
#tic-image-list {
- height: calc(100vh - 320px);
display: inline-block;
overflow: auto;
text-overflow: ellipsis;
width: 100%;
}
-#tic-image-filter {
- width: 100%;
- float: left
-}
/* Image List Item */
.image-list-name {
display:inline-block;
min-width: 350px;
overflow: hidden;
- width: 97%;
color: #31708f;
+ float: left;
+ margin-bottom: 8px;
+}
+.image-list-name-btndownload {
+ float: left;
+ min-width: 10px;
+ padding-right: 4px;
}
.image-list-detail {
padding-left: 10px;
white-space:nowrap;
display:inline-block;
overflow: hidden;
- width: 85%;
}
.image-list-btndownload {
- float: right;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
}
.image-item {
overflow: hidden;
- height: 10vh;
+ height: 7vh;
}
.image-item-title {
width: 100%;
+ float: left;
}
.image-item-info {
- width: 60%;
-
+ width: 100%;
+ float: left;
}
-.image-item-btnbox {
- width: 40%;
+#tic-image-list-content {
+ height: calc(100vh - 320px);
+ display: inline-block;
+ width: 100%;
+}
+#tic-image-list-pagination {
float: right;
- height: 100%;
- position: absolute;
- top: 20px;
- right: 20px;
+ text-align: center;
}
/* Settings Page */
<div class="panel-body">
<div id="tic-job-list">
<div id="tic-job-list-content">
- <div id="tic-job-filter">
- <form class="navbar-form" role="search">
- <div class="input-group">
- <input type="text" class="form-control" placeholder="Search Status, JobId" name="q">
- <div class="input-group-btn">
- <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button>
- </div>
- </div>
- </form>
- </div>
<div>
<table class="table table-hover table-bordered" id="tic-job-table">
<thead>
<div class="panel-heading">Image List</div>
<div class="panel-body">
<div id="tic-image-list-content">
- <div id="tic-image-filter">
- <form class="navbar-form" role="search">
- <div class="input-group">
- <input type="text" class="form-control" placeholder="Search JobId" name="q">
- <div class="input-group-btn">
- <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button>
- </div>
- </div>
- </form>
- </div>
- <div>
- <ul class="list-group" id="tic-image-list"></ul>
- </div>
+ <ul class="list-group" id="tic-image-list"></ul>
</div>
<div id="tic-image-list-pagination">
<ul class="pagination pagination-sm">
'jquery',
'lodash',
'js/util',
- 'js/logger'
+ 'js/logger',
+ './JobStatusModel'
], function (
$,
_,
Util,
- Logger
+ Logger,
+ JobStatusModel
) {
'use strict';
// define the default status
var DEFAULT_STATUS = 'READY';
- // describe the all the status of job
- var JOB_STATUS_LIST = [
- {
- value: 'READY',
- text: 'Ready'
- },
- {
- value: 'DONE',
- text: 'Done'
- },
- {
- value: 'CANCELED',
- text: 'Canceled'
- },
- {
- value: 'FAILED',
- text: 'Failed'
- },
- {
- value: 'INPROGRESS',
- text: 'In Progress'
- }
- ];
-
// set the config information for the app
Util.getAppConfig().then(function (data) {
AppConfig = data;
var statusInfo, isDownloadable;
isDownloadable = false;
- statusInfo = _.find(JOB_STATUS_LIST, {value: status}) || _.find(JOB_STATUS_LIST, {value: DEFAULT_STATUS});
+ statusInfo = JobStatusModel.getStatusInfo(status);
this.jobStatus = statusInfo.value || '';
this.setJobStatusText(statusInfo.text);
--- /dev/null
+define([
+ 'lodash',
+ 'js/logger'
+], function (
+ _,
+ Logger
+) {
+ 'use strict';
+
+ var logger = Logger('model/JobStatusModel.js');
+
+ // define the default status
+ var DEFAULT_STATUS = 'READY';
+
+ var JobStatusModel = function JobStatusModel (paramObj) {
+ this.all = [
+ {
+ value: 'READY',
+ text: 'Ready',
+ class: 'fa fa-toggle-off'
+ },
+ {
+ value: 'DONE',
+ text: 'Done',
+ class: 'fa fa-toggle-on'
+ },
+ {
+ value: 'CANCELED',
+ text: 'Canceled',
+ class: 'fa fa-toggle-off'
+ },
+ {
+ value: 'FAILED',
+ text: 'Failed',
+ class: 'fa fa-toggle-off'
+ },
+ {
+ value: 'INPROGRESS',
+ text: 'In Progress',
+ class: 'fa fa-refresh fa-spin'
+ }
+ ];
+ return this;
+ };
+
+ /**
+ * getStatusInfo
+ */
+ JobStatusModel.prototype.getStatusInfo = function getStatusInfo (value) {
+ var status = value || DEFAULT_STATUS;
+ var statusInfo = _.find(this.all, {value: status});
+ return statusInfo;
+ };
+
+ var jobStatusModel = new JobStatusModel();
+ return jobStatusModel;
+});
var strItem = [
'<li class="list-group-item image-item">',
'<div class="image-item-title">',
- '<p class="image-list-name" title="<%= imageFileName %>"><%= imageFileName %></p>',
+ '<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>',
'<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>',
'</div>',
- '<div class="image-item-btnbox">',
- '<div><a class="image-list-btndownload" href="<%= imagePath %>" date-name="<%= imageFileName %>">Download</a></div>',
- '<div><a class="image-list-btndownload" href="<%= ksPath %>" date-name="<%= ksFileName %>">KS</a></div>',
- '<div><a class="image-list-btndownload" href="<%= logPath %>" date-name="<%= logFileName %>">Log</a></div>',
- '</div>',
'</li>'
];
ksFileName: AppConfig.TIC_WEB.KS_FILE_NAME,
logFileName: AppConfig.TIC_WEB.LOG_FILE_NAME,
imagePath: item.getJobAbsImagePath(),
+ classJobKsPath: item.getImageHasKsFile() === '0' ? 'btnnotactive' : '',
ksPath: item.getJobAbsKsPath(),
logPath: item.getJobAbsLogPath()
});
'<td><a class="tic-job-list-btn btndownload" href="<%= jobImagePath %>" title="<%= jobImageName %>">Download</a></td>',
'<td><%= jobImageSize %></td>',
'<td><%= jobUptime %></td>',
- '<td><a class="tic-job-list-btn btncancel" title="Cancel">Cancel</a></td>',
- '<td><a class="tic-job-list-btn" href="<%= jobKsPath %>" title="KS">KS</a></td>',
+ '<td><a class="tic-job-list-btn btncancel <%= classJobCancel %>" title="Cancel">Cancel</a></td>',
+ '<td><a class="tic-job-list-btn <%= classJobKsPath %>" href="<%= jobKsPath %>" title="KS">KS</a></td>',
'<td><a class="tic-job-list-btn" href="<%= jobLogPath %>" title="Log">Log</a></td>',
'</tr>'
];
'<td><a class="tic-job-list-btn btndownload btnnotactive">Download</a></td>',
'<td><%= jobImageSize %></td>',
'<td><%= jobUptime %></td>',
- '<td><a class="tic-job-list-btn btncancel" title="Cancel">Cancel</a></td>',
- '<td><a class="tic-job-list-btn" href="<%= jobKsPath %>" title="KS">KS</a></td>',
+ '<td><a class="tic-job-list-btn btncancel <%= classJobCancel %>" title="Cancel">Cancel</a></td>',
+ '<td><a class="tic-job-list-btn <%= classJobKsPath %>" href="<%= jobKsPath %>" title="KS">KS</a></td>',
'<td><a class="tic-job-list-btn" href="<%= jobLogPath %>" title="Log">Log</a></td>',
'</tr>',
'<tr id="extended_job_table_row_<%= jobNum %>" class="extended_job_table_row">',
];
var JOB_STATUS_INPROGRESS = 'INPROGRESS';
+ var JOB_STATUS_DONE = 'DONE';
var JobTableItem = function (modelObj) {
this.model = modelObj;
'jobImageName': data.getJobImageName(),
'jobImageSize': data.getJobImageSize(),
'jobImagePath': data.getJobAbsImagePath(),
+ 'classJobCancel': statusValue === JOB_STATUS_DONE ? 'btnnotactive' : '',
+ 'classJobKsPath': data.getJobHasKsFile() === '0' ? 'btnnotactive' : '',
'jobKsPath': data.getJobAbsKsPath(),
'jobLogPath': data.getJobAbsLogPath(),
'jobUptime': data.getJobUptime()
'jobImageName': data.getJobImageName(),
'jobImageSize': data.getJobImageSize(),
'jobImagePath': data.getJobAbsImagePath(),
+ 'classJobCancel': statusValue === JOB_STATUS_DONE ? 'btnnotactive' : '',
+ 'classJobKsPath': data.getJobHasKsFile() === '0' ? 'btnnotactive' : '',
'jobKsPath': data.getJobAbsKsPath(),
'jobLogPath': data.getJobAbsLogPath(),
'jobUptime': data.getJobUptime()