2020-12-28 17:08:08 +00:00
|
|
|
import { createContextStore } from 'easy-peasy';
|
|
|
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
2021-01-01 22:55:30 +00:00
|
|
|
|
2021-01-05 21:52:49 +00:00
|
|
|
import databases, { AdminDatabaseStore } from '@/state/admin/databases';
|
|
|
|
import locations, { AdminLocationStore } from '@/state/admin/locations';
|
|
|
|
import mounts, { AdminMountStore } from '@/state/admin/mounts';
|
2021-01-01 00:27:16 +00:00
|
|
|
import nests, { AdminNestStore } from '@/state/admin/nests';
|
2021-01-05 21:52:49 +00:00
|
|
|
import nodes, { AdminNodeStore } from '@/state/admin/nodes';
|
2020-12-28 17:08:08 +00:00
|
|
|
import roles, { AdminRoleStore } from '@/state/admin/roles';
|
2021-01-05 16:17:44 +00:00
|
|
|
import servers, { AdminServerStore } from '@/state/admin/servers';
|
2021-01-04 19:44:44 +00:00
|
|
|
import users, { AdminUserStore } from '@/state/admin/users';
|
2020-12-28 17:08:08 +00:00
|
|
|
|
|
|
|
interface AdminStore {
|
2021-01-05 21:52:49 +00:00
|
|
|
databases: AdminDatabaseStore;
|
|
|
|
locations: AdminLocationStore;
|
|
|
|
mounts: AdminMountStore;
|
2021-01-04 19:44:44 +00:00
|
|
|
nests: AdminNestStore;
|
2021-01-05 21:52:49 +00:00
|
|
|
nodes: AdminNodeStore;
|
2020-12-28 17:08:08 +00:00
|
|
|
roles: AdminRoleStore;
|
2021-01-05 16:17:44 +00:00
|
|
|
servers: AdminServerStore;
|
2021-01-04 19:44:44 +00:00
|
|
|
users: AdminUserStore;
|
2020-12-28 17:08:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const AdminContext = createContextStore<AdminStore>({
|
2021-01-05 21:52:49 +00:00
|
|
|
databases,
|
|
|
|
locations,
|
|
|
|
mounts,
|
2021-01-01 00:27:16 +00:00
|
|
|
nests,
|
2021-01-05 21:52:49 +00:00
|
|
|
nodes,
|
2020-12-28 17:08:08 +00:00
|
|
|
roles,
|
2021-01-05 16:17:44 +00:00
|
|
|
servers,
|
2021-01-04 19:44:44 +00:00
|
|
|
users,
|
2020-12-28 17:08:08 +00:00
|
|
|
}, {
|
|
|
|
compose: composeWithDevTools({
|
|
|
|
name: 'AdminStore',
|
|
|
|
trace: true,
|
|
|
|
}),
|
|
|
|
});
|