Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions InfoLogger/config-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
tls: false,
allow: true,
name: 'ILG',
apiAuthRoutes: true,
},

// optional data source, comment object if not used
Expand Down
32 changes: 17 additions & 15 deletions InfoLogger/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import { sessionService } from '/js/src/index.js';
sessionService.loadAndHideParameters();
const isSessionLoaded = sessionService.loadAndHideParameters({ loginUrl: '/api/login' });

// Expose sessionService to interact with it the browser's console
window.sessionService = sessionService;
Expand All @@ -23,20 +23,22 @@
import view from './view.js';
import Model from './Model.js';

// Start application
const model = new Model();
const debug = true; // shows when redraw is done
StatefulComponent.useRenderer(model); // Register the model for the stateful components
let currentView = view;
mount(document.body, (model) => currentView(model), model, debug);
// Start application, unless the browser is being redirected to the login
if (isSessionLoaded) {
const model = new Model();
const debug = true; // shows when redraw is done
StatefulComponent.useRenderer(model); // Register the model for the stateful components
let currentView = view;
mount(document.body, (model) => currentView(model), model, debug);

// Expose model to interact with it the browser's console
window.model = model;
// Expose model to interact with it the browser's console
window.model = model;

// Dev only: swap in the new view tree on edit and keep model state; stripped from the prod build
if (import.meta.hot) {
import.meta.hot.accept('./view.js', (newModule) => {
currentView = newModule.default;
model.notify();
});
// Dev only: swap in the new view tree on edit and keep model state; stripped from the prod build
if (import.meta.hot) {
import.meta.hot.accept('./view.js', (newModule) => {
currentView = newModule.default;
model.notify();
});
}
}
1 change: 1 addition & 0 deletions InfoLogger/test/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
tls: false,
allow: true,
name: 'TST',
apiAuthRoutes: true,
},
infoLoggerServer: {
host: 'localhost',
Expand Down
Loading