diff --git a/cmd/drone-server/static/scripts/controllers/builds.js b/cmd/drone-server/static/scripts/controllers/builds.js
index 6a28a17b..d37ad76c 100644
--- a/cmd/drone-server/static/scripts/controllers/builds.js
+++ b/cmd/drone-server/static/scripts/controllers/builds.js
@@ -64,7 +64,6 @@
* BuildCtrl responsible for rendering a build.
*/
function BuildCtrl($scope, $stateParams, $window, logs, builds, repos, users) {
-
var number = $stateParams.number;
var owner = $stateParams.owner;
var name = $stateParams.name;
@@ -97,6 +96,27 @@
$scope.build = event;
$scope.$apply();
});
+
+ $scope.restart = function () {
+ console.log('restart');
+ builds.restart(fullName, number).then(function (payload) {
+ $scope.build = payload.data;
+ }).catch(function (err) {
+ $scope.error = err;
+ });
+ };
+
+ $scope.cancel = function () {
+ builds.cancel(fullName, number).then(function (payload) {
+ $scope.build = payload.data;
+ }).catch(function (err) {
+ $scope.error = err;
+ });
+ };
+
+ $scope.tail = function () {
+ tail = !tail;
+ };
}
@@ -172,6 +192,7 @@
});
$scope.restart = function () {
+ console.log('restart');
builds.restart(fullName, number).then(function (payload) {
$scope.build = payload.data;
$scope.task = payload.data.builds[step - 1];
@@ -212,7 +233,6 @@
});
}
-
angular
.module('drone')
.controller('BuildOutCtrl', BuildOutCtrl)
diff --git a/cmd/drone-server/static/scripts/drone.js b/cmd/drone-server/static/scripts/drone.js
index 3c85fcf7..cf8e8c58 100644
--- a/cmd/drone-server/static/scripts/drone.js
+++ b/cmd/drone-server/static/scripts/drone.js
@@ -78,9 +78,14 @@
})
.state('login', {
url: '/login',
- templateUrl: '/static/scripts/views/login.html',
- title: 'Login',
- controller: 'UserLoginCtrl'
+ views: {
+ 'layout': {
+ templateUrl: '/static/scripts/views/login.html',
+ controller: 'UserLoginCtrl',
+ resolve: resolveUser
+ }
+ },
+ title: 'Login'
})
.state('app.profile', {
url: '/profile',
@@ -123,13 +128,15 @@
views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/index/toolbar.html',
- controller: 'BuildsCtrl'
+ controller: 'RepoEditCtrl',
+ resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/index/content.html',
controller: 'BuildsCtrl'
}
- }
+ },
+ title: 'Builds'
})
.state('app.repo_edit', {
url: '/:owner/:name/edit',
@@ -168,20 +175,33 @@
.state('app.build', {
url: '/:owner/:name/:number',
views: {
- 'toolbar': {templateUrl: '/static/scripts/views/builds/show/toolbar.html'},
- 'content': {templateUrl: '/static/scripts/views/builds/show/content.html'}
+ 'toolbar': {
+ templateUrl: '/static/scripts/views/builds/show/toolbar.html',
+ controller: 'BuildCtrl',
+ resolve: resolveUser
+ },
+ 'content': {
+ templateUrl: '/static/scripts/views/builds/show/content.html',
+ controller: 'BuildCtrl',
+ resolve: resolveUser
+ }
},
- controller: 'BuildCtrl',
- resolve: resolveUser
+ title: 'Build'
})
.state('app.build_step', {
url: '/:owner/:name/:number/:step',
views: {
- 'toolbar': {templateUrl: '/static/scripts/views/builds/step/toolbar.html'},
- 'content': {templateUrl: '/static/scripts/views/builds/step/content.html'}
- },
- controller: 'BuildOutCtrl',
- resolve: resolveUser
+ 'toolbar': {
+ templateUrl: '/static/scripts/views/builds/step/toolbar.html',
+ controller: 'BuildOutCtrl',
+ resolve: resolveUser
+ },
+ 'content': {
+ templateUrl: '/static/scripts/views/builds/step/content.html',
+ controller: 'BuildOutCtrl',
+ resolve: resolveUser
+ }
+ }
});
// Enables html5 mode
@@ -211,8 +231,8 @@
function RouteChange($rootScope, repos, logs) {
$rootScope.$on('$stateChangeStart', function () {
- // repos.unsubscribe();
- // logs.unsubscribe();
+ repos.unsubscribe();
+ logs.unsubscribe();
});
$rootScope.$on('$stateChangeSuccess', function (event, current) {
diff --git a/cmd/drone-server/static/scripts/views/builds/index/content.html b/cmd/drone-server/static/scripts/views/builds/index/content.html
index c469202b..e55d239c 100644
--- a/cmd/drone-server/static/scripts/views/builds/index/content.html
+++ b/cmd/drone-server/static/scripts/views/builds/index/content.html
@@ -1,14 +1,18 @@
-
+
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/index/toolbar.html b/cmd/drone-server/static/scripts/views/builds/index/toolbar.html
index 968a7f4b..c79f647e 100644
--- a/cmd/drone-server/static/scripts/views/builds/index/toolbar.html
+++ b/cmd/drone-server/static/scripts/views/builds/index/toolbar.html
@@ -1,18 +1,18 @@
-
-
- home
-
-
{{ repo.owner }} / {{ repo.name }}
+
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/show/content.html b/cmd/drone-server/static/scripts/views/builds/show/content.html
index 3fd4fc31..d81b832f 100644
--- a/cmd/drone-server/static/scripts/views/builds/show/content.html
+++ b/cmd/drone-server/static/scripts/views/builds/show/content.html
@@ -1,36 +1,39 @@
-
-
-
-
-
{{ build.head_commit.message }}
-
{{ build.head_commit.author.login }} pushed to {{ build.head_commit.branch }} {{ build.started_at | fromNow }}
-
# {{build.number}}
-
-
-
+
+
+
+
+
{{ build.head_commit.message }}
-
+
{{ build.head_commit.author.login }} pushed to {{ build.head_commit.branch
+ }} {{ build.started_at | fromNow }}
+
+
# {{build.number}}
+
+
+
+
+
-
Restart
Cancel
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/show/toolbar.html b/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
index 60e28037..9dee2b14 100644
--- a/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
+++ b/cmd/drone-server/static/scripts/views/builds/show/toolbar.html
@@ -1,15 +1,20 @@
-
-
- home
-
-
{{ repo.owner }} / {{ repo.name }}
-
-
{{ build.number }}
+
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/step/content.html b/cmd/drone-server/static/scripts/views/builds/step/content.html
index 9ec5fb7c..40351b42 100644
--- a/cmd/drone-server/static/scripts/views/builds/step/content.html
+++ b/cmd/drone-server/static/scripts/views/builds/step/content.html
@@ -1,39 +1,38 @@
-
-
-
-
-
{{ build.head_commit.message }}
-
{{ build.head_commit.author.login }} pushed to {{ build.head_commit.branch }} {{ build.started_at | fromNow }}
-
-
+
+
+
+
+
{{ build.head_commit.message }}
-
-
+
{{ build.head_commit.author.login }} pushed to {{ build.head_commit.branch
+ }} {{ build.started_at | fromNow }}
+
+
-
-
-
-
- {{ key.toUpperCase() }}={{ value }}
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ key.toUpperCase() }}={{ value }}
+
+
+
+
+
-
-
-
-
+
+
-
Restart
Cancel
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/builds/step/toolbar.html b/cmd/drone-server/static/scripts/views/builds/step/toolbar.html
index b2d193ce..37018ff5 100644
--- a/cmd/drone-server/static/scripts/views/builds/step/toolbar.html
+++ b/cmd/drone-server/static/scripts/views/builds/step/toolbar.html
@@ -1,14 +1,22 @@
-
-
-
{{ repo.owner }} / {{ repo.name }}
-
-
{{ build.sequence }}
-
-
{{ task.sequence }}
+
\ No newline at end of file
diff --git a/cmd/drone-server/static/scripts/views/repos/toolbar.html b/cmd/drone-server/static/scripts/views/repos/toolbar.html
index 9be485c7..6d7f1b35 100644
--- a/cmd/drone-server/static/scripts/views/repos/toolbar.html
+++ b/cmd/drone-server/static/scripts/views/repos/toolbar.html
@@ -6,7 +6,13 @@
\ No newline at end of file