add image output tab in file manager

This commit is contained in:
Qing
2023-01-07 20:51:05 +08:00
parent a7382807be
commit f1c7f6dc99
8 changed files with 201 additions and 161 deletions

View File

@@ -172,9 +172,9 @@ export async function postInteractiveSeg(
}
}
export async function getMediaFile(filename: string) {
export async function getMediaFile(tab: string, filename: string) {
const res = await fetch(
`${API_ENDPOINT}/media/${encodeURIComponent(filename)}`,
`${API_ENDPOINT}/media/${tab}/${encodeURIComponent(filename)}`,
{
method: 'GET',
}
@@ -188,8 +188,8 @@ export async function getMediaFile(filename: string) {
throw new Error(errMsg)
}
export async function getMedias() {
const res = await fetch(`${API_ENDPOINT}/medias`, {
export async function getMedias(tab: string) {
const res = await fetch(`${API_ENDPOINT}/medias/${tab}`, {
method: 'GET',
})
if (res.ok) {