Commit Graph

428 Commits

Author SHA1 Message Date
Pascal Precht 892200a236
fix(cockpit/services/api): make sure query params are serialized correctly
In 9097f31c83 we ensured to send query parameters
along with GET requests done by our API service. This resulted in weird behaviour
where query parameters have been attached as `params` in a serialized format of our API requests.

So instead of sending sth. like:

```
/embark-api?token=foo-bar
```

Requests looked like:

```
/embark-api?params=...
```

This has even been patched accordingly on the server like here 043697bddc,
while still being unpatched in other places on the server.

It turns out however, that the reason this `params` parameter appears, is that all of our GET requests,
already send their payload as `params`.

This commit now ensures that GET parameters are sent in the correct format.
2018-10-23 11:12:53 +02:00
Jonathan Rainville fd67844235
review comments 2018-10-23 11:12:53 +02:00
Jonathan Rainville 2d66870773
fix dashboard broken 2018-10-23 11:12:53 +02:00
Jonathan Rainville e660eaea72
add tooltip on copy when there is no onCopy prop 2018-10-23 11:12:52 +02:00
Jonathan Rainville ab77cc012e
conflict in index.css 2018-10-23 11:12:52 +02:00
Jonathan Rainville 29fb9fbe80
add copyButton to abi and bytecode thing 2018-10-23 11:12:52 +02:00
Jonathan Rainville bd4f4726b3
create CopyButton component to wrap arround CopyToClipboard 2018-10-23 11:12:52 +02:00
Jonathan Rainville 261b4eddf3
linting 2018-10-23 11:12:52 +02:00
Jonathan Rainville 6150ce0b54
review comments 2018-10-23 11:12:51 +02:00
Jonathan Rainville 972e0aca40
remove leftover comment 2018-10-23 11:12:51 +02:00
Jonathan Rainville 423d8dcdf0
better style search bar with error and loading 2018-10-23 11:12:51 +02:00
Jonathan Rainville 47beac499f
enable searching contracts 2018-10-23 11:12:51 +02:00
Jonathan Rainville aa742e4a6e
conflict in Layout 2018-10-23 11:12:51 +02:00
Jonathan Rainville 203c4253d7
conflict in layout 2018-10-23 11:12:51 +02:00
Jonathan Rainville e683887ea4
fix bar's css 2018-10-23 11:12:50 +02:00
Anthony Laibe 02aea0506f
Add missing error on authentication 2018-10-23 11:12:50 +02:00
Anthony Laibe 4ca753f38f
Trim text on widget 2018-10-23 11:12:50 +02:00
Anthony Laibe cf460da277
Remove toggler 2018-10-23 11:12:50 +02:00
Anthony Laibe f9dd202713
Apply header and sidebar layout navigation 2018-10-23 11:12:50 +02:00
Pascal Precht c8bd4f19e3
cleanup(cockpit/TextEditorContractsToolbar): remove unused `Icon`
In https://github.com/status-im/embark-area-51/commit/c8339c074 we started using
Font Awesome Icons, so this is a leftover.
2018-10-23 11:12:50 +02:00
Pascal Precht e692e7b19e
fix(cockpit/sevices/api): properly send query parameters for get requests
Ever since we moved to using Axios in 20831179fc,
we haven't properly sent GET parameters along with the requests.

This is because Axios exposes two different properties to send params
along different http verb methods.
2018-10-23 11:12:49 +02:00
Anthony Laibe a1c33a23a2
Remove tabler-react 2018-10-23 11:12:49 +02:00
Anthony Laibe 627fec5b49
Use cards in contract deployment 2018-10-23 11:12:48 +02:00
Pascal Precht 8740c8c0c9
fix(cockpit/Layout): ensure Layout render doesn't throw
In https://github.com/status-im/embark-area-51/commit/62964c8ce we've introduced a
regression where are two errors are thrown when `Layout` component is rendered:

