Compare commits

..

No commits in common. "main" and "v0.0.1" have entirely different histories.
main ... v0.0.1

8 changed files with 811 additions and 855 deletions

View File

@ -1,4 +1,4 @@
FROM node:alpine as builder FROM node:alpine
EXPOSE 3000 EXPOSE 3000
WORKDIR /app WORKDIR /app
@ -9,13 +9,9 @@ COPY tsconfig.json .
RUN npm install RUN npm install
COPY --chmod=111 startup.sh .
COPY public public COPY public public
COPY src src COPY src src
RUN npm run build ENTRYPOINT [ "/usr/bin/env", "./startup.sh" ]
FROM node:alpine
COPY --from=builder /app/build /opt/server
WORKDIR /opt/server
ENTRYPOINT [ "npx", "-y" , "serve", "-s", "/opt/server" ]

View File

@ -1 +0,0 @@
var API_URL = 'https://games.acooldomain.co'

801
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
var API_URL = "http://localhost"

View File

@ -3,7 +3,6 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.svg"/> <link rel="icon" href="%PUBLIC_URL%/favicon.svg"/>
<script type="text/javascript" src="%PUBLIC_URL%/config.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta

View File

@ -1,7 +1,7 @@
import axios, { AxiosInstance, AxiosResponse } from "axios"; import axios, { AxiosInstance, AxiosResponse } from "axios";
import React, { Context, Dispatch, ReactNode, createContext, useContext, useState } from "react"; import React, { Context, Dispatch, ReactNode, createContext, useContext, useState } from "react";
import { useLocation, Navigate } from "react-router-dom"; import { useLocation, Navigate } from "react-router-dom";
import Cookies from 'js-cookie'; import Cookies from 'js-cookie'
import { Box, Button, ButtonGroup, ButtonOwnProps, Modal, PaletteMode, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField } from "@mui/material"; import { Box, Button, ButtonGroup, ButtonOwnProps, Modal, PaletteMode, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField } from "@mui/material";
import { Form } from "@rjsf/mui"; import { Form } from "@rjsf/mui";
import validator from '@rjsf/validator-ajv8'; import validator from '@rjsf/validator-ajv8';
@ -86,9 +86,10 @@ export const getDesignTokens = (mode: PaletteMode) => ({
} }
}); });
const API_URL = (window as any).API_URL const API_URL = `${process.env.REACT_APP_API_SCHEME}://${process.env.REACT_APP_API_URL}`
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
export const api: AxiosInstance = axios.create({ export const api: AxiosInstance = axios.create({
baseURL: API_URL, baseURL: API_URL,
withCredentials: true, withCredentials: true,
@ -170,8 +171,7 @@ function CustomField(props: WidgetProps) {
{label: 'Create', value: Permission.Create}, {label: 'Create', value: Permission.Create},
{label: 'Admin', value: Permission.Admin}, {label: 'Admin', value: Permission.Admin},
{label: 'Cloud', value: Permission.Cloud}, {label: 'Cloud', value: Permission.Cloud},
] ]}} registry={registry} value={convertNumber(props.value)} />
}} registry={registry} value={convertNumber(props.value)} />
} }
if (options2 === null){ if (options2 === null){

View File

@ -7,7 +7,7 @@ import { fetchToken } from "./login";
const signUp = async (username: string, password: string, token: string) => { const signUp = async (username: string, password: string, token: string) => {
try { try {
const response = await api.post(`/auth/signup?token=${token}`, { const response = await api.post(`/signup?token=${token}`, {
username: username, username: username,
password: password, password: password,
}, { }, {