Skip to content

Commit

Permalink
feat: add etherjot (#393)
Browse files Browse the repository at this point in the history
* feat: upgrade to bee 1.17.5

* feat: add etherjot
  • Loading branch information
Cafe137 authored Dec 4, 2023
1 parent 9df3cc6 commit 721c51a
Show file tree
Hide file tree
Showing 21 changed files with 192 additions and 2 deletions.
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.

1 change: 1 addition & 0 deletions dist/etherjot/static/media/index.93ef761341cad87ea7f1.cjs

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`)
}
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

0 comments on commit 721c51a

Please sign in to comment.