Skip to content

How to add right hand sidebar too

contactzen edited this page Feb 10, 2023 · 1 revision

To add Right sidebar,

it is two step process,

in first step, you need to infrom ui to call for right hand sidebar. You can do that by following code.

@app.get("/", response_class=HTMLResponse)
async def root(request: Request, res: Response):
    tr = templates.TemplateResponse("index.html", {"request": request})
    tr.set_cookie("show_right_sidebar","true") # this line
    return tr

then you just need to add following line of code


@app.get("/backend/sidebar2", response_model=s.Sidebar)
async def sidebar():
    x =  s.Sidebar(tabs=[ # Add tabs here if you desire
       ],
        filters=[ # Provide your global filter here]
    )
    return x

This will add sidebar in your dashboard

Clone this wiki locally