-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from premAI-io/feat/service-details
service detail changes
- Loading branch information
Showing
16 changed files
with
135 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 22 additions & 5 deletions
27
src/modules/service-detail/components/ServiceResourceBars.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AxiosResponse } from "axios"; | ||
import api from "shared/api/v1"; | ||
import { ServiceStats } from "../types"; | ||
|
||
const getServiceStats = async (id: string): Promise<AxiosResponse<ServiceStats>> => | ||
api.get(`api/v1/stats/${id}`); | ||
|
||
export default getServiceStats; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AxiosResponse } from "axios"; | ||
import api from "shared/api/v1"; | ||
import { Stats } from "../types"; | ||
|
||
const getSystemStats = async (): Promise<AxiosResponse<Stats>> => | ||
api.get("api/v1/stats-all/"); | ||
|
||
export default getSystemStats; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import getService from "modules/service-detail/api/getService"; | ||
|
||
export const SERVICE_KEY = "getService"; | ||
|
||
const useService = (id: string) => { | ||
return useQuery(["getService", id], () => getService(id), { staleTime: 0 }); | ||
return useQuery([SERVICE_KEY, id], () => getService(id)); | ||
}; | ||
|
||
export default useService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import getServiceStats from "modules/service/api/getServiceStats"; | ||
|
||
const useServiceStats = (serviceId: string) => { | ||
return useQuery( | ||
["getServiceStats", serviceId], | ||
() => getServiceStats(serviceId), | ||
{ staleTime: 0 } | ||
); | ||
}; | ||
|
||
export default useServiceStats; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import getSystemStats from "modules/service/api/getSystemStats"; | ||
|
||
const useSystemStats = () => { | ||
return useQuery(["getSystemStats"], getSystemStats); | ||
}; | ||
|
||
export default useSystemStats; |