mirror of
https://github.com/getredash/redash.git
synced 2026-05-10 15:00:16 -04:00
Add static enum option to redash
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<select ng-model="$ctrl.parameter.type" class="form-control">
|
||||
<option value="text">Text</option>
|
||||
<option value="number">Number</option>
|
||||
<option value="enum">Enum</option>
|
||||
<option value="date">Date</option>
|
||||
<option value="datetime-local">Date and Time</option>
|
||||
<option value="datetime-with-seconds">Date and Time (with seconds)</option>
|
||||
@@ -22,5 +23,9 @@
|
||||
<label>Global</label>
|
||||
<input type="checkbox" class="form-inline" ng-model="$ctrl.parameter.global">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Values (newline delimited)</label>
|
||||
<textarea class="form-control" rows="3" ng-model="$ctl.parameter.enumOptions">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
<input ng-switch-when="datetime-with-seconds" type="datetime-local" step="1" class="form-control" ng-model="param.ngModel">
|
||||
<input ng-switch-when="datetime-local" type="datetime-local" class="form-control" ng-model="param.ngModel">
|
||||
<input ng-switch-when="date" type="date" class="form-control" ng-model="param.ngModel">
|
||||
<span ns-switch-when="enum">
|
||||
<select ns-model="param.value" class="form-control">
|
||||
<option ng-repeat="option in param.enumOptions.split('\n')" value="{{option}}">{{option}}</option>
|
||||
</select>
|
||||
</span>
|
||||
<input ng-switch-default type="{{param.type}}" class="form-control" ng-model="param.ngModel">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -50,6 +50,7 @@ class Parameter {
|
||||
this.type = parameter.type;
|
||||
this.value = parameter.value;
|
||||
this.global = parameter.global;
|
||||
this.enumOptions = parameter.enumOptions;
|
||||
}
|
||||
|
||||
get ngModel() {
|
||||
|
||||
Reference in New Issue
Block a user