+ Whoops! Something went wrong...
+
+
+ {{ error }}
+
+diff --git a/py-kms/pykms_WebUI.py b/py-kms/pykms_WebUI.py index 7f8b576..1030b67 100644 --- a/py-kms/pykms_WebUI.py +++ b/py-kms/pykms_WebUI.py @@ -2,14 +2,19 @@ import os, uuid, datetime from flask import Flask, render_template from pykms_Sql import sql_get_all -app = Flask('pykms_webui') - -start_time = datetime.datetime.now() serve_count = 0 def _random_uuid(): return str(uuid.uuid4()).replace('-', '_') +def _get_serve_count(): + return serve_count + +app = Flask('pykms_webui') +app.jinja_env.globals['start_time'] = datetime.datetime.now() +app.jinja_env.globals['get_serve_count'] = _get_serve_count +app.jinja_env.globals['random_uuid'] = _random_uuid + @app.route('/') def root(): global serve_count @@ -33,13 +38,20 @@ def root(): countClientsWindows = len([c for c in clients if c['applicationId'] == 'Windows']) if clients else 0 countClientsOffice = countClients - countClientsWindows return render_template( - 'index.html', - start_time=start_time.isoformat(), + 'clients.html', error=error, clients=clients, count_clients=countClients, count_clients_windows=countClientsWindows, - count_clients_office=countClientsOffice, - serve_count=serve_count, - random_uuid=_random_uuid - ) \ No newline at end of file + count_clients_office=countClientsOffice + ) + +@app.route('/license') +def license(): + global serve_count + serve_count += 1 + with open('../LICENSE', 'r') as f: + return render_template( + 'license.html', + license=f.read() + ) \ No newline at end of file diff --git a/py-kms/static/LICENSE b/py-kms/static/LICENSE deleted file mode 120000 index 30cff74..0000000 --- a/py-kms/static/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE \ No newline at end of file diff --git a/py-kms/templates/base.html b/py-kms/templates/base.html new file mode 100644 index 0000000..28c22ce --- /dev/null +++ b/py-kms/templates/base.html @@ -0,0 +1,35 @@ + + +
+ +Client ID | +Machine Name | +Application ID | +SKU ID | +License Status | +Last Seen | +KMS EPID | +Seen Count | +
---|---|---|---|---|---|---|---|
{{ client.clientMachineId }} |
+ + {% if client.machineName | length > 16 %} + {{ client.machineName | truncate(16, True, '...') }} + {% else %} + {{ client.machineName }} + {% endif %} + | +{{ client.applicationId }} | +{{ client.skuId }} | +{{ client.licenseStatus }} | +{{ client.lastRequestTime }} | ++ {% if client.kmsEpid | length > 16 %} + {{ client.kmsEpid | truncate(16, True, '...') }} + {% else %} + {{ client.kmsEpid }} + {% endif %} + | +{{ client.requestCount }} | +
Client ID | -Machine Name | -Application ID | -SKU ID | -License Status | -Last Seen | -KMS EPID | -Seen Count | -
---|---|---|---|---|---|---|---|
{{ client.clientMachineId }} |
- - {% if client.machineName | length > 16 %} - {{ client.machineName | truncate(16, True, '...') }} - {% else %} - {{ client.machineName }} - {% endif %} - | -{{ client.applicationId }} | -{{ client.skuId }} | -{{ client.licenseStatus }} | -{{ client.lastRequestTime }} | -- {% if client.kmsEpid | length > 16 %} - {{ client.kmsEpid | truncate(16, True, '...') }} - {% else %} - {{ client.kmsEpid }} - {% endif %} - | -{{ client.requestCount }} | -
{{ license }}+{% endblock %} \ No newline at end of file