11"use client" ;
22
33import { CodeBlock , Pre } from "fumadocs-ui/components/codeblock" ;
4- import defaultMdxComponents from "fumadocs-ui/mdx" ;
5- import {
6- BarChartBigIcon ,
7- BlocksIcon ,
8- SailboatIcon ,
9- TerminalSquareIcon ,
10- } from "lucide-react" ;
4+ import { Label } from "@/components/ui/label"
5+ import { Switch } from "@/components/ui/switch"
116import { useEffect , useState } from "react" ;
12- import PresetsBuilderSection from ". /builder-sections/presets" ;
13- import CKANVersionBuilderSection from ". /builder-sections/ckan-version" ;
14- import CKANExtensionsBuilderSection from ". /builder-sections/ckan-extensions" ;
15- import FeaturesBuilderSection from ". /builder-sections/features" ;
7+ import PresetsBuilderSection from "@/components /builder-sections/presets" ;
8+ import CKANVersionBuilderSection from "@/components /builder-sections/ckan-version" ;
9+ import CKANExtensionsBuilderSection from "@/components /builder-sections/ckan-extensions" ;
10+ import FeaturesBuilderSection from "@/components /builder-sections/features" ;
1611
1712export type Config = {
1813 preset : string | undefined ;
@@ -25,11 +20,28 @@ export const selectedCardClasses =
2520 "bg-blue-100 dark:bg-blue-950 border-blue-300 dark:border-blue-900 border-2" ;
2621
2722export default function Builder ( ) {
28- const { Card, Cards } = defaultMdxComponents ;
23+ const [ downloadScript , setDownloadScript ] = useState ( true ) ;
24+ const downloadScriptString = `#!/usr/bin/env bash
25+
26+ # Update/Upgrade system dependencies
27+ sudo apt update -y
28+ sudo apt upgrade -y
29+
30+ # Install curl
31+ sudo apt install curl -y
32+
33+ # Change to the home directory
34+ cd ~/
35+
36+ # Download the ckan-devstaller binary file
37+ wget https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/ckan-devstaller
38+
39+ # Add execute permission to ckan-devstaller binary file
40+ sudo chmod +x ./ckan-devstaller\n\n# Run ckan-devstaller script\n` ;
2941 const [ command , setCommand ] = useState ( "./ckan-devstaller" ) ;
3042 const [ config , setConfig ] = useState < Config > ( {
3143 preset : "ckan-only" ,
32- ckanVersion : "2.11.3 " ,
44+ ckanVersion : "2.11.4 " ,
3345 extensions : [ ] ,
3446 features : [ ] ,
3547 } ) ;
@@ -56,8 +68,12 @@ ${ckanVersionString}${extensionsString ? extensionsString : ""}${featuresString
5668 < div className = "md:col-span-1 md:border-r-2 md:pr-4" >
5769 < div className = "sticky top-8" >
5870 < h2 > ckan-devstaller command</ h2 >
71+ < div className = "flex items-center space-x-2" >
72+ < Switch defaultChecked = { downloadScript } onCheckedChange = { ( ) => setDownloadScript ( ! downloadScript ) } id = "download-script" />
73+ < Label htmlFor = "download-script" > Include download script?</ Label >
74+ </ div >
5975 < CodeBlock title = "Installation command" >
60- < Pre className = "text-wrap pl-4 max-w-[21rem]" > { command } </ Pre >
76+ < Pre className = "text-wrap pl-4 max-w-[21rem]" > { downloadScript ? downloadScriptString : "" } { command } </ Pre >
6177 </ CodeBlock >
6278 < h2 > Selected configuration</ h2 >
6379 < div >
0 commit comments