This commit is contained in:
Charles Le Maux 2024-07-03 14:31:15 +01:00
parent b69adc4ed4
commit ce5f30dee3
2 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import styles from './CreateServer.module.scss';
import { getUserSubdomain } from "../../service/firebase";
import { saveSubdomain } from "../../service/api.tsx";
import serviiApi from "../../service/api.tsx";
const CreateServer = ({ user, onCreateServer }) => {
const [subdomain, setSubdomain] = useState(null);
@ -26,7 +26,7 @@ const CreateServer = ({ user, onCreateServer }) => {
const handleSaveSubdomain = async () => {
try {
await saveSubdomain(subdomainInput);
await serviiApi.setSubdomain(subdomainInput);
setSubdomain(subdomainInput);
} catch (error) {
console.error('Error setting subdomain:', error);

View File

@ -32,8 +32,8 @@ const DashboardPage = ({ user }) => {
try {
const serverName = prompt('Enter the name for the new server:');
if (!serverName) return;
await createServer(serverName);
loadServers();
await serviiApi.serverCreate(serverName, "1.20.6", "paper");
await loadServers();
} catch (error) {
console.error('Error creating server:', error);
}
@ -41,7 +41,7 @@ const DashboardPage = ({ user }) => {
const handleRunServer = async (serverName) => {
try {
await runServer(serverName);
await serviiApi.serverRun(serverName);
} catch (error) {
console.error('Error starting server:', error);
}
@ -49,7 +49,7 @@ const DashboardPage = ({ user }) => {
const handleStopServer = async (serverName) => {
try {
await stopServer(serverName);
await serviiApi.serverStop(serverName);
} catch (error) {
console.error('Error stopping server:', error);
}
@ -57,7 +57,7 @@ const DashboardPage = ({ user }) => {
const handleDeleteServer = async (serverName) => {
try {
await deleteServer(serverName);
await serviiApi.serverDelete(serverName);
loadServers();
} catch (error) {
console.error('Error deleting server:', error);