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",
|
"name": "acc-server-manager-web",
|
||||||
"version": "0.20.0",
|
"version": "0.20.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "acc-server-manager-web",
|
"name": "acc-server-manager-web",
|
||||||
"version": "0.20.0",
|
"version": "0.20.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@date-fns/utc": "^2.1.1",
|
"@date-fns/utc": "^2.1.1",
|
||||||
"@hookform/resolvers": "^5.2.1",
|
"@hookform/resolvers": "^5.2.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "acc-server-manager-web",
|
"name": "acc-server-manager-web",
|
||||||
"version": "0.20.0",
|
"version": "0.20.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev --turbopack",
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Server, ServiceStatus, getStatusColor, serviceStatusToString } from '@/lib/types';
|
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 {
|
interface ServerCardProps {
|
||||||
server: Server;
|
server: Server;
|
||||||
@@ -49,7 +53,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<div className="flex justify-between gap-2 bg-gray-900 px-4 py-3">
|
<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
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Running}
|
disabled={server.status === ServiceStatus.Running}
|
||||||
@@ -59,7 +63,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action={restartServerAction.bind(null, server.id)}>
|
<form action={restartServerEventAction.bind(null, server.id)}>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Stopped}
|
disabled={server.status === ServiceStatus.Stopped}
|
||||||
@@ -69,7 +73,7 @@ export function ServerCard({ server }: ServerCardProps) {
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action={stopServerAction.bind(null, server.id)}>
|
<form action={stopServerEventAction.bind(null, server.id)}>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Stopped}
|
disabled={server.status === ServiceStatus.Stopped}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Server, getStatusColor, serviceStatusToString, ServiceStatus } from '@/lib/types/server';
|
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 {
|
interface ServerHeaderProps {
|
||||||
server: Server;
|
server: Server;
|
||||||
@@ -49,7 +53,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex space-x-3">
|
<div className="flex space-x-3">
|
||||||
<form action={startServerAction.bind(null, server.id)}>
|
<form action={startServerEventAction.bind(null, server.id)}>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Running}
|
disabled={server.status === ServiceStatus.Running}
|
||||||
@@ -59,7 +63,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action={restartServerAction.bind(null, server.id)}>
|
<form action={restartServerEventAction.bind(null, server.id)}>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Stopped}
|
disabled={server.status === ServiceStatus.Stopped}
|
||||||
@@ -69,7 +73,7 @@ export function ServerHeader({ server }: ServerHeaderProps) {
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action={stopServerAction.bind(null, server.id)}>
|
<form action={stopServerEventAction.bind(null, server.id)}>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={server.status === ServiceStatus.Stopped}
|
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) {
|
export async function stopServerAction(serverId: string) {
|
||||||
try {
|
try {
|
||||||
const session = await requireAuth();
|
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) {
|
export async function restartServerAction(serverId: string) {
|
||||||
try {
|
try {
|
||||||
const session = await requireAuth();
|
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