Moved Remote Debug from Advanced to Dashboard for faster access.

This commit is contained in:
Gunther Brunner
2014-08-07 14:55:40 +09:00
parent ad29c048b3
commit 5bad2a35d5
10 changed files with 24 additions and 18 deletions

View File

@@ -0,0 +1,12 @@
require('./remote-debug.css')
module.exports = angular.module('stf.remote-debug', [
])
.run(["$templateCache", function ($templateCache) {
$templateCache.put(
'control-panes/advanced/remote-debug/remote-debug.jade',
require('./remote-debug.jade')
)
}])
.controller('RemoteDebugCtrl', require('./remote-debug-controller'))

View File

@@ -0,0 +1,17 @@
module.exports = function RemoteDebugCtrl($scope, $timeout) {
function startRemoteConnect() {
$scope.control.startRemoteConnect().then(function (result) {
var url = result.lastData
$scope.$apply(function () {
$scope.debugCommand = 'adb connect ' + url
})
})
}
// TODO: Remove timeout and fix control initialization
if ($scope.control) {
startRemoteConnect()
} else {
$timeout(startRemoteConnect, 200)
}
}

View File

@@ -0,0 +1,17 @@
describe('RemoteDebugCtrl', function () {
beforeEach(module('stf.remote-debug'));
var scope, ctrl;
beforeEach(inject(function ($rootScope, $controller) {
scope = $rootScope.$new();
ctrl = $controller('RemoteDebugCtrl', {$scope: scope});
}));
it('should ...', inject(function () {
expect(1).toEqual(1);
}));
});

View File

@@ -0,0 +1,10 @@
.stf-remote-debug {
}
.stf-remote-debug .remote-debug-textarea {
resize: none;
cursor: text;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
}

View File

@@ -0,0 +1,9 @@
.widget-container.fluid-height.stf-remote-debug(ng-controller='RemoteDebugCtrl')
.heading
i.fa.fa-bug
span(translate) Remote debug
i.fa.fa-question-circle.pull-right(tooltip='{{"Run the following on your command line to debug the device from your IDE" | translate}}', tooltip-placement='left')
.widget-content.padded
.form-inline
textarea(readonly, rows='1', ng-model='debugCommand', msd-elastic, text-focus-select).form-control.remote-debug-textarea