Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add etherjot #393

Merged
merged 2 commits into from
Dec 4, 2023
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
node_modules

# electron
dist
dist/*
!dist/etherjot
build
out

Expand Down
15 changes: 15 additions & 0 deletions dist/etherjot/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": {
"main.css": "/etherjot/static/css/main.d4b9c69a.css",
"main.js": "/etherjot/static/js/main.d74a0875.js",
"static/media/index.cjs": "/etherjot/static/media/index.93ef761341cad87ea7f1.cjs",
"static/media/space-grotesk.woff2": "/etherjot/static/media/space-grotesk.28337638d11938e35866.woff2",
"index.html": "/etherjot/index.html",
"main.d4b9c69a.css.map": "/etherjot/static/css/main.d4b9c69a.css.map",
"main.d74a0875.js.map": "/etherjot/static/js/main.d74a0875.js.map"
},
"entrypoints": [
"static/css/main.d4b9c69a.css",
"static/js/main.d74a0875.js"
]
}
Binary file added dist/etherjot/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions dist/etherjot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/etherjot/favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/etherjot/logo192.png"/><link rel="manifest" href="/etherjot/manifest.json"/><title>Etherjot</title><script defer="defer" src="/etherjot/static/js/main.d74a0875.js"></script><link href="/etherjot/static/css/main.d4b9c69a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Binary file added dist/etherjot/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/etherjot/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions dist/etherjot/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Binary file added dist/etherjot/no.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions dist/etherjot/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Binary file added dist/etherjot/space-grotesk.woff2
Binary file not shown.
2 changes: 2 additions & 0 deletions dist/etherjot/static/css/main.d4b9c69a.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/etherjot/static/css/main.d4b9c69a.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/etherjot/static/js/main.d74a0875.js

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions dist/etherjot/static/js/main.d74a0875.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*! MIT License. Copyright 2015-2022 Richard Moore <[email protected]>. See LICENSE.txt. */

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */

/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* Function that converts Node's Readable into WHATWG ReadableStream
*
* Taken over from https://github.com/gwicke/node-web-streams/blob/master/lib/conversions.js
* Because it uses forked web-streams-polyfill that are outdated.
*
* @author https://github.com/gwicke
* @licence Apache License 2.0 https://github.com/gwicke/node-web-streams/blob/master/LICENSE
* @param nodeStream
*/

/**
* Function that converts WHATWG ReadableStream into Node's Readable
*
* Taken over from https://github.com/gwicke/node-web-streams/blob/master/lib/conversions.js
* Because it uses forked web-streams-polyfill that is outdated.
*
* **Warning!**
* If you want to use this function in browser you have to polyfill `stream` package with your bundler.
*
* @author https://github.com/gwicke
* @licence Apache License 2.0 https://github.com/gwicke/node-web-streams/blob/master/LICENSE
* @param webStream
* @param options
*/

/**
* Taken over from https://github.com/gwicke/node-web-streams/blob/master/lib/conversions.js
* Because it uses forked web-streams-polyfill that are outdated.
*
* @author https://github.com/gwicke
* @licence Apache License 2.0 https://github.com/gwicke/node-web-streams/blob/master/LICENSE
*/

/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [[email protected]]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/

/**!
* @uiw/copy-to-clipboard v1.0.15
* Copy to clipboard.
*
* Copyright (c) 2023 Kenny Wang
* https://github.com/uiwjs/copy-to-clipboard.git
*
* @website: https://uiwjs.github.io/copy-to-clipboard

* Licensed under the MIT license
*/
1 change: 1 addition & 0 deletions dist/etherjot/static/js/main.d74a0875.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file added dist/etherjot/yes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ import { port } from './port'
export function openDashboardInBrowser() {
shell.openExternal(`http://localhost:${port.value}/dashboard/?v=${getApiKey()}`)
}

export function openEtherjotInBrowser() {
shell.openExternal(`http://localhost:${port.value}/etherjot`)
}
2 changes: 1 addition & 1 deletion src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function runDownloader(force = false): Promise<void> {
}
await ensureDir(paths.data)
await ensureAsset(
`https://github.com/ethersphere/bee/releases/download/v1.17.4/bee-${platformString}-${archString}${suffixString}`,
`https://github.com/ethersphere/bee/releases/download/v1.17.5/bee-${platformString}-${archString}${suffixString}`,
`bee${suffixString}`,
{ chmod: process.platform !== 'win32', force },
)
Expand Down
13 changes: 12 additions & 1 deletion src/electron.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app, Menu, nativeTheme, Tray } from 'electron'
import opener from 'opener'
import { openDashboardInBrowser } from './browser'
import { openDashboardInBrowser, openEtherjotInBrowser } from './browser'
import { runLauncher } from './launcher'
import { BeeManager } from './lifecycle'
import { createNotification } from './notify'
Expand Down Expand Up @@ -29,6 +29,17 @@ export function rebuildElectronTray() {
},
},
{ type: 'separator' },
{
type: 'submenu',
label: 'Apps',
submenu: [
{
label: 'Etherjot (demo)',
click: openEtherjotInBrowser,
},
],
},
{ type: 'separator' },
{
label: 'Logs',
click: async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ import { getStatus } from './status'
import { swap } from './swap'

const UI_DIST = path.join(__dirname, '..', '..', 'ui')
const ETHERJOT_DIST = path.join(__dirname, '..', '..', 'etherjot')

const AUTO_UPDATE_ENABLED_PLATFORMS = ['darwin', 'win32']

export function runServer() {
const app = new Koa()
logger.info(`Serving UI from path: ${UI_DIST}`)
app.use(mount('/dashboard', serve(UI_DIST)))
logger.info(`Serving Etherjot from path: ${ETHERJOT_DIST}`)
app.use(mount('/etherjot', serve(ETHERJOT_DIST)))

app.use(async (context, next) => {
const corsOrigin = process.env.NODE_ENV === 'development' ? '*' : `http://localhost:${port.value}`
Expand Down
14 changes: 7 additions & 7 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "http://localhost:5000/dashboard",
"dependencies": {
"@ethersphere/bee-dashboard": "^0.24.0",
"@ethersphere/bee-dashboard": "^0.24.1",
"@types/jest": "^28.1.3",
"@types/node": "^18.0.0",
"@types/react": "^18.0.14",
Expand Down
Loading