mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haosdent huang <haosd...@apache.org>
Subject Re: Review Request 60370: Updated agent webui page to display allocated resources per each role.
Date Mon, 03 Jul 2017 18:27:42 GMT


> On June 27, 2017, 5:33 p.m., haosdent huang wrote:
> > src/webui/master/static/js/controllers.js
> > Lines 604 (patched)
> > <https://reviews.apache.org/r/60370/diff/2/?file=1764203#file1764203line604>
> >
> >     `ng-repeat` support map, have you try
> >     
> >     ```
> >     ng-repeat="(role, reservation) in $data"
> >     ```
> 
> Andrei Budnik wrote:
>     If I change this:
>     ```html
>             <tr ng-repeat="reservation in $data">
>               <td>{{reservation.role}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].cpus
| number) || 0}} / {{reservation.cpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].gpus
| number) || 0}} / {{reservation.gpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].mem *
(1024 * 1024) | dataSize) || 0}} / {{reservation.mem * (1024 * 1024) | dataSize}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].disk
* (1024 * 1024) | dataSize) || 0}} / {{reservation.disk * (1024 * 1024) | dataSize}}</td>
>             </tr>
>     ```
>     to that:
>     ```html
>             <tr ng-repeat="(role, reservation) in $data">
>               <td>{{role}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].cpus
| number) || 0}} / {{reservation.cpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].gpus
| number) || 0}} / {{reservation.gpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].mem *
(1024 * 1024) | dataSize) || 0}} / {{reservation.mem * (1024 * 1024) | dataSize}}</td>
>               <td>{{(state.reserved_resources_allocated[reservation.role].disk
* (1024 * 1024) | dataSize) || 0}} / {{reservation.disk * (1024 * 1024) | dataSize}}</td>
>             </tr>
>     ```
>     Then it will look like in the [picture](https://reviews.apache.org/r/60370/file/1508/).
> 
> haosdent huang wrote:
>     It is because you convert it from map to arrary at
>     
>     ```
>     $scope.agent.resource_reservations = roles.map
>     ```
>     
>     Have you remove it?
>     
>     I test with 
>     
>     ```
>           <li ng-repeat='(role, reservation) in {"role1": {}}'>
>             <span>{{role}}</span>
>           </li>
>     ```
>     
>     and work for me.
> 
> Andrei Budnik wrote:
>     Yeah, I can use this code:
>     ```html
>             <tr ng-repeat="(role, reservation) in state.reserved_resources">
>               <td>{{role}}</td>
>               <td>{{(state.reserved_resources_allocated[role].cpus || 0) | number}}
/ {{reservation.cpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[role].gpus || 0) | number}}
/ {{reservation.gpus | number}}</td>
>               <td>{{(state.reserved_resources_allocated[role].mem * (1024 * 1024)
|| 0) | dataSize}} / {{reservation.mem * (1024 * 1024) | dataSize}}</td>
>               <td>{{(state.reserved_resources_allocated[role].disk * (1024 * 1024)
|| 0) | dataSize}} / {{reservation.disk * (1024 * 1024) | dataSize}}</td>
>             </tr>
>     ```
>     but filter becomes missing, see [picture](https://reviews.apache.org/r/60370/file/1509/).

I see, it is because datatable don't support map. so it would hide filter.


- haosdent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60370/#review178996
-----------------------------------------------------------


On June 28, 2017, 8:52 p.m., Andrei Budnik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60370/
> -----------------------------------------------------------
> 
> (Updated June 28, 2017, 8:52 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and haosdent huang.
> 
> 
> Bugs: MESOS-6441
>     https://issues.apache.org/jira/browse/MESOS-6441
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Updated agent webui page to display allocated resources per each role.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/agent.html 71e5e702e5e64e6f46c84791247aa5156c046ed9 
>   src/webui/master/static/js/controllers.js 67bfd030649dd21840c16188a4964f814aa232d7

> 
> 
> Diff: https://reviews.apache.org/r/60370/diff/3/
> 
> 
> Testing
> -------
> 
> See screenshot.
> 
> 
> File Attachments
> ----------------
> 
> agent.html
>   https://reviews.apache.org/media/uploaded/files/2017/06/22/66cc61b4-04c8-451e-a434-58f556397724__Resource_Reservations.png
> ui_bug
>   https://reviews.apache.org/media/uploaded/files/2017/06/28/1b7755e3-0b11-46ab-9ae4-71f19bce0cd6__ui_bug.png
> ui_bug2
>   https://reviews.apache.org/media/uploaded/files/2017/06/28/b89990c9-9aa5-432a-a0da-3f90c9428127__ui_bug2.png
> ui_bug3
>   https://reviews.apache.org/media/uploaded/files/2017/06/28/51553e9d-7fb9-40c0-b47c-b62fc6c37393__ui_bug3.png
> 
> 
> Thanks,
> 
> Andrei Budnik
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message