- one for NavItem not having a key property
- one for margin-top not being a supported style property on Container

This commits fixes both.
2018-10-23 11:12:48 +02:00
Anthony Laibe ba5e479ae8
PR feedback 2018-10-23 11:12:48 +02:00
Anthony Laibe 2c74c2aa30
Add identicon 2018-10-23 11:12:48 +02:00
Pascal Precht 98fc1ab51e
fix(cockpit/AppContainer): allow bootstrap with query params
Cockpit allows for authentication via a `token` query parameter a la

```
http://localhost:8000/embark?token=xxxx-xxxx-xxxx-xxxx
```

So far, this was the only query parameter cockpit knew about, which is
why the algorithm during bootstrap always assumed that, if we have
query parameters, there has to be a `token` query parameter.

However, since 20831179fc, this turns out to be a problem. The hashing algorithm
for the request headers will throw, when `token` is not defined, which
can be possible with future features that add new query parameters.

This can be easily reproduced by bootstrapping/refreshing Cockpit using
any arbitrary query string parameter that is not `token`.

With this commit we ensure that we only perform query string authentication
when a `token` parameter is available.
2018-10-23 11:12:48 +02:00
Pascal Precht 8562a3f6c8
feat(cockpit): enable query param authentication in development mode
Prior to this commit it wasn't possible to authenticate using the
`token` query param as the `host` used for authentication doesn't
match the one of the Embark host.
2018-10-23 11:12:47 +02:00
Anthony Laibe ff0d7d20df
Better format element of explorer 2018-10-23 11:12:47 +02:00
Anthony Laibe 4e23acb558
PR feedback 2018-10-23 11:12:47 +02:00
Anthony Laibe 3844d864e7
Apply PR feedback 2018-10-23 11:12:47 +02:00
Anthony Laibe a4d4278dc9
Adding option to switch deployment pipeline 2018-10-23 11:12:47 +02:00
Anthony Laibe 83a9fd4ed0
Add debugger line highlight 2018-10-23 11:12:00 +02:00
Iuri Matias d5cd0b0ff7
address code review 2018-10-23 11:12:00 +02:00
Pascal Precht 923bacf22f
feat(cockpit): introduce transaction decoder component
This commit adds a new component to decode and analyze transactions.
It's similar to the transaction component that's already available,
with the difference that it takes advantage of the ReactJson tree
view for better analysis experience.
2018-10-23 11:12:00 +02:00
Anthony Laibe fb29e5a7c8
Add/remove breakpoints 2018-10-23 11:12:00 +02:00
Iuri Matias d1cb157da1
remove unsued variables 2018-10-23 11:11:59 +02:00
Iuri Matias 315413a87e
transform card view into a card; remove duplicated names per tab 2018-10-23 11:11:59 +02:00
Iuri Matias b86761e83d
restrict logs; switch order in dashboard; don't limit height in contracts box 2018-10-23 11:11:58 +02:00
Iuri Matias b06d224883
fix services & processes; improve UI 2018-10-23 11:11:58 +02:00
Iuri Matias 167cf50db5
move console to embark tab; add search box to top bar 2018-10-23 11:11:57 +02:00
Iuri Matias c2eaa80923
add icons to top bar navigation 2018-10-23 11:11:15 +02:00
Iuri Matias 6fd6988b0f
ui fixes 2018-10-23 11:11:14 +02:00
Andre Medeiros edb8c99af3
Send params in data 2018-10-23 11:11:14 +02:00
Pascal Precht eb412c026b
feat(cockpit/utils): introduce components to sign and verify messages 2018-10-23 11:11:14 +02:00
Jonathan Rainville 1c85d898b7
fix search box css in dark theme 2018-10-23 11:04:02 +02:00
Jonathan Rainville cf294d8bb2
move explorer search to its own file 2018-10-23 11:04:01 +02:00
Jonathan Rainville 29ec199195
review comments 2018-10-23 11:04:01 +02:00
Jonathan Rainville 5cfe208f6f
little fixes 2018-10-23 11:04:01 +02:00
Jonathan Rainville 224a5bd3fd
fix css a bit and submit on enter press 2018-10-23 11:04:01 +02:00
Jonathan Rainville 56ebd94d6d
add loading message on search 2018-10-23 11:04:01 +02:00
Jonathan Rainville 7ea2cb2ed6
show error if it fails 2018-10-23 11:04:01 +02:00
Jonathan Rainville 847e20d092
change page on search result 2018-10-23 11:04:00 +02:00
Jonathan Rainville 890dc50768
conflict in reducer and sagas 2018-10-23 11:04:00 +02:00
Pascal Precht a53976ad3d
uiux(login): introduce dark-theme for login screen
This introduces a new dark-theme file for the login screen
and ensures that it keeps the contrast ratio in tact when
switching themes.

