-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(admin): Use Declarative UI (Menu Component)
- Loading branch information
Showing
17 changed files
with
335 additions
and
415 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
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,58 @@ | ||
import { State, UploadFilesDialog } from "webgen/mod.ts"; | ||
import { API } from "../manager/RESTSpec.ts"; | ||
import { state } from "./state.ts"; | ||
import { StreamingUploadHandler } from "../manager/upload.ts"; | ||
import { delay } from "https://deno.land/std@0.182.0/async/delay.ts"; | ||
|
||
export async function refreshState() { | ||
state.reviews = State(await API.music(API.getToken()).reviews.get()); | ||
state.users = State(await API.user(API.getToken()).list.get()); | ||
state.payouts = State(await API.music(API.getToken()).payouts.get()); | ||
} | ||
|
||
|
||
export function upload(type: "isrc" | "manual") { | ||
if (type == "manual") { | ||
UploadFilesDialog((list) => { | ||
console.log(list); | ||
StreamingUploadHandler(`music/payout/upload`, { | ||
failure: () => { | ||
//state.loading = false; | ||
alert("Your Upload has failed. Please try a different file or try again later"); | ||
}, | ||
uploadDone: () => { | ||
console.log("Upload done"); | ||
}, | ||
credentials: () => API.getToken(), | ||
backendResponse: (id) => { | ||
console.log(id); | ||
}, | ||
onUploadTick: async (percentage) => { | ||
console.log(percentage); | ||
await delay(2); | ||
} | ||
}, list[ 0 ].file); | ||
}, '.xlsx'); | ||
} else { | ||
UploadFilesDialog((list) => { | ||
console.log(list); | ||
StreamingUploadHandler(`music/payout/isrcsync`, { | ||
failure: () => { | ||
//state.loading = false; | ||
alert("Your Upload has failed. Please try a different file or try again later"); | ||
}, | ||
uploadDone: () => { | ||
console.log("Upload done"); | ||
}, | ||
credentials: () => API.getToken(), | ||
backendResponse: (id) => { | ||
console.log(id); | ||
}, | ||
onUploadTick: async (percentage) => { | ||
console.log(percentage); | ||
await delay(2); | ||
} | ||
}, list[ 0 ].file); | ||
}, '.xlsx'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.