mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
Feat/admin react (#6211)
* Added vite react admin ui. * Added react i18next. * Added pads manager. * Fixed docker build. * Fixed windows build. * Fixed installOnWindows script. * Install only if path exists.
This commit is contained in:
parent
d34b964cc2
commit
db46ffb63b
112 changed files with 3327 additions and 946 deletions
47
admin/src/store/store.ts
Normal file
47
admin/src/store/store.ts
Normal file
|
@ -0,0 +1,47 @@
|
|||
import {create} from "zustand";
|
||||
import {Socket} from "socket.io-client";
|
||||
import {PadSearchResult} from "../utils/PadSearch.ts";
|
||||
|
||||
type ToastState = {
|
||||
description?:string,
|
||||
title: string,
|
||||
open: boolean,
|
||||
success: boolean
|
||||
}
|
||||
|
||||
|
||||
type StoreState = {
|
||||
settings: string|undefined,
|
||||
setSettings: (settings: string) => void,
|
||||
settingsSocket: Socket|undefined,
|
||||
setSettingsSocket: (socket: Socket) => void,
|
||||
showLoading: boolean,
|
||||
setShowLoading: (show: boolean) => void,
|
||||
setPluginsSocket: (socket: Socket) => void
|
||||
pluginsSocket: Socket|undefined,
|
||||
toastState: ToastState,
|
||||
setToastState: (val: ToastState)=>void,
|
||||
pads: PadSearchResult|undefined,
|
||||
setPads: (pads: PadSearchResult)=>void
|
||||
}
|
||||
|
||||
|
||||
export const useStore = create<StoreState>()((set) => ({
|
||||
settings: undefined,
|
||||
setSettings: (settings: string) => set({settings}),
|
||||
settingsSocket: undefined,
|
||||
setSettingsSocket: (socket: Socket) => set({settingsSocket: socket}),
|
||||
showLoading: false,
|
||||
setShowLoading: (show: boolean) => set({showLoading: show}),
|
||||
pluginsSocket: undefined,
|
||||
setPluginsSocket: (socket: Socket) => set({pluginsSocket: socket}),
|
||||
setToastState: (val )=>set({toastState: val}),
|
||||
toastState: {
|
||||
open: false,
|
||||
title: '',
|
||||
description:'',
|
||||
success: false
|
||||
},
|
||||
pads: undefined,
|
||||
setPads: (pads)=>set({pads})
|
||||
}));
|
Loading…
Add table
Add a link
Reference in a new issue