instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
integrations/light/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border border-slate-6 dark:border-[#1C2024] shadow-large",
class_n... |
def databricks_card():
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
)
def user_p... | def okta_card():
return integration_card_light_dark(
"okta",
class_name=f"rounded-t-[14px] rounded-bl-[14px] rounded-br-[4px] absolute top-2 left-2 animate-scale-rotate-in animate-duration-{DURATION_OKTA} animate-ease-out animate-delay-{DELAY_OKTA}",
) |
C2024] shadow-large",
class_name,
),
)
def integration_card_light_dark(icon: str, class_name: str = ""):
return rx.el.div(
rx.image(
src=f"/landing/integrations/light/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 dark:hidden",
),
... |
def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overfl... | def databricks_card():
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
) |
),
rx.image(
src=f"/landing/integrations/dark/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 hidden dark:block",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border b... |
def slack_alert():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/integrations/light/slack.svg",
class_name="size-full pointer-events-none shrink-0 object-cover",
),
class_name="size-9 bg-white-1 dark:bg-white rounded-[8px] border-... | def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overflow-... |
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
)
def user_profile():
return rx.el... |
def metrics_tabs():
return rx.el.div(
rx.el.div(
rx.el.span(
"All",
class_name="text-slate-10 text-xs font-medium size-full text-center bg-slate-2 overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Critica... | def slack_alert():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/integrations/light/slack.svg",
class_name="size-full pointer-events-none shrink-0 object-cover",
),
class_name="size-9 bg-white-1 dark:bg-white rounded-[8px] border-[0.... |
,
rx.el.p(
"Metrics reached critical level of 93%",
rx.el.br(),
"Please, check it.",
class_name="text-slate-11 text-xs font-medium word-wrap",
),
class_name="flex flex-col",
),
rx.el.span(
"no... |
def metrics_header():
return rx.el.div(
rx.el.div(
rx.html(
"""<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M64 32C64 49.6731 49.6731 64 32 64C14.3269 64 0 49.6731 0 32C0 14.3269 14.3269 0 32 0C49.6731 0 64 14.3269 64... | def metrics_tabs():
return rx.el.div(
rx.el.div(
rx.el.span(
"All",
class_name="text-slate-10 text-xs font-medium size-full text-center bg-slate-2 overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Critical",... |
center text-red-10 text-base font-[565] leading-[21px] font-mono z-10",
),
class_name="relative size-16 flex-none",
),
rx.el.div(
rx.el.span(
"Metrics",
class_name="text-slate-12 text-lg font-semibold",
),
rx.el.... |
def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
... | def metrics_content():
def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx.el.span(
tim... |
e font-[565] leading-[21px] font-mono z-10",
),
class_name="relative size-16 flex-none",
),
rx.el.div(
rx.el.span(
"Metrics",
class_name="text-slate-12 text-lg font-semibold",
),
rx.el.div(
get_ic... |
return rx.el.div(
metrics_row("Critical", "93%", "Now"),
metrics_row("Normal", "32%", "12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divid... | def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx.el.span(
time, class_name="text-slate-9... |
TRICS_HEADER} pl-6",
)
def metrics_content():
def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx... |
def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute ... | def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
... |
"12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divide-slate-4 border-t border-slate-3 animate-slide-in-up animate-delay-{DELAY_METRICS_CONTENT} animate-ease-out... |
def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem... | def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute lef... |
ter-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
class_name="flex flex-col gap-6 justify-start items-center min-w-[18.375rem] pt-6 overflow-hid... |
def graph_chart():
return rx.el.div(
graph_y_axis(),
rx.el.div(
stacked_bar_chart(primary_height=8.4375, secondary_height=16),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=14.75, secondary_height=16),
... | def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem",
... |
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
class_name="relative",
)
for i in [64, 48, 32, 24, 16, 8, 4... |
def graph_overview():
return rx.el.div(
databricks_card(),
rx.el.div(
rx.el.div(
rx.el.span(
"Overview",
class_name="text-slate-12 text-2xl font-semibold",
),
rx.el.div(
rx.el.d... | def graph_chart():
return rx.el.div(
graph_y_axis(),
rx.el.div(
stacked_bar_chart(primary_height=8.4375, secondary_height=16),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=14.75, secondary_height=16),
s... |
t(primary_height=11.25, secondary_height=15.0625),
stacked_bar_chart(primary_height=12.9375, secondary_height=16),
stacked_bar_chart(primary_height=14.375, secondary_height=16),
stacked_bar_chart(primary_height=8.625, secondary_height=12.3125),
stacked_bar_chart(primary_h... |
def app_build():
return rx.el.section(
slack_alert(),
okta_card(),
rx.el.div(
rx.el.div(
rx.el.div(
rx.el.div(
class_name="w-[0.95rem] inset-y-0 absolute left-0 z-50 pointer-events-none backdrop-blur-[1px]",
... | def graph_overview():
return rx.el.div(
databricks_card(),
rx.el.div(
rx.el.div(
rx.el.span(
"Overview",
class_name="text-slate-12 text-2xl font-semibold",
),
rx.el.div(
rx.el.div(... |
apacity Per Day",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
class_name="flex flex-row items-center gap-4",
),
class_name="flex flex-col gap-6",
),
rx.el.div(
... | def app_build():
return rx.el.section(
slack_alert(),
okta_card(),
rx.el.div(
rx.el.div(
rx.el.div(
rx.el.div(
class_name="w-[0.95rem] inset-y-0 absolute left-0 z-50 pointer-events-none backdrop-blur-[1px]",
... | |
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)... | import reflex as rx | |
import reflex as rx
|
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientSta... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
... | from reflex.experimental import ClientStateVar |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
|
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
|
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
... | company_cs = ClientStateVar.create("company", "") |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
|
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
... | area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area... |
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
... | area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area... |
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_na... | area_opacity = ClientStateVar.create(var_name="area_opacity", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area... |
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
... | companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
] |
"unicef": {
# "company_name": "Unicef",
# "quote": """Reflex made it easy to focus on building my app with pure Python and integrate the components I needed without the hassle of learning new front-end frameworks.
# It integrates seamlessly with Microsoft Azure, making deployment and scaling smo... |
def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
... | companies_case_studies_var = rx.Var.create(companies_case_studies) |
"Reflex made it easy to focus on building my app with pure Python and integrate the components I needed without the hassle of learning new front-end frameworks.
# It integrates seamlessly with Microsoft Azure, making deployment and scaling smooth and efficient.""",
# "person": "Lakshmi",
# "pict... |
def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
... | def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
... |
seamlessly integrates, making it the perfect solution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
companies_case_studies_var = rx.Var.create(companie... |
def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg... | def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
... |
ution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
companies_case_studies_var = rx.Var.create(companies_case_studies)
def stat(stat: str, text: str) ... |
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.box(
ui.gradient_profile(
seed=case_study["person"],
... | case_study = companies_case_studies_var[company] |
center",
)
def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fil... |
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-x... | def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-vi... |
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
... |
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
)
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
area_opacity = ClientStateVar.create(
... | def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs f... |
udy_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 grou... |
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.c... | area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
) |
olet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row item... |
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote... | area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
) |
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
def quote_badge() -> rx.Component:
return r... |
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote_box(company_cs.value),
rx.box(
stat(stat="1 Million+", text="App... | area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
) |
.call_function(
area_x_pos.set_value(
rx.Var(
f"event.clientX - document.getElementById({id}).getBoundingClientRect().left"
)
)
),
rx.call_function(
area_y_pos.set_value(
... | def companies() -> rx.Component:
return rx.el.section(
rx.box(
*[
company_card(
name=company,
id=f"landing-company-card-{company}",
)
for company in companies_list
],
class_name="lg:gr... | |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-cent... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
... | from pcweb.components.numbers_pattern import numbers_pattern |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcwe... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.securi... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Compon... | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.... | from pcweb.components.numbers_pattern import numbers_pattern |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
|
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"... | from pcweb.constants import REFLEX_CLOUD_URL |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
|
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
... | from pcweb.pages.databricks.databricks import databricks_page |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
|
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
... | from pcweb.pages.hosting.views.deploy_animation import animated_box |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import ani... |
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-pri... | from pcweb.pages.security.security import security_page |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import ani... |
def deploy_card() -> rx.Component:
return rx.el.div(
rx.el.div(
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="342" height="322" viewBox="0 0 342 322" fill="none">
<g filter="url(#filter0_f_10857_12767)">
<path d="M229.949 96.5486C278.245 98.9569 202.581 123.... | def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primar... |
xl font-semibold",
),
rx.el.div(
rx.image(
src="/hosting_graphing.svg",
class_name="w-auto h-[1.95rem]",
),
ui.link(
render_=ui.button(
"Start deploying",
... |
def badge_card(component: rx.Component, link: str) -> rx.Component:
return rx.el.a(
rx.el.div(
component,
class_name="size-18 rounded-lg border border-slate-5 dark:border-[#1C2024] shadow-large bg-white-1 group-hover:bg-slate-2 transition-colors flex items-center justify-center z-... | def feature_card(icon: str, title: str, description: str) -> rx.Component:
return rx.box(
rx.box(
get_icon(icon, class_name="!text-slate-9 !size-5"),
rx.text(title, class_name="text-slate-12 text-base font-semibold"),
class_name="flex flex-row gap-2 items-center",
... |
_CLOUD_URL,
target="_blank",
),
class_name="flex flex-col lg:flex-row lg:gap-8 gap-6 items-center mt-8 max-lg:w-full max-lg:justify-start max-lg:items-start",
),
class_name="flex flex-col items-end",
),
class_name="max-w-[71.125... |
def security_badges() -> rx.Component:
return rx.box(
rx.box(
badge_card(
rx.el.div(
rx.el.span(
"AICPA",
class_name="text-violet-9 text-base font-semibold",
),
rx.el.sp... | def badge_card(component: rx.Component, link: str) -> rx.Component:
return rx.el.a(
rx.el.div(
component,
class_name="size-18 rounded-lg border border-slate-5 dark:border-[#1C2024] shadow-large bg-white-1 group-hover:bg-slate-2 transition-colors flex items-center justify-center z-[2]... |
class_name="text-violet-9 text-base font-semibold",
),
rx.el.span("SOC 2", class_name="text-slate-9 text-sm font-medium"),
class_name="flex flex-col items-center justify-center",
),
security_page.path,
... |
def deploy_content() -> rx.Component:
return rx.box(
rx.box(
feature_card(
"backend_db",
"Build and deploy",
"Deploy and scale your Reflex app with a single command.",
),
feature_card(
"backend_auth",
... | def security() -> rx.Component:
return rx.el.div(
rx.box(
rx.box(
rx.el.h2(
"Secure by default",
class_name="text-slate-12 text-xl lg:text-2xl font-semibold lg:text-start text-center",
),
rx.el.h3(
... |
card(
"analytics",
"Get alerts and metrics",
"Get alerts and metrics for your Reflex app to help you monitor and optimize your app.",
),
class_name="flex flex-col max-w-full lg:max-w-full divide-y divide-slate-3",
),
rx.box(
... | def deploy_section() -> rx.Component:
return rx.el.section(
rx.el.div(
rx.el.div(
numbers_pattern(side="left", class_name="left-0 top-0"),
numbers_pattern(side="right", class_name="right-0 top-0"),
header(),
rx.el.div(
... | |
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex fl... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-cent... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"... | from pcweb.components.numbers_pattern import numbers_pattern |
_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
... |
rest_of_text = " ".join(text.split(" ")[1:])
return rx.el.a(
rx.el.div(
rx.image(
src=f"/customers/{rx.color_mode_cond('light', 'dark')}{image}",
class_name="w-auto h-[1.875rem]",
),
rx.el.span(
name,
cl... | first_word = text.split(" ")[0] |
f header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear ... |
return rx.el.a(
rx.el.div(
rx.image(
src=f"/customers/{rx.color_mode_cond('light', 'dark')}{image}",
class_name="w-auto h-[1.875rem]",
),
rx.el.span(
name,
class_name="text-slate-12 text-3xl font-bold",
... | rest_of_text = " ".join(text.split(" ")[1:]) |
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold ... | import reflex as rx | |
import reflex as rx
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
)... | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python... | from pcweb.components.numbers_pattern import numbers_pattern |
import reflex as rx
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
|
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python",
class_name="text-slate-9 lg:te... | from pcweb.constants import REFLEX_BUILD_URL |
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MA... | import base64 | |
import base64
|
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLE... | import uuid |
import base64
import uuid
|
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BAC... | from typing import TypedDict |
import base64
import uuid
from typing import TypedDict
|
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def ... | import httpx |
import base64
import uuid
from typing import TypedDict
import httpx
|
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_vali... | import reflex as rx |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
|
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) ->... | import reflex_ui as ui |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is vali... | from reflex.experimental import ClientStateVar |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
|
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_... | from pcweb.components.numbers_pattern import numbers_pattern |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
|
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity... | from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
... |
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", d... | def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/") |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
... |
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = No... | textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
... |
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field... | textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
... |
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_t... | show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
... |
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_da... | class ImageData(TypedDict):
data: bytes
mime_type: str |
pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos ... |
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = ... | if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
... |
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos",... |
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"... | if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
) |
e content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_defau... |
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
... | random_uuid = uuid.uuid4() |
tStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class Ima... |
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
... | response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
... |
e):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if l... |
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: li... | self.is_processing = True |
least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"p... |
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
... | if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return |
ient:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
... |
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
... | self.is_uploading = True |
await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
... |
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not firs... | self._images = self._images or [] |
rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.rese... |
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
... | for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
... |
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processin... |
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("i... | if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return |
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") ... |
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.con... | self.is_uploading = False |
th self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
... |
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
... | if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return |
is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
... |
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
... | self.is_uploading = False |
t(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files... |
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
... | self._images = None |
/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-... |
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self... | if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return |
es:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
... |
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield r... | self.is_uploading = False |
iles selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 ... |
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button... | self._images = None |
oad-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload... |
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images... | upload_data = await first_file.read() |
.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_up... |
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < ... | if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
... |
rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
... |
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(... | self.is_uploading = False |
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
... |
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.i... | self._images = None |
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
se... |
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
... | self.is_uploading = False |
elf._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self.... |
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def i... | def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.p... |
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
... |
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def i... | if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index) |
ith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
... |
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if se... | self.is_uploading = False |
x.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE... |
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
... | self._images = None |
rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large... |
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def i... | elif self._images is not None:
if index < len(self._images):
self._images.pop(index) |
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
... |
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def i... | if index < len(self._images):
self._images.pop(index) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.