diff --git a/master/assets/css/index.css b/master/assets/css/index.css
new file mode 100644
index 0000000..c3da618
--- /dev/null
+++ b/master/assets/css/index.css
@@ -0,0 +1,7 @@
+html {
+ background-color: black;
+ color: white;
+ font-family: 'Roboto', sans-serif;
+ font-size: 16px;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/master/main.py b/master/main.py
index eaa6846..d4b2775 100644
--- a/master/main.py
+++ b/master/main.py
@@ -1,4 +1,4 @@
-from flask import Flask, make_response, redirect, request, jsonify
+from flask import Flask, make_response, redirect, request, jsonify, render_template, send_from_directory
import dotenv
import os
import requests
@@ -459,30 +459,15 @@ def home():
pass
# Create html page
- html = "
Welcome
"
- html += "Create a site
"
- html += ""
-
- html += "
Stats
"
- html += "Workers
"
- html += ""
+ workerhtml = ""
for worker in workers:
- html += "- Name: " + worker.split(':')[0] + " | IP: " + worker.split(':')[2].strip('\n') + "
"
- html += "
"
- html += "Sites
"
- html += "Total sites: " + str(len(sites)) + "
"
- html += ""
+ workerhtml += "- Name: " + worker.split(':')[0] + " | IP: " + worker.split(':')[2].strip('\n') + "
"
+ sitehtml = ""
for site in sites:
- html += "- Domain: "+site.split(':')[0]+" | Worker: " + site.split(':')[1].strip('\n') + "
"
- html += "
"
- html += "Number of unclaimed licences: " + str(len(licences)) + "
"
+ sitehtml += "Domain: "+site.split(':')[0]+" | Worker: " + site.split(':')[1].strip('\n') + ""
- html += ""
- return html
+
+ return render_template('index.html', workers=workerhtml, site_count = str(len(sites)), sites = sitehtml, licences = str(len(licences)))
# Admin page
@app.route('/admin')
@@ -776,7 +761,10 @@ def login():
def failed_login():
return "Failed login
"
-
+# Assets
+@app.route('/assets/')
+def send_report(path):
+ return send_from_directory('assets', path)
diff --git a/master/templates/index.html b/master/templates/index.html
new file mode 100644
index 0000000..e15a231
--- /dev/null
+++ b/master/templates/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ HNS Hosting Wordpress
+
+
+
+ HNS Hosting Wordpress
+ Intro blurb
+
+
+
+
+
Stats
+
Workers
+
+
Sites
+
Total sites: {{site_count}}
+
+
+
Unclaimed licences: {{licences}}
+
+
+
+
+
\ No newline at end of file