mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Add ADB Key modal.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
module.exports =
|
||||
function AddAdbKeyModalServiceFactory($modal) {
|
||||
var service = {}
|
||||
|
||||
var ModalInstanceCtrl = function ($scope, $modalInstance, data) {
|
||||
$scope.modal = {}
|
||||
$scope.modal.showAdd = true
|
||||
$scope.modal.fingerprint = data.fingerprint
|
||||
$scope.modal.title = data.title
|
||||
|
||||
$scope.ok = function () {
|
||||
console.log('add key')
|
||||
$modalInstance.close(true)
|
||||
}
|
||||
|
||||
|
||||
$scope.$watch('modal.showAdd', function (newValue) {
|
||||
if (newValue === false) {
|
||||
$scope.ok()
|
||||
}
|
||||
})
|
||||
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel')
|
||||
}
|
||||
}
|
||||
|
||||
service.open = function (data) {
|
||||
var modalInstance = $modal.open({
|
||||
template: require('./add-adb-key-modal.jade'),
|
||||
controller: ModalInstanceCtrl,
|
||||
resolve: {
|
||||
data: function () {
|
||||
return data
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
modalInstance.result.then(function () {
|
||||
}, function () {
|
||||
})
|
||||
}
|
||||
|
||||
return service
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
describe('FatalMessageService', function() {
|
||||
|
||||
beforeEach(angular.mock.module(require('./').name));
|
||||
|
||||
it('should ...', inject(function(FatalMessageService) {
|
||||
|
||||
//expect(FatalMessageService.doSomething()).toEqual('something');
|
||||
|
||||
}));
|
||||
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
.stf-add-adb-key-modal.stf-modal
|
||||
.modal-header.dialog-header-confirm
|
||||
button(type='button', ng-click='cancel()').close ×
|
||||
h4.modal-title.text-dangerX
|
||||
i.fa.fa-android
|
||||
.button-spacer
|
||||
span(translate) Add the following ADB Key to STF?
|
||||
.modal-body
|
||||
//p Add the following ADB Key to STF?
|
||||
|
||||
form.panel(ng-submit='ok()')
|
||||
.panel-body
|
||||
label.control-label
|
||||
i.fa.fa-key.fa-fw
|
||||
span(translate) Fingerprint
|
||||
pre(ng-bind='modal.fingerprint').selectable
|
||||
|
||||
label.control-label
|
||||
i.fa.fa-laptop.fa-fw
|
||||
span(translate) Device
|
||||
pre(ng-bind='modal.title').selectable
|
||||
|
||||
button.btn.btn-primary-outline.btn-sm.pull-right(type='submit')
|
||||
i.fa.fa-plus.fa-fw
|
||||
span(translate) Add Key
|
||||
|
||||
//.modal-footer
|
||||
button.btn.btn-primary(type='button', ng-click='ok()')
|
||||
i.fa.fa-refresh
|
||||
span(translate) Try to reconnect
|
||||
button.btn.btn-success(ng-click='second()')
|
||||
i.fa.fa-sitemap
|
||||
span(translate) Go to Device List
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = angular.module('stf.add-adb-key-modal', [
|
||||
require('stf/common-ui/modals/common').name,
|
||||
//require('stf/keys/add-adb-key').name
|
||||
])
|
||||
.factory('AddAdbKeyModalService', require('./add-adb-key-modal-service'))
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = angular.module('stf.modals', [
|
||||
require('./fatal-message').name,
|
||||
require('./version-update').name
|
||||
require('./version-update').name,
|
||||
require('./add-adb-key-modal').name
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user