mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-20 23:56:34 -04:00
4 space indent everywhere
This commit is contained in:
parent
0591548861
commit
9ed1ac817e
@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Brozzler Console: Jobs</title>
|
||||
<title>Brozzler Console</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap-theme.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.css">
|
||||
@ -13,18 +13,17 @@
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/controllers.js"></script>
|
||||
<style>
|
||||
body { padding-top: 1rem; }
|
||||
.thumbnail:focus, .thumbnail:hover { text-decoration: none; }
|
||||
.thumbnail { word-wrap: break-word; }
|
||||
/* .glyphicon { color: #563d7c; } */
|
||||
.bigstats { font-size:125% }
|
||||
.bigstats .fa { font-size:150% }
|
||||
.bigstats .stat { padding:2rem }
|
||||
body { padding-top: 1rem; }
|
||||
.thumbnail:focus, .thumbnail:hover { text-decoration: none; }
|
||||
.thumbnail { word-wrap: break-word; }
|
||||
.bigstats { font-size:125% }
|
||||
.bigstats .fa { font-size:150% }
|
||||
.bigstats .stat { padding:2rem }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body role="document">
|
||||
<div ng-view class="container" role="main">
|
||||
</div>
|
||||
<div ng-view class="container" role="main">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -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: '<div> <div class="page-header"> <h1>Not Found</h1> </div> <div class="row"> <div class="col-sm-12"> How the heck did you get here? </div> </div> </div> ',
|
||||
});
|
||||
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: '<div> <div class="page-header"> <h1>Not Found</h1> </div> <div class="row"> <div class="col-sm-12"> How the heck did you get here? </div> </div> </div> ',
|
||||
});
|
||||
|
||||
$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;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
});
|
||||
*/
|
||||
|
@ -1,12 +1,12 @@
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li class="active">{{job.id}}</li>
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li class="active">{{job.id}}</li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@ -35,31 +35,31 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h3>Sites</h3>
|
||||
<div class="col-sm-6 col-md-4" ng-repeat="site in sites">
|
||||
<a class="thumbnail" href="/sites/{{site.id}}">
|
||||
<img style="width:300px;height:190px" src="http://wbgrp-svc107.us.archive.org:8091/web/3/thumbnail:{{site.seed}}" alt="thumb">
|
||||
<div class="caption">
|
||||
<h5>{{site.seed}}</h5>
|
||||
<!--
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h3>Sites</h3>
|
||||
<div class="col-sm-6 col-md-4" ng-repeat="site in sites">
|
||||
<a class="thumbnail" href="/sites/{{site.id}}">
|
||||
<img style="width:300px;height:190px" src="http://wbgrp-svc107.us.archive.org:8091/web/3/thumbnail:{{site.seed}}" alt="thumb">
|
||||
<div class="caption">
|
||||
<h5>{{site.seed}}</h5>
|
||||
<!--
|
||||
<div><span class="glyphicon glyphicon-file"></span> <strong>{{site.page_count}}</strong> pages crawled</div>
|
||||
<div><span class="glyphicon glyphicon-duplicate"></span> <strong>{{site.stats.total.urls}}</strong> urls crawled</div>
|
||||
<div><span class="glyphicon glyphicon-oil"></span> <strong>{{site.stats.total.wire_bytes | byteformat}}</strong> crawled</div>
|
||||
<div><span class="glyphicon glyphicon-menu-hamburger"></span> <strong>{{site.queued_count}}</strong> pages queued</div>
|
||||
-->
|
||||
-->
|
||||
|
||||
<ul class="fa-ul">
|
||||
<li><span class="fa fa-li fa-file-text"></span> <strong>{{site.page_count}}</strong> pages crawled</li>
|
||||
<li><span class="fa fa-li fa-clone"></span> <strong>{{site.stats.total.urls}}</strong> urls crawled</li>
|
||||
<li><span class="fa fa-li fa-archive"></span> <strong>{{site.stats.total.wire_bytes | byteformat}}</strong> crawled</li>
|
||||
<li><span class="fa fa-li fa-ellipsis-h"></span> <strong>{{site.queued_count}}</strong> pages queued</li>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="fa-ul">
|
||||
<li><span class="fa fa-li fa-file-text"></span> <strong>{{site.page_count}}</strong> pages crawled</li>
|
||||
<li><span class="fa fa-li fa-clone"></span> <strong>{{site.stats.total.urls}}</strong> urls crawled</li>
|
||||
<li><span class="fa fa-li fa-archive"></span> <strong>{{site.stats.total.wire_bytes | byteformat}}</strong> crawled</li>
|
||||
<li><span class="fa fa-li fa-ellipsis-h"></span> <strong>{{site.queued_count}}</strong> pages queued</li>
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,38 +1,38 @@
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">Jobs</li>
|
||||
<li class="active">Jobs</li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Jobs</h2>
|
||||
<h2>Jobs</h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>status</th>
|
||||
<th>started</th>
|
||||
<th>finished</th>
|
||||
<th># of seeds</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="job in jobs">
|
||||
<td><a href="/jobs/{{job.id}}">{{job.id}}</a></td>
|
||||
<td>{{job.status}}</td>
|
||||
<td>{{job.started}}</td>
|
||||
<td>{{job.finished}}</td>
|
||||
<td>{{job.conf.seeds.length}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>status</th>
|
||||
<th>started</th>
|
||||
<th>finished</th>
|
||||
<th># of seeds</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="job in jobs">
|
||||
<td><a href="/jobs/{{job.id}}">{{job.id}}</a></td>
|
||||
<td>{{job.status}}</td>
|
||||
<td>{{job.started}}</td>
|
||||
<td>{{job.finished}}</td>
|
||||
<td>{{job.conf.seeds.length}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li><a href="/jobs/{{site.job_id}}">{{site.job_id}}</a></li>
|
||||
<li class="active">{{site.seed}}</li>
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li><a href="/jobs/{{site.job_id}}">{{site.job_id}}</a></li>
|
||||
<li class="active">{{site.seed}}</li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
<h1>Brozzler
|
||||
<a href="/"><img src="/static/brozzler.svg" style="height:1.5em;float:right"></a>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Site {{site.seed}} (Job <a href="/jobs/{{site.job_id}}">{{site.job_id}}</a>)</h2>
|
||||
<h2>Site {{site.seed}} (Job <a href="/jobs/{{site.job_id}}">{{site.job_id}}</a>)</h2>
|
||||
|
||||
<div class="row bigstats">
|
||||
<div class="col-sm-6 col-md-3">
|
||||
@ -36,19 +36,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h2>Pages</h2>
|
||||
<div class="col-sm-6 col-md-4" ng-repeat="page in pages">
|
||||
<div class="thumbnail">
|
||||
<img width="300" height="190" src="http://wbgrp-svc107.us.archive.org:8091/web/3/thumbnail:{{page.url}}" alt="thumb">
|
||||
<div class="caption">
|
||||
<h3>Thumbnail label</h3>
|
||||
{{page}}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h2>Pages</h2>
|
||||
<div class="col-sm-6 col-md-4" ng-repeat="page in pages">
|
||||
<div class="thumbnail">
|
||||
<img width="300" height="190" src="http://wbgrp-svc107.us.archive.org:8091/web/3/thumbnail:{{page.url}}" alt="thumb">
|
||||
<div class="caption">
|
||||
<h3>Thumbnail label</h3>
|
||||
{{page}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user