Skip to content

Commit

Permalink
Added last Accessed Time column to dataset list
Browse files Browse the repository at this point in the history
  • Loading branch information
datasetutil committed Sep 21, 2016
1 parent 892df9d commit 7fbeff0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void init(String[] args, boolean join) throws Exception {
server.start();
} catch (BindException e) {
System.out.println("\n\t\t**************************************************");
System.out.println("Cannot start Datsetutils,maybe datasetutils is already running");
System.out.println("\tCannot start server. Maybe datasetUtils is already running");
System.out.println("\t\t**************************************************\n");
//e.printStackTrace();
throw e;
Expand Down
14 changes: 10 additions & 4 deletions src/main/webapp/finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,16 @@


<div class="container-fluid">
<div id="header" class="row">&nbsp;</div>
<div id="title2" class="row"></div>
<div id="header" class="row">
<div class="col-md-11"></div>
<div id="header-count" class="col-md-1 label label-primary text-right">&nbsp;</div>
</div>
</div>

<div class="container-fluid">
<div id="title2" class="row"></div>
</div>

<div class="container-fluid">

<div class="table-responsive">
Expand All @@ -82,8 +88,8 @@
<th style="width:20%" class="hidden-phone">App</th>
<th style="width:15%" class="hidden-phone">Modified By</th>
<th style="width:15%" class="hidden-phone">Modified Date</th>
<th style="width:10%" class="hidden-phone">Status</th>
<th style="width:10%" class="hidden-phone">Actions</th>
<th style="width:15%" class="hidden-phone">Access Date</th>
<th style="width:5%" class="hidden-phone">Actions</th>
</tr>
</thead>
<tbody id="result-body">
Expand Down
12 changes: 9 additions & 3 deletions src/main/webapp/js/finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $(document).ready(function() {
function listDatasets(){
$.getJSON('list?type=datasetAndApps&current=true',{},function(data){
if (typeof data !== 'undefined' && data.length > 0) {
$("#header-count").text('Dataset Count: '+data.length);
printTable(data);
}else
{
Expand Down Expand Up @@ -62,6 +63,13 @@ function deleteDataset(datasetAlias,datasetId){
buttonClass = buttonClass + " disabled";
}

var lastAccessed = "n/a";
if(data[i]._lastAccessed>0)
{
lastAccessed = new Date(data[i]._lastAccessed).toLocaleString();
}


var tablerow = "<td> \
<a href=\"csvpreview.html?type=dataset&name="+data[i]._alias+ "&datasetId=" + data[i]._uid + "&datasetVersion=" + data[i].edgemartData._uid+"\"><span class=\"name\">"+data[i].name+"</span></a> \
</td> \
Expand All @@ -70,9 +78,7 @@ function deleteDataset(datasetAlias,datasetId){
<span class=\"name\">"+data[i]._createdBy.name+"</span> \
</td> \
<td class=\"hidden-phone\">"+new Date(data[i].edgemartData._createdDateTime).toLocaleString()+"</td> \
<td class=\"hidden-phone\"> \
<span class=\"label label label-success\">Current</span> \
</td> \
<td class=\"hidden-phone\">"+lastAccessed+"</td> \
<td class=\"hidden-phone\"> \
<div class=\"btn-group\"> \
<button data-toggle=\"dropdown\" class=\""+buttonClass+"\" data-original-title=\"\" title=\"\"> \
Expand Down

0 comments on commit 7fbeff0

Please sign in to comment.