Merge pull request #1096 from simonoff/0.4-database-assets-refactoring

Assets refactoring
This commit is contained in:
Brad Rydzewski 2015-07-14 14:12:35 -04:00
commit 8b54d51e04
35 changed files with 2396 additions and 2379 deletions

BIN
cmd/drone-server/drone-server Executable file

Binary file not shown.

View file

@ -8,38 +8,39 @@
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,300' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,300' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='//cdn.rawgit.com/zavoloklom/material-design-iconic-font/master/css/material-design-iconic-font.min.css' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/icon?family=Material+Icons' rel='stylesheet' type='text/css'>
<link href='//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.min.css' rel='stylesheet' type='text/css'> <link href='//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.min.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Droid+Sans+Mono" /> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Droid+Sans+Mono"/>
<link href='/static/styles/drone.css' rel='stylesheet' type='text/css'> <link href='/static/styles/drone.css' rel='stylesheet' type='text/css'>
<link rel="icon" href="/static/favicon.png"> <link rel="icon" href="/static/favicon.png">
</head> </head>
<body> <body>
<div role="main" ng-view ng-cloak></div> <div ui-view="layout"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-route.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-route.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-resource.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-resource.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.6.0/moment.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.6.0/moment.min.js"></script>
<!-- main javascript application --> <!-- main javascript application -->
<script src="/static/scripts/term.js"></script> <script src="/static/scripts/term.js"></script>
<script src="/static/scripts/drone.js"></script> <script src="/static/scripts/drone.js"></script>
<script src="/static/scripts/controllers/repos.js"></script> <script src="/static/scripts/controllers/repos.js"></script>
<script src="/static/scripts/controllers/builds.js"></script> <script src="/static/scripts/controllers/builds.js"></script>
<script src="/static/scripts/controllers/users.js"></script> <script src="/static/scripts/controllers/users.js"></script>
<script src="/static/scripts/services/repos.js"></script> <script src="/static/scripts/services/repos.js"></script>
<script src="/static/scripts/services/builds.js"></script> <script src="/static/scripts/services/builds.js"></script>
<script src="/static/scripts/services/users.js"></script> <script src="/static/scripts/services/users.js"></script>
<script src="/static/scripts/services/logs.js"></script> <script src="/static/scripts/services/logs.js"></script>
<script src="/static/scripts/services/tokens.js"></script> <script src="/static/scripts/services/tokens.js"></script>
<script src="/static/scripts/services/feed.js"></script> <script src="/static/scripts/services/feed.js"></script>
<script src="/static/scripts/filters/filter.js"></script> <script src="/static/scripts/filters/filter.js"></script>
<script src="/static/scripts/filters/gravatar.js"></script> <script src="/static/scripts/filters/gravatar.js"></script>
<script src="/static/scripts/filters/time.js"></script> <script src="/static/scripts/filters/time.js"></script>
</body> </body>
</html> </html>

View file

@ -4,46 +4,45 @@
* BuildsCtrl responsible for rendering the repo's * BuildsCtrl responsible for rendering the repo's
* recent build history. * recent build history.
*/ */
function BuildsCtrl($scope, $routeParams, builds, repos, users, logs) { function BuildsCtrl($scope, $stateParams, builds, repos, users, logs) {
var owner = $stateParams.owner;
var owner = $routeParams.owner; var name = $stateParams.name;
var name = $routeParams.name; var fullName = owner + '/' + name;
var fullName = owner+'/'+name;
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
// Gets a repository // Gets a repository
repos.get(fullName).then(function(payload){ repos.get(fullName).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
// Gets a list of builds // Gets a list of builds
builds.list(fullName).then(function(payload){ builds.list(fullName).then(function (payload) {
$scope.builds = angular.isArray(payload.data) ? payload.data : []; $scope.builds = angular.isArray(payload.data) ? payload.data : [];
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
$scope.watch = function(repo) { $scope.watch = function (repo) {
repos.watch(repo.full_name).then(function(payload) { repos.watch(repo.full_name).then(function (payload) {
$scope.repo.starred = true; $scope.repo.starred = true;
}); });
} };
$scope.unwatch = function(repo) { $scope.unwatch = function (repo) {
repos.unwatch(repo.full_name).then(function() { repos.unwatch(repo.full_name).then(function () {
$scope.repo.starred = false; $scope.repo.starred = false;
}); });
} };
repos.subscribe(fullName, function(event) { repos.subscribe(fullName, function (event) {
var added = false; var added = false;
for (var i=0;i<$scope.builds.length;i++) { for (var i = 0; i < $scope.builds.length; i++) {
var build = $scope.builds[i]; var build = $scope.builds[i];
if (event.number !== build.number) { if (event.number !== build.number) {
continue; // ignore continue; // ignore
@ -64,33 +63,32 @@
/** /**
* BuildCtrl responsible for rendering a build. * BuildCtrl responsible for rendering a build.
*/ */
function BuildCtrl($scope, $routeParams, $window, logs, builds, repos, users) { function BuildCtrl($scope, $stateParams, $window, logs, builds, repos, users) {
var number = $stateParams.number;
var number = $routeParams.number; var owner = $stateParams.owner;
var owner = $routeParams.owner; var name = $stateParams.name;
var name = $routeParams.name; var fullName = owner + '/' + name;
var fullName = owner+'/'+name;
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
// Gets a repository // Gets a repository
repos.get(fullName).then(function(payload){ repos.get(fullName).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
// Gets the build // Gets the build
builds.get(fullName, number).then(function(payload){ builds.get(fullName, number).then(function (payload) {
$scope.build = payload.data; $scope.build = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
repos.subscribe(fullName, function(event) { repos.subscribe(fullName, function (event) {
if (event.number !== parseInt(number)) { if (event.number !== parseInt(number)) {
return; // ignore return; // ignore
} }
@ -98,59 +96,79 @@
$scope.build = event; $scope.build = event;
$scope.$apply(); $scope.$apply();
}); });
$scope.restart = function () {
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;
};
} }
/** /**
* BuildOutCtrl responsible for rendering a build output. * BuildOutCtrl responsible for rendering a build output.
*/ */
function BuildOutCtrl($scope, $routeParams, $window, logs, builds, repos, users) { function BuildOutCtrl($scope, $stateParams, $window, logs, builds, repos, users) {
var step = parseInt($routeParams.step) || 1; var step = parseInt($stateParams.step) || 1;
var number = $routeParams.number; var number = $stateParams.number;
var owner = $routeParams.owner; var owner = $stateParams.owner;
var name = $routeParams.name; var name = $stateParams.name;
var fullName = owner+'/'+name; var fullName = owner + '/' + name;
var streaming = false; var streaming = false;
var tail = false; var tail = false;
// Initiates streaming a build. // Initiates streaming a build.
var stream = function() { var stream = function () {
if (streaming) { if (streaming) {
return; return;
} }
streaming = true; streaming = true;
var convert = new Filter({stream:true,newline:false}); var convert = new Filter({stream: true, newline: false});
var term = document.getElementById("term"); var term = document.getElementById("term");
term.innerHTML = ""; term.innerHTML = "";
// subscribes to the build otuput. // subscribes to the build otuput.
logs.subscribe(fullName, number, step, function(data){ logs.subscribe(fullName, number, step, function (data) {
term.innerHTML += convert.toHtml(data.replace("\\n","\n")); term.innerHTML += convert.toHtml(data.replace("\\n", "\n"));
if (tail) { if (tail) {
// scrolls to the bottom of the page if enabled // scrolls to the bottom of the page if enabled
$window.scrollTo(0, $window.document.body.scrollHeight); $window.scrollTo(0, $window.document.body.scrollHeight);
} }
}); });
} };
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
// Gets a repository // Gets a repository
repos.get(fullName).then(function(payload){ repos.get(fullName).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
// Gets the build // Gets the build
builds.get(fullName, number).then(function(payload){ builds.get(fullName, number).then(function (payload) {
$scope.build = payload.data; $scope.build = payload.data;
$scope.task = payload.data.jobs[step-1]; $scope.task = payload.data.jobs[step - 1];
if (['pending', 'killed'].indexOf($scope.task.status) !== -1) { if (['pending', 'killed'].indexOf($scope.task.status) !== -1) {
// do nothing // do nothing
@ -160,47 +178,26 @@
} else { } else {
// fetch the logs for the finished build. // fetch the logs for the finished build.
logs.get(fullName, number, step).then(function(payload){ logs.get(fullName, number, step).then(function (payload) {
var convert = new Filter({stream:false,newline:false}); var convert = new Filter({stream: false, newline: false});
var term = document.getElementById("term") var term = document.getElementById("term")
term.innerHTML = convert.toHtml(payload.data); term.innerHTML = convert.toHtml(payload.data);
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} }
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
$scope.restart = function() { repos.subscribe(fullName, function (event) {
builds.restart(fullName, number).then(function(payload){
$scope.build = payload.data;
$scope.task = payload.data.builds[step-1];
}).catch(function(err){
$scope.error = err;
});
};
$scope.cancel = function() {
builds.cancel(fullName, number).then(function(payload){
$scope.build = payload.data;
$scope.task = payload.data.builds[step-1];
}).catch(function(err) {
$scope.error = err;
});
};
$scope.tail = function() {
tail = !tail;
};
repos.subscribe(fullName, function(event) {
if (event.number !== parseInt(number)) { if (event.number !== parseInt(number)) {
return; // ignore return; // ignore
} }
// update the build // update the build
$scope.build = event; $scope.build = event;
$scope.task = event.builds[step-1]; console.log(event.builds);
$scope.task = event.builds[step - 1];
$scope.$apply(); $scope.$apply();
// start streaming the current build // start streaming the current build
@ -211,8 +208,29 @@
streaming = false; streaming = false;
} }
}); });
}
$scope.restart = function () {
builds.restart(fullName, number).then(function (payload) {
$scope.build = payload.data;
$scope.task = payload.data.builds[step - 1];
}).catch(function (err) {
$scope.error = err;
});
};
$scope.cancel = function () {
builds.cancel(fullName, number).then(function (payload) {
$scope.build = payload.data;
$scope.task = payload.data.builds[step - 1];
}).catch(function (err) {
$scope.error = err;
});
};
$scope.tail = function () {
tail = !tail;
};
}
angular angular
.module('drone') .module('drone')

View file

@ -4,10 +4,10 @@
* CommitsCtrl responsible for rendering the repo's * CommitsCtrl responsible for rendering the repo's
* recent commit history. * recent commit history.
*/ */
function CommitsCtrl($scope, $routeParams, builds, repos, users, logs) { function CommitsCtrl($scope, $stateParams, builds, repos, users, logs) {
var owner = $routeParams.owner; var owner = $stateParams.owner;
var name = $routeParams.name; var name = $stateParams.name;
var fullName = owner+'/'+name; var fullName = owner+'/'+name;
// Gets the currently authenticated user // Gets the currently authenticated user

View file

@ -4,18 +4,17 @@
* ReposCtrl responsible for rendering the user's * ReposCtrl responsible for rendering the user's
* repository home screen. * repository home screen.
*/ */
function ReposCtrl($scope, $routeParams, repos, users) { function ReposCtrl($scope, $stateParams, repos, users) {
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
// Gets a list of repos to display in the // Gets a list of repos to display in the
// dropdown. // dropdown.
repos.list().then(function(payload){ repos.list().then(function (payload) {
$scope.repos = angular.isArray(payload.data) ? payload.data : []; $scope.repos = angular.isArray(payload.data) ? payload.data : [];
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} }
@ -27,14 +26,14 @@
function RepoAddCtrl($scope, $location, repos, users) { function RepoAddCtrl($scope, $location, repos, users) {
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
$scope.add = function(slug) { $scope.add = function (slug) {
repos.post(slug).then(function(payload) { repos.post(slug).then(function (payload) {
$location.path('/'+slug); $location.path('/' + slug);
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} }
@ -43,66 +42,66 @@
/** /**
* RepoEditCtrl responsible for editing a repository. * RepoEditCtrl responsible for editing a repository.
*/ */
function RepoEditCtrl($scope, $window, $location, $routeParams, repos, users) { function RepoEditCtrl($scope, $window, $location, $stateParams, repos, users) {
var owner = $routeParams.owner; var owner = $stateParams.owner;
var name = $routeParams.name; var name = $stateParams.name;
var fullName = owner+'/'+name; var fullName = owner + '/' + name;
// Inject window for composing url // Inject window for composing url
$scope.window = $window; $scope.window = $window;
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function (payload) {
$scope.user = payload.data; $scope.user = payload.data;
}); });
// Gets a repository // Gets a repository
repos.get(fullName).then(function(payload){ repos.get(fullName).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
$scope.save = function(repo) { $scope.save = function (repo) {
repo.timeout = parseInt(repo.timeout); repo.timeout = parseInt(repo.timeout);
repos.update(repo).then(function(payload) { repos.update(repo).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} };
$scope.delete = function(repo) { $scope.delete = function (repo) {
repos.delete(repo).then(function(payload) { repos.delete(repo).then(function (payload) {
$location.path('/'); $location.path('/');
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} };
$scope.param={} $scope.param = {};
$scope.addParam = function(param) { $scope.addParam = function (param) {
if (!$scope.repo.params) { if (!$scope.repo.params) {
$scope.repo.params = {} $scope.repo.params = {}
} }
$scope.repo.params[param.key]=param.value; $scope.repo.params[param.key] = param.value;
$scope.param={} $scope.param = {};
// auto-update // auto-update
repos.update($scope.repo).then(function(payload) { repos.update($scope.repo).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} };
$scope.deleteParam = function(key) { $scope.deleteParam = function (key) {
delete $scope.repo.params[key]; delete $scope.repo.params[key];
// auto-update // auto-update
repos.update($scope.repo).then(function(payload) { repos.update($scope.repo).then(function (payload) {
$scope.repo = payload.data; $scope.repo = payload.data;
}).catch(function(err){ }).catch(function (err) {
$scope.error = err; $scope.error = err;
}); });
} }

View file

@ -7,7 +7,8 @@
*/ */
angular.module('drone', [ angular.module('drone', [
'ngRoute', 'ngRoute',
'ui.filters' 'ui.filters',
'ui.router'
]); ]);
/** /**
@ -37,84 +38,185 @@
* Defines the route configuration for the * Defines the route configuration for the
* main application. * main application.
*/ */
function Config ($routeProvider, $httpProvider, $locationProvider) { function Config($stateProvider, $httpProvider, $locationProvider) {
// Resolver that will attempt to load the currently // Resolver that will attempt to load the currently
// authenticated user prior to loading the page. // authenticated user prior to loading the page.
var resolveUser = { var resolveUser = {
user: function(users) { user: function (users) {
return users.getCached(); return users.getCached();
} }
} };
$routeProvider $stateProvider
.when('/', { .state('app', {
templateUrl: '/static/scripts/views/repos.html', abstract: true,
views: {
'layout': {
templateUrl: '/static/scripts/views/layout.html',
controller: function ($scope, $routeParams, repos, users) {
users.getCached().then(function (payload) {
$scope.user = payload.data;
});
}
}
}
})
.state('app.index', {
url: '/',
views: {
'toolbar': {
templateUrl: '/static/scripts/views/repos/index/toolbar.html'
},
'content': {
templateUrl: '/static/scripts/views/repos/index/content.html',
controller: 'ReposCtrl', controller: 'ReposCtrl',
resolve: resolveUser resolve: resolveUser
}
},
title: 'Dashboard'
}) })
.when('/login', { .state('login', {
url: '/login',
views: {
'layout': {
templateUrl: '/static/scripts/views/login.html', templateUrl: '/static/scripts/views/login.html',
controller: 'UserLoginCtrl' controller: 'UserLoginCtrl',
resolve: resolveUser
}
},
title: 'Login'
}) })
.when('/profile', { .state('app.profile', {
templateUrl: '/static/scripts/views/user.html', url: '/profile',
views: {
'toolbar': {templateUrl: '/static/scripts/views/profile/toolbar.html'},
'content': {
templateUrl: '/static/scripts/views/profile/content.html',
controller: 'UserCtrl', controller: 'UserCtrl',
resolve: resolveUser resolve: resolveUser
}
},
title: 'Profile'
}) })
.when('/users', { .state('app.users', {
templateUrl: '/static/scripts/views/users.html', url: '/users',
views: {
'toolbar': {templateUrl: '/static/scripts/views/users/toolbar.html'},
'content': {
templateUrl: '/static/scripts/views/users/content.html',
controller: 'UsersCtrl', controller: 'UsersCtrl',
resolve: resolveUser resolve: resolveUser
}
},
title: 'Users'
}) })
.when('/new', { .state('app.new_repo', {
templateUrl: '/static/scripts/views/repos_add.html', url: '/new',
views: {
'toolbar': {templateUrl: '/static/scripts/views/repos/add/toolbar.html'},
'content': {
templateUrl: '/static/scripts/views/repos/add/content.html',
controller: 'RepoAddCtrl', controller: 'RepoAddCtrl',
resolve: resolveUser resolve: resolveUser
}
},
title: 'Add Repository'
}) })
.when('/:owner/:name', { .state('app.builds', {
templateUrl: '/static/scripts/views/builds.html', url: '/:owner/:name',
controller: 'BuildsCtrl', views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/index/toolbar.html',
controller: 'RepoEditCtrl',
resolve: resolveUser resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/index/content.html',
controller: 'BuildsCtrl'
}
},
title: 'Builds'
}) })
.when('/:owner/:name/edit', { .state('app.repo_edit', {
templateUrl: '/static/scripts/views/repos_edit.html', url: '/:owner/:name/edit',
views: {
'toolbar': {
templateUrl: '/static/scripts/views/repos/toolbar.html',
controller: 'RepoEditCtrl',
resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/repos/edit.html',
controller: 'RepoEditCtrl',
resolve: resolveUser
}
},
title: 'Edit Repository'
})
.state('app.repo.env', {
url: '/:owner/:name/edit/env',
views: {
'toolbar': {templateUrl: '/static/scripts/views/repos/toolbar.html'},
'content': {templateUrl: '/static/scripts/views/repos/env.html'}
},
controller: 'RepoEditCtrl', controller: 'RepoEditCtrl',
resolve: resolveUser resolve: resolveUser
}) })
.when('/:owner/:name/edit/env', { .state('app.repo.del', {
templateUrl: '/static/scripts/views/repos_env.html', url: '/:owner/:name/delete',
views: {
'toolbar': {templateUrl: '/static/scripts/views/repos/toolbar.html'},
'content': {templateUrl: '/static/scripts/views/repos/del.html'}
},
controller: 'RepoEditCtrl', controller: 'RepoEditCtrl',
resolve: resolveUser resolve: resolveUser
}) })
.when('/:owner/:name/delete', { .state('app.build', {
templateUrl: '/static/scripts/views/repos_del.html', url: '/:owner/:name/:number',
controller: 'RepoEditCtrl', views: {
resolve: resolveUser 'toolbar': {
}) templateUrl: '/static/scripts/views/builds/show/toolbar.html',
.when('/:owner/:name/:number', {
templateUrl: '/static/scripts/views/build.html',
controller: 'BuildCtrl', controller: 'BuildCtrl',
resolve: resolveUser resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/show/content.html',
controller: 'BuildCtrl',
resolve: resolveUser
}
},
title: 'Build'
}) })
.when('/:owner/:name/:number/:step', { .state('app.job', {
templateUrl: '/static/scripts/views/build_out.html', url: '/:owner/:name/:number/:step',
views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/step/toolbar.html',
controller: 'BuildOutCtrl', controller: 'BuildOutCtrl',
resolve: resolveUser resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/step/content.html',
controller: 'BuildOutCtrl',
resolve: resolveUser
},
title: 'Build Job'
}
}); });
// Enables html5 mode // Enables html5 mode
$locationProvider.html5Mode(true) $locationProvider.html5Mode(true);
// Appends the Bearer token to authorize every // Appends the Bearer token to authorize every
// outbound http request. // outbound http request.
$httpProvider.defaults.headers.common.Authorization = 'Bearer '+localStorage.getItem('access_token'); $httpProvider.defaults.headers.common.Authorization = 'Bearer ' + localStorage.getItem('access_token');
// Intercepts every oubput http response and redirects // Intercepts every oubput http response and redirects
// the user to the logic screen if the request was rejected. // the user to the logic screen if the request was rejected.
$httpProvider.interceptors.push(function($q, $location) { $httpProvider.interceptors.push(function ($q, $location) {
return { return {
'responseError': function(rejection) { 'responseError': function (rejection) {
if (rejection.status === 401 && rejection.config.url !== "/api/user") { if (rejection.status === 401 && rejection.config.url !== "/api/user") {
$location.path('/login'); $location.path('/login');
} }
@ -128,16 +230,15 @@
}); });
} }
function RouteChange($rootScope, repos, logs) { function RouteChange($rootScope, repos, logs) {
$rootScope.$on('$routeChangeStart', function (event, next) { $rootScope.$on('$stateChangeStart', function () {
repos.unsubscribe(); repos.unsubscribe();
logs.unsubscribe(); logs.unsubscribe();
}); });
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) { $rootScope.$on('$stateChangeSuccess', function (event, current) {
if (current.$$route.title) { if (current.title) {
document.title = current.$$route.title + ' · drone'; document.title = current.title + ' · drone';
} }
}); });
} }

View file

@ -15,7 +15,7 @@
/** /**
* Gets a list of all repositories. * Gets a list of all repositories.
*/ */
this.list = function() { this.list = function () {
return $http.get('/api/user/repos'); return $http.get('/api/user/repos');
}; };
@ -24,8 +24,8 @@
* *
* @param {string} Name of the repository. * @param {string} Name of the repository.
*/ */
this.get = function(repoName) { this.get = function (repoName) {
return $http.get('/api/repos/'+repoName); return $http.get('/api/repos/' + repoName);
}; };
/** /**
@ -33,7 +33,7 @@
* *
* @param {object} JSON representation of a repository. * @param {object} JSON representation of a repository.
*/ */
this.post = function(repoName) { this.post = function (repoName) {
return $http.post('/api/repos/' + repoName); return $http.post('/api/repos/' + repoName);
}; };
@ -42,8 +42,8 @@
* *
* @param {object} JSON representation of a repository. * @param {object} JSON representation of a repository.
*/ */
this.update = function(repo) { this.update = function (repo) {
return $http.patch('/api/repos/'+repo.full_name, repo); return $http.patch('/api/repos/' + repo.full_name, repo);
}; };
/** /**
@ -51,8 +51,8 @@
* *
* @param {string} Name of the repository. * @param {string} Name of the repository.
*/ */
this.delete = function(repoName) { this.delete = function (repoName) {
return $http.delete('/api/repos/'+repoName); return $http.delete('/api/repos/' + repoName);
}; };
/** /**
@ -60,8 +60,8 @@
* *
* @param {string} Name of the repository. * @param {string} Name of the repository.
*/ */
this.watch = function(repoName) { this.watch = function (repoName) {
return $http.post('/api/repos/'+repoName+'/watch'); return $http.post('/api/repos/' + repoName + '/watch');
}; };
/** /**
@ -69,8 +69,8 @@
* *
* @param {string} Name of the repository. * @param {string} Name of the repository.
*/ */
this.unwatch = function(repoName) { this.unwatch = function (repoName) {
return $http.delete('/api/repos/'+repoName+'/unwatch'); return $http.delete('/api/repos/' + repoName + '/unwatch');
}; };
@ -83,10 +83,10 @@
* *
* @param {string} Name of the repository. * @param {string} Name of the repository.
*/ */
this.subscribe = function(repo, _callback) { this.subscribe = function (repo, _callback) {
callback = _callback; callback = _callback;
events = new EventSource("/api/stream/" + repo + "?access_token=" + token, { withCredentials: true }); events = new EventSource("/api/stream/" + repo + "?access_token=" + token, {withCredentials: true});
events.onmessage = function (event) { events.onmessage = function (event) {
if (callback !== undefined) { if (callback !== undefined) {
callback(angular.fromJson(event.data)); callback(angular.fromJson(event.data));
@ -102,7 +102,7 @@
}; };
}; };
this.unsubscribe = function() { this.unsubscribe = function () {
callback = undefined; callback = undefined;
if (events !== undefined) { if (events !== undefined) {
events.close(); events.close();

View file

@ -1,64 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a ng-href="/{{ repo.full_name }}" class="icon icon-home"></a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
<span class="spacer"></span>
<a ng-href="#">{{ build.number }}</a>
</div>
<div class="menu">
<a href="settings.html" class="icon icon-settings"></a>
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div>
</div>
<article>
<section class="commit-section">
<div class="row build-row">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch }}</strong> {{ build.started_at | fromNow }}</p>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{build.number}}</div>
</div>
</div>
</section>
<section>
<a class="row build-row sub-build-row" ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>
<div ng-repeat="(key, value) in job.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</h3>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{job.number}}</div>
</div>
</a>
</section>
</article>
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<button ng-if="build.status === 'pending' || build.status === 'running'" ng-click="cancel()">Cancel</button>

View file

@ -1,68 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a ng-href="/{{ repo.full_name }}/{{ build.sequence }}" class="icon icon-home"></a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
<span class="spacer"></span>
<a ng-href="/{{ repo.full_name }}/{{ build.sequence }}">{{ build.sequence }}</a>
<span class="spacer"></span>
<a href="#">{{ task.sequence }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div>
</div>
<article>
<section class="commit-section">
<div class="row build-row">
<div>
<div ng-class="[ 'build-num', task.status ]" ng-if="task"></div>
<div ng-class="[ 'build-num', build.status ]" ng-if="!task"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch }}</strong> {{ build.started_at | fromNow }}</p>
</div>
</div>
<div class="row build-row sub-build-row" ng-if="build.jobs.length > 1">
<div>
</div>
<div>
<h3 style="margin-top:0px">
<div ng-repeat="(key, value) in task.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</h3>
</div>
</div>
</section>
<pre id="term" ng-if="task && task.status !== 'pending'"></pre>
<button class="fab" ng-if="build.status === 'running'" ng-click="tail()"></button>
</article>
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<button ng-if="build.status === 'pending' || build.status === 'running'" ng-click="cancel()">Cancel</button>

View file

@ -1,39 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home"></a>
<a href="#">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right"></button>
</div>
</div>
<article>
<section>
<a class="row build-row" ng-repeat="build in builds | orderBy:'-number'" ng-href="/{{ repo.full_name }}/{{ build.number }}">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch }}</strong> {{ build.started_at | fromNow }}</p>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{build.number}}</div>
</div>
</a>
</section>
</article>

View file

@ -0,0 +1,18 @@
<article>
<section>
<a class="row build-row" ng-repeat="build in builds | orderBy:'-number'" ng-href="/{{ repo.full_name }}/{{ build.number }}">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p>
<strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch}}</strong> {{ build.started_at | fromNow }}
</p>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{build.number}}</div>
</div>
</a>
</section>
</article>

View file

@ -0,0 +1,18 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a href="#">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull">
<i class="material-icons md-18">edit</i>
</a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right">
<i class="material-icons md-18">star_border</i>
</button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right">
<i class="material-icons md-18">star</i>
</button>
</div>

View file

@ -0,0 +1,40 @@
<article>
<section class="commit-section">
<div class="row build-row">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch}}</strong> {{ build.started_at | fromNow }}</p>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{build.number}}</div>
</div>
</div>
</section>
<p style="padding-top: 20px;">
<h3><strong>Build jobs</strong></h3>
</p>
<section>
<a class="row build-row sub-build-row" ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>
<div ng-repeat="(key, value) in job.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</h3>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{job.number}}</div>
</div>
</a>
</section>
</article>
<div style="padding-left: 20px;">
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<button ng-if="build.status === 'pending' || build.status === 'running'" ng-click="cancel()">Cancel</button>
</div>

View file

@ -0,0 +1,20 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a ng-href="/{{ repo.full_name }}" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
<span class="spacer"></span>
<a ng-href="#">#{{ build.number }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull">
<i class="material-icons md-18">edit</i>
</a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right">
<i class="material-icons md-18">star_border</i>
</button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right">
<i class="material-icons md-18">star</i>
</button>
</div>

View file

@ -0,0 +1,37 @@
<article>
<section class="commit-section">
<div class="row build-row">
<div>
<div ng-class="[ 'build-num', task.status ]" ng-if="task"></div>
<div ng-class="[ 'build-num', build.status ]" ng-if="!task"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch}}</strong> {{ build.started_at | fromNow }}</p>
</div>
</div>
<div class="row build-row sub-build-row" ng-if="build.jobs.length > 1">
<div>
</div>
<div>
<h3 style="margin-top:0px">
<div ng-repeat="(key, value) in task.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</h3>
</div>
</div>
</section>
<pre id="term" ng-if="task && task.status !== 'pending'"></pre>
<button class="fab" ng-if="build.status === 'running'" ng-click="tail()"></button>
</article>
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<button ng-if="build.status === 'pending' || build.status === 'running'" ng-click="cancel()">Cancel</button>

View file

@ -0,0 +1,22 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a ng-href="/{{ repo.full_name }}/{{ build.sequence }}" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
<span class="spacer">&nbsp;</span>
<a ng-href="/{{ repo.full_name }}/{{ build.number }}">Build # {{ build.number }}</a>
<span class="spacer"></span>
<a href="#">Job #{{ task.number }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull">
<i class="material-icons md-18">edit</i>
</a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right">
<i class="material-icons md-18">star_border</i>
</button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right">
<i class="material-icons md-18">star</i>
</button>
</div>

View file

@ -0,0 +1,15 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank">
<i class="material-icons md-18">help</i>
</a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin">
<i class="material-icons md-18">supervisor_account</i>
</a>
<a class="menu-item settings float-right" href="/profile">
<i class="material-icons md-18">settings</i>
</a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar" ui-view="toolbar"></div>
<div ui-view="content"></div>

View file

@ -1,34 +1,38 @@
<style> <style>
html, body { html, body {
background:#EEEEEE; background: #EEEEEE;
padding:0px; padding: 0px;
margin:0px; margin: 0px;
font-family:"Roboto"; font-family: "Roboto";
font-size:15px; font-size: 15px;
text-transform:uppercase; text-transform: uppercase;
width:100%; width: 100%;
height:100%; height: 100%;
} }
a.box { a.box {
background:#FFF; background: #FFF;
width:250px; width: 250px;
padding:20px; padding: 20px;
box-shadow: 0px 0px 0 rgba(255,255,255,0.05); box-shadow: 0px 0px 0 rgba(255, 255, 255, 0.05);
-webkit-transition: all .5s; -webkit-transition: all .5s;
-webkit-box-flex: 0; -webkit-box-flex: 0;
display:block; display: block;
text-decoration:none; text-decoration: none;
border-radius:3px; border-radius: 3px;
} }
a.box:hover { a.box:hover {
box-shadow: 7px 7px 0 rgba(255,255,255,0.05); box-shadow: 7px 7px 0 rgba(255, 255, 255, 0.05);
} }
div.logo { div.logo {
background: url(/static/images/logo.svg) no-repeat center center;; background: url(/static/images/logo.svg) no-repeat center center;
background-size:72px; background-size: 72px;
height:150px; height: 150px;
-webkit-transition: all .5s; -webkit-transition: all .5s;
} }
div.login { div.login {
text-align: center; text-align: center;
padding: 15px; padding: 15px;
@ -38,11 +42,12 @@
border-radius: 3px; border-radius: 3px;
-webkit-transition: all .5s; -webkit-transition: all .5s;
background: #424242; background: #424242;
color: rgba(255,255,255,0.7); color: rgba(255, 255, 255, 0.7);
} }
body > div { body > div {
width:100%; width: 100%;
height:100%; height: 100%;
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
@ -53,7 +58,7 @@
-webkit-justify-content: center; -webkit-justify-content: center;
justify-content: center; justify-content: center;
} }
</style> </style>
<a href="/authorize" target="_self" class="box"> <a href="/authorize" target="_self" class="box">
<div class="logo"></div> <div class="logo"></div>
@ -61,7 +66,9 @@
<div ng-switch-when="internal_error">Oops. There was an unexpected error. Please try again.</div> <div ng-switch-when="internal_error">Oops. There was an unexpected error. Please try again.</div>
<div ng-switch-when="user_not_found">There was an error authorizing your account.</div> <div ng-switch-when="user_not_found">There was an error authorizing your account.</div>
<div ng-switch-when="access_denied_org">Login is restricted to approved organization members only</div> <div ng-switch-when="access_denied_org">Login is restricted to approved organization members only</div>
<div ng-switch-when="access_denied">Self-registration is disabled. Please contact the system admin to grant access.</div> <div ng-switch-when="access_denied">Self-registration is disabled. Please contact the system admin to grant
access.
</div>
</div> </div>
<div class="login">Login</div> <div class="login">Login</div>
</a> </a>

View file

@ -1,19 +1,3 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home"></a>
<a href="#">Profile</a>
</div>
</div>
<article> <article>
<section> <section>
<h2>Login info</h2> <h2>Login info</h2>
@ -34,8 +18,12 @@
<section> <section>
<h2>Tokens</h2> <h2>Tokens</h2>
<form> <form>
<div style="padding-left: 20px; float: left;">
<input type="label" ng-model="newToken.label" /> <input type="label" ng-model="newToken.label" />
</div>
<div style="padding-top: 20px; padding-left: 20px; float: left;">
<button ng-click="createToken(newToken)">Create</button> <button ng-click="createToken(newToken)">Create</button>
</div>
</form> </form>
<div class="alert" ng-if="tokens && tokens.length === 0">No Personal Tokens Exist</div> <div class="alert" ng-if="tokens && tokens.length === 0">No Personal Tokens Exist</div>

View file

@ -0,0 +1,6 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a href="#">Profile</a>
</div>

View file

@ -1,34 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="#">Dashboard</a>
</div>
<div class="menu">
<a ng-href="/new" class="nav-item add float-right"></a>
</div>
</div>
<article>
<section>
<a class="row build-row" ng-repeat="repo in repos | orderBy:'full_name'" ng-href="/{{ repo.full_name }}">
<div>
<div class="icon icon-repo"></div>
</div>
<div>
<h3>{{ repo.owner }} / {{ repo.name }}</h3>
<p>{{ repo.clone_url }}</p>
</div>
</a>
</section>
</article>

View file

@ -1,18 +1,3 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home"></a>
<a href="#">Add Repository</a>
</div>
</div>
<article> <article>
<section style="background:transparent !important;"> <section style="background:transparent !important;">
<p style="color:#9E9E9E;font-size:15px;line-height:22px;">Register your repository with Drone to enable automated testing. Note that Drone <p style="color:#9E9E9E;font-size:15px;line-height:22px;">Register your repository with Drone to enable automated testing. Note that Drone

View file

@ -0,0 +1,6 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a href="#">Add Repository</a>
</div>

View file

@ -0,0 +1,17 @@
<article>
<section style="padding:30px; background-color:#EF5350;">
<button ng-click="delete(repo.full_name)" style="color:rgba(255,255,255,0.9);
text-transform: uppercase;
text-decoration: none;
border: 1px solid rgba(255,255,255,0.9);
padding: 10px;
background:transparent;
display:inline-block;
cursor:pointer;
margin-right: 10px;">Delete</button>
<span style="color:rgba(255,255,255,0.9);font-size:16px;">Warning: this action cannot be undone.</span>
</section>
</article>

View file

@ -0,0 +1,75 @@
<article>
<section>
<h2>Settings</h2>
<div class="row">
<div>Post Commit Hooks</div>
<div>
<input id="post_commits" type="checkbox" hidden="hidden" ng-model="repo.hooks.push" ng-change="save(repo)"/>
<label for="post_commits" class="switch"></label>
</div>
</div>
<div class="row">
<div>Pull Request Hooks</div>
<div>
<input id="pull_requests" type="checkbox" hidden="hidden" ng-model="repo.hooks.pull_request"
ng-change="save(repo)"/>
<label for="pull_requests" class="switch"></label>
</div>
</div>
<a class="row" ng-href="{{ repo.full_name }}/edit/env">
<div>Private Variables</div>
<div>
Inject private variables into your build environment
</div>
</a>
<a class="row" ng-href="{{ repo.full_name }}/delete">
<div>Delete</div>
<div>Delete this repository and its build history</div>
</a>
</section>
<section ng-if="user.admin">
<h2>Admin settings</h2>
<div class="row">
<div>Trusted (Evelvate Privilege)</div>
<div>
<input id="trusted" type="checkbox" hidden="hidden" ng-model="repo.trusted" ng-change="save(repo)"/>
<label for="trusted" class="switch"></label>
</div>
</div>
<div class="row">
<div>Timeout in minutes</div>
<div>
<input type="range" ng-model="repo.timeout" min="0" max="900" ng-blur="save(repo)"/>
<span class="slider-label">{{ repo.timeout }} minutes</span>
</div>
</div>
</section>
<section>
<h2>Badges</h2>
<div class="row">
<div>Markdown</div>
<div>
<pre class="snippet">[![Build Status]({{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg)]({{ window.location.origin }}/{{ repo.full_name }})</pre>
</div>
</div>
<div class="row">
<div>CCMenu</div>
<div>
<pre class="snippet">{{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml</pre>
</div>
</div>
</section>
<section>
<h2>Public Key</h2>
<div>
<pre class="snippet snippet-padding">{{ repo.keypair.public }}</pre>
</div>
</section>
</article>

View file

@ -1,25 +1,3 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/{{ repo.full_name }}/edit" class="icon icon-home"></a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div>
</div>
<article> <article>
<section style="padding:30px;"> <section style="padding:30px;">
<h2 style=" padding-left: 0px; <h2 style=" padding-left: 0px;

View file

@ -0,0 +1,14 @@
<article>
<section>
<a class="row build-row" ng-repeat="repo in repos | orderBy:'full_name'" ng-href="/{{ repo.full_name }}">
<div>
<div class="icon icon-repo"></div>
</div>
<div>
<h3>{{ repo.owner }} / {{ repo.name }}</h3>
<p>{{ repo.clone_url }}</p>
</div>
</a>
</section>
</article>

View file

@ -0,0 +1,9 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="#">Dashboard</a>
</div>
<div class="menu">
<a ng-href="/new" class="nav-item add float-right">
<i class="material-icons">add</i>
</a>
</div>

View file

@ -0,0 +1,18 @@
<div class="breadcrumb">
<a href="/{{ repo.full_name }}/edit" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull">
<i class="material-icons md-18">edit</i>
</a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right">
<i class="material-icons md-18">star_border</i>
</button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right">
<i class="material-icons md-18">star</i>
</button>
</div>

View file

@ -1,42 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/{{ repo.full_name }}/edit" class="icon icon-home"></a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div>
</div>
<article>
<section style="padding:30px; background-color:#EF5350;">
<button ng-click="delete(repo.full_name)" style="color:rgba(255,255,255,0.9);
text-transform: uppercase;
text-decoration: none;
border: 1px solid rgba(255,255,255,0.9);
padding: 10px;
background:transparent;
display:inline-block;
cursor:pointer;
margin-right: 10px;">Delete</button>
<span style="color:rgba(255,255,255,0.9);font-size:16px;">Warning: this action cannot be undone.</span>
</section>
</article>

View file

@ -1,95 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/{{ repo.full_name }}" class="icon icon-home"></a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
</div>
<div class="menu">
<a href="settings.html" class="icon icon-settings"></a>
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div>
</div>
<article>
<section>
<h2>Settings</h2>
<div class="row">
<div>Post Commit Hooks</div>
<div>
<input id="post_commits" type="checkbox" hidden="hidden" ng-model="repo.hooks.push" ng-change="save(repo)" />
<label for="post_commits" class="switch"></label>
</div>
</div>
<div class="row">
<div>Pull Request Hooks</div>
<div>
<input id="pull_requests" type="checkbox" hidden="hidden" ng-model="repo.hooks.pull_request" ng-change="save(repo)" />
<label for="pull_requests" class="switch"></label>
</div>
</div>
<a class="row" ng-href="{{ repo.full_name }}/edit/env">
<div>Private Variables</div>
<div>
Inject private variables into your build environment
</div>
</a>
<a class="row" ng-href="{{ repo.full_name }}/delete">
<div>Delete</div>
<div>Delete this repository and its build history</div>
</a>
</section>
<section ng-if="user.admin">
<h2>Admin settings</h2>
<div class="row">
<div>Trusted (Evelvate Privilege)</div>
<div>
<input id="trusted" type="checkbox" hidden="hidden" ng-model="repo.trusted" ng-change="save(repo)" />
<label for="trusted" class="switch"></label>
</div>
</div>
<div class="row">
<div>Timeout in minutes</div>
<div>
<input type="range" ng-model="repo.timeout" min="0" max="900" ng-blur="save(repo)" />
<span class="slider-label">{{ repo.timeout }} minutes</span>
</div>
</div>
</section>
<section>
<h2>Badges</h2>
<div class="row">
<div>Markdown</div>
<div>
<pre class="snippet">[![Build Status]({{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg)]({{ window.location.origin }}/{{ repo.full_name }})</pre>
</div>
</div>
<div class="row">
<div>CCMenu</div>
<div>
<pre class="snippet">{{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml</pre>
</div>
</div>
</section>
<section>
<h2>Public Key</h2>
<div>
<pre class="snippet snippet-padding">{{ repo.keypair.public }}</pre>
</div>
</section>
</article>

View file

@ -1,41 +0,0 @@
<header>
<a class="logo float-left" href="/"></a>
<a class="menu-item settings float-right" href="/profile"></a>
<a class="menu-item users float-right" href="/users" ng-if="user.admin"></a>
<a class="menu-item help float-right" href="http://readme.drone.io" target="_blank"></a>
<a class="menu-item user-name float-right" href="/profile">{{ "+"+user.login }}</a>
</header>
<div class="toolbar">
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home"></a>
<a href="#">Users</a>
</div>
</div>
<article>
<section>
<form style="padding:30px">
<input type="text" ng-model="login" placeholder="i.e. octocat" style="font-size:14px;padding:10px 20px;width:400px;border: 1px solid #d9d9d9;outline:none;"/>
<button ng-click="add(login)" style="display: inline-block;background:#EEE;font-size:14px; padding:0px 20px;text-transform:uppercase;cursor:pointer;color:#616161;height:39px;line-height:41px;margin-left:10px;">Add User</button>
</form>
</section>
<section>
<div class="row row-user" ng-repeat="user in users">
<div>
<img ng-src="{{ user.gravatar_id | gravatar }}" />
</div>
<div>
<h3>{{ user.login }} <small ng-if="user.admin">Admin</small></h3>
<p>{{ user.email }}</p>
<button ng-click="toggle(user)" ng-class="{'btn-admin':true, 'btn-checked': user.admin}"></button>
<button ng-click="remove(user)" class="btn-remove"></button>
</div>
</div>
</section>
</article>

View file

@ -0,0 +1,36 @@
<article>
<section>
<form style="padding:30px">
<input type="text" ng-model="login" placeholder="i.e. octocat"
style="font-size:14px;padding:10px 20px;width:400px;border: 1px solid #d9d9d9;outline:none;"/>
<button ng-click="add(login)"
style="display: inline-block;background:#EEE;font-size:14px; padding:0px 20px;text-transform:uppercase;cursor:pointer;color:#616161;height:39px;line-height:41px;margin-left:10px;">
Add User
</button>
</form>
</section>
<section>
<div class="row row-user" ng-repeat="user in users">
<div>
<img ng-src="{{ user.gravatar_id | gravatar }}"/>
</div>
<div>
<h3>{{ user.login }}
<small ng-if="user.admin">Admin</small>
</h3>
<p>{{ user.email }}</p>
<button ng-click="toggle(user)" ng-class="{'btn-admin':true, 'btn-checked': user.admin}">
<i class="material-icons md-18">account_circle</i>
</button>
<button ng-click="remove(user)" class="btn-remove">
<i class="material-icons md-18">delete</i>
</button>
</div>
</div>
</section>
</article>

View file

@ -0,0 +1,6 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a href="/" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a href="#">Users</a>
</div>

File diff suppressed because it is too large Load diff