Skip to content

Commit

Permalink
PRE-BUILD COMMANDS! NOW IN CONSOLE!
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrux committed Nov 5, 2018
1 parent 3879d76 commit ccc2d40
Show file tree
Hide file tree
Showing 35 changed files with 805 additions and 325 deletions.
106 changes: 8 additions & 98 deletions app/actions/eon_detail_actions.js
Original file line number Diff line number Diff line change
@@ -1,118 +1,28 @@
import * as types from '../constants/eon_detail_action_types';

// ACTION CREATORS
let pollerId;

export function BEGIN_install(eon) {
return {
type: types.INSTALL,
payload: eon
};
}

export function SUCCESS_install() {
return {
type: types.INSTALL_SUCCESS
};
}

export function FAIL_install(err) {
return {
type: types.INSTALL_FAIL,
payload: {
err
}
};
}

export function BEGIN_uninstall() {
return {
type: types.UNINSTALL
};
}

export function SUCCESS_uninstall() {
return {
type: types.UNINSTALL_SUCCESS
};
}

export function FAIL_uninstall(err) {
return {
type: types.UNINSTALL_FAIL,
payload: {
err
}
};
}

export function CHANGE_TAB(tab) {
return {
type: types.CHANGE_TAB,
payload: tab
};
}

// SSH ACTION CREATORS
export function BEGIN_connectSSH() {
export function SHOW_COMMAND(tab) {
return {
type: types.CONNECT_SSH
};
}


export function SUCCESS_connectSSH() {
return {
type: types.CONNECT_SSH_SUCCESS
};
}

export function FAIL_connectSSH(err) {
return {
type: types.CONNECT_SSH_FAIL,
payload: {
err
}
};
}

export function BEGIN_sshCommand() {
return {
type: types.SSH_COMMAND
};
}

export function SUCCESS_sshCommand() {
return {
type: types.SSH_COMMAND_SUCCESS
};
}

export function RESPONSE_sshCommand(stdout,stderr) {
return {
type: types.SSH_COMMAND_RESPONSE,
payload: {
stderr,
stdout
}
type: types.SHOW_COMMAND,
payload: tab
};
}

export function STOP_POLLING() {
export function HIDE_COMMAND() {
return {
type: types.STOP_POLLING
type: types.HIDE_COMMAND
};
}

export function FAIL_sshCommand(err) {
export function RUN_COMMAND(command) {
return {
type: types.SSH_COMMAND_FAIL,
payload: {
err
}
type: types.RUN_COMMAND,
payload: command
};
}

export function stopPolling() {
dispatch(STOP_POLLING);
}
8 changes: 8 additions & 0 deletions app/actions/ui_actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import * as types from '../constants/ui_action_types';

export function SET_TERMINAL_FONT_SIZE(fontSize) {
return {
type: types.SET_TERMINAL_FONT_SIZE,
payload: fontSize
};
}
export function SET_STATE_LIST_DEPTH(depth) {
console.warn("Setting depth to: ", depth);
return {
type: types.SET_STATE_LIST_DEPTH,
payload: depth
};
}
7 changes: 6 additions & 1 deletion app/actions/zmq_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ export function ERROR(err) {
type: types.ERROR,
payload: err
};
}
}
export function TOGGLE_PAUSE() {
return {
type: types.TOGGLE_PAUSE
};
}
9 changes: 8 additions & 1 deletion app/app.global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ $right-content-width: calc(100% - #{$left-bar-width});
body {
background-color:#000;
}
.react-json-view {
* {
opacity:1!important;
}
}
.app-wrapper {
$darker_col: 6;
padding-top:0;
Expand All @@ -37,6 +42,8 @@ body {
@import "styles/tab-list";
@import "styles/tab-content";
@import "styles/loading-overlay";
@import "styles/state-list";
@import "styles/command-bar";
@import "styles/is-mac";

.container-fluid {
Expand Down Expand Up @@ -69,7 +76,7 @@ body {
position:relative;
height:100%;
width:100%;
padding:15px;
padding:0;
.json-pretty {
background-color:#000;
}
Expand Down
34 changes: 23 additions & 11 deletions app/background/zmq.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ function onMessage(sender, event_message, service, cb) {
if (service.id === "logMessage") {
jsonData = JSON.parse(jsonData);
}
newData = {
fields: Object.keys(jsonData),
latestMessage: jsonData
};
if (!data[service.id]) {
data[service.id] = {};
}
// newData = {
// ,
// latestMessage: jsonData
// };

data[service.id] = {
...data[service.id],
...newData
fields: Object.keys(jsonData),
latestMessage: jsonData,
messages: [
...data[service.id].messages,
jsonData
]
};

writeLog("message count: " + data[service.id].messages.length);
let msgResp = {};
msgResp[service.id] = data[service.id]
msgResp[service.id] = data[service.id];
sender.send(types.MESSAGE, msgResp);
}

Expand All @@ -52,6 +54,16 @@ export function startZmq() {
ipcMain.on(types.CONNECT, (evt, ip, service) => {
const { sender } = evt;
const addr = `tcp://${ip}:${service.port}`;
if (!data[service.id]) {
data[service.id] = {
latestMessage: {},
messages: []
};
}
// if (!data[service.id].messages) {
// data[service.id].messages = [];
// }
data[service.id].messages = [];
msgHandler = throttle((msg) => { return onMessage(sender, msg, service); }, 200, { leading: true });
sock.on('message', msgHandler);
writeLog(`Connecting to ${addr}`, service.key);
Expand Down
80 changes: 0 additions & 80 deletions app/components/EonDetail/DriveViewer.js

This file was deleted.

Loading

0 comments on commit ccc2d40

Please sign in to comment.