mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 12:55:26 +02:00
Add screenshots to UI. Still need to implement resizing.
This commit is contained in:
@@ -47,10 +47,10 @@ module.exports = syrup.serial()
|
||||
router.on(wire.ScreenCaptureMessage, function(channel) {
|
||||
var reply = wireutil.reply(options.serial)
|
||||
plugin.capture()
|
||||
.then(function(url) {
|
||||
.then(function(file) {
|
||||
push.send([
|
||||
channel
|
||||
, reply.okay(url)
|
||||
, reply.okay('success', file)
|
||||
])
|
||||
})
|
||||
.catch(function(err) {
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = syrup.serial()
|
||||
else {
|
||||
try {
|
||||
var result = JSON.parse(body)
|
||||
log.info('Uploaded to %s', result.resources.file)
|
||||
log.info('Uploaded to %s', result.resources.file.url)
|
||||
resolver.resolve(result.resources.file)
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
@@ -43,15 +43,18 @@ module.exports = function(options) {
|
||||
, resources: (function() {
|
||||
var mapped = Object.create(null)
|
||||
storedFiles.forEach(function(file) {
|
||||
mapped[file.field] = util.format(
|
||||
'http://%s:%s/api/v1/resources/%s%s'
|
||||
, options.publicIp
|
||||
, options.port
|
||||
, file.id
|
||||
, file.name
|
||||
? util.format('/%s', path.basename(file.name))
|
||||
: ''
|
||||
)
|
||||
mapped[file.field] = {
|
||||
date: new Date()
|
||||
, url: util.format(
|
||||
'http://%s:%s/api/v1/resources/%s%s'
|
||||
, options.publicIp
|
||||
, options.port
|
||||
, file.id
|
||||
, file.name
|
||||
? util.format('/%s', path.basename(file.name))
|
||||
: ''
|
||||
)
|
||||
}
|
||||
})
|
||||
return mapped
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user