main: Added initial bootstrap site
All checks were successful
Build Docker / Build Master (push) Successful in 42s
Build Docker / Build Bot (push) Successful in 48s

This commit is contained in:
2023-09-02 13:29:12 +10:00
parent 75b4f979e3
commit 58bce1e8bf
18 changed files with 310 additions and 58 deletions

View File

@@ -429,17 +429,7 @@ def workerIP(worker):
# Home page
@app.route('/')
def home():
# Show stats and info
# Get worker info
workers = []
try:
workers_file = open('/data/workers.txt', 'r')
workers = workers_file.readlines()
workers_file.close()
except FileNotFoundError:
pass
# Show index template
# Get site info
sites = []
try:
@@ -449,25 +439,8 @@ def home():
except FileNotFoundError:
pass
# Get licence info
licences = []
try:
licences_file = open('/data/licence_key.txt', 'r')
licences = licences_file.readlines()
licences_file.close()
except FileNotFoundError:
pass
# Create html page
workerhtml = ""
for worker in workers:
workerhtml += "<li>Name: " + worker.split(':')[0] + " | IP: " + worker.split(':')[2].strip('\n') + "</li>"
sitehtml = ""
for site in sites:
sitehtml += "<li>Domain: <a href=\"https://" + site.split(':')[0] + "\" target=\"_blank\">"+site.split(':')[0]+"</a> | Worker: " + site.split(':')[1].strip('\n') + "</li>"
return render_template('index.html', workers=workerhtml, site_count = str(len(sites)), sites = sitehtml, licences = str(len(licences)))
return render_template('index.html', site_count = str(len(sites)))
# Admin page
@app.route('/admin')