Merge pull request #3683 from overleaf/bg-admin-open-editor

Allow admin to reopen editor after closing

GitOrigin-RevId: 9bf0c4234a9d510785aa4bddbb9f239d678ba503
This commit is contained in:
Jessica Lawshe 2021-02-22 09:01:48 -06:00 committed by Copybot
parent 5338990fb3
commit 0f7b268cdf
3 changed files with 18 additions and 1 deletions

View file

@ -107,6 +107,12 @@ const AdminController = {
return res.sendStatus(200)
},
openEditor(req, res) {
logger.warn('opening editor')
Settings.editorIsOpen = true
return res.sendStatus(200)
},
closeEditor(req, res) {
logger.warn('closing editor')
Settings.editorIsOpen = req.body.isOpen

View file

@ -943,6 +943,11 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
AuthorizationMiddleware.ensureUserIsSiteAdmin,
UserController.register
)
webRouter.post(
'/admin/openEditor',
AuthorizationMiddleware.ensureUserIsSiteAdmin,
AdminController.openEditor
)
webRouter.post(
'/admin/closeEditor',
AuthorizationMiddleware.ensureUserIsSiteAdmin,

View file

@ -34,7 +34,7 @@ block content
each agent in agents
li(ng-non-bindable) #{agent}
tab(heading="Close Editor")
tab(heading="Open/Close Editor")
.row-spaced
form(method='post',action='/admin/closeEditor')
input(name="_csrf", type="hidden", value=csrfToken)
@ -47,6 +47,12 @@ block content
button.btn.btn-danger(type="submit") Disconnect all users
p.small Will force disconnect all users with the editor open. Make sure to close the editor first to avoid them reconnecting.
.row-spaced
form(method='post',action='/admin/openEditor')
input(name="_csrf", type="hidden", value=csrfToken)
button.btn.btn-danger(type="submit") Reopen Editor
p.small Will reopen the editor after closing.
tab(heading="TPDS/Dropbox Management")
h3 Flush project to TPDS
.row