Skip to content

Commit

Permalink
Merge pull request #15 from BBN-Holding/gang
Browse files Browse the repository at this point in the history
Gang
  • Loading branch information
greg6775 authored Sep 4, 2023
2 parents f28d27d + b72078d commit 32c39df
Show file tree
Hide file tree
Showing 69 changed files with 1,500 additions and 1,229 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.sass-cache
*.css.map
.DS_Store
dist
deno.lock
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
"*.jsx": "${capture}.js",
"*.tsx": "${capture}.ts",
"tsconfig.json": "tsconfig.*.json",
"package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml",
"deno.jsonc": "deno.lock"
},
"editor.codeActionsOnSave": {
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FROM nginx
COPY dist /usr/share/nginx/html
COPY dist /usr/share/nginx/html
COPY default /etc/nginx/sites-available/default
10 changes: 10 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
--main-color: #37517e;
--bbn-primary: #37517e;
--bbn-secondary: hsla(31, 100%, 66%, 1);
--font: "Twemoji Country Flags", "Red Hat Display", "din alternate", system-ui, optima, avenir;
}

body {
color: var(--on-background-text);
}

@font-face {
font-family: "Twemoji Country Flags";
unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
src: url('https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2') format('woff2');
size-adjust: 90%;
font-display: swap;
}

a.action {
color: var(--main-color);
padding: .5rem 0.65rem;
Expand Down
3 changes: 1 addition & 2 deletions bug-reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ globalThis.onerror = (e) => {
};

function report(msg: any) {
if (msg === "ResizeObserver loop limit exceeded") return;
if (msg === "Uncaught aborting javascript here") return;
if (["ResizeObserver loop completed with undelivered notifications.", "ResizeObserver loop limit exceeded", "Uncaught aborting javascript here"].includes(msg)) return;

API.bugReport({
type: "web-frontend",
Expand Down
2 changes: 1 addition & 1 deletion components/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ nav.home {

}

[data-theme="light"] nav.home .vertical-stack>img {
[data-theme="light"] nav.home .clickable img {
filter: invert();
}

Expand Down
6 changes: 3 additions & 3 deletions components/nav.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API } from "shared";
import { delay } from "std/async/delay.ts";
import { BasicLabel, Box, Button, ButtonStyle, Component, Custom, Grid, Horizontal, Image, Label, MIcon, Spacer, Vertical, createElement, img } from "webgen/mod.ts";
import { BasicLabel, Box, Button, ButtonStyle, Component, Custom, Grid, Horizontal, Image, Label, MIcon, Spacer, Vertical, createElement } from "webgen/mod.ts";
import { IsLoggedIn, activeUser, permCheck, showProfilePicture } from "../pages/_legacy/helper.ts";
import './nav.css';
import { activeLogo, pages } from "./pages.ts";
Expand Down Expand Up @@ -44,7 +44,7 @@ export function DynaNavigation(type: "Home" | "Music" | "Settings" | "Hosting" |
Vertical(
MIcon("apps"),
Vertical(
Custom(img(activeLogo(type)))
Image(activeLogo(type), "Selected Service")
),
)
.setGap(".5rem")
Expand Down Expand Up @@ -85,7 +85,7 @@ export function DynaNavigation(type: "Home" | "Music" | "Settings" | "Hosting" |
Button("Resend Verify Email")
.addClass("link")
.onPromiseClick(async () => {
await API.user(API.getToken()).mail.resendVerifyEmail.post();
await API.user.mail.resendVerifyEmail.post();
await delay(1000);
})
).addClass("email-banner", type.toLowerCase()) : Box().removeFromLayout(),
Expand Down
12 changes: 6 additions & 6 deletions components/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import bbnWalletLogo from '../assets/img/bbnWallet.svg';

import { Permission } from "shared";

export const pages: [logo: any, perm: Permission[], route: string][] = [
[bbnHolding, [], "/"],
[bbnMusicLogo, [], "/music"],
[bbnHostingLogo, [], "/hosting"],
[bbnWalletLogo, [], "/wallet"],
[bbnAdminLogo, ["/bbn/manage", "/hmsys/user"], "/admin"],
export const pages: [ logo: any, perm: Array<Permission>, route: string ][] = [
[ bbnHolding, [], "/" ],
[ bbnMusicLogo, [], "/music" ],
[ bbnHostingLogo, [], "/hosting" ],
[ bbnWalletLogo, [], "/wallet" ],
[ bbnAdminLogo, [ "/bbn/manage", "/hmsys/user" ], "/admin" ],
];

// Moved this to the up array when we use the hmsys permission system
Expand Down
57 changes: 57 additions & 0 deletions data/servers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"/minecraft/vanilla/": {
"name": "Minecraft Vanilla",
"docker_image": "itzg/minecraft-server",
"version_api": "https://launchermeta.mojang.com/mc/game/version_manifest.json"
},
"/minecraft/default/": {
"name": "Minecraft",
"docker_image": "itzg/minecraft-server",
"version_api": "https://api.purpurmc.org/v2/purpur"
},
"/minecraft/paper/": {
"name": "Minecraft (Paper)",
"docker_image": "itzg/minecraft-server",
"version_api": "https://papermc.io/api/v2/projects/paper"
},
"/minecraft/modded/fabric/": {
"name": "Minecraft Fabric",
"docker_image": "itzg/minecraft-server",
"environment": {
"TYPE": "FABRIC"
},
"version_api": "https://meta.fabricmc.net/v2/versions/game"
},
"/minecraft/modded/forge/": {
"name": "Minecraft Forge",
"docker_image": "itzg/minecraft-server",
"environment": {
"TYPE": "FORGE"
},
"version_api": "https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json"
},
"/minecraft/bedrock/": {
"name": "Minecraft Bedrock",
"docker_image": "itzg/minecraft-bedrock-server"
},
"/minecraft/pocketmine/": {
"name": "Pocketmine MP",
"docker_image": "pmmp/pocketmine-mp"
},
"/minecraft/legacy/magma/": {
"name": "Minecraft Magma",
"egg": 30
},
"/minecraft/legacy/nukkit/": {
"name": "Minecraft Nukkit",
"egg": 33
},
"/minecraft/legacy/pgf/": {
"name": "Minecraft Purpur Geyser Floodgate",
"egg": 34
},
"/minecraft/legacy/purpur/": {
"name": "Minecraft Purpur",
"egg": 20
}
}
17 changes: 17 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

error_page 500 502 503 504 /50x.html;

location / {
try_files $uri $uri.html $uri/index.html =404;
root /usr/share/nginx/html;
index index.html index.htm;
}

location = /50x.html {
root /usr/share/nginx/html;
}
}
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"imports": {
"webgen/": "https://raw.githubusercontent.com/lucsoft/WebGen/b9b71c3/",
// "webgen/": "../WebGen/",
"std/": "https://deno.land/std@0.195.0/",
"std/": "https://deno.land/std@0.197.0/",
"shared": "./pages/shared/mod.ts"
},
"compilerOptions": {
Expand Down
16 changes: 16 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
try_files $uri $uri.html $uri/index.html =404;
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Loading

0 comments on commit 32c39df

Please sign in to comment.