Normal index page

This commit is contained in:
norohind 2021-12-02 22:25:03 +03:00
parent 68ce518bf8
commit 7a2a9ab969
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
3 changed files with 10 additions and 15 deletions

View File

@ -47,6 +47,8 @@
<td><a href="/leaderboard/trade/platform/xbox">TRADE</a></td>
</tr>
</table>
<a>In order to access to api, add /api/ to any endpoint</a>
<a>In order to access to api, add /api/ prefix to any endpoint url<br>
Author contact: a31#6403 (discord), a31@demb.design (email)<br>
<a href="https://github.com/norohind/SquadsActivityMonitor">Source code</a></a>
</body>
</html>

View File

@ -141,15 +141,6 @@ def _get_bearer() -> str:
return bearer
def build_index_page(app: falcon.App, index_path: str) -> None:
with open(index_path, 'w', encoding='utf-8') as index_file: # kinda documentation on main page
from falcon import inspect
app_info = inspect.inspect_app(app)
app_info_str = app_info.__str__().replace('\n', '<br>')
index_file.write(index_template.format(body=app_info_str))
def measure(function: callable):
"""
Decorator to measure function (method) execution time
@ -204,8 +195,13 @@ activity_table_html_template = """<!DOCTYPE HTML>
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
</head>
<body>
<div id="table0div">
</div>
<div id="table0div">
</div>
<div id=footer0div>
<footer>
<a href="/">Main page</a>
</footer>
</div>
</body>
</html>"""

3
web.py
View File

@ -119,9 +119,6 @@ app.add_route('/', MainPage())
application = app # for uwsgi
# index_file = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static'), 'index.html')
# utils.build_index_page(app, index_file)
if __name__ == '__main__':
import waitress