mirror of
https://github.com/hubHarmony/servii-frontend.git
synced 2024-11-17 21:40:30 +00:00
[+] Fix
This commit is contained in:
parent
b69adc4ed4
commit
ce5f30dee3
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user