Compare commits
3 Commits
55e0370004
...
v0.20.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb0a5ab66d | ||
|
|
76d08df3da | ||
|
|
fac61ef678 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "acc-server-manager-web",
|
||||
"version": "0.20.0",
|
||||
"version": "0.20.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "acc-server-manager-web",
|
||||
"version": "0.20.0",
|
||||
"version": "0.20.1",
|
||||
"dependencies": {
|
||||
"@date-fns/utc": "^2.1.1",
|
||||
"@hookform/resolvers": "^5.2.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "acc-server-manager-web",
|
||||
"version": "0.20.0",
|
||||
"version": "0.20.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import Link from 'next/link';
|
||||
import { Server, ServiceStatus, getStatusColor, serviceStatusToString } from '@/lib/types';
|
||||
import { startServerAction, stopServerAction, restartServerAction } from '@/lib/actions/servers';
|
||||
import {
|
||||
startServerEventAction,
|
||||
restartServerEventAction,
|
||||
stopServerEventAction
|
||||
} from '@/lib/actions/servers';
|
||||
|
||||
interface ServerCardProps {
|
||||
server: Server;
|
||||
@@ -49,7 +53,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
||||
</Link>
|
||||
|
||||
<div className="flex justify-between gap-2 bg-gray-900 px-4 py-3">
|
||||
<form action={startServerAction.bind(null, server.id)}>
|
||||
<form action={startServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Running}
|
||||
@@ -59,7 +63,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action={restartServerAction.bind(null, server.id)}>
|
||||
<form action={restartServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Stopped}
|
||||
@@ -69,7 +73,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action={stopServerAction.bind(null, server.id)}>
|
||||
<form action={stopServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Stopped}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import Link from 'next/link';
|
||||
import { Server, getStatusColor, serviceStatusToString, ServiceStatus } from '@/lib/types/server';
|
||||
import { startServerAction, stopServerAction, restartServerAction } from '@/lib/actions/servers';
|
||||
import {
|
||||
startServerEventAction,
|
||||
restartServerEventAction,
|
||||
stopServerEventAction
|
||||
} from '@/lib/actions/servers';
|
||||
|
||||
interface ServerHeaderProps {
|
||||
server: Server;
|
||||
@@ -49,7 +53,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
||||
</div>
|
||||
|
||||
<div className="flex space-x-3">
|
||||
<form action={startServerAction.bind(null, server.id)}>
|
||||
<form action={startServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Running}
|
||||
@@ -59,7 +63,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action={restartServerAction.bind(null, server.id)}>
|
||||
<form action={restartServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Stopped}
|
||||
@@ -69,7 +73,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action={stopServerAction.bind(null, server.id)}>
|
||||
<form action={stopServerEventAction.bind(null, server.id)}>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={server.status === ServiceStatus.Stopped}
|
||||
|
||||
@@ -18,6 +18,10 @@ export async function startServerAction(serverId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function startServerEventAction(serverId: string) {
|
||||
await startServerAction(serverId);
|
||||
}
|
||||
|
||||
export async function stopServerAction(serverId: string) {
|
||||
try {
|
||||
const session = await requireAuth();
|
||||
@@ -32,6 +36,10 @@ export async function stopServerAction(serverId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function stopServerEventAction(serverId: string) {
|
||||
await stopServerAction(serverId);
|
||||
}
|
||||
|
||||
export async function restartServerAction(serverId: string) {
|
||||
try {
|
||||
const session = await requireAuth();
|
||||
@@ -45,3 +53,7 @@ export async function restartServerAction(serverId: string) {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function restartServerEventAction(serverId: string) {
|
||||
await restartServerAction(serverId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user