This repository has been archived by the owner on May 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
182 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "../base.html" %} | ||
{% block title %}Status{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h2>Job queue stats</h2> | ||
<table class="table table-striped table-bordered" style="margin-top: 10px;"> | ||
<tbody> | ||
<tr><td>Jobs in test queue</td><td>{{ jobs_in_queue }}</td></tr> | ||
<tr><td>WPT tests awaiting results</td><td>{{ tests_awaiting_results }}</td></tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2>Total status</h2> | ||
<table class="table table-striped table-bordered" style="margin-top: 10px;"> | ||
<tbody> | ||
<tr><td>Total test URLS</td><td>{{ total_urls }}</td></tr> | ||
<tr><td>Total tests completed</td><td>{{ total_tests }}</td></tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
|
||
</body> | ||
</html> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{% extends "../base.html" %} | ||
{% block title %}URL Admin{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<style> | ||
.form-horizontal .controls { | ||
margin-left: 90px; | ||
} | ||
.form-horizontal .control-label { | ||
width: 80px; | ||
} | ||
.form-horizontal input[type="submit"] { | ||
padding-left: 10px; | ||
padding-right: 10px; | ||
} | ||
table form { | ||
margin: 0; | ||
} | ||
|
||
</style> | ||
|
||
{% if messages %} | ||
<div class="alert alert-success"> | ||
{% for message in messages %} | ||
<p>{{ message }}</p> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
<h2>URLs currently in test</h2> | ||
<table class="table table-striped table-bordered" style="margin-top: 10px;"> | ||
<thead> | ||
<tr><th>Name</th><th>URL</th><th>Dashboard</th><th>Schedule Test</th><th>Delete</th></tr> | ||
</thead> | ||
<tbody> | ||
{% for url in urls %} | ||
<tr> | ||
<td>{{ url.name }}</td> | ||
<td><a href="{{ url.url }}">{{ url.url }}</a></td> | ||
<td><a href="/dashboard/{{ url.dashboard }}">{{ url.dashboard }}</a></td> | ||
<td><i class="icon-time"></i> <a href="/schedule/{{ url.key }}">Test</a></td> | ||
<td> | ||
<form method="post" action="/admin/urls"> | ||
<i class="icon-trash"></i> | ||
<input type="hidden" name="method" value="delete"><!-- Yay, HTTP --> | ||
<input type="hidden" name="key" value="{{ url.key }}" /> | ||
<input type="submit" value="Delete" class="btn btn-mini" /> | ||
</form> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
<div class="row"> | ||
<div class="span6"> | ||
|
||
<h3>Add new URL</h3> | ||
{% ifequal adding 'url' %} | ||
{% ifequal error 'BadValueError' %} | ||
<div class="alert alert-error"><p>All fields are required.</p></div> | ||
{% endifequal %} | ||
{% ifequal error '200' %} | ||
<div class="alert alert-error"><p>Bad URL. Make sure you entered a URL that returns a HTTP 200 code, ie. no redirects, and is on the public internet.</p></div> | ||
{% endifequal %} | ||
{% endifequal %} | ||
<form method="post" action="/admin/urls" class="form-horizontal" style="margin-top: 10px;"> | ||
<div class="control-group"> | ||
<label class="control-label" for="f-name">Name:</label> | ||
<div class="controls"> | ||
<input type="text" name="name" id="f-name" placeholder="Guardian Network Front" value="{{ fields.name }}" /> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<label class="control-label" for="f-url">URL:</label> | ||
<div class="controls"> | ||
<input type="text" name="url" id="f-url" placeholder="www.guardian.co.uk" value="{{ fields.url }}" /> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<label class="control-label" for="f-url">Dashboard:</label> | ||
<div class="controls"> | ||
<select name="dashboard"> | ||
{% for dashboard in dashboards %} | ||
<option value="{{ dashboard.id }}"{% ifequal dashboard.id fields.dashboard %} selected="selected"{%endifequal %}>{{ dashboard.name }}</option> | ||
{% endfor %} | ||
</select> | ||
<p class="help-block">Which dashboard do you want the URL to appear on</p> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<input type="hidden" name="model" value="url" /> | ||
<input type="submit" value="Add" class="btn btn-primary" /> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
<div class="span6"> | ||
<h3>Add new Dashboard</h3> | ||
{% ifequal adding 'dashboard' %} | ||
{% ifequal error 'BadValueError' %} | ||
<div class="alert alert-error"><p>Both fields are required.</p></div> | ||
{% endifequal %} | ||
{% endifequal %} | ||
<form method="post" action="/admin/urls" class="form-horizontal" style="margin-top: 10px;"> | ||
<div class="control-group"> | ||
<label class="control-label" for="f-dashboard-name">Name:</label> | ||
<div class="controls"> | ||
<input type="text" name="dashboard-name" id="f-dashboard-name" placeholder="Discussion" value="{{ fields.dashboardname }}" /> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<label class="control-label" for="f-dashboard-id">ID:</label> | ||
<div class="controls"> | ||
<input type="text" name="dashboard-id" id="f-dashboard-id" placeholder="discussion" value="{{ fields.dashboardid }}" /> | ||
</div> | ||
</div> | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<input type="hidden" name="model" value="dashboard" /> | ||
<input type="submit" value="Add" class="btn btn-primary" /> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters