@@ -6,7 +6,7 @@ from pcweb.pages import docs
66from pcweb.styles.styles import get_code_style, cell_style
77
88
9- regions = {
9+ REGIONS_DICT = {
1010 " ams" : " Amsterdam, Netherlands" ,
1111 " arn" : " Stockholm, Sweden" ,
1212 " bom" : " Mumbai, India" ,
@@ -21,10 +21,31 @@ regions = {
2121 " lhr" : " London, United Kingdom" ,
2222 " nrt" : " Tokyo, Japan" ,
2323 " ord" : " Chicago, Illinois (US)" ,
24- " sin" : " Singapore, Singapore" ,
2524 " sjc" : " San Jose, California (US)" ,
25+ " sin" : " Singapore, Singapore" ,
2626 " syd" : " Sydney, Australia" ,
27- " yyz" : " Toronto, Canada"
27+ " yyz" : " Toronto, Canada" ,
28+ }
29+
30+ COUNTRIES_CODES = {
31+ " ams" : " NL" ,
32+ " arn" : " SE" ,
33+ " bom" : " IN" ,
34+ " cdg" : " FR" ,
35+ " dfw" : " US" ,
36+ " ewr" : " US" ,
37+ " fra" : " DE" ,
38+ " gru" : " BR" ,
39+ " iad" : " US" ,
40+ " jnb" : " ZA" ,
41+ " lax" : " US" ,
42+ " lhr" : " GB" ,
43+ " nrt" : " JP" ,
44+ " ord" : " US" ,
45+ " sjc" : " US" ,
46+ " sin" : " SG" ,
47+ " syd" : " AU" ,
48+ " yyz" : " CA" ,
2849}
2950
3051
@@ -40,12 +61,55 @@ To scale your app to multiple regions in the Cloud UI, click on the `Settings` t
4061image_zoom(rx.image(src = " /scaling_regions.webp" , padding_bottom = " 20px" ))
4162```
4263
43- The images below show all the regions that can be deployed in.
64+ The table below show all the regions that can be deployed in.
4465
4566``` python eval
46- rx.hstack(
47- image_zoom(rx.image(src = " /regions_1.webp" , padding_bottom = " 20px" )),
48- image_zoom(rx.image(src = " /regions_2.webp" , padding_bottom = " 20px" )),
67+ rx.el.table(
68+ rx.el.thead(
69+ rx.el.tr(
70+ rx.el.th(
71+ rx.el.div(
72+ " Region" ,
73+ ),
74+ class_name = " px-6 py-3 text-left text-sm font-semibold text-secondary-12 text-nowrap" ,
75+ ),
76+ rx.el.th(
77+ rx.el.div(
78+ " Country" ,
79+ ),
80+ class_name = " px-6 py-3 text-left text-sm font-semibold text-secondary-12 text-nowrap" ,
81+ ),
82+ ),
83+ class_name = " bg-slate-2" ,
84+ ),
85+ rx.el.tbody(
86+ * [
87+ rx.el.tr(
88+ rx.el.td(
89+ rx.el.div(
90+ region,
91+ class_name = " h-5 rounded-md border justify-start items-center inline-flex bg-slate-1 text-xs font-medium shrink-0 px-1.5 w-fit text-slate-12 border-slate-6"
92+ ),
93+ class_name = " px-6 py-3" ,
94+ ),
95+ rx.el.td(
96+ rx.el.div(
97+ rx.image(
98+ src = f " https://cloud.reflex.dev/flags/ { COUNTRIES_CODES [region]} .svg " ,
99+ class_name = " rounded-[2px] mr-2 w-5 h-4" ,
100+ ),
101+ REGIONS_DICT [region],
102+ class_name = " flex flex-row items-center gap-2" ,
103+ ),
104+ class_name = " px-6 py-3 text-sm font-medium text-slate-9"
105+ ),
106+ class_name = " even:bg-slate-2 odd:bg-slate-1 hover:bg-secondary-3" ,
107+ )
108+ for region in REGIONS_DICT .keys()
109+ ],
110+ class_name = " divide-y divide-slate-4" ,
111+ ),
112+ class_name = " w-full table-fixed rounded-xl overflow-hidden divide-y divide-slate-4" ,
49113)
50114```
51115
0 commit comments