K0K0V0K commented on code in PR #7330:
URL: https://github.com/apache/hadoop/pull/7330#discussion_r1930679041


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/get-from-map.js:
##########
@@ -0,0 +1,36 @@
+import Ember from 'ember';
+
+
+function getNestedValue(obj, path) {
+  return path.split('.').reduce((acc, key) => {
+    if (acc === null || acc === undefined) {
+      return undefined;
+    }
+
+    // Handle array indexing within the partition map
+    const arrayMatch = key.match(/(\w+)\[(\d+)\]/);

Review Comment:
   NIT: maybe an example input as comment what is matching with this can be 
helpful



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/partition-usage.hbs:
##########
@@ -0,0 +1,40 @@
+
+<div class="row">
+  <div class="col-md-12 container-fluid">
+    <div class="panel panel-default queue-page-breadcrumb" 
id="partition-usage-container">
+      <div class="panel-heading">
+        {{model.firstObject.type}} scheduler - Partition usage overview
+     </div>
+     <div class="flex">
+        {{log module.exports}}
+        {{#if (eq model.firstObject.type "capacity")}}
+
+        <table class="table table-striped table-bordered active-user-table">
+          <thead>
+            <tr>
+              <th>Partition Name</th>
+              <th>Resource Used from the Partition</th>
+              <th>Total Resource in the Partition</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr style="display: none">
+            </tr>
+            {{#each model.firstObject.partitions as |part|}}
+            <tr>
+              <td>{{part}}</td>
+              <td>{{getFromMap map=model.firstObject.partitionMap key=part 
parameter="usedCapacity" }}%</td>

Review Comment:
   by any chance, what do you think, can we display other resources (like FPGA) 
here? Or that would be a to much change?



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/partition-usage.hbs:
##########
@@ -0,0 +1,40 @@
+
+<div class="row">
+  <div class="col-md-12 container-fluid">
+    <div class="panel panel-default queue-page-breadcrumb" 
id="partition-usage-container">
+      <div class="panel-heading">
+        {{model.firstObject.type}} scheduler - Partition usage overview
+     </div>
+     <div class="flex">
+        {{log module.exports}}
+        {{#if (eq model.firstObject.type "capacity")}}
+
+        <table class="table table-striped table-bordered active-user-table">
+          <thead>
+            <tr>
+              <th>Partition Name</th>
+              <th>Resource Used from the Partition</th>
+              <th>Total Resource in the Partition</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr style="display: none">

Review Comment:
   ```suggestion
               <tr style="display: none;">
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to