Skip to content

Commit

Permalink
Merge pull request #44 from oslabs-beta/newDashboard
Browse files Browse the repository at this point in the history
finish incorporating kubecost url for deployed cluster
  • Loading branch information
alyagraf authored Feb 6, 2023
2 parents bb7ffa8 + bf5fadc commit 7fa2604
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
79 changes: 39 additions & 40 deletions components/dashboard/costComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,50 +114,49 @@ export default function CostComponent({ data }: any) {
getAverages(kubeCostVals);
makeTableVals(refinedData);
return (
<div className="grid h-screen place-items-center bg-slate-900 w-full shadow-inner body ">
<div className=" justify-center items-center flex flex-row ">
<div className="ml-6 relative overflow-x-auto border border-gray-600 rounded-lg">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-6 py-3">
Cost <br />
Category
</th>
<th scope="col" className="px-6 py-3">
Total Cost <br />
per month
// <div className="grid h-screen place-items-center bg-slate-900 w-full shadow-inner body ">
<div className="mx-auto flex flex-row justify-center items-center ">
<div className="ml-6 relative overflow-x-auto border border-gray-600 rounded-lg">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" className="px-6 py-3">
Cost <br />
Category
</th>
<th scope="col" className="px-6 py-3">
Total Cost <br />
per month
</th>
</tr>
</thead>
<tbody>
{tableVals ? (
tableVals
) : (
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th
scope="row"
className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"
>
<h2>
You Need To Connect To Kubecost Before You Can See Expected
Cluster Costs
</h2>
</th>
<td className="px-6 py-4">
<h2>
You Need To Connect To Kubecost Before You Can See Expected
Cluster Costs
</h2>
</td>
</tr>
</thead>
<tbody>
{tableVals ? (
tableVals
) : (
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<th
scope="row"
className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"
>
<h2>
You Need To Connect To Kubecost Before You Can See
Expected Cluster Costs
</h2>
</th>
<td className="px-6 py-4">
<h2>
You Need To Connect To Kubecost Before You Can See
Expected Cluster Costs
</h2>
</td>
</tr>
)}
</tbody>
</table>
</div>
)}
</tbody>
</table>
</div>
<Footer />
</div>
// </div>
);
}

Expand Down
3 changes: 2 additions & 1 deletion components/dashboard/dashboardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ const fetcher = async (url: string) => fetch(url).then((res) => res.json());

export default function DashboardContainer({ props }: any) {
const [clusterType, setClusterType] = useState('deployed');
//http://34.121.148.52:9090/overview
const { data, error, isLoading } = useSWR(
`http://127.0.0.1:9090/model/allocation?window=15d&aggregate=cluster`,
`http://34.121.148.52:9090/model/allocation?window=15d&aggregate=cluster`,
fetcher
);

Expand Down

0 comments on commit 7fa2604

Please sign in to comment.