mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 15:51:26 +00:00
Overhaul: real metrics, Git integration UI, open-source hygiene, root cleanup
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>
This commit is contained in:
1 parent
355a97bab4
commit
9f3b196032
499 files changed
+4471
-94235
No files matched your search
@@ -279,9 +279,16 @@ func handleCreateFromTemplate(c *gin.Context) {
|
||||
|
||||
serviceImage := resolveTemplateRuntimeImage(config.Runtime)
|
||||
serviceCommand := strings.TrimSpace(config.StartCommand)
|
||||
buildCommand := strings.TrimSpace(config.BuildCommand)
|
||||
cpu, memory := defaultTemplateResources(serviceType)
|
||||
serviceEnvironment := "production"
|
||||
|
||||
environmentID, err := getProjectEnvironmentID(db, projectID, serviceEnvironment)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to resolve service environment"})
|
||||
return
|
||||
}
|
||||
|
||||
serviceID := uuid.New()
|
||||
now := time.Now()
|
||||
|
||||
@@ -294,18 +301,24 @@ func handleCreateFromTemplate(c *gin.Context) {
|
||||
|
||||
txQueries := queries.WithTx(tx)
|
||||
err = txQueries.CreateServiceFromTemplate(ctx, sqlcdb.CreateServiceFromTemplateParams{
|
||||
ID: serviceID,
|
||||
ProjectID: projectID,
|
||||
Name: req.Name,
|
||||
Type: serviceType,
|
||||
Status: "stopped",
|
||||
Image: sql.NullString{String: serviceImage, Valid: true},
|
||||
Command: sql.NullString{String: serviceCommand, Valid: true},
|
||||
Environment: sql.NullString{String: serviceEnvironment, Valid: true},
|
||||
Cpu: sql.NullString{String: cpu, Valid: true},
|
||||
Memory: sql.NullString{String: memory, Valid: true},
|
||||
CreatedAt: sql.NullTime{Time: now, Valid: true},
|
||||
UpdatedAt: sql.NullTime{Time: now, Valid: true},
|
||||
ID: serviceID,
|
||||
ProjectID: projectID,
|
||||
Name: req.Name,
|
||||
EnvironmentID: environmentID,
|
||||
ServiceType: serviceType,
|
||||
SourceType: "template",
|
||||
ImageName: sql.NullString{String: serviceImage, Valid: serviceImage != ""},
|
||||
BuildCommand: sql.NullString{String: buildCommand, Valid: buildCommand != ""},
|
||||
StartCommand: sql.NullString{String: serviceCommand, Valid: serviceCommand != ""},
|
||||
Type: serviceType,
|
||||
Status: "stopped",
|
||||
Image: sql.NullString{String: serviceImage, Valid: serviceImage != ""},
|
||||
Command: sql.NullString{String: serviceCommand, Valid: serviceCommand != ""},
|
||||
Environment: sql.NullString{String: serviceEnvironment, Valid: true},
|
||||
Cpu: sql.NullString{String: cpu, Valid: true},
|
||||
Memory: sql.NullString{String: memory, Valid: true},
|
||||
CreatedAt: sql.NullTime{Time: now, Valid: true},
|
||||
UpdatedAt: sql.NullTime{Time: now, Valid: true},
|
||||
})
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to create service from template"})
|
||||
|
||||
Reference in new issue
Block a user