Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlauer-Hax committed Aug 12, 2024
2 parents 73cb997 + 7166e08 commit f16a3e1
Show file tree
Hide file tree
Showing 48 changed files with 130 additions and 143 deletions.
4 changes: 4 additions & 0 deletions assets/css/music.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ nav.music {
nav.music {
background: linear-gradient(166deg, #F19D2D 6.59%, #db7621 101.73%);
}
}

div.navigation>div.vertical-stack {
gap: unset !important;
}
2 changes: 1 addition & 1 deletion components/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { delay } from "@std/async";
import { API } from "shared/mod.ts";
import { BasicLabel, Box, Button, ButtonStyle, Component, createElement, Custom, Empty, Grid, Horizontal, Image, Label, LinkButton, MIcon, Spacer, Vertical } from "webgen/mod.ts";
import { Popover } from "webgen/src/components/Popover.ts";
import { activeUser, IsLoggedIn, permCheck, showProfilePicture } from "../pages/_legacy/helper.ts";
import { activeUser, IsLoggedIn, permCheck, showProfilePicture } from "../pages/shared/helper.ts";
import "./nav.css";
import { activeTitle, pages } from "./pages.ts";

Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@std/path": "jsr:@std/path@^0.225.2",
"shared/": "./pages/shared/",
// "webgen/": "../WebGen/"
"webgen/": "https://raw.githubusercontent.com/lucsoft/WebGen/e46dd0c/"
"webgen/": "https://raw.githubusercontent.com/lucsoft/WebGen/2a09549/"
},
"lock": false,
"compilerOptions": {
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/admin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Body, Vertical, WebGen } from "webgen/mod.ts";
import "../../assets/css/main.css";
import { DynaNavigation } from "../../components/nav.ts";
import { changeThemeColor, permCheck, RegisterAuthRefresh, renewAccessTokenIfNeeded, sheetStack } from "../_legacy/helper.ts";
import { changeThemeColor, permCheck, RegisterAuthRefresh, renewAccessTokenIfNeeded, sheetStack } from "../shared/helper.ts";
import "./admin.css";
import { refreshState } from "./loading.ts";
import { adminMenu } from "./views/menu.ts";
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { asState, Box, Button, ButtonStyle, CenterV, Checkbox, createElement, cs
import { zod } from "webgen/zod.ts";
import reviewTexts from "../../data/reviewTexts.json" with { type: "json" };
import { Drop, ReviewResponse } from "../../spec/music.ts";
import { sheetStack } from "../_legacy/helper.ts";
import { sheetStack } from "../shared/helper.ts";
import { clientRender, dropPatternMatching, rawTemplate, render } from "./email.ts";

document.adoptedStyleSheets.push(css`
Expand Down
38 changes: 18 additions & 20 deletions pages/admin/review.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { API, createActionList, createBreadcrumb, createTagList, LoadingSpinner, Navigation, stupidErrorAlert } from "shared/mod.ts";
import { Body, Button, ButtonStyle, Color, Empty, Entry, Grid, Horizontal, isMobile, Label, Spacer, Vertical, WebGen } from "webgen/mod.ts";
import { BasicLabel, Body, Button, ButtonStyle, Color, Empty, Entry, Grid, Horizontal, isMobile, Label, Spacer, Vertical, WebGen } from "webgen/mod.ts";
import "../../assets/css/main.css";
import "../../assets/css/music.css";
import { DynaNavigation } from "../../components/nav.ts";
import { changeThemeColor, permCheck, RegisterAuthRefresh, renewAccessTokenIfNeeded, saveBlob, sheetStack, showPreviewImage, showProfilePicture } from "../_legacy/helper.ts";
import { ChangeDrop } from "../_legacy/music/changeDrop.ts";
import { ChangeSongs } from "../_legacy/music/changeSongs.ts";
import { ChangeDrop } from "../music/views/changeDrop.ts";
import { ChangeSongs } from "../music/views/changeSongs.ts";
import { DropTypeToText } from "../music/views/list.ts";
import { changeThemeColor, permCheck, RegisterAuthRefresh, renewAccessTokenIfNeeded, saveBlob, sheetStack, showPreviewImage, showProfilePicture } from "../shared/helper.ts";
import { ApproveDialog, DeclineDialog, dialogState } from "./dialog.ts";
import { reviewState } from "./state.ts";
import { changeState, changeTypeDialog } from "./views/entryReview.ts";
Expand Down Expand Up @@ -59,17 +59,17 @@ sheetStack.setDefault(Vertical(
: LoadingSpinner()
).asRefComponent(),
)
.setCssStyle("border", "solid").setGap().setBorderRadius("tiny"),
.setMaxHeight("calc(100vh - 53px)")
.setCssStyle("overflow", "auto")
.setCssStyle("border", "solid")
.setGap()
.setBorderRadius("tiny"),
reviewState.$drop.map((drop) =>
drop
? Navigation({
title: drop.title,
children: [
Horizontal(
//TODO: Make this look better
Label(DropTypeToText(drop.type)).setTextSize("2xl"),
Spacer(),
),
Label(DropTypeToText(drop.type)).setTextSize("2xl"),
{
id: "edit-drop",
title: "Drop",
Expand Down Expand Up @@ -104,13 +104,7 @@ sheetStack.setDefault(Vertical(
.setHeader((menu) =>
isMobile.map((mobile) => {
const list = Vertical(
menu.path.map((x) =>
x == "-/"
? Grid(
showPreviewImage(drop).addClass("image-preview"),
).setEvenColumns(1, "10rem")
: Empty()
).asRefComponent(),
menu.path.map((x) => x == "-/" ? Grid(showPreviewImage(drop).addClass("image-preview")).setEvenColumns(1, "10rem") : Empty()).asRefComponent(),
createBreadcrumb(menu),
createTagList(menu),
).setGap();
Expand All @@ -124,9 +118,9 @@ sheetStack.setDefault(Vertical(
}).asRefComponent()
)
: LoadingSpinner()
).asRefComponent().setJustifyItems("center").setAlignItems("center"),
).asRefComponent(),
Vertical(
Label("Drop History", "h1").setTextAlign("center"),
BasicLabel({ title: "", subtitle: "Drop History" }),
reviewState.$drop.map((drop) =>
drop
? Vertical(
Expand Down Expand Up @@ -171,7 +165,11 @@ sheetStack.setDefault(Vertical(
ApproveDialog.setOnClose(() => refreshReviewState());
}),
).setGap(),
).setCssStyle("border", "solid").setBorderRadius("tiny"),
)
.setMaxHeight("calc(100vh - 53px)")
.setCssStyle("overflow", "auto")
.setCssStyle("border", "solid")
.setBorderRadius("tiny"),
)
.setGap()
.setRawColumns("1fr 3fr 1fr"),
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { External } from "shared/mod.ts";
import { asState } from "webgen/mod.ts";
import { Drop, File, Group, OAuthApp, Payout, Server, Transcript, Wallet } from "../../spec/music.ts";
import { ProfileData } from "../_legacy/helper.ts";
import { ProfileData } from "../shared/helper.ts";

export const state = asState({
drops: {
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/views/entryReview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { API } from "shared/mod.ts";
import { asState, Button, ButtonStyle, Color, DropDownInput, Entry, Horizontal, SheetDialog, Spacer, Vertical } from "webgen/mod.ts";
import { Drop, DropType } from "../../../spec/music.ts";
import { sheetStack, showPreviewImage } from "../../_legacy/helper.ts";
import { sheetStack, showPreviewImage } from "../../shared/helper.ts";

export function ReviewEntry(x: Drop) {
return Entry({
Expand Down
12 changes: 6 additions & 6 deletions pages/admin/views/list.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { API, External, fileCache, RenderItem, stupidErrorAlert } from "shared/mod.ts";
import { Box, Button, Cache, Color, Entry, Grid, Horizontal, IconButton, Image, MIcon, ref, SheetDialog, Spacer, TextInput, Vertical } from "webgen/mod.ts";
import { asRef, Box, Button, Cache, Color, Entry, Grid, Horizontal, IconButton, Image, MIcon, ref, SheetDialog, Spacer, TextInput, Vertical } from "webgen/mod.ts";
import { templateArtwork } from "../../../assets/imports.ts";
import { File, OAuthApp, Transcript, Wallet } from "../../../spec/music.ts";
import { saveBlob, sheetStack } from "../../_legacy/helper.ts";
import { saveBlob, sheetStack } from "../../shared/helper.ts";
import { state } from "../state.ts";

export function entryWallet(wallet: Wallet) {
Expand Down Expand Up @@ -73,10 +73,10 @@ const oAuthViewDialog = (oauth: OAuthApp) =>
"OAuth App Details",
Vertical(
Grid(
TextInput("text", "Name").setValue(oauth.name).setColor(Color.Disabled),
TextInput("text", "Client ID").setValue(oauth._id).setColor(Color.Disabled),
TextInput("text", "Client Secret").setValue(oauth.secret).setColor(Color.Disabled),
TextInput("text", "Redirect URI").setValue(oauth.redirect.join(",")).setColor(Color.Disabled),
TextInput("text", "Name").ref(asRef(oauth.name)).setColor(Color.Disabled),
TextInput("text", "Client ID").ref(asRef(oauth._id)).setColor(Color.Disabled),
TextInput("text", "Client Secret").ref(asRef(oauth.secret)).setColor(Color.Disabled),
TextInput("text", "Redirect URI").ref(asRef(oauth.redirect.join(","))).setColor(Color.Disabled),
),
Horizontal(
Spacer(),
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/views/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const addOAuthDialog = SheetDialog(
Table([
["URI", "auto", (_, index) =>
TextInput("text", "URI", "blur")
.setValue(x[index])
.ref(asRef(x[index]))
.onChange((data) => {
x[index] = data ?? "";
})],
Expand Down
2 changes: 1 addition & 1 deletion pages/holding/distributionAgreement.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Footer } from "shared/footer.ts";
import { Body, Box, Label, WebGen } from "webgen/mod.ts";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./flowText.css";
WebGen();
await RegisterAuthRefresh();
Expand Down
2 changes: 1 addition & 1 deletion pages/holding/imprint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Footer } from "shared/footer.ts";
import { Body, Box, ButtonStyle, Horizontal, Label, LinkButton, Spacer, WebGen } from "webgen/mod.ts";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./flowText.css";
WebGen();
await RegisterAuthRefresh();
Expand Down
2 changes: 1 addition & 1 deletion pages/holding/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Body, Box, Grid, Image, Label, LinkButton, Vertical, WebGen } from "webgen/mod.ts";
import "../../assets/css/main.css";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./landing.css";
import { data, streamingPool } from "./loading.ts";
// Main
Expand Down
2 changes: 1 addition & 1 deletion pages/holding/privacyPolicy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Footer } from "shared/footer.ts";
import { Body, Box, Label, WebGen } from "webgen/mod.ts";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./flowText.css";
WebGen();
await RegisterAuthRefresh();
Expand Down
2 changes: 1 addition & 1 deletion pages/holding/termsOfUse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Footer } from "shared/footer.ts";
import { Body, Box, Label, WebGen } from "webgen/mod.ts";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./flowText.css";
WebGen();
await RegisterAuthRefresh();
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/dialogs/deleteFileDialog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Button, Color, Grid, Label, SheetDialog, Vertical } from "webgen/mod.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";

export function deleteFileDialog() {
const response = Promise.withResolvers<boolean>();
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/dialogs/deleteServerDialog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API, stupidErrorAlert } from "shared/restSpec.ts";
import { Button, ButtonStyle, Color, Grid, Label, SheetDialog } from "webgen/mod.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";

export const deleteServerDialog = (serverId: string) => {
const sheet = SheetDialog(
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/dialogs/editFileDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { editor } from "https://esm.sh/[email protected]/esm/vs/editor/editor

import { delay } from "@std/async";
import { asRef, Box, Button, Cache, Color, Custom, Grid, Label, lazy, MIcon, refMerge, SheetDialog, Vertical } from "webgen/mod.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";
import { uploadFile } from "../loading.ts";
import "./editFileDialog.css";

Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/dialogs/editServerDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { asState, Button, ButtonStyle, Color, DropDownInput, Grid, isMobile, Lab
import locations from "../../../data/locations.json" with { type: "json" };
import serverTypes from "../../../data/servers.json" with { type: "json" };
import { Server } from "../../../spec/music.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";
import { MB, state } from "../data.ts";

export const editServerDialog = (server: Server, versions: string[]) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/dialogs/forceRestartDialog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API, stupidErrorAlert } from "shared/restSpec.ts";
import { Button, ButtonStyle, Color, Grid, Label, SheetDialog } from "webgen/mod.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";

export const forceRestartDialog = (serverId: string) => {
const sheet = SheetDialog(
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { API, ProgressTracker } from "shared/mod.ts";
import { createStableWebSocket } from "webgen/extended.ts";
import { asRef, asState, lazy, Reference } from "webgen/mod.ts";
import { Deferred, InstalledAddon, Server, SidecarRequest, SidecarResponse } from "../../spec/music.ts";
import { activeUser, tokens } from "../_legacy/helper.ts";
import { activeUser, tokens } from "../shared/helper.ts";
import { state } from "./data.ts";
import { canWriteInFolder, currentFiles } from "./views/state.ts";

Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { API, stupidErrorAlert } from "shared/restSpec.ts";
import { asState, Body, Vertical, WebGen } from "webgen/mod.ts";
import "../../assets/css/main.css";
import { DynaNavigation } from "../../components/nav.ts";
import { changeThemeColor, RegisterAuthRefresh, renewAccessTokenIfNeeded, sheetStack } from "../_legacy/helper.ts";
import { changeThemeColor, RegisterAuthRefresh, renewAccessTokenIfNeeded, sheetStack } from "../shared/helper.ts";
import { state } from "./data.ts";
import { listFiles, liveUpdates, refreshState, startSidecarConnection } from "./loading.ts";
import { hostingMenu } from "./views/menu.ts";
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/views/FileBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createDownloadStream } from "shared/libs/streamSaver.ts";
import { Progress, ProgressTracker, Table2 } from "shared/mod.ts";
import { asRef, BasicLabel, BIcon, Box, Button, ButtonStyle, Color, Empty, Entry, Grid, IconButton, Label, MIcon, ref, refMerge, SheetDialog } from "webgen/mod.ts";
import { SidecarResponse } from "../../../spec/music.ts";
import { sheetStack } from "../../_legacy/helper.ts";
import { sheetStack } from "../../shared/helper.ts";
import { mapFiletoIcon } from "../constants.ts";
import { deleteFileDialog } from "../dialogs/deleteFileDialog.ts";
import { editFileDialog, editFileLanguage, editFilePath, editFileReadOnly, editFilestreamingText } from "../dialogs/editFileDialog.ts";
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/views/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "../../../assets/css/hosting.css";
import "../../../assets/css/main.css";
import { DynaNavigation } from "../../../components/nav.ts";
import { ServerTypes } from "../../../spec/music.ts";
import { RegisterAuthRefresh, renewAccessTokenIfNeeded } from "../../_legacy/helper.ts";
import { RegisterAuthRefresh, renewAccessTokenIfNeeded } from "../../shared/helper.ts";
import { refreshState } from "../loading.ts";
import { creationState, state } from "./../data.ts";
import { creationView } from "./wizard.ts";
Expand Down
2 changes: 1 addition & 1 deletion pages/hosting/views/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { templateArtwork } from "../../../assets/imports.ts";
import locations from "../../../data/locations.json" with { type: "json" };
import serverTypes from "../../../data/servers.json" with { type: "json" };
import { AuditTypes, InstalledAddon, Server, ServerAudit, ServerTypes } from "../../../spec/music.ts";
import { activeUser, ProfileData, showProfilePicture } from "../../_legacy/helper.ts";
import { activeUser, ProfileData, showProfilePicture } from "../../shared/helper.ts";
import { state } from "../data.ts";
import { deleteServerDialog } from "../dialogs/deleteServerDialog.ts";
import { editServerDialog } from "../dialogs/editServerDialog.ts";
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/music-landing/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Footer } from "shared/footer.ts";
import { Body, Box, Button, Color, Content, Empty, FullWidthSection, Grid, Image, Label, LinkButton, mediaQueryRef, MIcon, WebGen } from "webgen/mod.ts";
import { DynaNavigation } from "../../components/nav.ts";
import { RegisterAuthRefresh } from "../_legacy/helper.ts";
import { RegisterAuthRefresh } from "../shared/helper.ts";
import "./main.css";

// @deno-types="https://raw.githubusercontent.com/lucsoft-DevTeam/lucsoft.de/master/custom.d.ts"
Expand Down
Loading

0 comments on commit f16a3e1

Please sign in to comment.