You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.9 KiB
Python
73 lines
1.9 KiB
Python
1 month ago
|
from __future__ import annotations
|
||
|
|
||
|
from pathlib import Path
|
||
|
from typing import * # type: ignore
|
||
|
|
||
|
import rio
|
||
|
|
||
|
from . import pages
|
||
|
from . import components as comps
|
||
|
|
||
|
from db_classes import *
|
||
|
|
||
|
# Define a theme for Rio to use.
|
||
|
#
|
||
|
# You can modify the colors here to adapt the appearance of your app or website.
|
||
|
# The most important parameters are listed, but more are available! You can find
|
||
|
# them all in the docs
|
||
|
#
|
||
|
# https://rio.dev/docs/api/theme
|
||
|
theme = rio.Theme.from_colors(
|
||
|
secondary_color=rio.Color.from_hex("004990ff"),
|
||
|
primary_color=rio.Color.from_hex("004990ff"),
|
||
|
neutral_color=rio.Color.from_hex("b1cad8FF"),
|
||
|
light=True,
|
||
|
)
|
||
|
|
||
|
init()
|
||
|
# Create a dataclass that inherits from rio.UserSettings. This indicates to
|
||
|
# Rio that these are settings and should be persisted.
|
||
|
|
||
|
# Create the Rio app
|
||
|
app = rio.App(
|
||
|
name='Inventory',
|
||
|
default_attachments=[
|
||
|
comps.Settings(),
|
||
|
],
|
||
|
pages=[
|
||
|
rio.Page(
|
||
|
name="Home",
|
||
|
page_url='',
|
||
|
build=pages.BrowsePage,
|
||
|
),
|
||
|
|
||
|
rio.Page(
|
||
|
name="AboutPage",
|
||
|
page_url='about-page',
|
||
|
build=pages.AboutPage,
|
||
|
),
|
||
|
|
||
|
rio.Page(
|
||
|
name="AddPage",
|
||
|
page_url='add',
|
||
|
build=pages.AddPage,
|
||
|
),
|
||
|
rio.Page(
|
||
|
name="ItemPage",
|
||
|
page_url='item',
|
||
|
build=pages.ItemPage,
|
||
|
),
|
||
|
],
|
||
|
# You can optionally provide a root component for the app. By default,
|
||
|
# a simple `rio.PageView` is used. By providing your own component, you
|
||
|
# can create components which stay put while the user navigates between
|
||
|
# pages, such as a navigation bar or footer.
|
||
|
#
|
||
|
# When you do this, make sure your component contains a `rio.PageView`
|
||
|
# so the currently active page is still visible.
|
||
|
build=pages.RootPage,
|
||
|
theme=theme,
|
||
|
assets_dir=Path(__file__).parent / "assets",
|
||
|
)
|
||
|
|