From 9ed1ac817eec09fb09e5d597ab0bae03b164a766 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Fri, 9 Oct 2015 20:31:07 +0000 Subject: [PATCH] 4 space indent everywhere --- webconsole/static/index.html | 19 ++-- webconsole/static/js/app.js | 74 ++++++------- webconsole/static/js/controllers.js | 154 +++++++++++++-------------- webconsole/static/partials/job.html | 50 ++++----- webconsole/static/partials/jobs.html | 56 +++++----- webconsole/static/partials/site.html | 38 +++---- 6 files changed, 195 insertions(+), 196 deletions(-) diff --git a/webconsole/static/index.html b/webconsole/static/index.html index bb2aa1c..9f31b61 100644 --- a/webconsole/static/index.html +++ b/webconsole/static/index.html @@ -4,7 +4,7 @@ -Brozzler Console: Jobs +Brozzler Console @@ -13,18 +13,17 @@ -
-
+
+
diff --git a/webconsole/static/js/app.js b/webconsole/static/js/app.js index cb7cdc4..51794a0 100644 --- a/webconsole/static/js/app.js +++ b/webconsole/static/js/app.js @@ -1,49 +1,49 @@ "use strict"; var brozzlerConsoleApp = angular.module("brozzlerConsoleApp", [ - "ngRoute", - "brozzlerControllers", + "ngRoute", + "brozzlerControllers", ]); brozzlerConsoleApp.config(["$routeProvider", "$locationProvider", - function($routeProvider, $locationProvider) { - $routeProvider. - when("/jobs", { - templateUrl: "/static/partials/jobs.html", - controller: "JobsListController" - }). - when("/jobs/:id", { - templateUrl: "/static/partials/job.html", - controller: "JobController" - }). - when("/sites/:id", { - templateUrl: "/static/partials/site.html", - controller: "SiteController" - }). - when("/", { - redirectTo: "/jobs" - }). - otherwise({ - template: '
How the heck did you get here?
', - }); + function($routeProvider, $locationProvider) { + $routeProvider. + when("/jobs", { + templateUrl: "/static/partials/jobs.html", + controller: "JobsListController" + }). + when("/jobs/:id", { + templateUrl: "/static/partials/job.html", + controller: "JobController" + }). + when("/sites/:id", { + templateUrl: "/static/partials/site.html", + controller: "SiteController" + }). + when("/", { + redirectTo: "/jobs" + }). + otherwise({ + template: '
How the heck did you get here?
', + }); - $locationProvider.html5Mode({ - enabled: true, - requireBase: false, - }); - }]); + $locationProvider.html5Mode({ + enabled: true, + requireBase: false, + }); + }]); // copied from https://bitbucket.org/webarchive/ait5/src/master/archiveit/static/app/js/filters/ByteFormat.js brozzlerConsoleApp.filter("byteformat", function() { - return function(bytes, precision) { - var bytes_f = parseFloat(bytes); - if (bytes_f == 0 || isNaN(bytes_f) || !isFinite(bytes_f)) return "0"; - if (bytes_f < 1024) return bytes_f.toFixed(0) + " bytes"; - if (typeof precision === "undefined") precision = 1; - var units = ["bytes", "kB", "MB", "GB", "TB", "PB"]; - var number = Math.floor(Math.log(bytes_f) / Math.log(1024)); - var result = (bytes_f / Math.pow(1024, Math.floor(number))).toFixed(precision) + " " + units[number]; - return result; - } + return function(bytes, precision) { + var bytes_f = parseFloat(bytes); + if (bytes_f == 0 || isNaN(bytes_f) || !isFinite(bytes_f)) return "0"; + if (bytes_f < 1024) return bytes_f.toFixed(0) + " bytes"; + if (typeof precision === "undefined") precision = 1; + var units = ["bytes", "kB", "MB", "GB", "TB", "PB"]; + var number = Math.floor(Math.log(bytes_f) / Math.log(1024)); + var result = (bytes_f / Math.pow(1024, Math.floor(number))).toFixed(precision) + " " + units[number]; + return result; + } }); diff --git a/webconsole/static/js/controllers.js b/webconsole/static/js/controllers.js index c4a5db2..bc7efe6 100644 --- a/webconsole/static/js/controllers.js +++ b/webconsole/static/js/controllers.js @@ -3,91 +3,91 @@ var brozzlerControllers = angular.module("brozzlerControllers", []); brozzlerControllers.controller("JobsListController", ["$scope", "$http", - function($scope, $http) { - $http.get("/api/jobs").success(function(data) { - $scope.jobs = data.jobs; - }); - }]); + function($scope, $http) { + $http.get("/api/jobs").success(function(data) { + $scope.jobs = data.jobs; + }); + }]); brozzlerControllers.controller("JobController", ["$scope", "$routeParams", "$http", - function($scope, $routeParams, $http) { - $http.get("/api/jobs/" + $routeParams.id).success(function(data) { - $scope.job = data; - $scope.job.page_count = $scope.job.queued_count = 0; - console.log("job=", $scope.job); - $http.get("/api/stats/" + $scope.job.conf.warcprox_meta.stats.buckets[0]).success(function(data) { - $scope.job.stats = data; - // console.log("job stats=", $scope.job.stats); - }); - }); + function($scope, $routeParams, $http) { + $http.get("/api/jobs/" + $routeParams.id).success(function(data) { + $scope.job = data; + $scope.job.page_count = $scope.job.queued_count = 0; + console.log("job=", $scope.job); + $http.get("/api/stats/" + $scope.job.conf.warcprox_meta.stats.buckets[0]).success(function(data) { + $scope.job.stats = data; + // console.log("job stats=", $scope.job.stats); + }); + }); - function statsSuccessCallback(site, bucket) { - return function(data) { - // console.log("site = ", site); - // console.log("/api/stats/" + bucket + " = ", data); - site.stats = data; - } - } + function statsSuccessCallback(site, bucket) { + return function(data) { + // console.log("site = ", site); + // console.log("/api/stats/" + bucket + " = ", data); + site.stats = data; + } + } - function pageCountSuccessCallback(site, bucket) { - return function(data) { - // console.log("site = ", site); - // console.log("/api/sites/" + site.id + "/page_count = ", data); - site.page_count = data.count; - $scope.job.page_count += data.count; - } - } + function pageCountSuccessCallback(site, bucket) { + return function(data) { + // console.log("site = ", site); + // console.log("/api/sites/" + site.id + "/page_count = ", data); + site.page_count = data.count; + $scope.job.page_count += data.count; + } + } - function queuedCountSuccessCallback(site, bucket) { - return function(data) { - // console.log("site = ", site); - // console.log("/api/sites/" + site.id + "/queued_count = ", data); - site.queued_count = data.count; - $scope.job.queued_count += data.count; - } - } + function queuedCountSuccessCallback(site, bucket) { + return function(data) { + // console.log("site = ", site); + // console.log("/api/sites/" + site.id + "/queued_count = ", data); + site.queued_count = data.count; + $scope.job.queued_count += data.count; + } + } - $http.get("/api/jobs/" + $routeParams.id + "/sites").success(function(data) { - $scope.sites = data.sites; - // console.log("sites=", $scope.sites); - for (var i = 0; i < $scope.sites.length; i++) { - var site = $scope.sites[i]; - $http.get("/api/sites/" + site.id + "/page_count").success(pageCountSuccessCallback(site, bucket)); - $http.get("/api/sites/" + site.id + "/queued_count").success(queuedCountSuccessCallback(site, bucket)); + $http.get("/api/jobs/" + $routeParams.id + "/sites").success(function(data) { + $scope.sites = data.sites; + // console.log("sites=", $scope.sites); + for (var i = 0; i < $scope.sites.length; i++) { + var site = $scope.sites[i]; + $http.get("/api/sites/" + site.id + "/page_count").success(pageCountSuccessCallback(site, bucket)); + $http.get("/api/sites/" + site.id + "/queued_count").success(queuedCountSuccessCallback(site, bucket)); - // parse Warcprox-Meta to find stats bucket - var warcprox_meta = angular.fromJson(site.extra_headers["Warcprox-Meta"]); - for (var j = 0; j < warcprox_meta.stats.buckets.length; j++) { - if (warcprox_meta.stats.buckets[j].indexOf("seed") >= 0) { - var bucket = warcprox_meta.stats.buckets[j]; - // console.log("warcprox_meta.stats.buckets[" + j + "]=" + bucket); - $http.get("/api/stats/" + bucket).success(statsSuccessCallback(site, bucket)); - } - } - } - }); - }]); + // parse Warcprox-Meta to find stats bucket + var warcprox_meta = angular.fromJson(site.extra_headers["Warcprox-Meta"]); + for (var j = 0; j < warcprox_meta.stats.buckets.length; j++) { + if (warcprox_meta.stats.buckets[j].indexOf("seed") >= 0) { + var bucket = warcprox_meta.stats.buckets[j]; + // console.log("warcprox_meta.stats.buckets[" + j + "]=" + bucket); + $http.get("/api/stats/" + bucket).success(statsSuccessCallback(site, bucket)); + } + } + } + }); + }]); brozzlerControllers.controller("SiteController", ["$scope", "$routeParams", "$http", - function($scope, $routeParams, $http) { - $http.get("/api/site/" + $routeParams.id).success(function(data) { - $scope.site = data; - // console.log("site = ", $scope.site); - }); - - $http.get("/api/site/" + $routeParams.id + "/pages?start=0&end=99").success(function(data) { - $scope.pages = data.pages; - // console.log("pages = ", $scope.pages); - }); - }]); + function($scope, $routeParams, $http) { + $http.get("/api/site/" + $routeParams.id).success(function(data) { + $scope.site = data; + // console.log("site = ", $scope.site); + }); + + $http.get("/api/site/" + $routeParams.id + "/pages?start=0&end=99").success(function(data) { + $scope.pages = data.pages; + // console.log("pages = ", $scope.pages); + }); + }]); /* -$http.get("/api/site/" + $routeParams.id).then(function(response) { - console.log("/api/site/" + $routeParams.id + " returned", response); - $scope.site = response.data; - return $http.get("/api/site/" + $routeParams.id + "/pages"); -}).then(function(response) { - console.log("/api/site/" + $routeParams.id + "/pages returned", response); - $scope.site.pages = response.data.pages; -}); -*/ + $http.get("/api/site/" + $routeParams.id).then(function(response) { + console.log("/api/site/" + $routeParams.id + " returned", response); + $scope.site = response.data; + return $http.get("/api/site/" + $routeParams.id + "/pages"); + }).then(function(response) { + console.log("/api/site/" + $routeParams.id + "/pages returned", response); + $scope.site.pages = response.data.pages; + }); + */ diff --git a/webconsole/static/partials/job.html b/webconsole/static/partials/job.html index 790435f..2c9c4b6 100644 --- a/webconsole/static/partials/job.html +++ b/webconsole/static/partials/job.html @@ -1,12 +1,12 @@
@@ -35,31 +35,31 @@
-
-
-

Sites

- +
    +
  • {{site.page_count}} pages crawled
  • +
  • {{site.stats.total.urls}} urls crawled
  • +
  • {{site.stats.total.wire_bytes | byteformat}} crawled
  • +
  • {{site.queued_count}} pages queued
  • +
+
+ +
+ - diff --git a/webconsole/static/partials/jobs.html b/webconsole/static/partials/jobs.html index a410761..7b14588 100644 --- a/webconsole/static/partials/jobs.html +++ b/webconsole/static/partials/jobs.html @@ -1,38 +1,38 @@
-

Jobs

+

Jobs

-
-
- - - - - - - - - - - - - - - - - - - -
idstatusstartedfinished# of seeds
{{job.id}}{{job.status}}{{job.started}}{{job.finished}}{{job.conf.seeds.length}}
+
+
+ + + + + + + + + + + + + + + + + + + +
idstatusstartedfinished# of seeds
{{job.id}}{{job.status}}{{job.started}}{{job.finished}}{{job.conf.seeds.length}}
+
-
diff --git a/webconsole/static/partials/site.html b/webconsole/static/partials/site.html index 9b7dbfa..da95837 100644 --- a/webconsole/static/partials/site.html +++ b/webconsole/static/partials/site.html @@ -1,17 +1,17 @@
-

Site {{site.seed}} (Job {{site.job_id}})

+

Site {{site.seed}} (Job {{site.job_id}})

@@ -36,19 +36,19 @@
-
-
-

Pages

-
-
- thumb -
-

Thumbnail label

- {{page}} -
+
+
+

Pages

+
+
+ thumb +
+

Thumbnail label

+ {{page}} +
+
+
-
-