kin: KIN-INFRA-007 Рефакторинг: убрать дублирование VALID_RUNTIMES и перенести import'ы из функции

This commit is contained in:
Gros Frumos 2026-03-17 18:30:26 +02:00
parent e63703ad33
commit c30a4c0fc4
4 changed files with 9 additions and 8 deletions

View file

@ -761,12 +761,10 @@ def patch_task(task_id: str, body: TaskPatch):
@app.get("/api/pipelines/{pipeline_id}/logs")
def get_pipeline_logs(pipeline_id: int, since_id: int = 0):
"""Get pipeline log entries after since_id (for live console polling)."""
"""Get pipeline log entries after since_id (for live console polling).
Returns [] if pipeline does not exist consistent empty response for log collections.
"""
conn = get_conn()
row = conn.execute("SELECT id FROM pipelines WHERE id = ?", (pipeline_id,)).fetchone()
if not row:
conn.close()
raise HTTPException(404, f"Pipeline {pipeline_id} not found")
logs = models.get_pipeline_logs(conn, pipeline_id, since_id=since_id)
conn.close()
return logs

View file

@ -199,6 +199,8 @@ export interface TaskFull extends Task {
pipeline_steps: PipelineStep[]
related_decisions: Decision[]
project_deploy_command: string | null
project_deploy_host: string | null
project_deploy_path: string | null
project_deploy_runtime: string | null
pipeline_id: string | null
}

View file

@ -597,7 +597,7 @@ async function saveEdit() {
<span v-if="resolvingManually" class="inline-block w-3 h-3 border-2 border-orange-400 border-t-transparent rounded-full animate-spin mr-1"></span>
{{ resolvingManually ? 'Сохраняем...' : '&#10003; Решить вручную' }}
</button>
<button v-if="task.status === 'done' && task.project_deploy_command"
<button v-if="task.status === 'done' && (task.project_deploy_command || task.project_deploy_runtime)"
@click.stop="runDeploy"
:disabled="deploying"
class="px-4 py-2 text-sm bg-teal-900/50 text-teal-400 border border-teal-800 rounded hover:bg-teal-900 disabled:opacity-50">