diff --git a/src/App.jsx b/src/App.jsx
index a49c114..3ca37a1 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,27 +1,20 @@
-// src/App.js
import React, { useEffect, useState } from 'react';
import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import LoginPage from './pages/LoginPage/LoginPage';
import DashboardPage from './pages/DashboardPage/DashboardPage';
+import ServerDetails from './pages/ServerDetails/ServerDetails';
import { auth } from './service/firebase';
import styles from './App.module.scss';
import Loading from './pages/Loading/loading';
+import NotFoundPage from './pages/NotFoundPage/NotFoundPage';
const App = () => {
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
- const script = document.createElement('script');
-
- script.src = 'https://static.cloudflareinsights.com/beacon.min.js';
- script.async = true;
- script.defer = true;
- script.data = JSON.stringify({
- token: '5cef39a7410e4a4e8ab3dfbe163b73d0',
- });
const unsubscribe = auth.onAuthStateChanged((user) => {
setUser(user);
setLoading(false);
@@ -40,7 +33,9 @@ const App = () => {
: } />
: } />
+ : } />
} />
+ } />
diff --git a/src/components/serverCard/serverCard.jsx b/src/components/serverCard/serverCard.jsx
index dd4b286..7786598 100644
--- a/src/components/serverCard/serverCard.jsx
+++ b/src/components/serverCard/serverCard.jsx
@@ -1,13 +1,14 @@
import React from 'react';
+import { Link } from 'react-router-dom';
import styles from './serverCard.module.scss';
-import paper from '../../assets/frameworks/paper_mc.png'
-import spigot from '../../assets/frameworks/spigot.png'
-import bukkit from '../../assets/frameworks/bukkit.png'
-import vanilla from '../../assets/frameworks/vanilla.png'
-import delete_button from '../../assets/frameworks/delete.png'
+import paper from '../../assets/frameworks/paper_mc.png';
+import spigot from '../../assets/frameworks/spigot.png';
+import bukkit from '../../assets/frameworks/bukkit.png';
+import vanilla from '../../assets/frameworks/vanilla.png';
+import delete_button from '../../assets/frameworks/delete.png';
-const ServerCard = ({status, version, link, name, framework, onRunClick, onStopClick, onDeleteClick }) => {
+const ServerCard = ({ status, version, name, framework, onRunClick, onStopClick, onDeleteClick }) => {
const getFrameworkSource = () => {
switch (framework) {
@@ -20,9 +21,10 @@ const ServerCard = ({status, version, link, name, framework, onRunClick, onStopC
default:
return vanilla;
}
- }
+ };
- const handleRun = async () => {
+ const handleRun = async (event) => {
+ event.preventDefault();
try {
await onRunClick(name);
} catch (error) {
@@ -30,7 +32,8 @@ const ServerCard = ({status, version, link, name, framework, onRunClick, onStopC
}
};
- const handleStop = async () => {
+ const handleStop = async (event) => {
+ event.preventDefault();
try {
await onStopClick(name);
} catch (error) {
@@ -38,7 +41,8 @@ const ServerCard = ({status, version, link, name, framework, onRunClick, onStopC
}
};
- const handleDelete = async () => {
+ const handleDelete = async (event) => {
+ event.preventDefault();
try {
await onDeleteClick(name);
} catch (error) {
@@ -47,25 +51,25 @@ const ServerCard = ({status, version, link, name, framework, onRunClick, onStopC
};
return (
-
+
{name}
-
+
- {!status && (
+ {status === "false" && (
)}
- {status && (
+ {status === true && (
)}
Version: {version}
-
-
+
+
);
};
diff --git a/src/components/serverCard/serverCard.module.scss b/src/components/serverCard/serverCard.module.scss
index 34c4d52..e63d961 100644
--- a/src/components/serverCard/serverCard.module.scss
+++ b/src/components/serverCard/serverCard.module.scss
@@ -10,8 +10,11 @@
background-color: var(--card-bg-color);
color: var(--text-color);
margin-bottom: 1.5rem;
+ cursor: pointer;
}
+
+
.status {
display: flex;
align-items: center;
@@ -46,6 +49,15 @@
transition: background-color 0.3s ease;
margin-top: 1rem;
}
+
+.runningButton:hover{
+ background-color: #8d213ec1;
+}
+
+.stoppedButton:hover{
+ background-color: #008d5fc1;
+}
+
.deleteButton{
width: 20px;
height: 20px;
diff --git a/src/main.css b/src/main.css
index d65f2ab..009958c 100644
--- a/src/main.css
+++ b/src/main.css
@@ -1,4 +1,4 @@
-/* index.css */
+/* main.css */
html {
font-size: 12px;
font-family: 'Poppins', sans-serif;
@@ -18,6 +18,11 @@ html {
--main-bg-color: #050816;
--text-color: white;
--text-color-black: black;
+ --input-bg-color: #44475a;
+ --input-border-color: #6272a4;
+ --button-bg-color: #50fa7b;
+ --button-text-color: #282a36;
+ --button-bg-color-hover: #8be9fd;
}
body {
diff --git a/src/pages/DashboardPage/DashboardPage.jsx b/src/pages/DashboardPage/DashboardPage.jsx
index 071b8df..12022f1 100644
--- a/src/pages/DashboardPage/DashboardPage.jsx
+++ b/src/pages/DashboardPage/DashboardPage.jsx
@@ -85,6 +85,13 @@ const DashboardPage = ({ user }) => {
}
};
+ const handleCopyAddress = () => {
+ const address = `${subdomain}.servii.fr`;
+ navigator.clipboard.writeText(address)
+ .then(() => {
+ })
+ };
+
if (loading) {
return (
@@ -111,7 +118,10 @@ const DashboardPage = ({ user }) => {
) : (
- Adresse de connexion à vos serveurs : {subdomain}.servii.fr
+ Adresse de connexion à vos serveurs :
+
+ {" " + subdomain}.servii.fr
+