mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-04-18 15:37:39 +03:00
Normal index page
This commit is contained in:
parent
68ce518bf8
commit
7a2a9ab969
@ -47,6 +47,8 @@
|
|||||||
<td><a href="/leaderboard/trade/platform/xbox">TRADE</a></td>
|
<td><a href="/leaderboard/trade/platform/xbox">TRADE</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
18
utils.py
18
utils.py
@ -141,15 +141,6 @@ def _get_bearer() -> str:
|
|||||||
return bearer
|
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):
|
def measure(function: callable):
|
||||||
"""
|
"""
|
||||||
Decorator to measure function (method) execution time
|
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">
|
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="table0div">
|
<div id="table0div">
|
||||||
</div>
|
</div>
|
||||||
|
<div id=footer0div>
|
||||||
|
<footer>
|
||||||
|
<a href="/">Main page</a>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
|
|
||||||
|
3
web.py
3
web.py
@ -119,9 +119,6 @@ app.add_route('/', MainPage())
|
|||||||
|
|
||||||
application = app # for uwsgi
|
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__':
|
if __name__ == '__main__':
|
||||||
import waitress
|
import waitress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user