Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="OpenTAKServer">
<meta name="application-name" content="OpenTAKServer">
<meta name="msapplication-TileColor" content="#da532c">
Expand All @@ -19,6 +19,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="src/main.tsx"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"short_name": "OpenTAKServer",
"icons": [
{
"src": "/android-chrome-192x192.png",
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"src": "android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
}
30 changes: 15 additions & 15 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@mantine/core/styles.css';
import { MantineProvider } from '@mantine/core';
import { Notifications } from '@mantine/notifications';
import { BrowserRouter, Route, Routes } from 'react-router';
import { HashRouter, Route, Routes } from 'react-router';
import React from 'react';
import { theme } from './theme';
import '@mantine/notifications/styles.css';
Expand All @@ -11,31 +11,31 @@ import 'react-resizable/css/styles.css'
import '@mantine/dates/styles.css';
import 'mantine-datatable/styles.css';
import './i18n';
import {I18nextProvider, useTranslation} from "react-i18next";
import { I18nextProvider, useTranslation } from "react-i18next";

const Login = React.lazy(() => import('./pages/Login/Login'));
const Error404 = React.lazy(() => import('./pages/Errors/Error404'));
const DefaultLayout = React.lazy(() => import('./DefaultLayout'));
const PasswordReset = React.lazy(() => import('./pages/PasswordReset'));

export default function App() {
const { t, i18n } = useTranslation();
const { t, i18n } = useTranslation();

return (
<I18nextProvider i18n={i18n}>
<MantineProvider theme={theme}>
<Notifications />
<BrowserRouter>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/404" element={<Error404 />} />
<Route path="/reset" element={<PasswordReset />} />
{/*<Route path="/register" name="Register Page" element={<Register />} />
<MantineProvider theme={theme}>
<Notifications />
<HashRouter>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/404" element={<Error404 />} />
<Route path="/reset" element={<PasswordReset />} />
{/*<Route path="/register" name="Register Page" element={<Register />} />
<Route path="/500" name="Page 500" element={<Page500 />} />*/}
<Route path="*" element={<DefaultLayout />} />
</Routes>
</BrowserRouter>
</MantineProvider>
<Route path="*" element={<DefaultLayout />} />
</Routes>
</HashRouter>
</MantineProvider>
</I18nextProvider>
);
}
20 changes: 10 additions & 10 deletions src/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import axios from './axios_config';
import { apiRoutes } from './apiRoutes';
import Navbar from './components/Navbar/Navbar';
import { socket } from './socketio';
import {t} from "i18next";
import { t } from "i18next";

export function DefaultLayout() {
const [mobileOpened, { toggle: toggleMobile }] = useDisclosure();
Expand All @@ -44,11 +44,11 @@ export function DefaultLayout() {
setSocketConnected(false);
}

function onAlert(alert:any) {
function onAlert(alert: any) {
let message = `${alert.alert_type} from ${alert.callsign}`;
let color = 'red';
let icon = <IconAlertTriangle style={{ width: rem(20), height: rem(20) }} />;
const alert_sound = new Audio('/alert.mp3');
const alert_sound = new Audio('alert.mp3');
alert_sound.play();

if (alert.cancel_time !== null) {
Expand Down Expand Up @@ -93,13 +93,13 @@ export function DefaultLayout() {

return (
<AppShell
header={{ height: 60 }}
navbar={{
header={{ height: 60 }}
navbar={{
width: 300,
breakpoint: 'sm',
collapsed: { mobile: !mobileOpened, desktop: !desktopOpened },
}}
padding="md"
padding="md"
>
<AppShell.Header pb={0} bg={computedColorScheme === 'light' ? '#2a2d43' : 'dark.8'}>
<Group justify="space-between" pr={5} h="100%">
Expand All @@ -120,13 +120,13 @@ export function DefaultLayout() {
<Menu.Label>OpenTAKServer</Menu.Label>
<Menu.Divider />
<Menu.Item
leftSection={<IconUser size={14} />} onClick={() => {navigate('/profile')}}>
leftSection={<IconUser size={14} />} onClick={() => { navigate('/profile') }}>
{t("Profile")}
</Menu.Item>
<Menu.Item
disabled={localStorage.getItem('loggedIn') !== 'true'}
leftSection={<IconLogout style={{ width: rem(14), height: rem(14) }} />}
onClick={() => {
disabled={localStorage.getItem('loggedIn') !== 'true'}
leftSection={<IconLogout style={{ width: rem(14), height: rem(14) }} />}
onClick={() => {
logout();
}}
>
Expand Down
134 changes: 67 additions & 67 deletions src/apiRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
export const apiRoutes = {
login: '/api/login?include_auth_token',
logout: '/api/logout',
eud: '/api/eud',
users: '/api/users',
alerts: '/api/alerts',
me: '/api/me',
create_user: '/api/user/create',
video_streams: '/api/video_streams',
generate_certificate: '/api/certificate',
data_packages: '/api/data_packages',
download_data_packages: '/api/data_packages/download',
assign_eud_to_user: '/api/user/assign_eud',
status: '/api/status',
casevac: '/api/casevac',
deleteDataPackage: '/api/data_packages',
addVideoStream: '/api/mediamtx/stream/add',
deleteVideoStream: '/api/mediamtx/stream/delete',
updateVideoStream: '/api/mediamtx/stream/update',
addUser: '/api/user/add',
changeRole: '/api/user/role',
deactivateUser: '/api/user/deactivate',
activateUser: '/api/user/activate',
deleteUser: '/api/user/delete',
adminResetPassword: '/api/user/password/reset', //Allows admins to change any user's password
register: '/api/register',
tfValidate: '/api/tf-validate',
tfSetup: '/api/tf-setup',
resetPassword: '/api/password/reset', //Allows users to reset their own password if they forgot it
mapState: '/api/map_state',
getScheduledJobs: '/api/scheduler/jobs',
runJob: '/api/scheduler/job/run',
resumeJob: '/api/scheduler/job/resume',
pauseJob: '/api/scheduler/job/pause',
getRecording: '/api/videos/recording',
getRecordings: '/api/videos/recordings',
deleteRecording: '/api/videos/recording',
adminSettings: '/api/config',
modifyJob: '/api/scheduler/job/modify',
startSSL: '/api/ssl/start',
stopSSL: '/api/ssl/stop',
startTCP: '/api/tcp/start',
stopTCP: '/api/tcp/stop',
itakQrString: '/api/itak_qr_string',
meshtasticChannels: '/api/meshtastic/channel',
generateMeshtasticPsk: '/api/meshtastic/generate_psk',
pluginPackage: '/api/packages',
deviceProfiles: '/api/profiles',
truststore: '/api/truststore',
missions: '/api/missions',
groups: '/api/groups',
mission_invite: '/api/missions/invite',
eud_stats: '/api/eud_stats',
plugins: '/api/plugins',
atakQrString: '/api/atak_qr_string',
pluginRepo: '/api/plugins/repo',
ldapLogin: '/api/ldap_login',
allGroups: '/api/groups/all',
allUsers: '/api/users/all',
groupMembers: '/api/groups/members',
userGroups: '/api/users/groups',
takgov: '/api/takgov',
takgovLink: '/api/takgov/link',
takgovToken: '/api/takgov/token',
takgovPlugins: '/api/takgov/plugins',
takgovIcon: '/api/takgov/icon',
takgovPlugin: '/api/takgov/plugin',
language: '/api/language',
login: 'api/login?include_auth_token',
logout: 'api/logout',
eud: 'api/eud',
users: 'api/users',
alerts: 'api/alerts',
me: 'api/me',
create_user: 'api/user/create',
video_streams: 'api/video_streams',
generate_certificate: 'api/certificate',
data_packages: 'api/data_packages',
download_data_packages: 'api/data_packages/download',
assign_eud_to_user: 'api/user/assign_eud',
status: 'api/status',
casevac: 'api/casevac',
deleteDataPackage: 'api/data_packages',
addVideoStream: 'api/mediamtx/stream/add',
deleteVideoStream: 'api/mediamtx/stream/delete',
updateVideoStream: 'api/mediamtx/stream/update',
addUser: 'api/user/add',
changeRole: 'api/user/role',
deactivateUser: 'api/user/deactivate',
activateUser: 'api/user/activate',
deleteUser: 'api/user/delete',
adminResetPassword: 'api/user/password/reset', //Allows admins to change any user's password
register: 'api/register',
tfValidate: 'api/tf-validate',
tfSetup: 'api/tf-setup',
resetPassword: 'api/password/reset', //Allows users to reset their own password if they forgot it
mapState: 'api/map_state',
getScheduledJobs: 'api/scheduler/jobs',
runJob: 'api/scheduler/job/run',
resumeJob: 'api/scheduler/job/resume',
pauseJob: 'api/scheduler/job/pause',
getRecording: 'api/videos/recording',
getRecordings: 'api/videos/recordings',
deleteRecording: 'api/videos/recording',
adminSettings: 'api/config',
modifyJob: 'api/scheduler/job/modify',
startSSL: 'api/ssl/start',
stopSSL: 'api/ssl/stop',
startTCP: 'api/tcp/start',
stopTCP: 'api/tcp/stop',
itakQrString: 'api/itak_qr_string',
meshtasticChannels: 'api/meshtastic/channel',
generateMeshtasticPsk: 'api/meshtastic/generate_psk',
pluginPackage: 'api/packages',
deviceProfiles: 'api/profiles',
truststore: 'api/truststore',
missions: 'api/missions',
groups: 'api/groups',
mission_invite: 'api/missions/invite',
eud_stats: 'api/eud_stats',
plugins: 'api/plugins',
atakQrString: 'api/atak_qr_string',
pluginRepo: 'api/plugins/repo',
ldapLogin: 'api/ldap_login',
allGroups: 'api/groups/all',
allUsers: 'api/users/all',
groupMembers: 'api/groups/members',
userGroups: 'api/users/groups',
takgov: 'api/takgov',
takgovLink: 'api/takgov/link',
takgovToken: 'api/takgov/token',
takgovPlugins: 'api/takgov/plugins',
takgovIcon: 'api/takgov/icon',
takgovPlugin: 'api/takgov/plugin',
language: 'api/language',
};
4 changes: 2 additions & 2 deletions src/i18n.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import i18n from "i18next";
import {initReactI18next} from "react-i18next";
import { initReactI18next } from "react-i18next";
import HttpApi from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";

Expand All @@ -13,7 +13,7 @@ i18n
returnEmptyString: false,
debug: false,
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.json",
loadPath: "locales/{{lng}}/{{ns}}.json",
}
});

Expand Down
Loading