Add in poll dropbox endpoint back into admin

This commit is contained in:
James Allen 2014-08-14 10:12:01 +01:00
parent 604505131b
commit 7816810249
3 changed files with 18 additions and 2 deletions

View file

@ -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?

View file

@ -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

View file

@ -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