Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerLoad component append prefix to url if I use url with http protocol included #354

Open
dchnkoo opened this issue Sep 25, 2024 · 0 comments

Comments

@dchnkoo
Copy link

dchnkoo commented Sep 25, 2024

I have application which communicate with other my servers, and i want to fetch with ServerLoad component to my endpoint on another server and that endpoint will be return the FastUI components, but when ServerLoad fetching to the given url also if url wtitten with http/https he append application prefix and doesn't use http method which i'm specify.

def send_mail_btn(service: str):
    serv = settings.get_service_by_name(service)

    if not serv:
        return []
    
    url = serv.get_endpoint_url("send_mail")

    if not url:
        return []

    _settings = get_settings()
    return [
        c.Button(
            text="Send Mail",
            on_click=e.PageEvent(name="send-mail"),
            class_name="btn btn-outline-success",
            html_type="button",
        ),
        c.Modal(
            title="Send Mail",
            open_trigger=e.PageEvent(name="send-mail"),
            body=[
                c.ServerLoad(
                    path=url 
                    + "?mails=" 
                    + encrypt(str(_settings.global_config.mails)),
                    load_trigger=e.PageEvent(name="send-mail"),
                    method="POST"
                )
            ],
            footer=[
                c.Button(
                    text="Close", 
                    on_click=e.PageEvent(name="send-mail", clear=True), 
                    named_style="secondary"
                )
            ]
        )
    ]

IMG_4550

I know i can create endpoint inside application and do fetch inside and return the components. But I think it's will be cool feature if implement that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant