Add basic subuser listing for servers
This commit is contained in:
parent
de464d35a2
commit
543884876f
14 changed files with 310 additions and 4 deletions
|
@ -3,6 +3,7 @@ import { action, Action, createContextStore, thunk, Thunk } from 'easy-peasy';
|
|||
import socket, { SocketStore } from './socket';
|
||||
import { ServerDatabase } from '@/api/server/getServerDatabases';
|
||||
import files, { ServerFileStore } from '@/state/server/files';
|
||||
import subusers, { ServerSubuserStore } from '@/state/server/subusers';
|
||||
|
||||
export type ServerStatus = 'offline' | 'starting' | 'stopping' | 'running';
|
||||
|
||||
|
@ -56,6 +57,7 @@ const databases: ServerDatabaseStore = {
|
|||
|
||||
export interface ServerStore {
|
||||
server: ServerDataStore;
|
||||
subusers: ServerSubuserStore;
|
||||
databases: ServerDatabaseStore;
|
||||
files: ServerFileStore;
|
||||
socket: SocketStore;
|
||||
|
@ -69,9 +71,14 @@ export const ServerContext = createContextStore<ServerStore>({
|
|||
status,
|
||||
databases,
|
||||
files,
|
||||
subusers,
|
||||
clearServerState: action(state => {
|
||||
state.server.data = undefined;
|
||||
state.databases.items = [];
|
||||
state.subusers.data = [];
|
||||
|
||||
state.files.directory = '/';
|
||||
state.files.contents = [];
|
||||
|
||||
if (state.socket.instance) {
|
||||
state.socket.instance.removeAllListeners();
|
||||
|
|
Reference in a new issue