mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add in poll dropbox endpoint back into admin
This commit is contained in:
parent
604505131b
commit
7816810249
3 changed files with 18 additions and 2 deletions
|
@ -12,7 +12,7 @@ rclient.auth(Settings.redis.web.password)
|
|||
RecurlyWrapper = require('../Subscription/RecurlyWrapper')
|
||||
SubscriptionHandler = require('../Subscription/SubscriptionHandler')
|
||||
projectEntityHandler = require('../Project/ProjectEntityHandler')
|
||||
TpdsPollingBackgroundTasks = require("../ThirdPartyDataStore/TpdsPollingBackgroundTasks")
|
||||
TpdsUpdateSender = require("../ThirdPartyDataStore/TpdsUpdateSender")
|
||||
EditorRealTimeController = require("../Editor/EditorRealTimeController")
|
||||
SystemMessageManager = require("../SystemMessages/SystemMessageManager")
|
||||
|
||||
|
@ -74,6 +74,11 @@ module.exports = AdminController =
|
|||
projectEntityHandler.flushProjectToThirdPartyDataStore req.body.project_id, (err)->
|
||||
res.send 200
|
||||
|
||||
pollDropboxForUser: (req, res)->
|
||||
user_id = req.body.user_id
|
||||
TpdsUpdateSender.pollDropboxForUser user_id, () ->
|
||||
res.send 200
|
||||
|
||||
createMessage: (req, res, next) ->
|
||||
SystemMessageManager.createMessage req.body.content, (error) ->
|
||||
return next(error) if error?
|
||||
|
|
|
@ -169,6 +169,7 @@ module.exports = class Router
|
|||
app.post '/admin/dissconectAllUsers', SecurityManager.requestIsAdmin, AdminController.dissconectAllUsers
|
||||
app.post '/admin/syncUserToSubscription', SecurityManager.requestIsAdmin, AdminController.syncUserToSubscription
|
||||
app.post '/admin/flushProjectToTpds', SecurityManager.requestIsAdmin, AdminController.flushProjectToTpds
|
||||
app.post '/admin/pollDropboxForUser', SecurityManager.requestIsAdmin, AdminController.pollDropboxForUser
|
||||
app.post '/admin/messages', SecurityManager.requestIsAdmin, AdminController.createMessage
|
||||
app.post '/admin/messages/clear', SecurityManager.requestIsAdmin, AdminController.clearMessages
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ block content
|
|||
.form-group
|
||||
button.btn-primary.btn(type='submit') Link
|
||||
|
||||
tab(heading="TPDS Management")
|
||||
tab(heading="TPDS/Dropbox Management")
|
||||
h3 Flush project to TPDS
|
||||
.row
|
||||
form.col-xs-6(enctype='multipart/form-data', method='post',action='/admin/flushProjectToTpds')
|
||||
|
@ -55,6 +55,16 @@ block content
|
|||
input.form-control(type='text', name='project_id', placeholder='project_id', required)
|
||||
.form-group
|
||||
button.btn-primary.btn(type='submit') Flush
|
||||
hr
|
||||
h3 Poll Dropbox for user
|
||||
.row
|
||||
form.col-xs-6(enctype='multipart/form-data', method='post',action='/admin/pollDropboxForUser')
|
||||
input(name="_csrf", type="hidden", value=csrfToken)
|
||||
.form-group
|
||||
label(for='user_id') user_id
|
||||
input.form-control(type='text', name='user_id', placeholder='user_id', required)
|
||||
.form-group
|
||||
button.btn-primary.btn(type='submit') Poll
|
||||
|
||||
tab(heading="System Messages")
|
||||
each message in systemMessages
|
||||
|
|
Loading…
Reference in a new issue