From 91dad658f80a2831364c9300835fd9bce908504e Mon Sep 17 00:00:00 2001 From: The Anh Nguyen Date: Fri, 20 Oct 2023 14:22:41 +0700 Subject: [PATCH 01/10] add comment field parameter --- lib/go-tc/parameters.go | 1 + traffic_ops/app/db/create_tables.sql | 1 + traffic_portal/.gitignore | 1 + .../common/modules/form/parameter/form.parameter.tpl.html | 8 ++++++++ .../modules/table/parameters/table.parameters.tpl.html | 2 ++ 5 files changed, 13 insertions(+) diff --git a/lib/go-tc/parameters.go b/lib/go-tc/parameters.go index 3abc19e884..cf81e85b99 100644 --- a/lib/go-tc/parameters.go +++ b/lib/go-tc/parameters.go @@ -95,6 +95,7 @@ type ParameterV50 struct { Profiles json.RawMessage `json:"profiles" db:"profiles"` Secure bool `json:"secure" db:"secure"` Value string `json:"value" db:"value"` + Comment string `json:"comment" db:"value"` } // ParameterNullableV5 is an alias for the latest minor version for the major version 5. diff --git a/traffic_ops/app/db/create_tables.sql b/traffic_ops/app/db/create_tables.sql index fa2c9b876f..99befe77fc 100644 --- a/traffic_ops/app/db/create_tables.sql +++ b/traffic_ops/app/db/create_tables.sql @@ -1156,6 +1156,7 @@ CREATE TABLE IF NOT EXISTS parameter ( value text NOT NULL, last_updated timestamp with time zone NOT NULL DEFAULT now(), secure boolean DEFAULT false NOT NULL, + comment text, CONSTRAINT unique_param UNIQUE (name, config_file, value), CONSTRAINT idx_89644_primary PRIMARY KEY (id) ); diff --git a/traffic_portal/.gitignore b/traffic_portal/.gitignore index b856303de5..d598874725 100644 --- a/traffic_portal/.gitignore +++ b/traffic_portal/.gitignore @@ -18,6 +18,7 @@ .tmp .sass-cache server/log/access.log +pnpm-lock.yaml node_modules app/dist Gemfile.lock diff --git a/traffic_portal/app/src/common/modules/form/parameter/form.parameter.tpl.html b/traffic_portal/app/src/common/modules/form/parameter/form.parameter.tpl.html index ac0db2b976..a00ef59f07 100644 --- a/traffic_portal/app/src/common/modules/form/parameter/form.parameter.tpl.html +++ b/traffic_portal/app/src/common/modules/form/parameter/form.parameter.tpl.html @@ -66,6 +66,14 @@ Required +
+ +
+ + Required + +
+