mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
list jobless sites on brozzler-webconsole front page
This commit is contained in:
parent
4fa1571bc5
commit
94a8e70226
@ -27,7 +27,6 @@ except ImportError as e:
|
|||||||
'brozzler[webconsole]".\nSee README.rst for more information.',
|
'brozzler[webconsole]".\nSee README.rst for more information.',
|
||||||
type(e).__name__, e)
|
type(e).__name__, e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
import rethinkstuff
|
import rethinkstuff
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@ -149,6 +148,16 @@ def sites(job_id):
|
|||||||
s["cookie_db"] = base64.b64encode(s["cookie_db"]).decode("ascii")
|
s["cookie_db"] = base64.b64encode(s["cookie_db"]).decode("ascii")
|
||||||
return flask.jsonify(sites=sites_)
|
return flask.jsonify(sites=sites_)
|
||||||
|
|
||||||
|
@app.route("/api/jobless-sites")
|
||||||
|
def jobless_sites():
|
||||||
|
# XXX inefficient (unindexed) query
|
||||||
|
sites_ = list(r.table("sites").filter(~r.row.has_fields("job_id")).run())
|
||||||
|
# TypeError: <binary, 7168 bytes, '53 51 4c 69 74 65...'> is not JSON serializable
|
||||||
|
for s in sites_:
|
||||||
|
if "cookie_db" in s:
|
||||||
|
s["cookie_db"] = base64.b64encode(s["cookie_db"]).decode("ascii")
|
||||||
|
return flask.jsonify(sites=sites_)
|
||||||
|
|
||||||
@app.route("/api/jobs/<int:job_id>")
|
@app.route("/api/jobs/<int:job_id>")
|
||||||
@app.route("/api/job/<int:job_id>")
|
@app.route("/api/job/<int:job_id>")
|
||||||
def job(job_id):
|
def job(job_id):
|
||||||
|
@ -79,6 +79,9 @@ brozzlerControllers.controller("HomeController", ["$scope", "$http",
|
|||||||
$http.get("/api/services").success(function(data) {
|
$http.get("/api/services").success(function(data) {
|
||||||
$scope.services = data.services;
|
$scope.services = data.services;
|
||||||
});
|
});
|
||||||
|
$http.get("/api/jobless-sites").success(function(data) {
|
||||||
|
$scope.joblessSites = data.sites;
|
||||||
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
brozzlerControllers.controller("WorkersListController", ["$scope", "$http",
|
brozzlerControllers.controller("WorkersListController", ["$scope", "$http",
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Jobs</h2>
|
<h2>Jobs</h2>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
@ -66,4 +65,23 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2>Jobless Sites</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>id</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="site in joblessSites">
|
||||||
|
<td><a href="/sites/{{site.id}}">{{site.id}}</a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
2
setup.py
2
setup.py
@ -32,7 +32,7 @@ def find_package_data(package):
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='brozzler',
|
name='brozzler',
|
||||||
version='1.1b6.dev72',
|
version='1.1b6.dev73',
|
||||||
description='Distributed web crawling with browsers',
|
description='Distributed web crawling with browsers',
|
||||||
url='https://github.com/internetarchive/brozzler',
|
url='https://github.com/internetarchive/brozzler',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user