diff --git a/cmd/drone-server/static/scripts/controllers/repos.js b/cmd/drone-server/static/scripts/controllers/repos.js index 19768d74..c74a28e0 100644 --- a/cmd/drone-server/static/scripts/controllers/repos.js +++ b/cmd/drone-server/static/scripts/controllers/repos.js @@ -4,9 +4,13 @@ * ReposCtrl responsible for rendering the user's * repository home screen. */ - function ReposCtrl($scope, $stateParams, repos, users) { + function ReposCtrl($scope, $location, $stateParams, repos, users) { + $scope.loading = true; + $scope.waiting = false; + // Gets the currently authenticated user users.getCached().then(function (payload) { + $scope.loading = false; $scope.user = payload.data; }); @@ -17,6 +21,24 @@ }).catch(function (err) { $scope.error = err; }); + + // Adds a repository + $scope.add = function (event, fullName) { + $scope.error = undefined; + if (event.which && event.which !== 13) { + return; + } + $scope.waiting = true; + + repos.post(fullName).then(function (payload) { + $location.path('/' + fullName); + $scope.waiting = false; + }).catch(function (err) { + $scope.error = err; + $scope.waiting = false; + $scope.search_text = undefined; + }); + } } /** diff --git a/cmd/drone-server/static/scripts/controllers/users.js b/cmd/drone-server/static/scripts/controllers/users.js index d9b817de..bc47527b 100644 --- a/cmd/drone-server/static/scripts/controllers/users.js +++ b/cmd/drone-server/static/scripts/controllers/users.js @@ -42,20 +42,35 @@ * This part of the site is for administrators only. */ function UsersCtrl($scope, users) { + $scope.loading = true; + $scope.waiting = false; + // Gets the currently authenticated user users.getCached().then(function(payload){ $scope.user = payload.data; }); + // Gets the list of all system users users.list().then(function(payload){ + $scope.loading = true; $scope.users = payload.data; }); - $scope.login=""; - $scope.add = function(login) { + $scope.add = function(event, login) { + $scope.error = undefined; + if (event.which && event.which !== 13) { + return; + } + $scope.waiting = true; + users.post(login).then(function(payload){ $scope.users.push(payload.data); - $scope.login=""; + $scope.search_text=undefined; + $scope.waiting = false; + }).catch(function (err) { + $scope.error = err; + $scope.waiting = false; + $scope.search_text = undefined; }); } 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 f3e33084..b2326610 100644 --- a/cmd/drone-server/static/scripts/views/builds/index/content.html +++ b/cmd/drone-server/static/scripts/views/builds/index/content.html @@ -16,6 +16,16 @@ +
+ settings_ethernet + Push code to execute your first build.
Be sure to configure you build using the .drone.yml file.
+
+ +
+ error_outline + There was an error fetching the build history. +
+
diff --git a/cmd/drone-server/static/scripts/views/repos/edit.html b/cmd/drone-server/static/scripts/views/repos/edit.html index 2d5ae0d5..aea3312e 100644 --- a/cmd/drone-server/static/scripts/views/repos/edit.html +++ b/cmd/drone-server/static/scripts/views/repos/edit.html @@ -1,7 +1,6 @@
-
-

Settings

+
Post Commit Hooks
@@ -18,6 +17,42 @@
+
+
Trusted Code
+
+ + +
+
+
+
Timeout in minutes
+
+ + {{ repo.timeout }} minutes +
+
+
+
Badge
+
+
[![Build Status]({{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg)]({{ window.location.origin }}/{{ repo.full_name }})
+
+
+
+
CCMenu
+
+
{{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml
+
+
+
+
Public Key
+
+
{{ repo.keypair.public }}
+
+
+ + +

NOTE: The below sections should re-architected and are therefore not styled. The delete page should be combined with this current page. Secret variables should be stored in the .drone.yml instead of the user interface

+
Private Variables
@@ -30,48 +65,5 @@
-
-

Admin settings

- -
-
Trusted (Evelvate Privilege)
-
- - -
-
-
-
Timeout in minutes
-
- - {{ repo.timeout }} minutes -
-
-
- -
-

Badges

- -
-
Markdown
-
-
[![Build Status]({{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg)]({{ window.location.origin }}/{{ repo.full_name }})
-
-
-
-
CCMenu
-
-
{{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml
-
-
-
- -
-

Public Key

- -
-
{{ repo.keypair.public }}
-
-
\ No newline at end of file diff --git a/cmd/drone-server/static/scripts/views/repos/index/content.html b/cmd/drone-server/static/scripts/views/repos/index/content.html index 720e7e27..904d27a3 100644 --- a/cmd/drone-server/static/scripts/views/repos/index/content.html +++ b/cmd/drone-server/static/scripts/views/repos/index/content.html @@ -2,13 +2,31 @@
-