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 += "

Domain:

" - html += "

Licence key:

" - html += "" - html += "
" - - html += "

Stats


" - html += "

Workers

" - html += "" - html += "

Sites

" - html += "

Total sites: " + str(len(sites)) + "

" - html += "" - html += "

Number of unclaimed licences: " + str(len(licences)) + "

" + sitehtml += "
  • Domain: "+site.split(':')[0]+" | Worker: " + site.split(':')[1].strip('\n') + "
  • " - html += "

    Admin

    " - 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

    +
    +
    +

    Create a new site

    +
    +

    Domain:

    +

    Licence key:

    +
    +
    +
    +
    +

    Stats

    +

    Workers

    + +

    Sites

    +

    Total sites: {{site_count}}

    + +
    +

    Unclaimed licences: {{licences}}

    +
    +
    +

    Admin

    + + \ No newline at end of file