mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2024-04-21 12:32:08 +00:00
chore (refactoring): cleanup admin
This commit is contained in:
@@ -5,7 +5,7 @@ import { CSS } from "../../helpers/loader.js";
|
||||
import transition from "./animate.js";
|
||||
import AdminHOC from "./decorator.js";
|
||||
import { initConfig } from "./model_config.js";
|
||||
import { initStorage } from "./ctrl_backend_state.js";
|
||||
import { initStorage, initMiddleware } from "./ctrl_backend_state.js";
|
||||
import componentStorageBackend from "./ctrl_backend_component_storage.js";
|
||||
import componentAuthenticationMiddleware from "./ctrl_backend_component_authentication.js";
|
||||
|
||||
@@ -17,9 +17,11 @@ export default AdminHOC(async function(render) {
|
||||
<div data-bind="authentication_middleware"></div>
|
||||
</div>
|
||||
`);
|
||||
render(transition($page));
|
||||
await initConfig();
|
||||
await initStorage();
|
||||
await initMiddleware();
|
||||
|
||||
render(transition($page));
|
||||
|
||||
componentStorageBackend(createRender(qs($page, "[data-bind=\"backend\"]")));
|
||||
componentAuthenticationMiddleware(createRender(qs($page, "[data-bind=\"authentication_middleware\"]")));
|
||||
|
||||
@@ -7,7 +7,7 @@ import { formTmpl } from "../../components/form.js";
|
||||
import { generateSkeleton } from "../../components/skeleton.js";
|
||||
|
||||
import {
|
||||
initMiddleware, getState,
|
||||
getState,
|
||||
getMiddlewareAvailable, getMiddlewareEnabled, toggleMiddleware,
|
||||
getBackendAvailable, getBackendEnabled,
|
||||
} from "./ctrl_backend_state.js";
|
||||
@@ -30,7 +30,6 @@ export default async function(render) {
|
||||
</div>
|
||||
`);
|
||||
render($page);
|
||||
await initMiddleware();
|
||||
|
||||
// feature: setup the buttons
|
||||
const init$ = getMiddlewareAvailable().pipe(
|
||||
|
||||
@@ -7,7 +7,7 @@ import { formObjToJSON$ } from "./helper_form.js";
|
||||
|
||||
export { getBackends as getBackendAvailable } from "./model_backend.js";
|
||||
|
||||
const backendsEnabled$ = new rxjs.ReplaySubject(1);
|
||||
const backendsEnabled$ = new rxjs.BehaviorSubject();
|
||||
|
||||
export async function initStorage() {
|
||||
return await getConfig().pipe(
|
||||
|
||||
Reference in New Issue
Block a user