1111env_path = Path ('.' ) / '.env'
1212load_dotenv (env_path )
1313
14- API_URL = os .getenv ("API_URL" , "http://localhost:8000/api/api-keys" )
1514API_KEY = os .getenv ("API_KEY" )
1615
1716# Set React version
@@ -385,13 +384,7 @@ def generate_satellites(count):
385384 html .Div (
386385 id = "api-key-status" , style = {"color" : "#666" , "marginBottom" : "10px" }
387386 ),
388- # Hidden API URL input
389- dcc .Input (
390- id = "api-url-input" ,
391- type = "text" ,
392- value = f"{ API_URL } /validate" ,
393- style = {"display" : "none" },
394- ),
387+
395388 ],
396389 justify = "center" ,
397390 align = "center" ,
@@ -404,6 +397,7 @@ def generate_satellites(count):
404397 dmc .GridCol (
405398 dmc .Stack (
406399 [
400+ dmc .Space (h = 50 ),
407401 DashPlanet (
408402 id = "demo-planet" ,
409403 centerContent = dmc .Indicator (
@@ -434,6 +428,7 @@ def generate_satellites(count):
434428 friction = 19 ,
435429 apiKey = "" ,
436430 ),
431+ dmc .Space (h = 150 ),
437432 html .Div (
438433 [
439434 # API validation status
@@ -442,7 +437,6 @@ def generate_satellites(count):
442437 "Click a satellite to see its function" ,
443438 id = "action-text" ,
444439 ta = "center" ,
445- mt = "120px" ,
446440 ),
447441 ]
448442 ),
@@ -503,6 +497,33 @@ def generate_satellites(count):
503497 ],
504498 style = styles ["featureItem" ],
505499 ),
500+ dmc .Divider (),
501+
502+ dmc .HoverCard (
503+ withArrow = True ,
504+ width = 200 ,
505+ shadow = "md" ,
506+ children = [
507+ dmc .HoverCardTarget (html .Li (
508+ [
509+ DashIconify (
510+ icon = "cib:buy-me-a-coffee" , color = "#9C27B0" , style = {'marginTop' : '10px' }
511+ ),
512+ dmc .Center (
513+ dmc .Anchor (href = 'https://pipinstallpython.pythonanywhere.com/catalogue/dash-planet_95/' , children = 'Buy a DashPlanet API key' , target = '_blank' , size = 'lg' , c = 'blue' )
514+ ),
515+ ],
516+ style = styles ["featureItem" ],
517+ )),
518+ dmc .HoverCardDropdown (
519+ dmc .Image (
520+ radius = "md" ,
521+ src = "/assets/images/tippy.png" ,
522+ )
523+ ),
524+ ],
525+ ),
526+
506527 ],
507528 style = styles ["featureList" ],
508529 ),
@@ -535,12 +556,11 @@ def generate_satellites(count):
535556 ],
536557 [
537558 Input ("api-key-input" , "value" ),
538- Input ("api-url-input" , "value" ),
539559 Input ("use-env-api-key" , "checked" )
540560 ],
541561 prevent_initial_call = True ,
542562)
543- def update_api_key (api_key , api_url , use_env_key ):
563+ def update_api_key (api_key , use_env_key ):
544564 """Update API key based on input or environment variable"""
545565 if use_env_key :
546566 return API_KEY , True , "Demo using a paid API key" , {"color" : "#4CAF50" }
0 commit comments