mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Cleanup.
This commit is contained in:
parent
45698c6977
commit
56541ba80e
7 changed files with 36 additions and 50 deletions
|
@ -1,6 +1,6 @@
|
|||
module.exports =
|
||||
function FatalMessageServiceFactory($modal, $location, $route, $interval,
|
||||
StateClassesService, $timeout) {
|
||||
StateClassesService) {
|
||||
var FatalMessageService = {}
|
||||
|
||||
var intervalDeviceInfo
|
||||
|
@ -15,7 +15,7 @@ module.exports =
|
|||
|
||||
function update() {
|
||||
$scope.device = device
|
||||
$scope.stateColor = StateClassesService.stateButton(device.state)
|
||||
$scope.stateColor = StateClassesService.stateColor(device.state)
|
||||
}
|
||||
|
||||
update()
|
||||
|
|
|
@ -15,33 +15,6 @@ module.exports = function deviceContextMenuDirective($window) {
|
|||
$window.close()
|
||||
}
|
||||
|
||||
function saveToDisk(fileURL, fileName) {
|
||||
// for non-IE
|
||||
if (!$window.ActiveXObject) {
|
||||
var save = document.createElement('a')
|
||||
save.href = fileURL
|
||||
save.target = '_blank'
|
||||
save.download = fileName || 'unknown'
|
||||
|
||||
var event = document.createEvent('Event')
|
||||
event.initEvent('click', true, true)
|
||||
save.dispatchEvent(event)
|
||||
if ($window.URL) {
|
||||
$window.URL.revokeObjectURL(save.href)
|
||||
} else if ($window.webkitURL) {
|
||||
$window.webkitURL.revokeObjectURL(save.href)
|
||||
}
|
||||
}
|
||||
|
||||
// for IE
|
||||
else if (!!$window.ActiveXObject && document.execCommand) {
|
||||
var _window = $window.open(fileURL, '_blank')
|
||||
_window.document.close()
|
||||
_window.document.execCommand('SaveAs', true, fileName || fileURL)
|
||||
_window.close()
|
||||
}
|
||||
}
|
||||
|
||||
scope.saveScreenShot = function () {
|
||||
scope.control.screenshot().then(function (result) {
|
||||
location.href = result.body.href + '?download'
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
div(ng-show='showClipboard')
|
||||
|
||||
.alert.alert-info.selectable <strong>Tip: </strong>Run this command to copy the key to your clipboard
|
||||
a(ng-href='/#!/docs/adb-keys').pull-right
|
||||
i.fa.fa-question-circle(tooltip='{{"More about ADB Keys" | translate}}', tooltip-placement='left')
|
||||
textarea(readonly, rows='1', text-focus-select, ng-copy='focusAddKey = true'
|
||||
).form-control.remote-debug-textarea pbcopy < ~/.android/adbkey.pub
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = function AccessTokensCtrl($scope) {
|
||||
module.exports = function AccessTokensCtrl() {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
module.exports = function AdbKeysCtrl($scope, $http, UserService) {
|
||||
$scope.adbKeys = []
|
||||
module.exports =
|
||||
function AdbKeysCtrl($scope, $http, UserService, AddAdbKeyModalService,
|
||||
FatalMessageService) {
|
||||
$scope.adbKeys = []
|
||||
|
||||
function updateKeys() {
|
||||
$scope.adbKeys = UserService.getAdbKeys()
|
||||
}
|
||||
|
||||
$scope.removeKey = function (key) {
|
||||
UserService.removeAdbKey(key)
|
||||
}
|
||||
|
||||
$scope.$on('user.keys.adb.updated', updateKeys)
|
||||
updateKeys()
|
||||
|
||||
//AddAdbKeyModalService.open({
|
||||
// fingerprint: '9a:12:5b:14:e3:3e:c9:d3:59:be:4f:16:0d:4d:cd:26',
|
||||
// title: 'a12907@PC-5954.local'
|
||||
//})
|
||||
|
||||
//FatalMessageService.open({
|
||||
// enhancedName: 'dev',
|
||||
// enhancedStatePassive: 'online',
|
||||
// likelyLeaveReason: 'Not good enough'
|
||||
//})
|
||||
|
||||
|
||||
function updateKeys() {
|
||||
$scope.adbKeys = UserService.getAdbKeys()
|
||||
}
|
||||
|
||||
$scope.removeKey = function (key) {
|
||||
UserService.removeAdbKey(key)
|
||||
}
|
||||
|
||||
$scope.$on('user.keys.adb.updated', updateKeys)
|
||||
updateKeys()
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
.widget-content.padded
|
||||
|
||||
add-adb-key(show-clipboard='true', show-add='showAdd')
|
||||
|
||||
nothing-to-show(icon='fa-android', message='{{"No ADB keys" | translate}}',
|
||||
ng-if='!adbKeys.length && !showAdd')
|
||||
|
||||
add-adb-key(show-clipboard='true', show-add='showAdd')
|
||||
|
||||
|
||||
//accordion(ng-if='showAdd').pointer
|
||||
accordion-group(is-open='showAdd')
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = function KeysCtrl($scope) {
|
||||
module.exports = function KeysCtrl() {
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue