Compare commits

..

No commits in common. "master" and "v1.0.16-DEV" have entirely different histories.

14 changed files with 17 additions and 142 deletions

View File

@ -3,7 +3,6 @@ on:
push: push:
branches: branches:
- master - master
- dev
jobs: jobs:
build-and-test: build-and-test:
@ -33,11 +32,6 @@ jobs:
- name: Build app - name: Build app
run: npm run build run: npm run build
- name: Get developer token
run: |
TOKEN=$(jq -r '.token' src/authtoken.json)
echo "TOKEN=$TOKEN" >> $GITHUB_ENV
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -65,25 +59,9 @@ jobs:
- name: Create Release - name: Create Release
uses: https://gitea.com/actions/gitea-release-action@v1 uses: https://gitea.com/actions/gitea-release-action@v1
with: with:
body: |
## Release Notes
This is an automated release of version ${{ env.VERSION }}
### Changes
- Built from latest main branch
- Includes:
${{ github.event.head_commit.message }}
### Developer Token
- ${{ env.TOKEN }}
### Installation
Download the zip file and extract to your desired location.
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ env.VERSION }} tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }} name: Release v${{ env.VERSION }}
files: | files: |
release-artifacts/admin_dashboard-${{ env.VERSION }}.zip release-artifacts/admin_dashboard-${{ env.VERSION }}.zip
draft: false draft: false

4
.gitignore vendored
View File

@ -13,11 +13,7 @@
# production # production
/build /build
*/build */build
/src/authtoken.json
<<<<<<< HEAD
=======
>>>>>>> dev
# misc # misc
.DS_Store .DS_Store
.env.local .env.local

View File

@ -1,11 +1,10 @@
CREATE TABLE users ( CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY, id INT AUTO_INCREMENT PRIMARY KEY,
token VARCHAR(255) NOT NULL,
username VARCHAR(50) NOT NULL UNIQUE, username VARCHAR(50) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL, password_hash VARCHAR(255) NOT NULL,
perms VARCHAR(255) NOT NULL perms VARCHAR(255) NOT NULL
); );
-- Test user with admin permissions -- Test user with admin permissions
INSERT INTO users (token, username, password_hash, perms) INSERT INTO users (username, password_hash, perms)
VALUES ('be01e88cc202593292d503e4ed9e51e9eb217093662efbb145030ba51b97c22a','admin', 'ecd71870d1963316a97e3ac3408c9835ad8cf0f3c1bc703527c30265534f75ae', 'admin'); VALUES ('admin', 'ecd71870d1963316a97e3ac3408c9835ad8cf0f3c1bc703527c30265534f75ae', 'admin');

View File

@ -1,6 +1,6 @@
const fs = require('fs'); const fs = require('fs');
const filePath = 'src/authtoken.json'; const filePath = 'authtoken.json';
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
const randomToken = (Math.random().toString(36).substring(2, 10)); const randomToken = (Math.random().toString(36).substring(2, 10));

View File

@ -1,3 +1,3 @@
# https://www.robotstxt.org/robotstxt.html # https://www.robotstxt.org/robotstxt.html
User-agent: * User-agent: *
Disallow: / Disallow:

View File

@ -11,7 +11,6 @@ import metadata from './metadata.json';
import './App.css' import './App.css'
import useToken from './core/useToken'; import useToken from './core/useToken';
import Terminal from './Terminal/TerminalPage' import Terminal from './Terminal/TerminalPage'
import DashboardReports from './Dashboard/DashboardReports';
function App() { function App() {
@ -27,8 +26,8 @@ function App() {
<Route path='/' element={<Navigate to='/dashboard' />} /> <Route path='/' element={<Navigate to='/dashboard' />} />
<Route path="/dashboard" element={<Dashboard/>} /> <Route path="/dashboard" element={<Dashboard/>} />
<Route path="/dashboard/users" element={<DashboardUsers />} /> <Route path="/dashboard/users" element={<DashboardUsers />} />
{/* <Route path="/dashboard/configuration" element={<Settings />} /> */} {/* <Route path="/dashboard/configuration" element={<Settings />} />
<Route path="/dashboard/reports" element={<DashboardReports />} /> <Route path="/dashboard/reports" element={<Reports />} /> */}
<Route path="/dashboard/console" element={<Terminal/>} /> <Route path="/dashboard/console" element={<Terminal/>} />
<Route path="/settings" element={<SettingsMain/>} /> <Route path="/settings" element={<SettingsMain/>} />
<Route path="/settings/info" element={<SettingsInfo/>} /> <Route path="/settings/info" element={<SettingsInfo/>} />

View File

@ -1,33 +0,0 @@
import React from 'react';
import {
Box,
CssBaseline,
Toolbar,
} from '@mui/material';
import { ThemeProvider } from '@mui/material/styles';
import theme from '../theme';
import { SidebarMain } from '../widgets/Sidebar';
import { AppBarFull } from '../widgets/AppBar';
import WidgetReport from '../widgets/WidgetReport';
export default function DashboardReports() {
return (
<ThemeProvider theme={theme}>
<Box sx={{ display: 'flex' }}>
<CssBaseline />
<AppBarFull />
<SidebarMain />
<Box
component="main"
sx={{ flexGrow: 1, bgcolor: 'background.default', p: 3 }}
>
<Toolbar />
{/* <Typography variant="h4">Hi {localStorage.getItem('token')}</Typography> */}
<Box sx={{ display: 'flex', gap: 3 }}>
<WidgetReport />
</Box>
</Box>
</Box>
</ThemeProvider>
);
}

View File

@ -1,28 +0,0 @@
import React from "react";
import { ThemeProvider, Box, Typography } from "@mui/material";
import { theme } from "../theme";
const SettingsDatabaseConfig = () => {
return (
<ThemeProvider theme={theme}>
<Box sx={{ display: 'flex' }}>
<CssBaseline />
<AppBarFull />
<SidebarSettings />
<Box
component="main"
sx={{ flexGrow: 1, bgcolor: 'background.default', p: 3 }}
>
<Toolbar />
<Typography variant="h5" sx={{ mb: 3, color: 'primary.main' }}>
Database Configuration
</Typography>
</Box>
</Box>
</ThemeProvider>
);
};
export default SettingsDatabaseConfig;

View File

@ -65,9 +65,3 @@ export function getDeveloperMode() {
throw error; throw error;
}); });
} }
export function getDatabaseConfig() {
return getConfig().then(config => config.database);
}

View File

@ -1 +1 @@
{"buildMajor":1,"buildMinor":0,"buildRevision":21,"buildTag":"DEV"} {"buildMajor":1,"buildMinor":0,"buildRevision":16,"buildTag":"DEV"}

View File

@ -9,7 +9,6 @@ import DashboardIcon from '@mui/icons-material/DashboardOutlined';
import SettingsIcon from '@mui/icons-material/SettingsOutlined'; import SettingsIcon from '@mui/icons-material/SettingsOutlined';
import LogoutIcon from '@mui/icons-material/LogoutOutlined'; import LogoutIcon from '@mui/icons-material/LogoutOutlined';
import deleteToken from "../core/deleteToken"; import deleteToken from "../core/deleteToken";
import metadata from "../metadata.json";
const drawerWidth = 240; const drawerWidth = 240;
@ -44,10 +43,7 @@ export const AppBarFull = () => {
<AppBar position="fixed" sx={{ width: `calc(100% - ${drawerWidth}px)`, ml: `${drawerWidth}px` }}> <AppBar position="fixed" sx={{ width: `calc(100% - ${drawerWidth}px)`, ml: `${drawerWidth}px` }}>
<Toolbar> <Toolbar>
<Typography variant="h6" noWrap sx={{ flexGrow: 1 }}> <Typography variant="h6" noWrap sx={{ flexGrow: 1 }}>
{['DEV', 'ALPHA', 'BETA'].includes(metadata.buildTag) ? Admin Dashboard
`Admin Dashboard ${metadata.buildTag}` :
'Admin Dashboard'
}
</Typography> </Typography>
<IconButton <IconButton
color="inherit" color="inherit"

View File

@ -31,28 +31,24 @@ export const SidebarSettings = () => {
> >
<Divider /> <Divider />
<List> <List>
<ListItem button key="Main Settings" onClick={() => window.location.href = '/settings'}> <ListItem button key="Database Configuration" selected={window.location.pathname === '/settings'}>
<DashboardIcon sx={{ marginRight: 2, color: '#FFFFFF'}}/>
<ListItemText primary="Main Settings" sx={{ color: '#FFFFFF' }} />
</ListItem>
<ListItem button key="Database Configuration" onClick={() => window.location.href = '/settings/database'}>
<DashboardIcon sx={{ marginRight: 2, color: '#FFFFFF'}}/> <DashboardIcon sx={{ marginRight: 2, color: '#FFFFFF'}}/>
<ListItemText primary="Database Configuration" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Database Configuration" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Access lists" onClick={() => window.location.href = '/settings/access'}> <ListItem button key="Access lists" selected={window.location.pathname === '/settings/access'}>
<PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Access lists" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Access lists" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Update" onClick={() => window.location.href = '/settings/update'}> <ListItem button key="Update" selected={window.location.pathname === '/settings/update'}>
<UpdateIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <UpdateIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Update" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Update" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Info" onClick={() => window.location.href = '/settings/info'}> <ListItem button key="Info" selected={window.location.pathname === '/settings/info'}>
<InfoIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <InfoIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Info" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Info" sx={{ color: '#FFFFFF' }} onClick={() => { window.location.href = '/settings/info'; }}/>
</ListItem> </ListItem>
{getDeveloperMode() && ( {getDeveloperMode() && (
<ListItem button key="Debug" onClick={() => window.location.href = '/settings/debug'}> <ListItem button key="Debug" selected={window.location.pathname === '/settings/debug'}>
<BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Debug" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Debug" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
@ -86,15 +82,15 @@ export const SidebarMain = () => {
<DashboardIcon sx={{ marginRight: 2, color: '#FFFFFF'}}/> <DashboardIcon sx={{ marginRight: 2, color: '#FFFFFF'}}/>
<ListItemText primary="Dashboard" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Dashboard" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Users" onClick={() => window.location.href = '/dashboard/users'}> <ListItem button key="Users">
<PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Users" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Users" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Reports" onClick={() => window.location.href = '/dashboard/reports'}> <ListItem button key="Reports">
<BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Reports" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Reports" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Server Configuration" onClick={() => window.location.href = '/dashboard/configuration'}> <ListItem button key="Server Configuration">
<ConstructionOutlinedIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <ConstructionOutlinedIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Server Configuration" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Server Configuration" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>

View File

@ -1,22 +0,0 @@
import React from "react";
import { Box, CssBaseline, Toolbar } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import theme from "../theme";
export default function WidgetReport() {
return (
<ThemeProvider theme={theme}>
<Box sx={{ display: "flex" }}>
<CssBaseline />
<Box
component="main"
sx={{ flexGrow: 1, bgcolor: "background.default", p: 3 }}
>
<Toolbar />
</Box>
</Box>
</ThemeProvider>
);
}