init
This commit is contained in:
23
templates/base.html
Normal file
23
templates/base.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Your page title</title>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{ bootstrap.load_css() }}
|
||||
<link rel="stylesheet" href="{{url_for('.static', filename='styles.css')}}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Torn User Activity Scraper</h1>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="navbar-nav mr-auto">
|
||||
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
||||
{{ render_nav_item('index', 'Home') }}
|
||||
{{ render_nav_item('results', 'Results') }}
|
||||
{{ render_nav_item('download_results', 'Download Results') }}
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
52
templates/download_results.html
Normal file
52
templates/download_results.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Your page title</title>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{ bootstrap.load_css() }}
|
||||
<link rel="stylesheet" href="{{url_for('.static', filename='styles.css')}}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Torn User Activity Scraper</h1>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="navbar-nav mr-auto">
|
||||
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
||||
{{ render_nav_item('index', 'Home') }}
|
||||
{{ render_nav_item('results', 'Results') }}
|
||||
{{ render_nav_item('download_results', 'Download Results') }}
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="scrapingFormContainer" class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<h2>Available Files</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Data</td>
|
||||
<td>Logs</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for file in files %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('download_results', filename=file) }}">{{ file }}</a></td>
|
||||
<td><a href="{{ url_for('download_logs', filename=file) }}">{{ file }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
{% block scripts %}
|
||||
{{ bootstrap.load_js() }}
|
||||
<script src="{{url_for('.static', filename='app.js')}}"></script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
64
templates/index.html
Normal file
64
templates/index.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Your page title</title>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{ bootstrap.load_css() }}
|
||||
<link rel="stylesheet" href="{{url_for('.static', filename='styles.css')}}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Torn User Activity Scraper</h1>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="navbar-nav mr-auto">
|
||||
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
||||
{{ render_nav_item('index', 'Home') }}
|
||||
{{ render_nav_item('results', 'Results') }}
|
||||
{{ render_nav_item('download_results', 'Download Results') }}
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<section id="scrapingFormContainer" class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<h2>Config</h2>
|
||||
<form id="scrapingForm" method="POST" action="{{ url_for('start_scraping') }}">
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-group">
|
||||
{{ form.faction_id.label(class="form-control-label") }}
|
||||
{{ form.faction_id(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.fetch_interval.label(class="form-control-label") }}
|
||||
{{ form.fetch_interval(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.run_interval.label(class="form-control-label") }}
|
||||
{{ form.run_interval(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.submit(class="btn btn-primary", type="submit", id="startButton") }}
|
||||
</div>
|
||||
</form>
|
||||
<button id="stopButton" class="btn btn-primary">Stop Scraping</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="resultsContainer" class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4">
|
||||
<h2>Logs</h2>
|
||||
<button id="prevPage">Previous</button>
|
||||
<button id="nextPage">Next</button>
|
||||
<pre class="pre-scrollable"><code id="logs"></code></pre>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
{% block scripts %}
|
||||
{{ bootstrap.load_js() }}
|
||||
<script src="{{url_for('.static', filename='app.js')}}"></script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
22
templates/results.html
Normal file
22
templates/results.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Scraping Results</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>User Activity Statistics</h1>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Hour</th>
|
||||
<th>Activity Count</th>
|
||||
</tr>
|
||||
{% for hour, count in stats.items() %}
|
||||
<tr>
|
||||
<td>{{ hour }}</td>
|
||||
<td>{{ count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user