Notice that it simply overrides the component styles which are
expected to be light-theme by default. That's because we don't
maintain equivalent SCSS files for the light-theme at the moment.

Fixes #114
2018-10-23 11:04:00 +02:00
Jonathan Rainville 66a371466d
conflict in explorer layout 2018-10-23 11:04:00 +02:00
Anthony Laibe 6e24b0eb85
Remove uneeded handler 2018-10-23 11:04:00 +02:00
Anthony Laibe 2d287c43f3
Ignore badly formatted message 2018-10-23 11:03:59 +02:00
Anthony Laibe 2a9262c4b9
Adding filter 2018-10-23 11:03:59 +02:00
Anthony Laibe 96c3575e75
Add Contract Events to UI 2018-10-23 11:03:59 +02:00
Anthony Laibe 5fa118ae2e
Event function filt 2018-10-23 11:02:54 +02:00
Anthony Laibe a118fc1017
Remove extra spaces between logs 2018-10-23 11:02:53 +02:00
Iuri Matias eb8de02ed0
refactor json object check 2018-10-23 11:02:53 +02:00
Iuri Matias 4020d4d6c1
detect is log is an object and display json view 2018-10-23 11:02:53 +02:00
Iuri Matias b126871a95
first stab at getting nice json output in the logs 2018-10-23 11:02:53 +02:00
Jonathan Rainville 639ede7b77
conflict in package json 2018-10-23 11:02:52 +02:00
Jonathan Rainville 5e1d60882d
review comments for storage 2018-10-23 11:02:09 +02:00
Jonathan Rainville 0b16b028b4
remove comments in scss files 2018-10-23 11:02:09 +02:00
Jonathan Rainville 2edbef81e4
conflict in constants 2018-10-23 11:02:09 +02:00
Jonathan Rainville 8d63268ae2
fix header not being fixed 2018-10-23 11:02:09 +02:00
Jonathan Rainville c833f9b3bf
store theme in localstorage 2018-10-23 11:02:08 +02:00
Jonathan Rainville be0129fea9
use redux to store the theme 2018-10-23 11:02:08 +02:00
Jonathan Rainville 7c910a571d
add base theme switcher that uses the component state 2018-10-23 11:02:08 +02:00
Jonathan Rainville 21cd0a71e4
final touch on the dark theme 2018-10-23 11:02:07 +02:00
Jonathan Rainville 12b3411ee2
change colors and add command to process scss 2018-10-23 11:01:11 +02:00
Jonathan Rainville f41e9ad1ce
add basic scss files 2018-10-23 11:01:11 +02:00
Andre Medeiros 428f591330
Don't send token in request body.
Instead, we want to hash a header to sign a request with a client nonce,
http method and URL. This is a first step towards protecting the backend
against eavesdropping.

