-
Notifications
You must be signed in to change notification settings - Fork 39
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
1 parent
a0e710a
commit 6e4fc44
Showing
9 changed files
with
85 additions
and
79 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 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
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,12 +1,45 @@ | ||
import { endpoints } from './api-endpoints.js'; | ||
import { replaceUrl } from '$lib/helpers/http.js'; | ||
import axios from 'axios'; | ||
|
||
/** | ||
* Get plugin list | ||
* @returns {Promise<import('$types').PluginDefModel[]>} | ||
*/ | ||
export async function GetPlugins() { | ||
export async function getPlugins() { | ||
let url = endpoints.pluginListUrl; | ||
const response = await axios.get(url); | ||
return response.data; | ||
} | ||
|
||
/** | ||
* Get plugin menu | ||
* @returns {Promise<import('$types').PluginMenuDefModel[]>} | ||
*/ | ||
export async function getPluginMenu() { | ||
let url = endpoints.pluginMenuUrl; | ||
const response = await axios.get(url); | ||
return response.data; | ||
} | ||
|
||
/** | ||
* Enable plugin | ||
* @param {string} id | ||
* @returns {Promise<import('$types').PluginDefModel>} | ||
*/ | ||
export async function enablePlugin(id) { | ||
let url = replaceUrl(endpoints.pluginEnableUrl, {id: id}); | ||
const response = await axios.post(url); | ||
return response.data; | ||
} | ||
|
||
/** | ||
* Disable plugin | ||
* @param {string} id | ||
* @returns {Promise<import('$types').PluginDefModel>} | ||
*/ | ||
export async function disablePlugin(id) { | ||
let url = replaceUrl(endpoints.pluginDisableUrl, {id: id}); | ||
const response = await axios.post(url); | ||
return response.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
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