Add ADB Key modal.

This commit is contained in:
Gunther Brunner
2014-09-29 19:57:30 +09:00
parent 6b1a2700bd
commit 9f0affaafd
6 changed files with 102 additions and 4 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,11 @@
describe('FatalMessageService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(FatalMessageService) {
//expect(FatalMessageService.doSomething()).toEqual('something');
}));
})

View File

@@ -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

View File

@@ -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'))