Please note that this will still be susceptible to replay attacks.
2018-10-23 11:01:11 +02:00
Iuri Matias 70b62bdc16
rename command_suggestions to commandSuggestions 2018-10-23 11:00:28 +02:00
Anthony Laibe 3c563ae317
Fix rendering of argument on deployment 2018-10-23 11:00:27 +02:00
Iuri Matias d1a7960cbe
fix view 2018-10-23 11:00:27 +02:00
Iuri Matias 24da141973
remove unsued variables 2018-10-23 11:00:27 +02:00
Iuri Matias f5479baf4c
fix misc issues reported by linter 2018-10-23 11:00:27 +02:00
Iuri Matias 1906b17c5d
fix options update; add sorting 2018-10-23 11:00:26 +02:00
Iuri Matias ce19fd96c4
intiial code to get suggestions from embark 2018-10-23 11:00:26 +02:00
Iuri Matias b2ef42df32
fix vairous bugs with submitting command; support more complex suggestions 2018-10-23 10:59:19 +02:00
Iuri Matias 06ac5315a5
display better command listing on autotype 2018-10-23 10:59:19 +02:00
Iuri Matias 2209aab934
switch to type ahead input box 2018-10-23 10:59:19 +02:00
emizzle 5a6a70e226
Removed tabler-react, clean up
Removed tabler-react from the page structure.

Changed sub nav to reactstrap.

Added the overview child item on LHS nav and the sub nav on the page.

Adjusted width of the sub nav and page contents.
2018-10-23 10:59:19 +02:00
emizzle b27caad7a4
Add explorer overview page
Explorer “dashboard” or overview page has been added to give an overview of what can be seen on the individual explorer pages.

Needs work for exact routes not highlighting the overview page.
2018-10-23 10:59:19 +02:00
Anthony Laibe b423e87e49
Replace tabler react by new theme 2018-10-23 10:59:18 +02:00
emizzle 7b784b9618
Missing pieces for adding log limit 2018-10-23 10:59:18 +02:00
emizzle 145f376000
Add LOG_LIMIT to limit max log response size
Re-adds the log limit feature that limits the log size coming back from embark

Also adds the log limit to other process logs (ie blockchain).
2018-10-23 10:59:18 +02:00
Iuri Matias 64713254f6
move require out of function (not really needed in a browser environment) 2018-10-23 10:59:18 +02:00
Iuri Matias deeeb985ad
fix rebase issues 2018-10-23 10:59:18 +02:00
Pascal Precht 588641222b
feat(contrainers/HomeContainer): introduce contracts list in dashboard 2018-10-23 10:59:17 +02:00
Pascal Precht 35d86beab7
refactor(components/contracts): move ContractsList into its own component
This is done so we can reuse the contracts list component, without introducing an
entire page layout with headline etc.
2018-10-23 10:59:17 +02:00
Iuri Matias fd142ac2e6
improve logs output 2018-10-23 10:59:17 +02:00
Jonathan Rainville 43030980b1
use cross-env for cd and make sure values are specified 2018-10-23 10:59:15 +02:00
Pascal Precht 0eb6067ddf
uiux(components/Login): use new Embark rocket 2018-10-23 10:59:15 +02:00
Anthony Laibe eeeb05fa43
Remove not needed import 2018-10-23 10:59:15 +02:00
Anthony Laibe 812a9d0dfa
Remove Dead Code 2018-10-23 10:59:15 +02:00
Anthony Laibe 4b2715421d
Adding tab to contract view 2018-10-23 10:59:15 +02:00
Pascal Precht df3bce145d
refactor(components/Ens): move ENS components to Utilities 2018-10-23 10:58:35 +02:00
Anthony Laibe 18320573d0
Update preview double load 2018-10-23 10:58:34 +02:00
Anthony Laibe cb4a1e1073
Fix height of flex 2018-10-23 10:58:34 +02:00
Pascal Precht 0e4cb11ab6
refactor(components/Communications): move component to Utilities 2018-10-23 10:58:34 +02:00
Anthony Laibe 9aac039e7e
Adding selector 2018-10-23 10:58:34 +02:00
Anthony Laibe a61f499abb
Fix embark logs guard 2018-10-23 10:58:34 +02:00
Pascal Precht 2d0dfdf6be
uiux(embark-ui/HomeContainer): show state of connected processes 2018-10-23 10:58:34 +02:00
Anthony Laibe de009db74f
Use process log ids 2018-10-23 10:57:05 +02:00
emizzle 5d29ab1d42
Minor PR comments
Removed a null check and intialised `this.context` to an empty object.
2018-10-23 10:57:05 +02:00
emizzle 46511bcfe8
Rebase updates
After the code was rebased, there were some additional changes for getting websockets logs that needed to be catered for.

