mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
brozzler web console initial fiddling
This commit is contained in:
parent
dff4149185
commit
1ca17f204b
1
webconsole/README.rst
Normal file
1
webconsole/README.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
flask --debug --app=brozzler-webconsole.py run --host=0.0.0.0 --port=8081
|
16
webconsole/brozzler-webconsole.py
Normal file
16
webconsole/brozzler-webconsole.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import flask
|
||||||
|
import rethinkstuff
|
||||||
|
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
|
r = rethinkstuff.Rethinker(["wbgrp-svc020", "wbgrp-svc035", "wbgrp-svc036"],
|
||||||
|
db="archiveit_brozzler")
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def jobs():
|
||||||
|
return flask.render_template("jobs.html", jobs=r.table("jobs").run())
|
||||||
|
# return "\n".join(("{} ({})".format(j["id"], j["status"]) for j in jobs))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(host="0.0.0.0", port=8081, debug=True)
|
||||||
|
|
3
webconsole/requirements.txt
Normal file
3
webconsole/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
git+https://github.com/mitsuhiko/flask.git
|
||||||
|
rethinkstuff
|
||||||
|
|
27
webconsole/templates/jobs.html
Normal file
27
webconsole/templates/jobs.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{% extends "layout.html" %}
|
||||||
|
{% block title %} Jobs {% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>Jobs</h1>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
{% for job in jobs %}
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">Job {{job.id}}: {{job.status}}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<h4> Seeds </h4>
|
||||||
|
<ul>
|
||||||
|
{% for seed in job.conf.seeds %}
|
||||||
|
<li> {{seed.url}} </li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
48
webconsole/templates/layout.html
Normal file
48
webconsole/templates/layout.html
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<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: {% block title %}{% endblock %}</title>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
padding-top: 70px;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body role="document">
|
||||||
|
<!-- Fixed navbar -->
|
||||||
|
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="container">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="/">Brozzler Console</a>
|
||||||
|
</div>
|
||||||
|
<div id="navbar" class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li><a href="/">Jobs</a></li>
|
||||||
|
<li><a href="/workers">Workers</a></li>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div><!--/.nav-collapse -->
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container" role="main">
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user