Skip to content

Commit dc4936b

Browse files
author
Alejandro Marques
committed
isDev working
1 parent 32a348c commit dc4936b

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,50 @@ Console Box AWS is an application that allows you to open different `AWS` sessio
66
You create a workspace to work with an aws session and inside you have a full browser to navigate. You can create as many workspaces as you want.
77

88
***
9+
## Example
910

1011
![gif](Screenshots/CBAWS-demo.gif)
1112

1213
***
1314

15+
## Behavior
1416

17+
The operation of the application is very simple, the ViewManager loads the root (ViewA or ViewB) based on the label `?view=viewB`.
18+
19+
ViewA contains the workspaces and ViewB contains the browser.
20+
21+
ViewB separates the sessions by the label `&session=${workSpace}`.
22+
23+
When you select a workspace in the ViewA, it creates a new process with the ViewB, separating the session.
24+
Being a new process, it allows to have the browser open even if the workspace is changed to anther one.
25+
26+
**This application does not save any data of your aws passwords or names. Only save the cache and session like a normal browser do.***
27+
28+
***
1529

1630
## Available Scripts
1731

1832
* First install all node dependencies with yarn.
19-
*
33+
34+
2035
In the project directory, you can run:
2136

2237
### `yarn dev`
2338

2439
Runs the app in the development mode at [http://localhost:3000].<br>
2540
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
2641

27-
You have to edit these lines to change between production and development.
28-
Comment the line that you do not use.
42+
Automatically switches between development and production.
2943
**For production to work, you have to use the prebuild command**
3044

3145
```javascript
32-
//view.webContents.loadURL(`http://localhost:3000?view=viewB&session=${workSpace}`);
33-
view.webContents.loadURL(`file://${path.join(remote.app.getAppPath(), `./build/index.html?view=viewB&session=${workSpace}`)}`);
46+
isDev? view.webContents.loadURL(`http://localhost:3000?view=viewB&session=${workSpace}`) : view.webContents.loadURL(`file://${path.join(remote.app.getAppPath(), `./build/index.html?view=viewB&session=${workSpace}`)}`);
3447
```
3548

3649
The page will reload if you make edits.<br>
3750
You will also see any lint errors in the console.
3851

52+
3953
### `yarn prebuild-pack`
4054

4155
Builds the app for production to the `build` folder.<br>
@@ -48,3 +62,4 @@ Your app is ready to be packaged!
4862

4963
Package and create the executables for windows and mac in the dist folder.
5064

65+
***

src/views/ViewA.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const Store = window.require('electron-store');
3131
const store = new Store();
3232
/* Store */
3333

34-
34+
/* DEV */
35+
const isDev = window.require('electron-is-dev');
36+
/* DEV */
3537

3638
/** **/
3739
window.React = React;
@@ -127,7 +129,8 @@ class ViewA extends React.Component {
127129
test.setBrowserView(view);
128130

129131
/* ------------------------------------------------------------------------------ SWITCH DEV ---------------------------------------------------------------------------- */
130-
view.webContents.loadURL(`http://localhost:3000?view=viewB&session=${workSpace}`);
132+
isDev? view.webContents.loadURL(`http://localhost:3000?view=viewB&session=${workSpace}`) : view.webContents.loadURL(`file://${path.join(remote.app.getAppPath(), `./build/index.html?view=viewB&session=${workSpace}`)}`);
133+
//view.webContents.loadURL(`http://localhost:3000?view=viewB&session=${workSpace}`);
131134
//view.webContents.loadURL(`file://${path.join(remote.app.getAppPath(), `./build/index.html?view=viewB&session=${workSpace}`)}`);
132135
/* ------------------------------------------------------------------------------ SWITCH DEV ---------------------------------------------------------------------------- */
133136

0 commit comments

Comments
 (0)