From 6a8c3a27e28db422ba08208ef73d446f7c5bf6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 13 May 2026 10:43:59 +0400 Subject: [PATCH] =?UTF-8?q?fix(console):=20v1.3.91=20=E2=80=94=20deps=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D1=8F=D1=8E=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=B0=D0=BD=D0=BD=D0=BE=D1=82=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=B8=20=D0=B2=D0=BE=D1=81=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2=D0=B0=D1=8E=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=B8=20edit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handleCreateFunction: deps → аннотация fission-console/deps - handleUpdateFunctionCode: deps → аннотация fission-console/deps (или удаление если пусто) - GET /functions/:name: возвращает deps из аннотации - openEdit: заполняет e-deps.value = fn.deps (вместо пустого поля) --- console/deploy/console.yaml | 2 +- console/internal/api/function_code.go | 8 ++++++++ console/internal/api/function_crud.go | 5 +++++ console/ui/index.html | 4 ++-- console/ui/js/functions.js | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/console/deploy/console.yaml b/console/deploy/console.yaml index 5797442..c482f5b 100644 --- a/console/deploy/console.yaml +++ b/console/deploy/console.yaml @@ -58,7 +58,7 @@ spec: serviceAccountName: fission-console containers: - name: console - image: naeel/fission-console:v1.3.90 + image: naeel/fission-console:v1.3.91 imagePullPolicy: Always ports: - containerPort: 8090 diff --git a/console/internal/api/function_code.go b/console/internal/api/function_code.go index ba700ad..04e67d7 100644 --- a/console/internal/api/function_code.go +++ b/console/internal/api/function_code.go @@ -214,6 +214,9 @@ func (s *Server) handleCreateFunction(w http.ResponseWriter, r *http.Request) { now := time.Now().UTC() fnAnnotations[functionCreatedAtAnnotation] = now.Format(time.RFC3339) fnAnnotations[functionUpdatedAtAnnotation] = now.Format(time.RFC3339) + if req.Deps != "" { + fnAnnotations["fission-console/deps"] = req.Deps + } if req.TTL != "" { expiresAt, ttlErr := parseTTL(req.TTL) if ttlErr != nil { @@ -402,6 +405,11 @@ func (s *Server) handleUpdateFunctionCode(w http.ResponseWriter, r *http.Request } fnAnnotations[functionCreatedAtAnnotation] = createdAt.UTC().Format(time.RFC3339) fnAnnotations[functionUpdatedAtAnnotation] = now.Format(time.RFC3339) + if req.Deps != "" { + fnAnnotations["fission-console/deps"] = req.Deps + } else { + delete(fnAnnotations, "fission-console/deps") + } fn.SetAnnotations(fnAnnotations) if err := unstructured.SetNestedField(fn.Object, map[string]any{ "name": newPkgName, diff --git a/console/internal/api/function_crud.go b/console/internal/api/function_crud.go index 8e316b7..c75f332 100644 --- a/console/internal/api/function_crud.go +++ b/console/internal/api/function_crud.go @@ -83,6 +83,7 @@ func (s *Server) handleGetFunction(w http.ResponseWriter, r *http.Request, name // Читаем source-type аннотацию (code / archive) sourceType := "code" archiveFilename := "" + deps := "" if ann := fn.GetAnnotations(); ann != nil { if v := ann[fissionSourceTypeAnnotation]; v != "" { sourceType = v @@ -90,6 +91,9 @@ func (s *Server) handleGetFunction(w http.ResponseWriter, r *http.Request, name if v := ann["fission-console/archive-filename"]; v != "" { archiveFilename = v } + if v := ann["fission-console/deps"]; v != "" { + deps = v + } } writeAnyJSON(w, http.StatusOK, map[string]any{ @@ -102,6 +106,7 @@ func (s *Server) handleGetFunction(w http.ResponseWriter, r *http.Request, name "created_at": functionTimestampResponse(fn)["created_at"], "updated_at": functionTimestampResponse(fn)["updated_at"], "code": code, + "deps": deps, "source_type": sourceType, "archive_filename": archiveFilename, "route": route, diff --git a/console/ui/index.html b/console/ui/index.html index a4c4bb6..a12fbbb 100644 --- a/console/ui/index.html +++ b/console/ui/index.html @@ -103,7 +103,7 @@
NUBES
FISSION CONSOLE
-
v1.3.90
+
v1.3.91
@@ -626,7 +626,7 @@ psycopg2-binary" style="width:100%; box-sizing:border-box; font-family:monospace
- v1.3.90 + v1.3.91
diff --git a/console/ui/js/functions.js b/console/ui/js/functions.js index fb0e0a2..8956e53 100644 --- a/console/ui/js/functions.js +++ b/console/ui/js/functions.js @@ -194,7 +194,7 @@ async function openEdit(name) { var eDepsLabel = document.getElementById('e-deps-label'); var eDepsArea = document.getElementById('e-deps'); if (eDepsLabel) eDepsLabel.textContent = depsLabels[lang] || 'Зависимости'; - if (eDepsArea) { eDepsArea.placeholder = depsPlaceholders[lang] || ''; eDepsArea.value = ''; } + if (eDepsArea) { eDepsArea.placeholder = depsPlaceholders[lang] || ''; eDepsArea.value = fn.deps || ''; } var aiRes = document.getElementById('e-ai-result'); if (aiRes) { aiRes.style.display = 'none'; aiRes.textContent = ''; } var warnEl = document.getElementById('e-tf-warn');