1st restructure
This commit is contained in:
16
app/templates/analyze.html
Normal file
16
app/templates/analyze.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<section class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<div class="container-sm">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2>Analyze</h2>
|
||||
</div>
|
||||
<div class="col">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock content %}
|
||||
29
app/templates/base.html
Normal file
29
app/templates/base.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!-- app/templates/layouts/base.html -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="UTF-8">
|
||||
<title>TornActivityTracker{% block title %}{% endblock %}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{% block styles %}
|
||||
{{ bootstrap.load_css() }}
|
||||
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
{% include 'includes/navigation.html' %}
|
||||
</header>
|
||||
<main>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
{% block scripts %}
|
||||
{% include 'includes/scripts.html' %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
105
app/templates/download_results.html
Normal file
105
app/templates/download_results.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<section class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<div class="container-sm">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2>Data Files</h2>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-warning" onclick="deleteSelectedFiles()">Delete Selected Files</button>
|
||||
<button class="btn btn-success" onclick="downloadSelectedFiles()">Download Selected Files</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="dataFilesTable" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="2%"><input type="checkbox" id="checkAllData" onclick="checkAllCheckboxes('dataFilesTable', 'checkAllData')"></th>
|
||||
<th onclick="sortTable(1, 'dataFilesTable')">File Name</th>
|
||||
<th onclick="sortTable(2, 'dataFilesTable')">Last Modified</th>
|
||||
<th onclick="sortTable(3, 'dataFilesTable')">Created</th>
|
||||
<th onclick="sortTable(4, 'dataFilesTable')">Size</th>
|
||||
<th>Action</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for file in files.data %}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="fileCheckbox" value="{{ url_for('download_log_file', filename=file.name_display) }}"{{ ' disabled' if file.active }}></td>
|
||||
<td><a href="{{ url_for('download_data_file', filename=file.name_display) }}" target="_blank">{{ file.name_display }}</a></td>
|
||||
<td>{{ file.last_modified | datetimeformat }}</td>
|
||||
<td>{{ file.created | datetimeformat }}</td>
|
||||
<td>{{ file.size }}</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-warning" onclick="deleteFiles(['{{ file.name }}'])"{{ ' disabled' if file.active }}>Delete</button>
|
||||
</td>
|
||||
<td>
|
||||
<span id="status-{{ file.name_display }}" class="badge {{ 'bg-danger' if file.active else 'bg-success' }}">
|
||||
{{ 'In Use' if file.active else 'Available' }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<section class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<div class="container-sm">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2>Log Files</h2>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-warning" onclick="deleteSelectedFiles()">Delete Selected Files</button>
|
||||
<button class="btn btn-success" onclick="downloadSelectedFiles()">Download Selected Files</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="logFilesTable" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="2%"><input type="checkbox" id="checkAllLog" onclick="checkAllCheckboxes('logFilesTable', 'checkAllLog')"></th>
|
||||
<th onclick="sortTable(1, 'logFilesTable')">File Name</th>
|
||||
<th onclick="sortTable(2, 'logFilesTable')">Last Modified</th>
|
||||
<th onclick="sortTable(3, 'logFilesTable')">Created</th>
|
||||
<th onclick="sortTable(4, 'logFilesTable')">Size</th>
|
||||
<th>Action</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for file in files.log %}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="fileCheckbox" value="{{ url_for('download_log_file', filename=file.name_display) }}"{{ ' disabled' if file.active }}></td>
|
||||
<td><a href="{{ url_for('download_log_file', filename=file.name_display) }}" target="_blank">{{ file.name_display }}</a></td>
|
||||
<td>{{ file.last_modified | datetimeformat }}</td>
|
||||
<td>{{ file.created | datetimeformat }}</td>
|
||||
<td>{{ file.size }}</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-warning" onclick="deleteFiles(['{{ file.name }}'])"{{ ' disabled' if file.active }}>Delete</button>
|
||||
</td>
|
||||
<td>
|
||||
<span id="status-{{ file.name_display }}" class="badge {{ 'bg-danger' if file.active else 'bg-success' }}">
|
||||
{{ 'In Use' if file.active else 'Available' }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
{% block scripts %}
|
||||
{{ bootstrap.load_js() }}
|
||||
<script src="{{url_for('.static', filename='download_results.js')}}"></script>
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
||||
17
app/templates/includes/navigation.html
Normal file
17
app/templates/includes/navigation.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- app/templates/includes/navigation.html -->
|
||||
<nav class="navbar navbar-nav navbar-expand-md bg-primary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">Torn User Activity Scraper</a>
|
||||
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
||||
{{ render_nav_item('analyze', 'Analyze') }}
|
||||
{{ render_nav_item('download_results', 'Files') }}
|
||||
{{ render_nav_item('log_viewer', 'Logs') }}
|
||||
<div class="d-flex" id="color-mode-toggle">
|
||||
<input type="checkbox" id="bd-theme" />
|
||||
<label for="bd-theme">
|
||||
<span class="icon sun"><i class="bi bi-brightness-high"></i></span>
|
||||
<span class="icon moon"><i class="bi bi-moon-stars"></i></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
2
app/templates/includes/scripts.html
Normal file
2
app/templates/includes/scripts.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ bootstrap.load_js() }}
|
||||
<script src="{{url_for('static', filename='color_mode.js')}}"></script>
|
||||
46
app/templates/index.html
Normal file
46
app/templates/index.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<section id="scrapingFormContainer" class="container-fluid d-flex justify-content-center">
|
||||
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
|
||||
<h2>Scraper <span id="activity_indicator" class="badge text-bg-danger">Inactive</span></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>
|
||||
</form>
|
||||
<div class="btn-group btn-group m-2" role="group">
|
||||
{{ form.submit(class="btn btn-success", type="submit", id="startButton", form="scrapingForm") }}
|
||||
<button class="btn btn-warning" type="button" id="stopButton">Stop</button>
|
||||
</div>
|
||||
</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" style="height: 500px;">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<h2>Logs</h2>
|
||||
<pre id="logs" class="pre-scrollable" style="height: 350px; overflow:scroll; "><code></code></pre>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-primary" id="prevPage">Previous</button>
|
||||
<button class="btn btn-primary" id="pageInfo" disabled>Page 1 of 1</button>
|
||||
<button class="btn btn-primary" id="nextPage">Next</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h2>Stats</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="{{url_for('static', filename='index.js')}}"></script>
|
||||
{% endblock content %}
|
||||
3
app/templates/log_viewer.html
Normal file
3
app/templates/log_viewer.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user