feat: update ckan-devstaller to v0.3.1

This commit is contained in:
rzmk 2025-10-30 09:10:01 -04:00
parent 0e263202a1
commit 475bcc4932
21 changed files with 240 additions and 57 deletions

View file

@ -1,18 +1,13 @@
"use client";
import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
import defaultMdxComponents from "fumadocs-ui/mdx";
import {
BarChartBigIcon,
BlocksIcon,
SailboatIcon,
TerminalSquareIcon,
} from "lucide-react";
import { Label } from "@/components/ui/label"
import { Switch } from "@/components/ui/switch"
import { useEffect, useState } from "react";
import PresetsBuilderSection from "./builder-sections/presets";
import CKANVersionBuilderSection from "./builder-sections/ckan-version";
import CKANExtensionsBuilderSection from "./builder-sections/ckan-extensions";
import FeaturesBuilderSection from "./builder-sections/features";
import PresetsBuilderSection from "@/components/builder-sections/presets";
import CKANVersionBuilderSection from "@/components/builder-sections/ckan-version";
import CKANExtensionsBuilderSection from "@/components/builder-sections/ckan-extensions";
import FeaturesBuilderSection from "@/components/builder-sections/features";
export type Config = {
preset: string | undefined;
@ -25,11 +20,28 @@ export const selectedCardClasses =
"bg-blue-100 dark:bg-blue-950 border-blue-300 dark:border-blue-900 border-2";
export default function Builder() {
const { Card, Cards } = defaultMdxComponents;
const [downloadScript, setDownloadScript] = useState(true);
const downloadScriptString = `#!/usr/bin/env bash
# Update/Upgrade system dependencies
sudo apt update -y
sudo apt upgrade -y
# Install curl
sudo apt install curl -y
# Change to the home directory
cd ~/
# Download the ckan-devstaller binary file
wget https://github.com/dathere/ckan-devstaller/releases/download/0.3.1/ckan-devstaller
# Add execute permission to ckan-devstaller binary file
sudo chmod +x ./ckan-devstaller\n\n# Run ckan-devstaller script\n`;
const [command, setCommand] = useState("./ckan-devstaller");
const [config, setConfig] = useState<Config>({
preset: "ckan-only",
ckanVersion: "2.11.3",
ckanVersion: "2.11.4",
extensions: [],
features: [],
});
@ -56,8 +68,12 @@ ${ckanVersionString}${extensionsString ? extensionsString : ""}${featuresString
<div className="md:col-span-1 md:border-r-2 md:pr-4">
<div className="sticky top-8">
<h2>ckan-devstaller command</h2>
<div className="flex items-center space-x-2">
<Switch defaultChecked={downloadScript} onCheckedChange={() => setDownloadScript(!downloadScript)} id="download-script" />
<Label htmlFor="download-script">Include download script?</Label>
</div>
<CodeBlock title="Installation command">
<Pre className="text-wrap pl-4 max-w-[21rem]">{command}</Pre>
<Pre className="text-wrap pl-4 max-w-[21rem]">{downloadScript ? downloadScriptString : ""}{command}</Pre>
</CodeBlock>
<h2>Selected configuration</h2>
<div>