Browse Source

cleanup + drilldown

Signed-off-by: Thomas Evans <tevans3@icloud.com>
jjarrett21 2 năm trước cách đây
mục cha
commit
6c16a0caa6

+ 2 - 2
ui/src/CloudCostReports.js

@@ -124,7 +124,7 @@ const CloudCostReports = () => {
             },
           ]);
         }
-        // setCloudCostData([]);
+        setCloudCostData([]);
       }
     } catch (err) {
       if (err.message.indexOf("404") === 0) {
@@ -148,7 +148,7 @@ const CloudCostReports = () => {
           },
         ]);
       }
-      // setCloudCostData([]);
+      setCloudCostData([]);
     }
     setLoading(false);
   }

+ 0 - 1
ui/src/components/Nav/NavItem.js

@@ -49,7 +49,6 @@ const NavItem = ({ active, href, name, onClick, secondary, title, icon }) => {
       className={active ? "active" : ""}
       classes={{ root: classes.root }}
       onClick={(e) => {
-        console.log("click");
         if (onClick) {
           onClick();
           e.stopPropagation();

+ 5 - 8
ui/src/services/cloudCostTop.js

@@ -16,20 +16,17 @@ class CloudCostTopService {
       filters,
     };
 
-    if (aggregate.includes("Item")) {
-      console.log("here");
-      console.log(aggregate);
-      const resp = await fetch(
+    if (aggregate.includes("item")) {
+      const resp = await axios.get(
         `${
           this.BASE_URL
         }/model/cloudCost/top?window=${window}&costMetric=${costMetric}${getCloudFilters(
           filters
         )}`
       );
-      const result_2 = await Promise.resolve(resp.data.json());
-      const whatData = formatSampleItemsForGraph(result_2);
-      console.log(whatData);
-      return formatSampleItemsForGraph(result_2);
+      const result_2 = await resp.data;
+
+      return { data: formatSampleItemsForGraph(result_2) };
     }
 
     const result = await axios.get(`${this.BASE_URL}/model/cloudCost/view`, {