mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 00:53:26 +02:00
Add Access Tokens base.
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
.row(ng-controller='AdbKeysCtrl')
|
||||
.col-sm-12
|
||||
.widget-container.fluid-height.stf-adb-keys
|
||||
.heading
|
||||
i.fa.fa-android
|
||||
span(translate) ADB Keys
|
||||
|
||||
button.btn.pull-right.btn-sm(
|
||||
ng-click='showAdd = !showAdd',
|
||||
ng-class='{ "btn-primary-outline": !showAdd, "btn-primary": showAdd }')
|
||||
//(tooltip='{{ "Add ADB Key" | translate }}')
|
||||
i.fa.fa-plus.fa-fw
|
||||
|
||||
.widget-content.padded
|
||||
|
||||
add-adb-key(show-clipboard='true', show-add='showAdd')
|
||||
|
||||
nothing-to-show(icon='fa-key', message='{{"No ADB keys" | translate}}',
|
||||
ng-if='!adbKeys.length && !showAdd')
|
||||
|
||||
|
||||
//accordion(ng-if='showAdd').pointer
|
||||
accordion-group(is-open='showAdd')
|
||||
accordion-heading.pointer
|
||||
i.fa.fa-fw.fa-key
|
||||
span(translateX) Add ADB Key
|
||||
|
||||
form.form-horizontal(name='adbkeyform', ng-submit='addKey(key)')
|
||||
|
||||
.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,
|
||||
).form-control.remote-debug-textarea pbcopy < ~/.android/adbkey.pub
|
||||
//<code>pbcopy < ~/.android/adbkey.pub</code>
|
||||
|
||||
br
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-key.fa-fw
|
||||
span(translate) Key
|
||||
.col-md-11
|
||||
textarea(rows='4', ng-model='key', ng-required='true',
|
||||
autocorrect='off', autocapitalize='off', spellcheck='false',
|
||||
focus-element='focusAddKey').form-control
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-laptop.fa-fw
|
||||
span(translate) Device
|
||||
.col-md-11
|
||||
input(type='text', ng-model='title', ng-required='true',
|
||||
text-focus-select, focus-element='focusAddTitle').form-control
|
||||
|
||||
button.btn.btn-primary-outline.btn-sm.pull-right(type='submit')
|
||||
i.fa.fa-plus.fa-fw
|
||||
span(translate) Add Key
|
||||
|
||||
//.panel.panel-default(ng-show='showAdd')
|
||||
.panel-heading
|
||||
h3.panel-title(translate) Add ADB Key
|
||||
.panel-body
|
||||
form.form-horizontal(name='adbkeyform', ng-submit='addKey(key)')
|
||||
|
||||
.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
|
||||
//<code>pbcopy < ~/.android/adbkey.pub</code>
|
||||
|
||||
br
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-key.fa-fw
|
||||
span(translate) Key
|
||||
.col-md-11
|
||||
textarea(rows='4', ng-model='key', ng-required='true',
|
||||
autocorrect='off', autocapitalize='off', spellcheck='false',
|
||||
focus-element='focusAddKey', ng-paste='focusAddTitle = true').form-control
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-laptop.fa-fw
|
||||
span(translate) Device
|
||||
.col-md-11
|
||||
input(type='text', ng-model='title', ng-required='true',
|
||||
text-focus-select, focus-element='focusAddTitle').form-control
|
||||
|
||||
|
||||
|
||||
button.btn.btn-primary-outline.btn-sm.pull-right(type='submit')
|
||||
i.fa.fa-plus.fa-fw
|
||||
span(translate) Add Key
|
||||
|
||||
//error-message(message='{{error}}')
|
||||
|
||||
|
||||
ul.list-group.key-list
|
||||
li.list-group-item(ng-repeat='key in adbKeys').animate-repeat
|
||||
a
|
||||
i.fa.fa-key.fa-2x.fa-fw.key-list-icon
|
||||
.key-list-details.selectable
|
||||
.key-list-title(ng-bind='key.title')
|
||||
.key-list-fingerprint(ng-bind='key.fingerprint')
|
||||
|
||||
button.btn.btn-xs.btn-danger-outline.pull-right.key-list-remove(ng-click='removeKey(key)')
|
||||
i.fa.fa-trash-o
|
||||
span(translate) Remove
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = angular.module('ui-settings', [
|
||||
require('./general').name,
|
||||
require('./adb-keys').name,
|
||||
require('./keys').name,
|
||||
require('stf/common-ui/nice-tabs').name
|
||||
//require('./notifications').name
|
||||
])
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function AccessTokensCtrl($scope) {
|
||||
|
||||
}
|
||||
17
res/app/settings/keys/access-tokens/access-tokens-spec.js
Normal file
17
res/app/settings/keys/access-tokens/access-tokens-spec.js
Normal file
@@ -0,0 +1,17 @@
|
||||
describe('AccessTokensCtrl', function () {
|
||||
|
||||
beforeEach(angular.mock.module(require('./index').name))
|
||||
|
||||
var scope, ctrl
|
||||
|
||||
beforeEach(inject(function ($rootScope, $controller) {
|
||||
scope = $rootScope.$new()
|
||||
ctrl = $controller('AccessTokensCtrl', {$scope: scope})
|
||||
}))
|
||||
|
||||
it('should ...', inject(function () {
|
||||
expect(1).toEqual(1)
|
||||
|
||||
}))
|
||||
|
||||
})
|
||||
3
res/app/settings/keys/access-tokens/access-tokens.css
Normal file
3
res/app/settings/keys/access-tokens/access-tokens.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.stf-access-tokens {
|
||||
|
||||
}
|
||||
33
res/app/settings/keys/access-tokens/access-tokens.jade
Normal file
33
res/app/settings/keys/access-tokens/access-tokens.jade
Normal file
@@ -0,0 +1,33 @@
|
||||
.widget-container.fluid-height.stf-access-tokens(ng-controller='AccessTokensCtrl')
|
||||
.heading
|
||||
i.fa.fa-key
|
||||
span(translate) Access Tokens
|
||||
|
||||
button.btn.pull-right.btn-sm(
|
||||
ng-click='showAdd = !showAdd',
|
||||
ng-class='{ "btn-primary-outline": !showAdd, "btn-primary": showAdd }')
|
||||
i.fa.fa-plus.fa-fw
|
||||
|
||||
a(ng-href='/#!/docs/access-tokens').pull-right.btn.btn-sm
|
||||
i.fa.fa-question-circle(tooltip='{{"More about Access Tokens" | translate}}', tooltip-placement='left')
|
||||
|
||||
.widget-content.padded
|
||||
|
||||
//add-adb-key(show-clipboard='true', show-add='showAdd')
|
||||
|
||||
nothing-to-show(icon='fa-key', message='{{"No access tokens" | translate}}',
|
||||
ng-if='!adbKeys.length && !showAdd')
|
||||
|
||||
|
||||
|
||||
ul.list-group.key-list
|
||||
li.list-group-item(ng-repeat='key in adbKeys').animate-repeat
|
||||
a
|
||||
i.fa.fa-key.fa-2x.fa-fw.key-list-icon
|
||||
.key-list-details.selectable
|
||||
.key-list-title(ng-bind='key.title')
|
||||
.key-list-fingerprint(ng-bind='key.fingerprint')
|
||||
|
||||
button.btn.btn-xs.btn-danger-outline.pull-right.key-list-remove(ng-click='removeKey(key)')
|
||||
i.fa.fa-trash-o
|
||||
span(translate) Remove
|
||||
11
res/app/settings/keys/access-tokens/index.js
Normal file
11
res/app/settings/keys/access-tokens/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
require('./access-tokens.css')
|
||||
|
||||
module.exports = angular.module('stf.access-tokens', [
|
||||
require('stf/common-ui').name
|
||||
])
|
||||
.run(["$templateCache", function ($templateCache) {
|
||||
$templateCache.put(
|
||||
'settings/keys/access-tokens/access-tokens.jade', require('./access-tokens.jade')
|
||||
)
|
||||
}])
|
||||
.controller('AccessTokensCtrl', require('./access-tokens-controller'))
|
||||
@@ -7,11 +7,11 @@ module.exports = function AdbKeysCtrl($scope, AddAdbKeyModalService) {
|
||||
|
||||
$scope.adbKeys = [
|
||||
{
|
||||
title: 'PC1264',
|
||||
title: 'A11251@PC1264.local',
|
||||
fingerprint: 'bb:86:60:39:d7:a2:e3:09:93:09:cc:f6:e8:37:99:3f'
|
||||
},
|
||||
{
|
||||
title: 'Mobile mac',
|
||||
title: 'A11251@MobileMac.local',
|
||||
fingerprint: '97:ca:ae:fa:09:0b:c4:fe:22:94:7d:b2:be:77:66:a1'
|
||||
}
|
||||
]
|
||||
114
res/app/settings/keys/adb-keys/adb-keys.jade
Normal file
114
res/app/settings/keys/adb-keys/adb-keys.jade
Normal file
@@ -0,0 +1,114 @@
|
||||
.widget-container.fluid-height.stf-adb-keys(ng-controller='AdbKeysCtrl')
|
||||
.heading
|
||||
i.fa.fa-android
|
||||
span(translate) ADB Keys
|
||||
|
||||
|
||||
|
||||
button.btn.pull-right.btn-sm(
|
||||
ng-click='showAdd = !showAdd',
|
||||
ng-class='{ "btn-primary-outline": !showAdd, "btn-primary": showAdd }')
|
||||
//(tooltip='{{ "Add ADB Key" | translate }}')
|
||||
i.fa.fa-plus.fa-fw
|
||||
|
||||
a(ng-href='/#!/docs/adb-keys').pull-right.btn.btn-sm
|
||||
i.fa.fa-question-circle(tooltip='{{"More about ADB Keys" | translate}}', tooltip-placement='left')
|
||||
|
||||
.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')
|
||||
|
||||
|
||||
//accordion(ng-if='showAdd').pointer
|
||||
accordion-group(is-open='showAdd')
|
||||
accordion-heading.pointer
|
||||
i.fa.fa-fw.fa-key
|
||||
span(translateX) Add ADB Key
|
||||
|
||||
form.form-horizontal(name='adbkeyform', ng-submit='addKey(key)')
|
||||
|
||||
.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,
|
||||
).form-control.remote-debug-textarea pbcopy < ~/.android/adbkey.pub
|
||||
//<code>pbcopy < ~/.android/adbkey.pub</code>
|
||||
|
||||
br
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-key.fa-fw
|
||||
span(translate) Key
|
||||
.col-md-11
|
||||
textarea(rows='4', ng-model='key', ng-required='true',
|
||||
autocorrect='off', autocapitalize='off', spellcheck='false',
|
||||
focus-element='focusAddKey').form-control
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-laptop.fa-fw
|
||||
span(translate) Device
|
||||
.col-md-11
|
||||
input(type='text', ng-model='title', ng-required='true',
|
||||
text-focus-select, focus-element='focusAddTitle').form-control
|
||||
|
||||
button.btn.btn-primary-outline.btn-sm.pull-right(type='submit')
|
||||
i.fa.fa-plus.fa-fw
|
||||
span(translate) Add Key
|
||||
|
||||
//.panel.panel-default(ng-show='showAdd')
|
||||
.panel-heading
|
||||
h3.panel-title(translate) Add ADB Key
|
||||
.panel-body
|
||||
form.form-horizontal(name='adbkeyform', ng-submit='addKey(key)')
|
||||
|
||||
.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
|
||||
//<code>pbcopy < ~/.android/adbkey.pub</code>
|
||||
|
||||
br
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-key.fa-fw
|
||||
span(translate) Key
|
||||
.col-md-11
|
||||
textarea(rows='4', ng-model='key', ng-required='true',
|
||||
autocorrect='off', autocapitalize='off', spellcheck='false',
|
||||
focus-element='focusAddKey', ng-paste='focusAddTitle = true').form-control
|
||||
|
||||
.form-group
|
||||
label.control-label.col-md-1
|
||||
i.fa.fa-laptop.fa-fw
|
||||
span(translate) Device
|
||||
.col-md-11
|
||||
input(type='text', ng-model='title', ng-required='true',
|
||||
text-focus-select, focus-element='focusAddTitle').form-control
|
||||
|
||||
|
||||
|
||||
button.btn.btn-primary-outline.btn-sm.pull-right(type='submit')
|
||||
i.fa.fa-plus.fa-fw
|
||||
span(translate) Add Key
|
||||
|
||||
//error-message(message='{{error}}')
|
||||
|
||||
|
||||
ul.list-group.key-list
|
||||
li.list-group-item(ng-repeat='key in adbKeys').animate-repeat
|
||||
a
|
||||
i.fa.fa-key.fa-2x.fa-fw.key-list-icon
|
||||
.key-list-details.selectable
|
||||
.key-list-title(ng-bind='key.title')
|
||||
.key-list-fingerprint(ng-bind='key.fingerprint')
|
||||
|
||||
button.btn.btn-xs.btn-danger-outline.pull-right.key-list-remove(ng-click='removeKey(key)')
|
||||
i.fa.fa-trash-o
|
||||
span(translate) Remove
|
||||
@@ -6,7 +6,7 @@ module.exports = angular.module('stf.settings.adb-keys', [
|
||||
])
|
||||
.run(["$templateCache", function ($templateCache) {
|
||||
$templateCache.put(
|
||||
'settings/adb-keys/adb-keys.jade', require('./adb-keys.jade')
|
||||
'settings/keys/adb-keys/adb-keys.jade', require('./adb-keys.jade')
|
||||
)
|
||||
}])
|
||||
.controller('AdbKeysCtrl', require('./adb-keys-controller'))
|
||||
12
res/app/settings/keys/index.js
Normal file
12
res/app/settings/keys/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
require('./keys.css')
|
||||
|
||||
module.exports = angular.module('stf.keys', [
|
||||
require('./adb-keys').name,
|
||||
require('./access-tokens').name
|
||||
])
|
||||
.run(["$templateCache", function ($templateCache) {
|
||||
$templateCache.put(
|
||||
'settings/keys/keys.jade', require('./keys.jade')
|
||||
)
|
||||
}])
|
||||
.controller('KeysCtrl', require('./keys-controller'))
|
||||
3
res/app/settings/keys/keys-controller.js
Normal file
3
res/app/settings/keys/keys-controller.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function KeysCtrl($scope) {
|
||||
|
||||
}
|
||||
17
res/app/settings/keys/keys-spec.js
Normal file
17
res/app/settings/keys/keys-spec.js
Normal file
@@ -0,0 +1,17 @@
|
||||
describe('KeysCtrl', function () {
|
||||
|
||||
beforeEach(angular.mock.module(require('./index').name))
|
||||
|
||||
var scope, ctrl
|
||||
|
||||
beforeEach(inject(function ($rootScope, $controller) {
|
||||
scope = $rootScope.$new()
|
||||
ctrl = $controller('KeysCtrl', {$scope: scope})
|
||||
}))
|
||||
|
||||
it('should ...', inject(function () {
|
||||
expect(1).toEqual(1)
|
||||
|
||||
}))
|
||||
|
||||
})
|
||||
3
res/app/settings/keys/keys.css
Normal file
3
res/app/settings/keys/keys.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.stf-keys {
|
||||
|
||||
}
|
||||
5
res/app/settings/keys/keys.jade
Normal file
5
res/app/settings/keys/keys.jade
Normal file
@@ -0,0 +1,5 @@
|
||||
.row
|
||||
.col-md-6
|
||||
div(ng-include='"settings/keys/access-tokens/access-tokens.jade"')
|
||||
.col-md-6
|
||||
div(ng-include='"settings/keys/adb-keys/adb-keys.jade"')
|
||||
@@ -4,7 +4,7 @@ module.exports = function SettingsCtrl($scope, gettext) {
|
||||
{
|
||||
title: gettext('Keys'),
|
||||
icon: 'fa-key fa-fw',
|
||||
templateUrl: 'settings/adb-keys/adb-keys.jade'
|
||||
templateUrl: 'settings/keys/keys.jade'
|
||||
},
|
||||
{
|
||||
title: gettext('General'),
|
||||
|
||||
Reference in New Issue
Block a user