Browse Source

AMBARI-12814. Ambari Files View: Add Date as a column. (Dipayak Bhowmick via yusaku)

Yusaku Sako 10 years ago
parent
commit
0bfb1ccf32

+ 4 - 0
contrib/views/files/src/main/resources/ui/app/controllers/files.js

@@ -162,6 +162,10 @@ App.FilesController = Ember.ArrayController.extend({
     return this.get('selectedFiles').filterProperty('isDirectory').get('length')===0;
     return this.get('selectedFiles').filterProperty('isDirectory').get('length')===0;
   }.property('selectedFiles.length'),
   }.property('selectedFiles.length'),
 
 
+  isSortPropertyEqualsDate: function() {
+    return this.get('sortProperties').get('firstObject') === 'date';
+  }.property('sortProperties.firstObject'),
+
   searchString:'',
   searchString:'',
   fileList: function () {
   fileList: function () {
     var fileList = this.get('arrangedContent');
     var fileList = this.get('arrangedContent');

+ 9 - 5
contrib/views/files/src/main/resources/ui/app/styles/application.less

@@ -107,24 +107,28 @@
     }
     }
     thead tr th.size {
     thead tr th.size {
       cursor: pointer;
       cursor: pointer;
-      width: 15%;
+      width: 10%;
+    }
+    thead tr th.date {
+      cursor: pointer;
+      width: 20%;
     }
     }
     thead tr th.owner {
     thead tr th.owner {
       cursor: pointer;
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     }
     thead tr th.grp {
     thead tr th.grp {
       cursor: pointer;
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     }
     thead tr th.perm {
     thead tr th.perm {
       cursor: pointer;
       cursor: pointer;
-      width: 15%;
+      width: 10%;
     }
     }
     thead tr th.download {
     thead tr th.download {
       width: 2%;
       width: 2%;
       .btn-group{
       .btn-group{
-        width: 130px;
+        width: 145px;
       }
       }
     }
     }
     thead tr th.check{
     thead tr th.check{

+ 7 - 2
contrib/views/files/src/main/resources/ui/app/templates/files.hbs

@@ -63,6 +63,7 @@
         <th class="icon"></th>
         <th class="icon"></th>
         <th class="path" {{action 'sort' 'name'}}> Name {{sort-arrow sPs=sortProperties sA=sortAscending sP='name'}} </th>
         <th class="path" {{action 'sort' 'name'}}> Name {{sort-arrow sPs=sortProperties sA=sortAscending sP='name'}} </th>
         <th class="size" {{action 'sort' 'size'}}>Size {{sort-arrow sPs=sortProperties sA=sortAscending sP='size'}}</th>
         <th class="size" {{action 'sort' 'size'}}>Size {{sort-arrow sPs=sortProperties sA=sortAscending sP='size'}}</th>
+        <th class="date" {{action 'sort' 'date'}}>Last Modified {{sort-arrow sPs=sortProperties sA=sortAscending sP='date'}}</th>
         <th class="owner" {{action 'sort' 'owner'}}>Owner {{sort-arrow sPs=sortProperties sA=sortAscending sP='owner'}}</th>
         <th class="owner" {{action 'sort' 'owner'}}>Owner {{sort-arrow sPs=sortProperties sA=sortAscending sP='owner'}}</th>
         <th class="grp" {{action 'sort' 'group'}} >Group {{sort-arrow sPs=sortProperties sA=sortAscending sP='group'}}</th>
         <th class="grp" {{action 'sort' 'group'}} >Group {{sort-arrow sPs=sortProperties sA=sortAscending sP='group'}}</th>
         <th class="perm" {{action 'sort' 'permission'}} >Permission {{sort-arrow sPs=sortProperties sA=sortAscending sP='permission'}}</th>
         <th class="perm" {{action 'sort' 'permission'}} >Permission {{sort-arrow sPs=sortProperties sA=sortAscending sP='permission'}}</th>
@@ -74,17 +75,21 @@
 
 
             <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
             <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
               <span>
               <span>
-              {{capitalize sortProperties.firstObject}}
+                {{#if isSortPropertyEqualsDate}}
+                  Last Modified
+                {{else}}
+                  {{capitalize sortProperties.firstObject}}
+                {{/if}}
               </span>
               </span>
               <span class="caret"></span>
               <span class="caret"></span>
             </button>
             </button>
             <ul class="dropdown-menu" role="menu">
             <ul class="dropdown-menu" role="menu">
               <li><a href="#" {{action 'sort' 'name'}} >Name</a></li>
               <li><a href="#" {{action 'sort' 'name'}} >Name</a></li>
               <li><a href="#" {{action 'sort' 'size'}} >Size</a></li>
               <li><a href="#" {{action 'sort' 'size'}} >Size</a></li>
+              <li><a href="#" {{action 'sort' 'date'}} >Last Modified</a></li>
               <li><a href="#" {{action 'sort' 'owner'}} >Owner</a></li>
               <li><a href="#" {{action 'sort' 'owner'}} >Owner</a></li>
               <li><a href="#" {{action 'sort' 'group'}} >Group</a></li>
               <li><a href="#" {{action 'sort' 'group'}} >Group</a></li>
               <li><a href="#" {{action 'sort' 'permission'}} >Permission</a></li>
               <li><a href="#" {{action 'sort' 'permission'}} >Permission</a></li>
-              <li><a href="#" {{action 'sort' 'date'}} >Date</a></li>
             </ul>
             </ul>
           </div>
           </div>
         </th>
         </th>

+ 5 - 5
contrib/views/files/src/main/resources/ui/app/templates/util/fileRow.hbs

@@ -35,17 +35,17 @@
           </a>
           </a>
         </span>
         </span>
       {{/file-shaker}}
       {{/file-shaker}}
-        <span class="help-block mod-time allow-open">
-          <small class='allow-open'>
-            Updated {{showDate modificationTime 'YYYY-MM-DD HH:mm'}}
-          </small>
-        </span>
       </div>
       </div>
     {{/rename-input}}
     {{/rename-input}}
   </td>
   </td>
   <td>
   <td>
     {{#unless content.isDirectory}}{{humanSize content.size}}{{else}}-{{/unless}}
     {{#unless content.isDirectory}}{{humanSize content.size}}{{else}}-{{/unless}}
   </td>
   </td>
+  <td>
+    <small class='allow-open'>
+      {{showDate modificationTime 'YYYY-MM-DD HH:mm'}}
+    </small>
+  </td>
   <td >{{content.owner}}</td>
   <td >{{content.owner}}</td>
   <td>{{content.group}}</td>
   <td>{{content.group}}</td>
   <td class="permission-cell">
   <td class="permission-cell">