-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
17,956 additions
and
7,148 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
Large diffs are not rendered by default.
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
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,7 @@ | ||
{ | ||
"@quasar/testing-unit-vitest": { | ||
"options": [ | ||
"ui" | ||
] | ||
} | ||
} |
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,13 @@ | ||
import axios from "axios"; | ||
|
||
import type { AlertTemplate } from "@/types/alerts"; | ||
|
||
export async function saveAlertTemplate(id: number, payload: AlertTemplate) { | ||
const { data } = await axios.put(`alerts/templates/${id}/`, payload); | ||
return data; | ||
} | ||
|
||
export async function addAlertTemplate(payload: AlertTemplate) { | ||
const { data } = await axios.post("alerts/templates/", payload); | ||
return data; | ||
} |
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,105 @@ | ||
import axios from "axios"; | ||
|
||
import type { URLAction, URLActionRunResponse } from "@/types/core/urlactions"; | ||
import type { AutomatedTask } from "@/types/tasks"; | ||
|
||
const baseUrl = "/core"; | ||
|
||
export async function fetchDashboardInfo(params = {}) { | ||
const { data } = await axios.get(`${baseUrl}/dashinfo/`, { params: params }); | ||
return data; | ||
} | ||
|
||
export async function fetchCustomFields(params = {}) { | ||
try { | ||
const { data } = await axios.get(`${baseUrl}/customfields/`, { | ||
params: params, | ||
}); | ||
return data; | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
} | ||
|
||
export async function fetchURLActions(params = {}) { | ||
const { data } = await axios.get(`${baseUrl}/urlaction/`, { | ||
params: params, | ||
}); | ||
return data; | ||
} | ||
|
||
export async function saveURLAction(action: URLAction) { | ||
const { data } = await axios.post(`${baseUrl}/urlaction/`, action); | ||
return data; | ||
} | ||
|
||
export async function editURLAction(id: number, action: URLAction) { | ||
const { data } = await axios.put(`${baseUrl}/urlaction/${id}/`, action); | ||
return data; | ||
} | ||
|
||
export async function removeURLAction(id: number) { | ||
const { data } = await axios.delete(`${baseUrl}/urlaction/${id}/`); | ||
return data; | ||
} | ||
|
||
export async function runURLAction(id: number): Promise<URLActionRunResponse> { | ||
const { data } = await axios.post(`${baseUrl}/urlaction/${id}/run/`); | ||
return data; | ||
} | ||
|
||
export async function fetchServerTasks(params = {}): Promise<AutomatedTask[]> { | ||
const { data } = await axios.get(`${baseUrl}/servertasks/`, { | ||
params: params, | ||
}); | ||
return data; | ||
} | ||
|
||
export async function saveServerTask(action: AutomatedTask) { | ||
const { data } = await axios.post(`${baseUrl}/servertasks/`, action); | ||
return data; | ||
} | ||
|
||
export async function editServerTask(id: number, action: AutomatedTask) { | ||
const { data } = await axios.put(`${baseUrl}/servertasks/${id}/`, action); | ||
return data; | ||
} | ||
|
||
export async function removeServerTask(id: number) { | ||
const { data } = await axios.delete(`${baseUrl}/servertasks/${id}/`); | ||
return data; | ||
} | ||
|
||
export interface ServerScriptResponse { | ||
output: string; | ||
execution_time: number; | ||
} | ||
|
||
export async function runServerTask(id: number): Promise<ServerScriptResponse> { | ||
const { data } = await axios.post(`${baseUrl}/servertasks/${id}/run/`); | ||
return data; | ||
} | ||
|
||
export interface ServerScriptRunRequest { | ||
timeout: number; | ||
env_vars: string[]; | ||
args: string[]; | ||
} | ||
|
||
export async function runServerScript( | ||
id: number, | ||
payload: ServerScriptRunRequest, | ||
): Promise<string> { | ||
const { data } = await axios.post( | ||
`${baseUrl}/serverscript/${id}/run/`, | ||
payload, | ||
); | ||
return data; | ||
} | ||
|
||
// TODO: Build out type for openai payload | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export async function generateScript(payload: any) { | ||
const { data } = await axios.post(`${baseUrl}/openai/generate/`, payload); | ||
return data; | ||
} |
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,11 @@ | ||
import { boot } from "quasar/wrappers"; | ||
import { createPinia } from "pinia"; | ||
|
||
export default boot(({ app }) => { | ||
const pinia = createPinia(); | ||
|
||
app.use(pinia); | ||
|
||
// You can add Pinia plugins here | ||
// pinia.use(SomePiniaPlugin) | ||
}); |
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.