When there is a call to get all logs for a process, the state entity is updated with a new array item containing all the logs (this is then reduced and selected for rendering). In the case of a websocket log that simply returns only one log item, the latest full log for the process is found in the state entities, and it’s logs are appending to with the data from the websocket.

Additionally, log limits were updated to be passed in as a parameter to the API calls from the frontend. Parameter validation (for `limit`) was also added in this commit.
2018-10-23 10:57:04 +02:00
emizzle d4d7e3b8ac
Addressed PR comments
*Console.js*
- Moved `DEFAULT_PROCESS` const to outside of the `Console` class (but inside the module).
- Removed `(` and `)` from `.filter` in `getProcessLogs()`.
- Updated comments

*logger.js*
- Moved `dateFormat` and `logRegex` to constants outside of `Logger` class
- Moved the `parseLogFile` method inside of the `Logger` class (ES6 style)
- Added a log limit to the `parseLogFile` method
- Added the log path to the constants file and used inside of `Logger`

*cmd_controller.js*
- Defaulted `this.context` to `[constants.context.any]` in the constructor.
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.

*engine.js*
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.
2018-10-23 10:57:04 +02:00
emizzle 0fa1e11ac7
Fixed issue with compounding duplicated logs
On every load of the component, the API request would fetch the entire log history, and effective append it to the list of process logs, so that if a component was loaded multiple times (ie click to different tab, then back to home), the log would be duplicated.

This was solved by timestamping and labelling each fetch response, then getting the latest response in the selector, and filtering by process name in the component.
2018-10-23 10:53:25 +02:00
emizzle 7de72cb474
Addressed PR feedback
- Created an “embark” module so that an “embark” process could be registered in the correct way. This service is only used on `embark run` (can be extended to other commands if needed).

- extracted “embark” to a const `DEFAULT_PROCESS` param in the `Console` component.

- extracted commands result rendering to it’s own function to keep the `renderTabs` function from getting cluttered

- Added sorting of logs by timestamp

- Added milliseconds to the log file data (which helps in sorting log messages).
2018-10-23 10:53:25 +02:00
emizzle 42cc9b559f
Fills embark logs tabs with existing embark logs
A logfile is now generated by default, in the format `.embark/embark-log__YYYY-MM-DD_HH-mm-ss.log`.

When the home tab is loaded, the process logs are fetched for all the processes. The list of processes returned now includes `embark`, and when `/embark-api/process-logs/embark` is fetched, the logFile is parsed and an array of log messages are returned.
2018-10-23 10:52:26 +02:00
Anthony Laibe 41eb23df82
Adding file contracts 2018-10-23 10:51:24 +02:00
Anthony Laibe ea9939c03a
WIP: style fiddle 2018-10-23 10:51:24 +02:00
Anthony Laibe 41176f0f70
Add id to process logs 2018-10-23 10:50:41 +02:00
Pascal Precht daf1d7269d
refactor: rename Unauthenticated to Login
This also removes the previously introduced `LoginLayout` component as
chances are very low that we'll need the layout for anything else then the
login.
2018-10-23 10:50:41 +02:00
Pascal Precht 0baf0526b1
feat(containers/AppContainers): make use of new LoginLayout 2018-10-23 10:50:40 +02:00
Pascal Precht c1b9760502
refactor(components/Unauthenticated): use CoreUI instead of Tabler 2018-10-23 10:50:40 +02:00
Pascal Precht cef60b56e8
feat(components/LoginLayout): introduce new layout for login view 2018-10-23 10:50:40 +02:00
Anthony Laibe ef2a88336b
Fix warning about nested button tag 2018-10-23 10:50:40 +02:00
Anthony Laibe f5ac131d93
Add new theme to utils 2018-10-23 10:50:40 +02:00
Anthony Laibe 5967aa3dc5
Initial version of deployment manager 2018-10-23 10:50:39 +02:00
emizzle 35a701fb90
Addressed PR comments
Updated comments in `FileExplorer.js`

