mirror of
https://github.com/dathere/ckan-devstaller.git
synced 2025-11-09 13:39:49 +00:00
feat: update ckan-devstaller to v0.3.1
This commit is contained in:
parent
0e263202a1
commit
475bcc4932
21 changed files with 240 additions and 57 deletions
|
|
@ -11,26 +11,26 @@ export default function CKANVersionBuilderSection({ config, setConfig }: any) {
|
|||
<Cards>
|
||||
<Card
|
||||
icon={<SailboatIcon />}
|
||||
title="2.11.3"
|
||||
title="2.11.4"
|
||||
className={
|
||||
config.ckanVersion === "2.11.3"
|
||||
config.ckanVersion === "2.11.4"
|
||||
? selectedCardClasses
|
||||
: "cursor-pointer"
|
||||
}
|
||||
onClick={() => {
|
||||
setConfig({ ...config, ckanVersion: "2.11.3" });
|
||||
setConfig({ ...config, ckanVersion: "2.11.4" });
|
||||
}}
|
||||
></Card>
|
||||
<Card
|
||||
icon={<SailboatIcon />}
|
||||
title="2.10.8"
|
||||
title="2.10.9"
|
||||
className={
|
||||
config.ckanVersion === "2.10.8"
|
||||
config.ckanVersion === "2.10.9"
|
||||
? selectedCardClasses
|
||||
: "cursor-pointer"
|
||||
}
|
||||
onClick={() => {
|
||||
setConfig({ ...config, ckanVersion: "2.10.8" });
|
||||
setConfig({ ...config, ckanVersion: "2.10.9" });
|
||||
}}
|
||||
></Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export default function PresetsBuilderSection({
|
|||
setConfig({
|
||||
...config,
|
||||
preset: "dathere-default",
|
||||
ckanVersion: "2.11.3",
|
||||
ckanVersion: "2.11.4",
|
||||
extensions: ["ckanext-scheming", "DataStore", "DataPusher+"],
|
||||
features: ["enable-ssh"],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
26
docs/components/ui/label.tsx
Normal file
26
docs/components/ui/label.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import * as LabelPrimitive from "@radix-ui/react-label"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const labelVariants = cva(
|
||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
)
|
||||
|
||||
const Label = React.forwardRef<
|
||||
React.ElementRef<typeof LabelPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
||||
VariantProps<typeof labelVariants>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<LabelPrimitive.Root
|
||||
ref={ref}
|
||||
className={cn(labelVariants(), className)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
Label.displayName = LabelPrimitive.Root.displayName
|
||||
|
||||
export { Label }
|
||||
29
docs/components/ui/switch.tsx
Normal file
29
docs/components/ui/switch.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import * as SwitchPrimitives from "@radix-ui/react-switch"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const Switch = React.forwardRef<
|
||||
React.ElementRef<typeof SwitchPrimitives.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SwitchPrimitives.Root
|
||||
className={cn(
|
||||
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-green-500 data-[state=unchecked]:bg-gray-500 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-gray-600",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
ref={ref}
|
||||
>
|
||||
<SwitchPrimitives.Thumb
|
||||
className={cn(
|
||||
"pointer-events-none block h-5 w-5 rounded-full bg-white dark:bg-blue-800 shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
||||
)}
|
||||
/>
|
||||
</SwitchPrimitives.Root>
|
||||
))
|
||||
Switch.displayName = SwitchPrimitives.Root.displayName
|
||||
|
||||
export { Switch }
|
||||
Loading…
Add table
Add a link
Reference in a new issue