mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Added comma-separated URL params
This commit is contained in:
@@ -14,7 +14,20 @@ class TopologyOptions extends React.Component {
|
||||
}
|
||||
|
||||
handleOptionClick(optionId, value, topologyId) {
|
||||
this.props.changeTopologyOption(optionId, value, topologyId);
|
||||
const { activeOptions, options } = this.props;
|
||||
const selectedOption = options.find(o => o.get('id') === optionId);
|
||||
|
||||
if (selectedOption.get('selectType') === 'union') {
|
||||
if (activeOptions.get(selectedOption.get('id')).includes(value)) {
|
||||
// Option already exists; user is de-selecting
|
||||
console.log('TODO! removeOption action');
|
||||
} else {
|
||||
// Option does not exist; user is enabling.
|
||||
console.log('TODO! addOption action');
|
||||
}
|
||||
} else {
|
||||
this.props.changeTopologyOption(optionId, value, topologyId);
|
||||
}
|
||||
}
|
||||
|
||||
renderOption(option) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import debug from 'debug';
|
||||
import reqwest from 'reqwest';
|
||||
import defaults from 'lodash/defaults';
|
||||
import { Map as makeMap } from 'immutable';
|
||||
import { Map as makeMap, List } from 'immutable';
|
||||
|
||||
import { blurSearch, clearControlError, closeWebsocket, openWebsocket, receiveError,
|
||||
receiveApiDetails, receiveNodesDelta, receiveNodeDetails, receiveControlError,
|
||||
@@ -45,7 +45,12 @@ let continuePolling = true;
|
||||
|
||||
export function buildOptionsQuery(options) {
|
||||
if (options) {
|
||||
return options.map((value, param) => `${param}=${value}`).join('&');
|
||||
return options.map((value, param) => {
|
||||
if (List.isList(value)) {
|
||||
value = value.join(',');
|
||||
}
|
||||
return `${param}=${value}`;
|
||||
}).join('&');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user