mirror of
https://github.com/hhftechnology/Dock-Dploy.git
synced 2026-11-18 06:43:45 -06:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
289d65a1fe | ||
|
|
8127c1772b | ||
|
|
48c81b4e59 | ||
|
|
3c12010f7e | ||
|
|
cc1d7555d8 | ||
|
|
9cfae42169 |
@@ -70,7 +70,7 @@ export function TemplateStoreModal({
|
||||
<span>
|
||||
Templates from{" "}
|
||||
<a
|
||||
href="https://github.com/Dokploy/templates"
|
||||
href="https://gitea.computersurge.dev/ComputerSurge/dockploy-templates"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-primary hover:underline"
|
||||
@@ -165,7 +165,7 @@ export function TemplateStoreModal({
|
||||
{...template}
|
||||
logo={
|
||||
template.logo
|
||||
? `https://raw.githubusercontent.com/Dokploy/templates/main/blueprints/${template.id}/${template.logo}`
|
||||
? `https://gitea.computersurge.dev/ComputerSurge/dockploy-templates/raw/branch/main/blueprints/${template.id}/${template.logo}`
|
||||
: undefined
|
||||
}
|
||||
onClick={() => onTemplateSelect(template)}
|
||||
|
||||
@@ -696,14 +696,14 @@ function App() {
|
||||
setTemplateError(null);
|
||||
}
|
||||
|
||||
const GITHUB_OWNER = "hhftechnology";
|
||||
const GITHUB_REPO = "Marketplace";
|
||||
const GITHUB_OWNER = "ComputerSurge";
|
||||
const GITHUB_REPO = "dock-dploy-Marketplace";
|
||||
const GITHUB_BRANCH = "main";
|
||||
const GITHUB_RAW_BASE = "https://raw.githubusercontent.com";
|
||||
const GITHUB_RAW_BASE = "https://gitea.computersurge.dev";
|
||||
|
||||
try {
|
||||
// Fetch meta.json
|
||||
const metaUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/${GITHUB_BRANCH}/meta.json`;
|
||||
const metaUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/raw/branch/${GITHUB_BRANCH}/meta.json`; // URL format is for gitea
|
||||
const metaResponse = await fetch(metaUrl);
|
||||
|
||||
if (!metaResponse.ok) {
|
||||
@@ -735,10 +735,10 @@ function App() {
|
||||
|
||||
// Fetch template details (compose, logo)
|
||||
async function fetchTemplateDetails(templateId: string): Promise<any> {
|
||||
const GITHUB_OWNER = "hhftechnology";
|
||||
const GITHUB_REPO = "Marketplace";
|
||||
const GITHUB_OWNER = "ComputerSurge";
|
||||
const GITHUB_REPO = "dock-dploy-Marketplace";
|
||||
const GITHUB_BRANCH = "main";
|
||||
const GITHUB_RAW_BASE = "https://raw.githubusercontent.com";
|
||||
const GITHUB_RAW_BASE = "https://gitea.computersurge.dev";
|
||||
|
||||
const template = templates.find((t) => t.id === templateId);
|
||||
if (!template) {
|
||||
@@ -749,7 +749,7 @@ function App() {
|
||||
const basePath = `compose-files/${templateId}`;
|
||||
|
||||
// Fetch docker-compose.yml
|
||||
const composeUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/${GITHUB_BRANCH}/${basePath}/docker-compose.yml`;
|
||||
const composeUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/raw/branch/${GITHUB_BRANCH}/${basePath}/docker-compose.yml`; // URL format is for gitea
|
||||
const composeResponse = await fetch(composeUrl);
|
||||
if (!composeResponse.ok) {
|
||||
throw new Error(
|
||||
@@ -761,7 +761,7 @@ function App() {
|
||||
// Build logo URL if logo exists
|
||||
let logoUrl = null;
|
||||
if (template.logo) {
|
||||
logoUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/${GITHUB_BRANCH}/${basePath}/${template.logo}`;
|
||||
logoUrl = `${GITHUB_RAW_BASE}/${GITHUB_OWNER}/${GITHUB_REPO}/raw/branch/${GITHUB_BRANCH}/${basePath}/${template.logo}`;
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -933,16 +933,19 @@ function App() {
|
||||
: [],
|
||||
user: actualServiceData.user || "",
|
||||
working_dir: actualServiceData.working_dir || "",
|
||||
labels: actualServiceData.labels
|
||||
? Array.isArray(actualServiceData.labels)
|
||||
? actualServiceData.labels.map((l: string) => {
|
||||
const [key, ...rest] = l.split("=");
|
||||
return { key, value: rest.join("=") };
|
||||
})
|
||||
: Object.entries(actualServiceData.labels).map(
|
||||
labels: Array.isArray(actualServiceData.labels)
|
||||
? actualServiceData.labels.map((l: string) => {
|
||||
const [key, ...rest] = l.split("=");
|
||||
return { key, value: rest.join("=") };
|
||||
})
|
||||
: actualServiceData.labels && typeof actualServiceData.labels === "object"
|
||||
? Object.entries(actualServiceData.labels).map(
|
||||
([key, value]: [string, any]) => ({ key, value: String(value) })
|
||||
)
|
||||
: [],
|
||||
: [],
|
||||
labels_syntax: Array.isArray(actualServiceData.labels)
|
||||
? "array"
|
||||
: "dict",
|
||||
privileged:
|
||||
actualServiceData.privileged !== undefined
|
||||
? !!actualServiceData.privileged
|
||||
@@ -1331,12 +1334,12 @@ function App() {
|
||||
<div className="mb-4 text-xs text-muted-foreground">
|
||||
Templates from{" "}
|
||||
<a
|
||||
href="https://github.com/hhftechnology/Marketplace"
|
||||
href="https://gitea.computersurge.dev/ComputerSurge/dock-dploy-Marketplace"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-primary hover:underline"
|
||||
>
|
||||
hhftechnology/Marketplace
|
||||
ComputerSurge/dock-dploy-Marketplace
|
||||
</a>{" "}
|
||||
repository.
|
||||
</div>
|
||||
@@ -1402,7 +1405,7 @@ function App() {
|
||||
<div className="w-full flex items-start gap-3">
|
||||
{template.logo ? (
|
||||
<img
|
||||
src={`https://raw.githubusercontent.com/Dokploy/templates/main/blueprints/${template.id}/${template.logo}`}
|
||||
src={`https://gitea.computersurge.dev/ComputerSurge/dockploy-templates/raw/branch/main/blueprints/${template.id}/${template.logo}`}
|
||||
alt={template.name}
|
||||
className="w-12 h-12 object-contain flex-shrink-0"
|
||||
onError={(
|
||||
@@ -3274,7 +3277,42 @@ function App() {
|
||||
</div>
|
||||
{/* Labels */}
|
||||
<div>
|
||||
<Label className="mb-1 block">Labels</Label>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="mb-1 block">Labels</Label>
|
||||
</div>
|
||||
<div className="flex gap-2 items-center">
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Syntax:
|
||||
</span>
|
||||
<Toggle
|
||||
pressed={svc.labels_syntax === "array"}
|
||||
onPressedChange={(pressed) =>
|
||||
updateServiceField(
|
||||
"labels_syntax",
|
||||
pressed ? "array" : "dict"
|
||||
)
|
||||
}
|
||||
aria-label="Array syntax"
|
||||
className="border rounded px-2 py-1 text-xs"
|
||||
>
|
||||
Array
|
||||
</Toggle>
|
||||
<Toggle
|
||||
pressed={svc.labels_syntax === "dict"}
|
||||
onPressedChange={(pressed) =>
|
||||
updateServiceField(
|
||||
"labels_syntax",
|
||||
pressed ? "dict" : "array"
|
||||
)
|
||||
}
|
||||
aria-label="Dictionary syntax"
|
||||
className="border rounded px-2 py-1 text-xs"
|
||||
>
|
||||
Dict
|
||||
</Toggle>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
{svc.labels?.map((label, idx) => (
|
||||
<div
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface ServiceConfig {
|
||||
user?: string;
|
||||
working_dir?: string;
|
||||
labels?: { key: string; value: string }[];
|
||||
labels_syntax?: "array" | "dict";
|
||||
privileged?: boolean;
|
||||
read_only?: boolean;
|
||||
shm_size?: string;
|
||||
|
||||
@@ -115,6 +115,7 @@ export function defaultService(): ServiceConfig {
|
||||
user: "",
|
||||
working_dir: "",
|
||||
labels: [],
|
||||
labels_syntax: "array",
|
||||
privileged: undefined,
|
||||
read_only: undefined,
|
||||
shm_size: "",
|
||||
|
||||
@@ -186,10 +186,20 @@ export function generateYaml(
|
||||
working_dir: svc.working_dir || undefined,
|
||||
labels:
|
||||
svc.labels && svc.labels.filter((l) => l.key).length
|
||||
? svc.labels
|
||||
? svc.labels_syntax === "dict"
|
||||
? svc.labels
|
||||
.filter(({ key }) => key)
|
||||
.reduce(
|
||||
(acc, { key, value }) => {
|
||||
acc[key] = value;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, string>
|
||||
)
|
||||
: svc.labels
|
||||
.filter((l) => l.key)
|
||||
.map(({ key, value }) => `"${key}=${value}"`)
|
||||
: undefined,
|
||||
.map(({ key, value}) => `"${key}=${value}"`)
|
||||
:undefined,
|
||||
privileged: svc.privileged !== undefined ? svc.privileged : undefined,
|
||||
read_only: svc.read_only !== undefined ? svc.read_only : undefined,
|
||||
shm_size: svc.shm_size || undefined,
|
||||
|
||||
Reference in New Issue
Block a user