1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00
This commit is contained in:
Gunther Brunner 2014-10-06 17:06:42 +09:00
parent 45698c6977
commit 56541ba80e
7 changed files with 36 additions and 50 deletions

View file

@ -1,6 +1,6 @@
module.exports = module.exports =
function FatalMessageServiceFactory($modal, $location, $route, $interval, function FatalMessageServiceFactory($modal, $location, $route, $interval,
StateClassesService, $timeout) { StateClassesService) {
var FatalMessageService = {} var FatalMessageService = {}
var intervalDeviceInfo var intervalDeviceInfo
@ -15,7 +15,7 @@ module.exports =
function update() { function update() {
$scope.device = device $scope.device = device
$scope.stateColor = StateClassesService.stateButton(device.state) $scope.stateColor = StateClassesService.stateColor(device.state)
} }
update() update()

View file

@ -15,33 +15,6 @@ module.exports = function deviceContextMenuDirective($window) {
$window.close() $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.saveScreenShot = function () {
scope.control.screenshot().then(function (result) { scope.control.screenshot().then(function (result) {
location.href = result.body.href + '?download' location.href = result.body.href + '?download'

View file

@ -7,8 +7,6 @@
div(ng-show='showClipboard') div(ng-show='showClipboard')
.alert.alert-info.selectable <strong>Tip: </strong>Run this command to copy the key to your clipboard .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' textarea(readonly, rows='1', text-focus-select, ng-copy='focusAddKey = true'
).form-control.remote-debug-textarea pbcopy < ~/.android/adbkey.pub ).form-control.remote-debug-textarea pbcopy < ~/.android/adbkey.pub

View file

@ -1,3 +1,3 @@
module.exports = function AccessTokensCtrl($scope) { module.exports = function AccessTokensCtrl() {
} }

View file

@ -1,14 +1,29 @@
module.exports = function AdbKeysCtrl($scope, $http, UserService) { module.exports =
$scope.adbKeys = [] 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()
}

View file

@ -16,11 +16,11 @@
.widget-content.padded .widget-content.padded
add-adb-key(show-clipboard='true', show-add='showAdd')
nothing-to-show(icon='fa-android', message='{{"No ADB keys" | translate}}', nothing-to-show(icon='fa-android', message='{{"No ADB keys" | translate}}',
ng-if='!adbKeys.length && !showAdd') ng-if='!adbKeys.length && !showAdd')
add-adb-key(show-clipboard='true', show-add='showAdd')
//accordion(ng-if='showAdd').pointer //accordion(ng-if='showAdd').pointer
accordion-group(is-open='showAdd') accordion-group(is-open='showAdd')

View file

@ -1,3 +1,3 @@
module.exports = function KeysCtrl($scope) { module.exports = function KeysCtrl() {
} }