mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-10 07:20:39 -04:00
progress on the structure of this little app
This commit is contained in:
parent
51732d0d49
commit
05e15b9667
7 changed files with 114 additions and 80 deletions
22
webconsole/static/js/app.js
Normal file
22
webconsole/static/js/app.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
var brozzlerConsoleApp = angular.module("brozzlerConsoleApp", [
|
||||
"ngRoute",
|
||||
"brozzlerControllers",
|
||||
]);
|
||||
|
||||
brozzlerConsoleApp.config(["$routeProvider",
|
||||
function($routeProvider) {
|
||||
$routeProvider.
|
||||
when("/jobs", {
|
||||
templateUrl: "partials/jobs.html",
|
||||
controller: "JobsListController"
|
||||
}).
|
||||
when("/jobs/:id", {
|
||||
templateUrl: "partials/job.html",
|
||||
controller: "JobController"
|
||||
}).
|
||||
otherwise({
|
||||
redirectTo: "/jobs"
|
||||
});
|
||||
}]);
|
21
webconsole/static/js/controllers.js
Normal file
21
webconsole/static/js/controllers.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
var brozzlerControllers = angular.module("brozzlerControllers", []);
|
||||
|
||||
brozzlerControllers.controller("JobsListController", ["$scope", "$http",
|
||||
function($scope, $http) {
|
||||
$http.get("api/jobs").success(function(data) {
|
||||
console.log(data);
|
||||
$scope.jobs = data.jobs;
|
||||
});
|
||||
}]);
|
||||
|
||||
brozzlerControllers.controller("JobController", ["$scope", "$routeParams", "$http",
|
||||
function($scope, $routeParams, $http) {
|
||||
$scope.phoneId = $routeParams.phoneId;
|
||||
$http.get("api/jobs/" + $routeParams.id).success(function(data) {
|
||||
console.log(data);
|
||||
$scope.job = data;
|
||||
});
|
||||
}]);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue