Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"css-loader": "^2.1.0",
"electron": "^4.0.4",
"electron-builder": "^20.39.0",
"electron-devtools-installer": "^2.2.4",
"eslint": "^5.10.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
Expand Down
26 changes: 20 additions & 6 deletions src/client/components/NavigationComponents/ClusterInfoComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ import React from 'react';

const ClusterInfoComponent = (props) => {
const { clusterInfo } = props;
let halfOfServerEndpoint;
let serverEndPointFrontHalf;
let serverEndPointBackHalf;
let subnetIds;

const halfOfServerEndpoint = Math.floor(clusterInfo.serverEndPoint.length / 2);
const serverEndPointFrontHalf = clusterInfo.serverEndPoint.slice(0, halfOfServerEndpoint);
const serverEndPointBackHalf = clusterInfo.serverEndPoint.slice(halfOfServerEndpoint);
console.log(clusterInfo);
console.log(Object.prototype.hasOwnProperty.call(clusterInfo, 'serverEndPoint'));
if (Object.prototype.hasOwnProperty.call(clusterInfo, 'serverEndPoint')) {
halfOfServerEndpoint = Math.floor(clusterInfo.serverEndPoint.length / 2);
serverEndPointFrontHalf = clusterInfo.serverEndPoint.slice(0, halfOfServerEndpoint);
serverEndPointBackHalf = clusterInfo.serverEndPoint.slice(halfOfServerEndpoint);
}

if (Object.prototype.hasOwnProperty.call(clusterInfo, 'subnetIdsArray')) {
subnetIds = clusterInfo.subnetIdsArray.map((subnet) => {
return (
<div key={subnet} className="cluster_info_subnets">{subnet}</div>
);
});
}

return (
<div className="cluster_info_container">
Expand Down Expand Up @@ -45,9 +61,7 @@ const ClusterInfoComponent = (props) => {
</div>
<div className="cluster_info_minor">
<div className="cluster_info_key">SUBNET IDS: </div>
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[0]}</div>
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[1]}</div>
<div className="cluster_info_subnets">{clusterInfo.subnetIdsArray[2]}</div>
{subnetIds}
</div>
<div className="cluster_info_minor">
<div className="cluster_info_key">SERVER END POINT: </div>
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/NavigationComponents/NavComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const NavComponent = (props) => {
<button className="nav_component_cluster_button" type="button" onMouseEnter={getAndDisplayClusterData} onMouseLeave={hideClusterInfo}>CLUSTER DATA</button>
{/* CLUSTER INFO DROPDOWN CONTAINER */}
{showClusterInfo === true && (
<ClusterInfoComponent clusterInfo={clusterInfo} />
<ClusterInfoComponent clusterInfo={clusterInfo} />
)}
</div>
</div>
Expand Down
17 changes: 10 additions & 7 deletions src/client/containers/NavContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ class NavContainer extends Component {
//* --------------- COMPONENT METHODS --------------------------- *//

getAndDisplayClusterData(e) {
const { clusterInfo, displayClusterInfo } = this.props;
if (clusterInfo.clusterName === '') {
ipcRenderer.send(events.GET_CLUSTER_DATA, 'request cluster data');
const { clusterInfo, displayClusterInfo, creatingCluster } = this.props;
if (!creatingCluster) {
if (clusterInfo.clusterName === '') {
ipcRenderer.send(events.GET_CLUSTER_DATA, 'request cluster data');
}
displayClusterInfo();
}
displayClusterInfo();
}

handleMenuItemToShow(e) {
Expand All @@ -92,11 +94,12 @@ class NavContainer extends Component {
}

handleNavBarClick(e) {
const { hideCreateMenuDropdown } = this.props;
hideCreateMenuDropdown();
const { hideCreateMenuDropdown, creatingCluster } = this.props;
if (!creatingCluster) {
hideCreateMenuDropdown();
}
}


// FOR DEBUGGING the main in production
handleKubectlData(event, data) {
console.log('Errors from stderr', data.stderr);
Expand Down
1 change: 1 addition & 0 deletions src/client/store/reducers/navbarReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default function navbarReducers(state = initialState, action) {
case types.HIDE_CLUSTER_INFO:
return { ...state, showClusterInfo: false };
case types.UPDATE_CLUSTER_DATA:
console.log(action.payload);
return { ...state, clusterInfo: action.payload };
default:
return state;
Expand Down
Binary file removed src/main/.DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require('dotenv').config();

// --------- ELECTRON MODULES -----------
const { app, BrowserWindow, ipcMain, shell, Menu, crashReporter } = require('electron');
const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');

crashReporter.start({
productName: 'kre8-awslaunched',
Expand Down Expand Up @@ -54,7 +55,9 @@ const createWindowAndSetEnvironmentVariables = () => {
if (NODE_ENV === 'development') {
process.env.APPLICATION_PATH = __dirname;
awsEventCallbacks.setEnvVarsAndMkDirsInDev();
BrowserWindow.addDevToolsExtension(REACT_DEV_TOOLS_PATH);
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
} else if (NODE_ENV === 'test') {
process.env.APPLICATION_PATH = __dirname;
awsEventCallbacks.setEnvVarsAndMkDirsInDev();
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = {
// 'process.env.NODE_ENV': JSON.stringify('development'),
// }),
],
devtool: 'cheap-source-map',
devtool: 'eval-source-map',
devServer: {
contentBase: OUTPUT_DIR,
historyApiFallback: true,
Expand Down
22 changes: 21 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-4.1.0.tgz#33eff662a5c39c0c2061170cc003c5120743fff0"
integrity sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==

"[email protected]":
version "0.0.6"
resolved "https://registry.yarnpkg.com/7zip/-/7zip-0.0.6.tgz#9cafb171af82329490353b4816f03347aa150a30"
integrity sha1-nK+xca+CMpSQNTtIFvAzR6oVCjA=

"@babel/cli@^7.2.3":
version "7.4.3"
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.4.3.tgz#353048551306ff42e5855b788b6ccd9477289774"
Expand Down Expand Up @@ -2270,6 +2275,11 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

[email protected]:
version "0.0.2"
resolved "https://registry.yarnpkg.com/cross-unzip/-/cross-unzip-0.0.2.tgz#5183bc47a09559befcf98cc4657964999359372f"
integrity sha1-UYO8R6CVWb78+YzEZXlkmZNZNy8=

crypto-browserify@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
Expand Down Expand Up @@ -2759,6 +2769,16 @@ electron-chromedriver@~3.0.0:
electron-download "^4.1.0"
extract-zip "^1.6.5"

electron-devtools-installer@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/electron-devtools-installer/-/electron-devtools-installer-2.2.4.tgz#261a50337e37121d338b966f07922eb4939a8763"
integrity sha512-b5kcM3hmUqn64+RUcHjjr8ZMpHS2WJ5YO0pnG9+P/RTdx46of/JrEjuciHWux6pE+On6ynWhHJF53j/EDJN0PA==
dependencies:
"7zip" "0.0.6"
cross-unzip "0.0.2"
rimraf "^2.5.2"
semver "^5.3.0"

electron-download@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8"
Expand Down Expand Up @@ -6600,7 +6620,7 @@ rgb2hex@^0.1.9:
resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.1.9.tgz#5d3e0e14b0177b568e6f0d5b43e34fbfdb670346"
integrity sha512-32iuQzhOjyT+cv9aAFRBJ19JgHwzQwbjUhH3Fj2sWW2EEGAW8fpFrDFP5ndoKDxJaLO06x1hE3kyuIFrUQtybQ==

rimraf@2, [email protected], rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
rimraf@2, [email protected], rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
Expand Down