mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Added ability to install from device screen. Still not synced to Upload panel.
This commit is contained in:
parent
24afc6fbef
commit
3aa44f1a9c
3 changed files with 46 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
|||
module.exports = function ($scope, gettext, $routeParams, $location,
|
||||
DeviceService, GroupService, ControlService) {
|
||||
module.exports = function ($scope, gettext, $routeParams, $location, DeviceService, GroupService, ControlService) {
|
||||
|
||||
var sharedTabs = [
|
||||
{
|
||||
|
@ -56,6 +55,48 @@ module.exports = function ($scope, gettext, $routeParams, $location,
|
|||
$scope.control = null
|
||||
|
||||
|
||||
$scope.installFileForced = function ($files) {
|
||||
$scope.upload = {
|
||||
progress: 0,
|
||||
lastData: 'uploading'
|
||||
}
|
||||
|
||||
var upload = $scope.control.uploadFile($files)
|
||||
return upload.promise
|
||||
.progressed(function (uploadResult) {
|
||||
$scope.$apply(function () {
|
||||
$scope.upload = uploadResult
|
||||
})
|
||||
})
|
||||
.then(function (uploadResult) {
|
||||
$scope.$apply(function () {
|
||||
$scope.upload = uploadResult
|
||||
})
|
||||
if (uploadResult.success) {
|
||||
return $scope.maybeInstallForced(uploadResult.body)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$scope.maybeInstallForced = function (options) {
|
||||
var install = $scope.control.install(options)
|
||||
return install.promise
|
||||
.progressed(function (installResult) {
|
||||
$scope.$apply(function () {
|
||||
installResult.manifest = options.manifest
|
||||
$scope.installation = installResult
|
||||
})
|
||||
})
|
||||
.then(function (installResult) {
|
||||
$scope.$apply(function () {
|
||||
installResult.manifest = options.manifest
|
||||
$scope.treeData = installResult.manifest
|
||||
$scope.installation = installResult
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
DeviceService.get($routeParams.serial, $scope)
|
||||
.then(function (device) {
|
||||
return GroupService.invite(device)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
device-screen canvas {
|
||||
transition: width 80ms linear;
|
||||
-ms-transform: width 80ms linear;
|
||||
-webkit-transform: width 80ms linear;
|
||||
}
|
||||
|
||||
device-screen {
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
span.pull-right(ng-click='kickDevice(groupDevice); $event.stopPropagation()').kick-device
|
||||
i.fa.fa-times
|
||||
|
||||
.as-row.fill-height(ng-file-drop='controll.install($files)')
|
||||
.as-row.fill-height(ng-file-drop='installFileForced($files)')
|
||||
div(ng-controller='DeviceScreenCtrl').fill-height
|
||||
device-screen(style='width: 100%; height: 100%; background: gray')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue