mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: make default workspace proxy editable (#7903)
* chore: add editing the default workspace proxy
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
-- name: UpsertDefaultProxy :exec
|
||||
-- The default proxy is implied and not actually stored in the database.
|
||||
-- So we need to store it's configuration here for display purposes.
|
||||
-- The functional values are immutable and controlled implicitly.
|
||||
INSERT INTO site_configs (key, value)
|
||||
VALUES
|
||||
('default_proxy_display_name', @display_name :: text),
|
||||
('default_proxy_icon_url', @icon_url :: text)
|
||||
ON CONFLICT
|
||||
(key)
|
||||
DO UPDATE SET value = EXCLUDED.value WHERE site_configs.key = EXCLUDED.key
|
||||
;
|
||||
|
||||
-- name: GetDefaultProxyConfig :one
|
||||
SELECT
|
||||
COALESCE((SELECT value FROM site_configs WHERE key = 'default_proxy_display_name'), 'Default') :: text AS display_name,
|
||||
COALESCE((SELECT value FROM site_configs WHERE key = 'default_proxy_icon_url'), '/emojis/1f3e1.png') :: text AS icon_url
|
||||
;
|
||||
|
||||
|
||||
-- name: InsertDeploymentID :exec
|
||||
INSERT INTO site_configs (key, value) VALUES ('deployment_id', $1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user