mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat(site): add presets to workspace creation page
* Add frontend components to pick a preset * Add api endpoints to list presets and fetch their parameters * update database queries based on new insights about how the frontend uses presets
This commit is contained in:
@ -25,21 +25,18 @@ WHERE
|
||||
|
||||
-- name: GetPresetByWorkspaceBuildID :one
|
||||
SELECT
|
||||
template_version_presets.id,
|
||||
template_version_presets.name,
|
||||
template_version_presets.created_at
|
||||
template_version_presets.*
|
||||
FROM
|
||||
workspace_builds
|
||||
INNER JOIN template_version_presets ON workspace_builds.template_version_preset_id = template_version_presets.id
|
||||
template_version_presets
|
||||
INNER JOIN workspace_builds ON workspace_builds.template_version_preset_id = template_version_presets.id
|
||||
WHERE
|
||||
workspace_builds.id = @workspace_build_id;
|
||||
|
||||
-- name: GetPresetParametersByPresetID :many
|
||||
-- name: GetPresetParametersByTemplateVersionID :many
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
value
|
||||
template_version_preset_parameters.*
|
||||
FROM
|
||||
template_version_preset_parameters
|
||||
INNER JOIN template_version_presets ON template_version_preset_parameters.template_version_preset_id = template_version_presets.id
|
||||
WHERE
|
||||
template_version_preset_id = @template_version_preset_id;
|
||||
template_version_presets.template_version_id = @template_version_id;
|
||||
|
@ -120,10 +120,11 @@ INSERT INTO
|
||||
provisioner_state,
|
||||
deadline,
|
||||
max_deadline,
|
||||
reason
|
||||
reason,
|
||||
template_version_preset_id
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13);
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14);
|
||||
|
||||
-- name: UpdateWorkspaceBuildCostByID :exec
|
||||
UPDATE
|
||||
|
Reference in New Issue
Block a user