web: remove old event log store

This commit is contained in:
Maximilian Hils 2016-06-03 18:35:27 -07:00
parent d6fcd7e06d
commit ff9cc8b283
5 changed files with 7 additions and 45 deletions

View File

@ -60,21 +60,6 @@ export var SettingsActions = {
}
};
var EventLogActions_event_id = 0;
export var EventLogActions = {
add_event: function (message) {
AppDispatcher.dispatchViewAction({
type: ActionTypes.EVENT_STORE,
cmd: StoreCmds.ADD,
data: {
message: message,
level: "web",
id: "viewAction-" + EventLogActions_event_id++
}
});
}
};
export var FlowActions = {
accept: function (flow) {
$.post("/flows/" + flow.id + "/accept");

View File

@ -9,7 +9,7 @@ import MainView from "./mainview.js";
import Footer from "./footer.js";
import {Header, MainMenu} from "./header.js";
import EventLog from "./eventlog.js"
import {EventLogStore, FlowStore, SettingsStore} from "../store/store.js";
import {FlowStore, SettingsStore} from "../store/store.js";
import {Key} from "../utils.js";
@ -24,7 +24,6 @@ var Reports = React.createClass({
var ProxyAppMain = React.createClass({
childContextTypes: {
flowStore: React.PropTypes.object.isRequired,
eventStore: React.PropTypes.object.isRequired,
returnFocus: React.PropTypes.func.isRequired,
location: React.PropTypes.object.isRequired,
},
@ -63,13 +62,11 @@ var ProxyAppMain = React.createClass({
getChildContext: function () {
return {
flowStore: this.state.flowStore,
eventStore: this.state.eventStore,
returnFocus: this.focus,
location: this.props.location
};
},
getInitialState: function () {
var eventStore = new EventLogStore();
var flowStore = new FlowStore();
var settingsStore = new SettingsStore();
@ -79,7 +76,6 @@ var ProxyAppMain = React.createClass({
return {
settings: settingsStore.dict,
flowStore: flowStore,
eventStore: eventStore
};
},
focus: function () {

View File

@ -1,4 +1,4 @@
import {ConnectionActions, EventLogActions} from "./actions.js";
import {ConnectionActions} from "./actions.js";
import {AppDispatcher} from "./dispatcher.js";
import * as webSocketActions from "./ducks/websocket"
import * as eventLogActions from "./ducks/eventLog"
@ -27,12 +27,12 @@ export default function Connection(url, dispatch) {
};
ws.onerror = function () {
ConnectionActions.error();
EventLogActions.add_event("WebSocket connection error.");
dispatch(eventLogActions.addLogEntry("WebSocket connection error."));
};
ws.onclose = function () {
ConnectionActions.close();
EventLogActions.add_event("WebSocket connection closed.");
dispatch(websocketActions.disconnected());
dispatch(eventLogActions.addLogEntry("WebSocket connection closed."));
dispatch(webSocketActions.disconnected());
};
return ws;
}

View File

@ -2,7 +2,6 @@
import _ from "lodash";
import $ from "jquery";
import {EventEmitter} from 'events';
import { EventLogActions } from "../actions.js"
import {ActionTypes, StoreCmds} from "../actions.js";
import {AppDispatcher} from "../dispatcher.js";
@ -118,7 +117,7 @@ _.extend(LiveStoreMixin.prototype, {
this.handle_fetch(message.data);
}.bind(this))
.fail(function () {
EventLogActions.add_event("Could not fetch " + this.type);
console.error("Could not fetch " + this.type)
}.bind(this));
}
},
@ -153,21 +152,4 @@ export function FlowStore() {
export function SettingsStore() {
return new LiveDictStore(ActionTypes.SETTINGS_STORE);
}
export function EventLogStore() {
LiveListStore.call(this, ActionTypes.EVENT_STORE);
}
_.extend(EventLogStore.prototype, LiveListStore.prototype, {
fetch: function(){
LiveListStore.prototype.fetch.apply(this, arguments);
// Make sure to display updates even if fetching all events failed.
// This way, we can send "fetch failed" log messages to the log.
if(this._fetchxhr){
this._fetchxhr.fail(function(){
this.handle_fetch(null);
}.bind(this));
}
}
});
}

View File

@ -99,7 +99,6 @@ $(document).ajaxError(function (event, jqXHR, ajaxSettings, thrownError) {
}
var message = jqXHR.responseText;
console.error(thrownError, message, arguments);
actions.EventLogActions.add_event(thrownError + ": " + message);
alert(message);
});