36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
import os
|
|
from nicegui import ui, app
|
|
from sqlalchemy import create_engine
|
|
import json
|
|
import valkey
|
|
|
|
|
|
VALKEY_R = valkey.Valkey(host='localhost', port=6379, db=0, decode_responses=True)
|
|
|
|
|
|
|
|
def root():
|
|
app.add_static_files(max_cache_age=0, url_path='/static', local_directory=os.path.join(os.path.dirname(__file__), 'nicegui_modules/static'))
|
|
ui.add_head_html('''
|
|
<meta name="darkreader-lock">
|
|
<link rel="stylesheet" type="text/css" href="/static/styles.css">
|
|
<script type="text/javascript" src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>
|
|
<script src="/static/script.js"></script>
|
|
'''
|
|
)
|
|
# ui.add_head_html('<meta name="darkreader-lock">')
|
|
# update_body_scroll(bool_override=ALLOW_BODY_SCROLL)
|
|
|
|
ui.sub_pages({
|
|
'/': controls_grid,
|
|
}).classes('w-full')
|
|
|
|
|
|
async def controls_grid():
|
|
with ui.grid(columns=16).classes('w-full gap-0 auto-fit'):
|
|
with ui.card().tight().classes('w-full col-span-full no-shadow border border-black-200').style('overflow: auto;'):
|
|
ui.html('<div id="tv" style="width:100%; height:800px;"></div>', sanitize=False).classes('w-full')
|
|
ui.run_javascript('await create_tv();')
|
|
|
|
|
|
ui.run(root, storage_secret="123ABC", reload=True, dark=True, title='Atwater_Trading') |