mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
Adapt InputsStore to changes in InputsResource, remove parameter.
This commit is contained in:
@@ -25,8 +25,8 @@ const InputsList = React.createClass({
|
||||
};
|
||||
},
|
||||
componentDidMount() {
|
||||
InputsActions.list.triggerPromise(true);
|
||||
SingleNodeActions.get.triggerPromise();
|
||||
InputsActions.list();
|
||||
SingleNodeActions.get();
|
||||
},
|
||||
_splitInputs(state) {
|
||||
const inputs = state.inputs;
|
||||
|
||||
@@ -43,7 +43,7 @@ const LoaderTabs = React.createClass({
|
||||
}
|
||||
},
|
||||
loadData() {
|
||||
InputsActions.list.triggerPromise();
|
||||
InputsActions.list();
|
||||
StreamsStore.listStreams().then((response) => {
|
||||
const streams = {};
|
||||
response.forEach((stream) => { streams[stream.id] = stream });
|
||||
|
||||
@@ -13,7 +13,7 @@ const SystemMessage = React.createClass({
|
||||
<tr>
|
||||
<td>{moment(message.timestamp).format()}</td>
|
||||
<td>
|
||||
<i className="fa fa-code-fork"></i>{' '}
|
||||
<i className="fa fa-code-fork"/>{' '}
|
||||
<LinkToNode nodeId={message.node_id} />
|
||||
</td>
|
||||
<td>{message.content}</td>
|
||||
|
||||
@@ -27,7 +27,7 @@ const ExportContentPackPage = React.createClass({
|
||||
GrokPatternsStore.loadPatterns((grokPatterns) => {
|
||||
this.setState({grok_patterns: grokPatterns});
|
||||
});
|
||||
InputsActions.list.triggerPromise();
|
||||
InputsActions.list();
|
||||
OutputsStore.load((resp) => {
|
||||
this.setState({outputs: resp.outputs});
|
||||
});
|
||||
|
||||
@@ -16,10 +16,10 @@ const InputsStore = Reflux.createStore({
|
||||
this.trigger({inputs: this.inputs, input: this.input});
|
||||
},
|
||||
|
||||
list(completeInput) {
|
||||
list() {
|
||||
const promise = fetch('GET', URLUtils.qualifyUrl(this.sourceUrl))
|
||||
.then(response => {
|
||||
this.inputs = (completeInput ? response.inputs : response.inputs.map((input) => input.message_input));
|
||||
this.inputs = response.inputs;
|
||||
this.trigger({inputs: this.inputs});
|
||||
|
||||
return this.inputs;
|
||||
@@ -55,7 +55,7 @@ const InputsStore = Reflux.createStore({
|
||||
promise
|
||||
.then(() => {
|
||||
UserNotification.success(`Input '${input.title}' launched successfully`);
|
||||
InputsActions.list.triggerPromise(true);
|
||||
InputsActions.list();
|
||||
})
|
||||
.catch(error => {
|
||||
UserNotification.error(`Launching input '${input.title}' failed with status: ${error}`,
|
||||
@@ -73,7 +73,7 @@ const InputsStore = Reflux.createStore({
|
||||
promise
|
||||
.then(() => {
|
||||
UserNotification.success(`Input '${inputTitle}' deleted successfully`);
|
||||
InputsActions.list.triggerPromise(true);
|
||||
InputsActions.list();
|
||||
})
|
||||
.catch(error => {
|
||||
UserNotification.error(`Deleting input '${inputTitle}' failed with status: ${error}`,
|
||||
|
||||
Reference in New Issue
Block a user