I am working om creating a dashboard to display data from my app-I have a dropdown where you select which environment you want to see data for-I need to set 2 values based on this dropdown:
1.connection for db queries
2. host for logs based queries
I searched many option but couldn't get any to work:I am trying to do <fieldset submitButton="false">
<input type="dropdown" token="connection">
<label>Select Region</label>
<default>dev-platform-postgres</default>
<choice value="dev-platform-postgres">US</choice>
<choice value="dev-platform-postgres-eu">EU</choice>
<change>
<condition label = 'dev-platform-postgres'>
<set token="host">eks-prod-saas-ue1-*</set>
</condition>
<condition label = 'dev-platform-postgres-eu'>
<set token="host">prd-shared-services-eu-eks*</set>
</condition>
</change>
</input>
</fieldset>
and then be able to use both $host$ and $connection$ tokens in the dashboard but I cant get $host$ initialized correctly
any help would be appreciated
also -side note I am getting a warning "Expected at most 1 children of fieldset in dashboard, instead saw 2"-how am I supposed to handle a case where I want 2 selections -one of date and one of connection?
I misunderstood your problem - your conditions need to use the values of the labels, i.e. US and EU
<form version="1.1" theme="light">
<label>Hosts</label>
<init>
<set token="host">eks-prod-saas-ue1-*</set>
</init>
<fieldset submitButton="false">
<input type="dropdown" token="connection">
<label>Select Region</label>
<default>dev-platform-postgres</default>
<choice value="dev-platform-postgres">US</choice>
<choice value="dev-platform-postgres-eu">EU</choice>
<change>
<condition label="US">
<set token="host">eks-prod-saas-ue1-*</set>
</condition>
<condition label="EU">
<set token="host">prd-shared-services-eu-eks*</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<html>
<p>$host$ $connection$</p>
</html>
</panel>
</row>
</form>
Use an init block
<form version="1.1" theme="light">
<label>Hosts</label>
<init>
<set token="host">eks-prod-saas-ue1-*</set>
</init>
<fieldset submitButton="false">
<input type="dropdown" token="connection">
<label>Select Region</label>
<default>dev-platform-postgres</default>
<choice value="dev-platform-postgres">US</choice>
<choice value="dev-platform-postgres-eu">EU</choice>
<change>
<condition label="dev-platform-postgres">
<set token="host">eks-prod-saas-ue1-*</set>
</condition>
<condition label="dev-platform-postgres-eu">
<set token="host">prd-shared-services-eu-eks*</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<html>
<p>$host$ $connection$</p>
</html>
</panel>
</row>
</form>
Hi @ITWhisperer thanks for taking the time to reply
when using init -it only initializes the first time but doesn't update accordingly when fieldset is changed
I tried also :
<fieldset submitButton="false">
<input type="dropdown" token="connection">
<label>Select Region</label>
<default>dev-platform-postgres</default>
<choice value="dev-platform-postgres">US</choice>
<choice value="dev-platform-postgres-eu">EU</choice>
<change>
<condition match="$connection$==dev-platform-postgres">
<set token="host">eks-prod-saas-ue1-*</set>
</condition>
<condition match="$connection$==dev-platform-postgres-eu">
<set token="host">prd-shared-services-eu-eks*</set>
</condition>
</change>
</input>
</fieldset>
but again $host$ is not updated on fieldset change
I misunderstood your problem - your conditions need to use the values of the labels, i.e. US and EU
<form version="1.1" theme="light">
<label>Hosts</label>
<init>
<set token="host">eks-prod-saas-ue1-*</set>
</init>
<fieldset submitButton="false">
<input type="dropdown" token="connection">
<label>Select Region</label>
<default>dev-platform-postgres</default>
<choice value="dev-platform-postgres">US</choice>
<choice value="dev-platform-postgres-eu">EU</choice>
<change>
<condition label="US">
<set token="host">eks-prod-saas-ue1-*</set>
</condition>
<condition label="EU">
<set token="host">prd-shared-services-eu-eks*</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<html>
<p>$host$ $connection$</p>
</html>
</panel>
</row>
</form>
thanks -that works now