mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 07:41:27 +00:00
Backend: - GET /services/:id/metrics with real Docker container stats - DELETE /git/providers/:id and GET repo branches endpoint Frontend: - Service detail shows real telemetry or honest empty states - Live status distinguishes idle/polling/reconnecting - Git providers section in Settings; repo+branch pickers in Add Service - Real logo, compact Projects header, canvas fitView fix - index.css deduplicated (1725 -> 1384 lines) - Fixed smoke tests, lint errors, ToastProvider/context unification Repo hygiene: - Added LICENSE (MIT), CONTRIBUTING.md, SECURITY.md; rewrote README - Untracked .env.prod and data/letsencrypt secrets; fixed .gitignore - Removed legacy root src/internal/cmd and stale configs/docs/artifacts - Moved guides and design references under docs/ Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
78 lines
1.6 KiB
SQL
78 lines
1.6 KiB
SQL
-- name: ListServiceTemplates :many
|
|
SELECT id, name, description, category, logo, config, variables, is_official, created_at, updated_at
|
|
FROM service_templates
|
|
ORDER BY is_official DESC, name ASC;
|
|
|
|
-- name: ListServiceTemplatesByCategory :many
|
|
SELECT id, name, description, category, logo, config, variables, is_official, created_at, updated_at
|
|
FROM service_templates
|
|
WHERE category = $1
|
|
ORDER BY is_official DESC, name ASC;
|
|
|
|
-- name: GetServiceTemplateByID :one
|
|
SELECT id, name, description, category, logo, config, variables, is_official, created_at, updated_at
|
|
FROM service_templates
|
|
WHERE id = $1;
|
|
|
|
-- name: GetProjectOwnerID :one
|
|
SELECT owner_id
|
|
FROM projects
|
|
WHERE id = $1;
|
|
|
|
-- name: CountServicesByProjectAndName :one
|
|
SELECT COUNT(*)
|
|
FROM services
|
|
WHERE project_id = $1 AND name = $2;
|
|
|
|
-- name: CreateServiceFromTemplate :exec
|
|
INSERT INTO services (
|
|
id,
|
|
project_id,
|
|
name,
|
|
environment_id,
|
|
service_type,
|
|
source_type,
|
|
source_url,
|
|
image_name,
|
|
build_command,
|
|
start_command,
|
|
type,
|
|
status,
|
|
image,
|
|
command,
|
|
environment,
|
|
cpu,
|
|
memory,
|
|
created_at,
|
|
updated_at
|
|
)
|
|
VALUES (
|
|
$1,
|
|
$2,
|
|
$3,
|
|
$4,
|
|
$5,
|
|
$6,
|
|
$7,
|
|
$8,
|
|
$9,
|
|
$10,
|
|
$11,
|
|
$12,
|
|
$13,
|
|
$14,
|
|
$15,
|
|
$16,
|
|
$17,
|
|
$18,
|
|
$19
|
|
);
|
|
|
|
-- name: UpsertEnvironmentVariable :exec
|
|
INSERT INTO environment_variables (id, service_id, key, value, is_secret, created_at, updated_at)
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7)
|
|
ON CONFLICT (service_id, key) DO UPDATE
|
|
SET value = EXCLUDED.value,
|
|
is_secret = EXCLUDED.is_secret,
|
|
updated_at = EXCLUDED.updated_at;
|