Moved `isFolder()`, `isNotFolder()`, and `byName()` outside of `fileTreeSort()` in `lib/pipeline/pipeline.js`.
2018-10-23 10:50:39 +02:00
emizzle 895c0d86ac
Finish adding show/hide of hidden files
Hidden files/folders (those beginning with “.”) are now hidden and shown depending on the state of the toggle.
2018-10-23 10:50:39 +02:00
emizzle f3431eecbd
File editor tree improvements
Sort files and folders by type, then by name

Hide hidden files/folders (starting with “.”) - WIP
2018-10-23 10:50:39 +02:00
Anthony Laibe 0e872c99e6
Update layout with new theme 2018-10-23 10:50:38 +02:00
Anthony Laibe 36602c30b6
Limit the number of commands/logs we keep 2018-10-23 10:50:38 +02:00
Anthony Laibe 0e4248cca8
Stop and limit fetch process logs 2018-10-23 10:50:38 +02:00
Anthony Laibe ca55a8091e
Only store ether value 2018-10-23 10:50:38 +02:00
Anthony Laibe c475244fb6
Save to when navigating 2018-10-23 10:50:38 +02:00
Anthony Laibe 1a0eb829e8
Keep ether conversion in state 2018-10-23 10:50:38 +02:00
Iuri Matias 771953e8b5
remove versions from dashboard which isn't necessary 2018-10-23 10:50:37 +02:00
Anthony Laibe fe51abc2bb
Eject react-scripts and implement our own
react-monaco-editor
2018-10-23 10:50:03 +02:00
Anthony Laibe 52a5f5dc71
Stop gas oracle 2018-10-23 10:50:03 +02:00
Anthony Laibe d6b348a869
Disable websocket and limit the number of record 2018-10-23 10:50:03 +02:00
Pascal Precht 479aafd076
feat(utils/converter): introduce copy-to-clipboard buttons
This commit enables users to easily copy values from the converter's inputs to the clipboard.
2018-10-23 10:50:02 +02:00
Jonathan Rainville 844e2ed5b0
add back tokens 2018-10-23 10:48:36 +02:00
Andre Medeiros a288afbf68
Address feedback 2018-10-23 10:48:36 +02:00
Jonathan Rainville e9ec0c019d
fix same key 2018-10-23 10:47:26 +02:00
Jonathan Rainville 5fcd1e679d
fix error with JSONTree empty at start 2018-10-23 10:47:26 +02:00
Andre Medeiros 777b0ff1e5
Use properties where it makes sense 2018-10-23 10:47:26 +02:00
Andre Medeiros 31cfc7bdeb
Move from props to state 2018-10-23 10:47:26 +02:00
Andre Medeiros 3339d27ee7
Add code reload component 2018-10-23 10:47:25 +02:00
Jonathan Rainville 1a20b7b9ae
replace reduce by a map to fix case where array is empty 2018-10-23 10:47:25 +02:00
Anthony Laibe 921c99b201
Improve feeling when switching tab 2018-10-23 10:47:25 +02:00
Anthony Laibe c52c0abb77
Allow to customize host 2018-10-23 10:47:25 +02:00