-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#73 Graph MVP
- Loading branch information
Showing
67 changed files
with
1,241 additions
and
111 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,5 @@ | ||
import { urls } from './urls'; | ||
|
||
export const getDataByDataTypeName = (dataTypeName: string): Promise<Response> => { | ||
return fetch(urls.getDataByDataTypeName(dataTypeName)); | ||
}; |
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,18 @@ | ||
import { urls } from './urls'; | ||
|
||
/** | ||
* Fetches all runs from the server | ||
* @returns A promise containing the response from the server | ||
*/ | ||
export const getAllRuns = (): Promise<Response> => { | ||
return fetch(urls.getAllRuns()); | ||
}; | ||
|
||
/** | ||
* Fetches the run with the given id | ||
* @param id The id of the run to request | ||
* @returns The requested run | ||
*/ | ||
export const getRunById = (id: number): Promise<Response> => { | ||
return fetch(urls.getRunById(id)); | ||
}; |
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,12 +1,27 @@ | ||
const baseURL = 'http://localhost:8000'; | ||
import { environment } from 'src/environment/environment'; | ||
|
||
const baseURL = environment.url; | ||
|
||
/* Nodes */ | ||
const getAllNodes = `${baseURL}/nodes`; | ||
const getAllNodes = () => `${baseURL}/nodes`; | ||
|
||
/* Systems */ | ||
const getAllSystems = `${baseURL}/systems`; | ||
const getAllSystems = () => `${baseURL}/systems`; | ||
|
||
/* Data */ | ||
const getDataByDataTypeName = (dataTypeName: string) => `${baseURL}/data/${dataTypeName}`; | ||
|
||
/* Runs */ | ||
const getRunById = (id: number) => `${baseURL}/runs/${id}`; | ||
const getAllRuns = () => `${baseURL}/runs`; | ||
|
||
export const urls = { | ||
getAllNodes, | ||
getAllSystems | ||
|
||
getAllSystems, | ||
|
||
getDataByDataTypeName, | ||
|
||
getAllRuns, | ||
getRunById | ||
}; |
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
Oops, something went wrong.