// SPDX-License-Identifier: AGPL-3.0
$(document).on('ready', function() {
// SPDX-License-Identifier: AGPL-3.0
$(document).on('ready', function() {
- vnode.state.db = new SessionDB()
- vnode.state.hostToAdd = m.stream('')
- vnode.state.error = m.stream()
- vnode.state.checking = m.stream()
+ vnode.state.db = new SessionDB();
+ vnode.state.db.autoRedirectToHomeCluster('/sessions');
+ vnode.state.db.migrateNonFederatedSessions();
+ vnode.state.hostToAdd = m.stream('');
+ vnode.state.error = m.stream();
+ vnode.state.checking = m.stream();
- m('a[href="/collections/multisite"]', 'multi-site search'),
- ' page to search collections on all sites at once.',
+ m('a[href="/search"]', 'multi-site search'),
+ ' page to search collections and projects on all sites at once.'
- m('td', m('span.label.label-success', 'logged in')),
+ m('td', session.user.is_active ?
+ m('span.label.label-success', 'logged in') :
+ m('span.label.label-warning', 'inactive')),
m('td', {title: session.baseURL}, uuidPrefix),
m('td', session.user.username),
m('td', session.user.email),
m('td', session.isFromRails ? null : m('button.btn.btn-xs.btn-default', {
uuidPrefix: uuidPrefix,
onclick: m.withAttr('uuidPrefix', db.logout),
m('td', {title: session.baseURL}, uuidPrefix),
m('td', session.user.username),
m('td', session.user.email),
m('td', session.isFromRails ? null : m('button.btn.btn-xs.btn-default', {
uuidPrefix: uuidPrefix,
onclick: m.withAttr('uuidPrefix', db.logout),
- }, 'Log out ', m('span.glyphicon.glyphicon-log-out'))),
+ }, session.listedHost ? 'Disable ':'Log out ', m('span.glyphicon.glyphicon-log-out')))
] : [
m('td', m('span.label.label-default', 'logged out')),
m('td', {title: session.baseURL}, uuidPrefix),
] : [
m('td', m('span.label.label-default', 'logged out')),
m('td', {title: session.baseURL}, uuidPrefix),
m('td', m('a.btn.btn-xs.btn-primary', {
uuidPrefix: uuidPrefix,
onclick: db.login.bind(db, session.baseURL),
m('td', m('a.btn.btn-xs.btn-primary', {
uuidPrefix: uuidPrefix,
onclick: db.login.bind(db, session.baseURL),
- }, 'Log in ', m('span.glyphicon.glyphicon-log-in'))),
+ }, session.listedHost ? 'Enable ':'Log in ', m('span.glyphicon.glyphicon-log-in')))
- m('td', session.isFromRails ? null : m('button.btn.btn-xs.btn-default', {
- uuidPrefix: uuidPrefix,
- onclick: m.withAttr('uuidPrefix', db.trash),
- }, 'Remove ', m('span.glyphicon.glyphicon-trash'))),
+ m('td', (session.isFromRails || session.listedHost) ? null :
+ m('button.btn.btn-xs.btn-default', {
+ uuidPrefix: uuidPrefix,
+ onclick: m.withAttr('uuidPrefix', db.trash),
+ }, 'Remove ', m('span.glyphicon.glyphicon-trash'))
+ ),