Compare commits

...
61 Commits
Author SHA1 Message Date
zramsay fc83856e11 Merge pull request 'Update package version' (#56) from zramsay-patch-2 into main
Reviewed-on: cerc-io/laconic-console#56
2024-08-09 19:10:42 +00:00
zramsay c1e368b3b0 Update package version 2024-08-09 19:09:54 +00:00
zramsay db449e9fe2 Merge pull request 'style/laconic-colors' (#55) from style/laconic-colors into main
Reviewed-on: cerc-io/laconic-console#55
2024-08-09 17:49:56 +00:00
Monkey b1f95b488c add favicon, hard code site title 2024-08-09 10:16:13 -04:00
Monkey fc76478b8a background for sidebar, tabs and footer darker, inner container lighter 2024-08-09 00:02:37 -04:00
cfbender 4afadb9502 style: json tree view 2024-08-08 23:44:55 -04:00
Monkey bff6749a91 lighten background color, footer background color and border 2024-08-08 23:44:49 -04:00
cfbender a4c15a4d3f chore: undo json comment 2024-08-08 23:16:25 -04:00
cfbender 3ead0ee0d0 style: appbar logo 2024-08-08 23:00:38 -04:00
cfbender aa794637d1 style: font 2024-08-08 22:45:58 -04:00
Monkey 956c84c17e sidebar icon selected color matches font color 2024-08-08 22:36:39 -04:00
cfbender ccb31956a8 style: some more colors 2024-08-08 22:24:20 -04:00
cfbender 01122eb7a8 style: set primary to laconic blue 2024-08-08 22:12:38 -04:00
prathamesh 740143ce7d Update package version (#54)
Part of [Rename laconic2d to laconicd](https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7)

Reviewed-on: cerc-io/laconic-console#54
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-25 07:04:11 +00:00
nabarun 4150076469 Rename laconic2d to laconicd repo in readme (#53)
Part of [Rename laconic2d to laconicd](https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7)

Reviewed-on: cerc-io/laconic-console#53
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-07-23 04:54:40 +00:00
nabarun 7330d03c3c Upgrade registry-sdk package version (#51)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

Reviewed-on: cerc-io/laconic-console#51
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-07-22 06:22:21 +00:00
prathameshandneeraj 06726b019d Upgrade registry-sdk version with changes for renaming laconic2d to laconicd (#50)
Part of https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Reviewed-on: cerc-io/laconic-console#50
Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
2024-04-02 13:57:45 +00:00
nabarun 61f445abe5 Update steps for running with laconic2d (#48)
Part of https://www.notion.so/Create-laconic-registry-SDK-d3a636d4aba44f7cbba3bd99b7146811?pvs=23

Reviewed-on: cerc-io/laconic-console#48
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-03-22 06:32:06 +00:00
prathameshandneeraj ef73da7ec5 Use registry-sdk and update minor version (#47)
Part of https://www.notion.so/Create-laconic-registry-SDK-d3a636d4aba44f7cbba3bd99b7146811?pvs=23

- Rename `crn` to `lrn`

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Reviewed-on: cerc-io/laconic-console#47
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-03-18 13:23:29 +00:00
prathamesh b9fd355a0e Upgrade SDK version (#46)
Part of cerc-io/laconicd#144

Reviewed-on: cerc-io/laconic-console#46
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-02-08 06:17:56 +00:00
telackey 39ec9a2e31 Fix GQL QueryLink (#45)
Reviewed-on: cerc-io/laconic-console#45
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-01-16 23:40:42 +00:00
telackey 6f77228f73 v1.3.6 2024-01-15 15:46:05 -06:00
telackey 475f53cdcf v1.3.5 2024-01-15 15:29:37 -06:00
telackey 9dcbc6e657 Update version (#44)
Reviewed-on: cerc-io/laconic-console#44
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-01-15 21:12:31 +00:00
telackey 3458f454a6 Update SDK 2024-01-15 12:34:56 -06:00
dboreham 83fca9efe9 Update yarn.lock 2023-04-17 12:56:41 -06:00
dboreham b05706986b Merge pull request #39 from cerc-io/dboreham/update-react-ux
Update to latest version of @lirewine/react-ux
2023-04-11 14:07:21 -06:00
dboreham 3fe735cb9f Update to latest version of @lirewine/react-ux 2023-04-11 14:06:44 -06:00
dboreham 4d3f7d0598 Merge pull request #38 from cerc-io/dboreham/make-hostable
Add config to drive self-hosting webapp scheme in stack orchestrator
2023-04-01 13:39:32 -06:00
dboreham 59ec22ea34 Make default config file the same as before 2023-04-01 13:38:01 -06:00
dboreham e1b05a4c34 Use lowercase 2023-03-31 14:55:09 -06:00
dboreham 41d2278463 Use hosting config in build 2023-03-31 06:21:34 -06:00
dboreham 97a100d52f Add hosting template config file 2023-03-30 22:07:21 -06:00
dboreham a1bd672182 Merge pull request #36 from cerc-io/dboreham/publish-aware
Make console publishable as an npm package
2023-03-23 10:10:34 -06:00
dboreham 402599662b Make console publishable as an npm package 2023-03-23 10:09:34 -06:00
dboreham c662128f7a Fix legacy text 2023-03-22 13:32:08 -06:00
Zach 0266e7614e Merge pull request #27 from cerc-io/dboreham/remove-lerna
Remove lerna and update dependencies to modern versions
2023-03-22 08:27:59 -04:00
Zach 052bf92486 Merge pull request #35 from cerc-io/zach/readme
update readme & remove old image
2023-03-22 08:27:04 -04:00
zramsay 8d7b41abcb update readme & rm old image 2023-03-22 08:24:17 -04:00
dboreham f8c8ac1ba6 Finally working 2023-03-21 14:22:29 -06:00
dboreham 1f597fb21a Remove old package.json 2023-03-21 09:42:03 -06:00
dboreham b82e553001 Fix webpack config for non-workspace repo 2023-03-21 09:41:03 -06:00
dboreham 5df8740c55 Remove unnecessary plugin 2023-03-21 09:17:30 -06:00
dboreham 9dd46987e9 Another swipe with the scythe 2023-03-21 09:15:43 -06:00
dboreham 62ac7d66e2 Update more depedencies 2023-03-21 01:22:47 -06:00
David Boreham b8ab4368af Update package name and webpack-cli 2023-03-20 19:04:08 -06:00
David Boreham 9282e9ea26 New yarn.lock 2023-03-20 02:30:25 -06:00
David Boreham f1009e6daa First cut at de-lernaizing 2023-03-20 02:23:46 -06:00
dboreham 64768e1dc5 Merge pull request #24 from cerc-io/dboreham/update-dependencies
Fix incompatibility with latest Node.js
2023-03-20 02:12:26 -06:00
David Boreham 072bb718e3 Update webpack-cli at top level 2023-03-20 02:09:40 -06:00
David Boreham 4c8f2a1a26 Webpack v5 working 2023-03-19 20:28:14 -06:00
David Boreham ce7209453f Fix webpack migration issues 2023-03-19 20:19:28 -06:00
David Boreham 1aca4e062f Work around error to do with new Node.js or new webpack 2023-03-19 19:24:55 -06:00
David Boreham 2e4f0827d1 Update config to suit current webpack 2023-03-19 19:11:48 -06:00
David Boreham a7aaf88d88 Fix merge conflicts 2023-03-19 18:46:43 -06:00
dboreham 3b9af1f222 Merge pull request #25 from cerc-io/dboreham/cleanup-old-files
Dboreham/cleanup old files
2023-03-19 18:41:05 -06:00
David Boreham 30d9841e5e Remove git hook package 2023-03-19 18:32:41 -06:00
David Boreham 20033ef102 Remove IDEA config files 2023-03-19 18:18:18 -06:00
David Boreham 1fd9351a56 Begin to try to fix incompatibility with latest Node.js 2023-03-19 18:12:09 -06:00
Zach 8ea5a49d50 Merge pull request #23 from cerc-io/zramsay-patch-2
Bump laconic-sdk to 0.1.6
2023-03-15 21:37:18 -04:00
Zach 8322154f77 Update package.json 2023-03-10 09:19:33 -05:00
114 changed files with 5231 additions and 13577 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Publish npm package to gitea
on:
release:
types: [published]
jobs:
npm_publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download yarn
run: |
curl -fsSL -o /usr/local/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.21/yarn-1.22.21.js
chmod +x /usr/local/bin/yarn
- name: Install jq
run: |
apt update && apt install -y jq
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: Run yarn build
run: |
LACONIC_HOSTED_CONFIG_FILE=config-hosted.yml yarn dist
- name: Configure git.vdb.to npm registry
run: |
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
- name: Authenticate to git.vdb.to registry
run: |
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.CICD_PUBLISH_TOKEN }}"
- name: npm publish
run: |
npm publish
-5
View File
@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
-11
View File
@@ -1,11 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
</project>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/console.iml" filepath="$PROJECT_DIR$/.idea/console.iml" />
</modules>
</component>
</project>
-12
View File
@@ -1,12 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="client" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/packages/console-app/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
-12
View File
@@ -1,12 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="server" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/packages/console-server/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
-2
View File
@@ -1,2 +0,0 @@
@cerc-io:registry=https://git.vdb.to/api/packages/cerc-io/npm/
@lirewine:registry=https://git.vdb.to/api/packages/cerc-io/npm/
+16 -22
View File
@@ -1,29 +1,27 @@
# Console
Laconic Kubenet GraphQL server and console application.
Laconic console application.
User interface for submitting and reading records registered on Laconic.
![Console](./docs/images/console.png)
## Development
* Clone the required repos:
* [laconicd](https://github.com/cerc-io/laconicd)
* [laconicd](https://git.vdb.to/cerc-io/laconicd)
```bash
git clone git@github.com:cerc-io/laconicd.git
git clone git@git.vdb.to:cerc-io/laconicd.git
```
* Run the `laconicd` chain:
* In [laconicd](https://github.com/cerc-io/laconicd) repo, start the chain
* In [laconicd](https://git.vdb.to/cerc-io/laconicd) repo, start the chain
```bash
./init.sh
./scripts/init.sh clean
```
* Run the laconic-console app
* In [laconic-console](https://github.com/cerc-io/laconic-console) repo, install dependencies
* From the root of this repo, run:
```bash
yarn
@@ -40,27 +38,23 @@ User interface for submitting and reading records registered on Laconic.
This can be ignored as it is an error for installing optional dependency
* Change directory to [packages/console-app](https://github.com/cerc-io/laconic-console/tree/main/packages/console-app) and start the react app
* Start the app:
```bash
# Change directory
cd packages/console-app/
# Start app
CONFIG_FILE=config-local.yml yarn start
```
* Open console-app at <http://localhost:8080>
* Open console at <http://localhost:8080>
* To view records in the app, test suite in laconic-sdk can be run
* To view records in the console, the test suite in registry-sdk can be run
* Clone the [laconic-sdk](https://github.com/cerc-io/laconic-sdk) repo:
* Clone the [registry-sdk](https://git.vdb.to/cerc-io/registry-sdk) repo:
```bash
git clone git@github.com:cerc-io/laconic-sdk.git
git clone git@git.vdb.to:cerc-io/registry-sdk.git
```
* In [laconic-sdk](https://github.com/cerc-io/laconic-sdk) repo, copy [.env.example](https://github.com/cerc-io/laconic-sdk/blob/main/.env.example) file and create a `.env` file
* In [registry-sdk](https://git.vdb.to/cerc-io/registry-sdk) repo, copy [.env.example](https://git.vdb.to/cerc-io/registry-sdk/blob/main/.env.example) file and create a `.env` file
```bash
cp .env.example .env
@@ -69,7 +63,7 @@ User interface for submitting and reading records registered on Laconic.
* Export the private key using:
```bash
laconicd keys export mykey --unarmored-hex --unsafe
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
```
* Copy the private key exported above and assign it to variable `PRIVATE_KEY` in the `.env` file.
@@ -80,12 +74,12 @@ User interface for submitting and reading records registered on Laconic.
yarn
```
* Run the tests in laconic-sdk repo:
* Run the tests in registry-sdk repo:
```bash
yarn test
```
*NOTE*: One test from [util.test.ts](https://github.com/cerc-io/laconic-sdk/blob/main/src/util.test.ts) fails as mentioned in the [PR](https://github.com/cerc-io/laconic-sdk/pull/5#issuecomment-1299572012)
*NOTE*: One test from [util.test.ts](https://git.vdb.to/cerc-io/registry-sdk/blob/main/src/util.test.ts) fails as mentioned in the [PR](https://git.vdb.to/cerc-io/registry-sdk/pull/5#issuecomment-1299572012)
* Open console-app at <http://localhost:8080> to view the records.
* Open console at <http://localhost:8080> to view the records.
@@ -12,7 +12,6 @@ module.exports = {
'import-graphql',
'inline-json-import',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-export-default-from'
'@babel/plugin-proposal-class-properties'
]
};
+42
View File
@@ -0,0 +1,42 @@
#
# NODE_ENV=development
# NOTE: Set CONFIG_FILE to swap out this config file.
#
# TODO: write a tool to automated insertion of the template strings in files like this.
app:
title: 'Console'
org': 'Laconic'
theme: 'dark'
website: 'LACONIC_HOSTED_CONFIG_app_website' # e.g. https://laconic.com
publicUrl: '/console'
api:
server: 'LACONIC_HOSTED_CONFIG_api_server' # e.g. http://127.0.0.1:9004
path: '/api'
intervalLog: 5000
pollInterval: 10000
system:
debug: 'laconic:console:*'
services:
app:
prefix: '/app'
server: 'LACONIC_HOSTED_CONFIG_services_app_server' # e.g. http://127.0.0.1:5999
wns:
server: 'LACONIC_HOSTED_CONFIG_services_wns_server' # e.g. http://127.0.0.1:9473/api
webui: 'LACONIC_HOSTED_CONFIG_services_wns_webui' # e.g. http://127.0.0.1:9473/console
signal:
server: 'LACONIC_HOSTED_CONFIG_services_signal_server' # e.g. ws://127.0.0.1:4000
api: 'LACONIC_HOSTED_CONFIG_services_signal_api' # e.g. http://127.0.0.1:4000/api
ipfs:
server: 'LACONIC_HOSTED_CONFIG_services_ipfs_server' # e.g. http://127.0.0.1:5001
gateway: 'LACONIC_HOSTED_CONFIG_services_ipfs_gateway' # e.g. http://127.0.0.1:8888/ipfs/
wellknown:
endpoint: 'LACONIC_HOSTED_CONFIG_services_wellknown_endpoint' # e.g. http://127.0.0.1:9000/.well-known/laconic
@@ -5,7 +5,7 @@
app:
title: 'Console'
org': 'Laconic'
org: 'Laconic'
theme: 'dark'
website: 'https://laconic.com'
publicUrl: '/console'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 KiB

-5
View File
@@ -1,5 +0,0 @@
{
"version": "1.2.9",
"useWorkspaces": true,
"npmClient": "yarn"
}
+74 -52
View File
@@ -1,69 +1,91 @@
{
"name": "laconic-console",
"version": "1.2.9-alpha.0",
"name": "@cerc-io/console-app",
"version": "0.2.2",
"description": "Laconic Console",
"main": "index.js",
"private": true,
"repository": "https://github.com/cerc-io/laconic-console",
"main": "dist/es/index.js",
"files": [
"dist/*", "src/*"
],
"scripts": {
"build": "lerna run build",
"clean": "lerna run clean",
"lint": "lerna run lint",
"lint:fix": "lerna run lint -- --fix",
"lint:staged": "lint-staged",
"sort-package-json": "lerna exec npx sort-package-json",
"test": "lerna run test"
"analyzer": "webpack --config webpack-analyzer.config.js",
"build": "yarn dist",
"build:babel": "babel ./src --out-dir ./dist/es --ignore \"**/*.test.js\" --source-maps inline",
"clean": "rm -rf dist",
"updatever": "scripts/update_version.sh > src/version.json",
"dist": "yarn clean && yarn updatever && yarn build:babel && CONFIG_FILE=${LACONIC_HOSTED_CONFIG_FILE:-config-production.yml} webpack",
"lint": "semistandard 'src/**/*.js'",
"start": "CONFIG_FILE=${CONFIG_FILE:-config-testnet.yml} VERBOSE=true webpack-dev-server --mode development",
"test": "jest --rootDir ./src --passWithNoTests --no-cache"
},
"author": "",
"license": "AGPLv3",
"workspaces": {
"packages": [
"packages/*"
]
},
"license": "GPL-3.0",
"browserslist": [
"> 5%"
"> 2%"
],
"jest": {
"testEnvironment": "node"
},
"dependencies": {
"lerna": "^3.19.0"
"@apollo/client": "^3.7.10",
"@apollo/react-components": "^4.0.0",
"@apollo/react-hooks": "^4.0.0",
"@babel/runtime": "^7.21.0",
"@cerc-io/registry-sdk": "^0.2.2",
"@lirewine/debug": "1.0.0-beta.78",
"@lirewine/gem-core": "1.0.0-beta.28",
"@lirewine/react-ux": "1.1.0-beta.1",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@material-ui/lab": "^4.0.0-alpha.61",
"@rehooks/component-size": "^1.0.3",
"@visx/network": "^1.0.0",
"@visx/tooltip": "^1.0.0",
"@visx/zoom": "^1.0.0",
"build-url": "^2.0.0",
"clsx": "^1.1.0",
"compare-versions": "^3.6.0",
"d3-force": "^2.1.1",
"debug": "^4.1.1",
"graphql-tag": "^2.10.3",
"lodash.defaultsdeep": "^4.6.1",
"lodash.get": "^4.4.2",
"moment": "^2.26.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"source-map-support": "^0.5.12"
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-config-semistandard": "^15.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-loader": "^3.0.3",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-jsdoc": "^21.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-standard": "^4.0.1",
"lint-staged": "^9.5.0",
"pre-commit": "^1.2.2",
"webpack-cli": "^3.3.11"
"@babel/cli": "7.21.0",
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@webpack-cli/info": "^2.0.1",
"babel-jest": "^29.5.0",
"babel-loader": "^9.1.2",
"babel-plugin-import-graphql": "^2.7.0",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-json-import": "^0.3.2",
"dotenv-webpack": "^8.0.1",
"graphql": "^15.0.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^29.5.0",
"webpack": "^5.76.2",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.1",
"webpack-merge": "^5.8.0",
"webpack-version-file-plugin": "^0.5.0",
"yaml-loader": "^0.8.0"
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": [
"plugin:jest/recommended",
"semistandard"
],
"plugins": [
"babel"
],
"rules": {
"babel/semi": 1
}
"peerDependencies": {
"react": "16.12.0",
"react-dom": "^16.12.0"
},
"semistandard": {
"parser": "babel-eslint",
"env": [
"jest",
"node",
"browser"
]
"publishConfig": {
"access": "public"
}
}
-58
View File
@@ -1,58 +0,0 @@
# Console
Apollo GraphQL client.
## Usage
First start the server:
```bash
cd packages/console-server
yarn start
```
Then start the Webpack devserver.
```bash
cd packages/console-app
yarn start
```
Then load the app: http://localhost:8080.
## Using a KUBE
To use your KUBE for testing, rather than running all the services locally, specify a different
config file when starting: `config-kube.yml`, which connects to `kube.local` for all services.
For example:
```javascript
cd packages/console-app
CONFIG_FILE=config-kube.yml yarn start
```
## Deploy
```bash
yarn build
```
This creates the following folders:
```
/dist
/es # Module imports.
/production # Production build.
```
NOTE: GQL and Production files and exported and may be used by the server.
```javascript
import SYSTEM_STATUS from '@cerc-io/console-app/src/gql/system_status.graphql';
...
const file = path.join(__dirname + '../../../../node_modules/@cerc-io/console-app/dist/production', 'index.html');
res.sendFile(file);
```
-133
View File
@@ -1,133 +0,0 @@
{
"name": "@cerc-io/console-app",
"version": "1.2.9",
"description": "Kubenet Console Client",
"repository": "https://github.com/cerc-io/laconic-console",
"main": "dist/es/index.js",
"files": [
"src/gql"
],
"scripts": {
"analyzer": "webpack --config webpack-analyzer.config.js",
"build": "yarn dist",
"build:babel": "babel ./src --out-dir ./dist/es --ignore \"**/*.test.js\" --source-maps inline",
"clean": "rm -rf dist",
"dist": "yarn clean && yarn build:babel && CONFIG_FILE=config-production.yml webpack",
"lint": "semistandard 'src/**/*.js'",
"start": "CONFIG_FILE=${CONFIG_FILE:-config-testnet.yml} VERBOSE=true webpack-dev-server --mode development",
"test": "jest --rootDir ./src --passWithNoTests --no-cache"
},
"author": "",
"license": "GPL-3.0",
"browserslist": [
"> 2%"
],
"jest": {
"testEnvironment": "node"
},
"dependencies": {
"@apollo/react-components": "^3.1.5",
"@apollo/react-hooks": "^3.1.5",
"@babel/runtime": "^7.8.7",
"@cerc-io/laconic-sdk": "0.1.4",
"@lirewine/debug": "1.0.0-beta.78",
"@lirewine/gem-core": "1.0.0-beta.28",
"@lirewine/react-ux": "1.1.0-beta.0",
"@material-ui/core": "^4.10.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.54",
"@rehooks/component-size": "^1.0.3",
"@visx/network": "^1.0.0",
"@visx/tooltip": "^1.0.0",
"@visx/zoom": "^1.0.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-http": "^1.5.17",
"build-url": "^2.0.0",
"clsx": "^1.1.0",
"compare-versions": "^3.6.0",
"d3-force": "^2.1.1",
"debug": "^4.1.1",
"graphql-tag": "^2.10.3",
"lodash.defaultsdeep": "^4.6.1",
"lodash.get": "^4.4.2",
"moment": "^2.26.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"source-map-support": "^0.5.12"
},
"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "^7.4.5",
"@babel/node": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-export-default-from": "^7.8.3",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@webpack-cli/info": "^0.2.0",
"@webpack-cli/init": "^0.3.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.0",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-import-graphql": "^2.7.0",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-json-import": "^0.3.2",
"dotenv-webpack": "^1.8.0",
"eslint": "^6.7.2",
"eslint-config-semistandard": "^15.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-jsx": "^8.1.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-jsdoc": "^21.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-standard": "^4.0.1",
"graphql": "^15.0.0",
"html-webpack-plugin": "^4.3.0",
"jest": "^24.8.0",
"react-scripts": "^3.4.1",
"semistandard": "^14.2.0",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2",
"webpack-version-file-plugin": "^0.4.0",
"yaml-loader": "^0.6.0"
},
"peerDependencies": {
"react": "16.12.0",
"react-dom": "^16.12.0"
},
"publishConfig": {
"access": "public"
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": [
"plugin:jest/recommended",
"semistandard",
"standard-jsx"
],
"plugins": [
"babel"
],
"rules": {
"babel/semi": 1
}
},
"semistandard": {
"parser": "babel-eslint",
"env": [
"jest",
"node",
"browser"
]
}
}
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= title %></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
@@ -1,84 +0,0 @@
//
// Copyright 2020 DXOS.org
//
import React from 'react';
import { makeStyles } from '@material-ui/core';
import MuiAppBar from '@material-ui/core/AppBar';
import Link from '@material-ui/core/Link';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import blueGrey from '@material-ui/core/colors/blueGrey';
// import GraphQLIcon from '@material-ui/icons/Adb';
// import LaconicIcon from '../icons/Laconic';
// import { graphqlApi } from '../client';
const useStyles = makeStyles((theme) => ({
offset: theme.mixins.denseToolbar,
logo: {
marginRight: theme.spacing(2),
color: theme.palette.grey[800],
'& svg': {
width: 100,
height: 48
}
},
logoLink: {
lineHeight: 0
},
title: {
display: 'flex',
flex: 1,
marginTop: 2,
color: theme.palette.grey[800]
},
link: {
color: blueGrey[900]
}
}));
const AppBar = ({ config }) => {
const classes = useStyles();
return (
<>
<MuiAppBar position='fixed' elevation={0}>
<Toolbar>
<Link classes={{ root: classes.logoLink }} href='/'>
{/* <div className={classes.logo}>
<LaconicIcon />
</div> */}
<div className={classes.title}>
<Typography variant='h6'>Laconic</Typography>
</div>
</Link>
&nbsp;
<div className={classes.title}>
<Typography variant='h6'>{config.app.title}</Typography>
</div>
{/* <div>
<Link
className={classes.link}
href={graphqlApi(config)}
rel='noreferrer'
target='_blank'
title='Console GraphQL'
>
<GraphQLIcon />
</Link>
</div> */}
</Toolbar>
</MuiAppBar>
<div className={classes.offset} />
</>
);
};
export default AppBar;
@@ -1,26 +0,0 @@
//
// Copyright 2020 DXOS.org
//
import React from 'react';
import { makeStyles } from '@material-ui/core';
import { JsonTreeView } from '@lirewine/react-ux';
import { omitDeep } from '../util/omit';
const useStyles = makeStyles(() => ({
root: {
flex: 1
}
}));
const Json = ({ data }) => {
const classes = useStyles();
return (
<JsonTreeView className={classes.root} data={omitDeep(data, '__typename')} />
);
};
export default Json;
@@ -1,100 +0,0 @@
//
// Copyright 2020 DXOS.org
//
import clsx from 'clsx';
import React from 'react';
import { useHistory, useParams } from 'react-router';
// import { useQuery } from '@apollo/react-hooks';
import { makeStyles } from '@material-ui/core';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import LinkIcon from '@material-ui/icons/ExitToApp';
import ListItemText from '@material-ui/core/ListItemText';
// import EXTENSIONS from '../gql/extensions.graphql';
// import { useQueryStatusReducer } from '../hooks';
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
flex: 1,
flexDirection: 'column',
justifyContent: 'space-between'
},
list: {
padding: 0
},
icon: {
minWidth: 40,
color: theme.palette.grey[500]
},
selected: {
color: theme.palette.primary.main
},
expand: {
flex: 1
}
}));
const Sidebar = ({ modules: { services, settings } }) => {
const classes = useStyles();
const history = useHistory();
const { module } = useParams();
// const { data: extensionsData } = useQueryStatusReducer(useQuery(EXTENSIONS));
// const extensions = extensionsData ? JSON.parse(extensionsData.extensions.json) : [];
const extensions = [];
const isSelected = path => path === `/${module}`;
const Modules = ({ modules }) => (
<List aria-label='items' className={classes.list}>
{modules.map(({ path, title, icon: Icon }) => (
<ListItem button selected={isSelected(path)} key={path} onClick={() => history.push(path)}>
<ListItemIcon classes={{ root: classes.icon }}>
<Icon className={clsx(classes.icon, isSelected(path) && classes.selected)} />
</ListItemIcon>
<ListItemText primary={title} />
</ListItem>
))}
</List>
);
const Extensions = ({ extensions }) => (
<List aria-label='items' className={classes.list}>
{extensions.map(({ url, title }) => {
url = url
.replace('%HOST%', window.location.host)
.replace('%PORT%', window.location.port)
.replace('%PROTOCOL%', window.location.protocol);
return (
<ListItem button key={url} onClick={() => { window.location = url; return true; }}>
<ListItemIcon classes={{ root: classes.icon }}>
<LinkIcon className={clsx(classes.icon)} />
</ListItemIcon>
<ListItemText primary={title} />
</ListItem>
);
}
)}
</List>
);
return (
<div className={classes.root}>
<Modules modules={services} />
<Extensions extensions={extensions} />
<div className={classes.expand} />
<Modules modules={settings} />
</div>
);
};
export default Sidebar;
@@ -1,32 +0,0 @@
//
// Copyright 2020 DXOS.org
//
import React from 'react';
import { makeStyles } from '@material-ui/core';
import MuiToolbar from '@material-ui/core/Toolbar';
const useStyles = makeStyles(theme => ({
toolbar: {
display: 'flex',
justifyContent: 'space-between',
whiteSpace: 'nowrap',
'& > button': {
margin: theme.spacing(0.5)
}
}
}));
// TODO(burdon): Tabs.
const Toolbar = ({ children }) => {
const classes = useStyles();
return (
<MuiToolbar disableGutters className={classes.toolbar}>
{children}
</MuiToolbar>
);
};
export default Toolbar;
-37
View File
@@ -1,37 +0,0 @@
//
// Copyright 2020 DXOS.org
//
import React from 'react';
import SvgIcon from '@material-ui/core/SvgIcon';
// TODO(burdon): Fixed color?
const Icon = (props) => (
<SvgIcon {...props} viewBox='0 0 256 256'>
<g transform='matrix(1,0,0,1,-160,-124)'>
<path
d='M282.254,147.134L195.254,194.589C191.399,196.692 189,200.732 189,205.124L189,298.876C189,303.268 191.399,307.308 195.254,309.411L282.254,356.866C285.836,358.819 290.164,358.819 293.746,356.866L380.746,309.411C384.601,307.308 387,303.268 387,298.876L387,205.124C387,200.732 384.601,196.692 380.746,194.589L293.746,147.134C290.164,145.181 285.836,145.181 282.254,147.134Z'
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '12px' }}
/>
<path
d='M288,252L216,216'
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
/>
<path
d='M216,288L288,252'
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
/>
<path
d='M360,288L288,252'
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
/>
<path
d='M360,216L288,252'
style={{ fill: 'none', fillRule: 'nonzero', stroke: 'rgb(0,68,121)', strokeWidth: '8px', strokeLinejoin: 'round' }}
/>
</g>
</SvgIcon>
);
export default Icon;
-79
View File
@@ -1,79 +0,0 @@
//
// Copyright 2019 DXOS.org
//
import { createTheme as createMuiTheme } from '@material-ui/core/styles';
import teal from '@material-ui/core/colors/teal';
import orange from '@material-ui/core/colors/orange';
export const createTheme = (theme) => createMuiTheme({
// https://material-ui.com/system/shadows
shadows: ['none'],
// https://stackoverflow.com/questions/60567673/reactjs-material-ui-theme-mixins-toolbar-offset-is-not-adapting-when-toolbar
mixins: {
denseToolbar: {
height: 48
}
},
// https://material-ui.com/customization/globals/#default-props
props: {
MuiButtonBase: {
disableRipple: true
},
MuiButton: {
size: 'small'
},
MuiFilledInput: {
margin: 'dense'
},
MuiFormControl: {
margin: 'dense'
},
MuiFormHelperText: {
margin: 'dense'
},
MuiIconButton: {
size: 'small'
},
MuiInputBase: {
margin: 'dense'
},
MuiInputLabel: {
margin: 'dense'
},
MuiTable: {
size: 'small'
},
MuiTextField: {
margin: 'dense'
},
MuiToolbar: {
variant: 'dense'
}
},
// https://material-ui.com/customization/palette/
palette: theme === 'dark' ? {
type: 'dark',
primary: orange
} : {
primary: teal
},
// https://material-ui.com/customization/theming/#theme-configuration-variables
// https://material-ui.com/customization/globals/
overrides: {
MuiCssBaseline: {
'@global': {
body: {
margin: 0,
overflow: 'hidden'
}
}
}
}
});
-7
View File
@@ -1,7 +0,0 @@
{
"build": {
"name": "@cerc-io/console-app",
"buildDate": "2020-12-19T03:06:08.492Z",
"version": "1.2.9-alpha.1"
}
}
-7
View File
@@ -1,7 +0,0 @@
{
"build": {
"name": "<%= package.name %>",
"buildDate": "<%= currentTime.toISOString() %>",
"version": "<%= package.version %>"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+18
View File
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Laconic | Console</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap"
rel="stylesheet" />
</head>
<body>
<div id="root"></div>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
#/bin/bash
NAME=`cat package.json | jq '.name'`
VERSION=`cat package.json | jq '.version'`
DATE=`date --rfc-3339=seconds`
echo '{"build": {}}' | jq ".build.name = $NAME" | jq ".build.version = $VERSION" | jq ".build.buildDate = \"$DATE\""
@@ -2,10 +2,7 @@
// Copyright 2020 DXOS.org
//
import { ApolloClient } from 'apollo-client';
import { ApolloLink } from 'apollo-link';
import { createHttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloClient, InMemoryCache, ApolloLink, HttpLink } from '@apollo/client';
import { createResolvers } from './resolvers';
import { getServiceUrl } from './util/config';
@@ -28,7 +25,7 @@ export const graphqlApi = config => {
*/
export const clientFactory = config => {
// https://www.apollographql.com/docs/link/
const defaultLink = createHttpLink({
const defaultLink = new HttpLink({
uri: graphqlApi(config),
// TODO(burdon): Authentication: send signed message to server (from client wallet).
@@ -39,7 +36,7 @@ export const clientFactory = config => {
});
const serviceLinks = {
signal: createHttpLink({
signal: new HttpLink({
uri: getServiceUrl(config, 'signal.api')
})
};
+94
View File
@@ -0,0 +1,94 @@
//
// Copyright 2020 DXOS.org
//
import React from "react";
import { makeStyles } from "@material-ui/core";
import MuiAppBar from "@material-ui/core/AppBar";
import Divider from "@material-ui/core/Divider";
import Link from "@material-ui/core/Link";
import Toolbar from "@material-ui/core/Toolbar";
import Typography from "@material-ui/core/Typography";
import blueGrey from "@material-ui/core/colors/blueGrey";
// import GraphQLIcon from '@material-ui/icons/Adb';
import LaconicIcon from "../icons/Logo";
// import { graphqlApi } from '../client';
const useStyles = makeStyles((theme) => ({
offset: theme.mixins.denseToolbar,
logo: {
marginRight: theme.spacing(2),
color: theme.palette.grey[800],
"& svg": {
width: 100,
height: 48,
},
},
logoLink: {
lineHeight: 0,
},
title: {
display: "flex",
flex: 1,
marginTop: 2,
color: "#FBFBFB",
},
link: {
color: blueGrey[900],
},
divider: {
backgroundColor: theme.palette.text.primary,
width: "1px",
height: "20px",
alignSelf: "center",
marginRight: 14,
},
}));
const AppBar = ({ config }) => {
const classes = useStyles();
return (
<>
<MuiAppBar position="fixed" elevation={0} color="primary">
<Toolbar>
<Link classes={{ root: classes.logoLink }} href="/">
<div className={classes.logo}>
<LaconicIcon />
</div>
</Link>
<Divider
orientation="vertical"
flexItem
className={classes.divider}
/>
<div className={classes.title}>
<Typography variant="h6">{config.app.title}</Typography>
</div>
{/* <div>
<Link
className={classes.link}
href={graphqlApi(config)}
rel='noreferrer'
target='_blank'
title='Console GraphQL'
>
<GraphQLIcon />
</Link>
</div> */}
</Toolbar>
</MuiAppBar>
<div className={classes.offset} />
</>
);
};
export default AppBar;
@@ -31,9 +31,9 @@ const getAppUrl = (config, { wrn }) => {
* @param {string} name
* @param {string} [text]
*/
const AppLink = ({ config, crn, text }) => {
const fullURL = getAppUrl(config, { crn });
return <Link href={fullURL} target={crn}>{text || crn}</Link>;
const AppLink = ({ config, lrn, text }) => {
const fullURL = getAppUrl(config, { lrn });
return <Link href={fullURL} target={lrn}>{text || lrn}</Link>;
};
export default AppLink;
+38
View File
@@ -0,0 +1,38 @@
//
// Copyright 2020 DXOS.org
//
import React from "react";
import { makeStyles } from "@material-ui/core";
import { JsonTreeView } from "@lirewine/react-ux";
import { omitDeep } from "../util/omit";
const useStyles = makeStyles(() => ({
root: {
flex: 1,
},
}));
const useTreeStyles = makeStyles(
(theme) => ({
colorPrimary: {
color: theme.palette.secondary.main,
},
}),
{ name: "MuiTypography" },
);
const Json = ({ data }) => {
const classes = useStyles();
useTreeStyles();
return (
<JsonTreeView
className={classes.root}
data={omitDeep(data, "__typename")}
/>
);
};
export default Json;
@@ -5,7 +5,7 @@
import React from 'react';
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles(() => ({
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
flexDirection: 'column',
@@ -17,7 +17,8 @@ const useStyles = makeStyles(() => ({
display: 'flex',
flexDirection: 'column',
flex: 1,
overflow: 'hidden'
overflow: 'hidden',
backgroundColor: theme.palette.background.paper,
}
}));
@@ -10,8 +10,41 @@ import LinkIcon from '@material-ui/icons/ExitToApp';
import { getServiceUrl } from '../util/config';
const QUERY = `
query {
getRecordsByIds(ids: [ "%ID%" ]) {
fragment ValueParts on Value {
... on BooleanValue {
bool: value
}
... on IntValue {
int: value
}
... on FloatValue {
float: value
}
... on StringValue {
string: value
}
... on BytesValue {
bytes: value
}
... on LinkValue {
link: value
}
}
fragment AttrParts on Attribute {
key
value {
...ValueParts
... on ArrayValue {
value {
...ValueParts
}
}
}
}
{
getRecordsByIds(ids: ["%ID%"]) {
id
names
bondId
@@ -19,12 +52,12 @@ const QUERY = `
expiryTime
owners
attributes {
key
...AttrParts
value {
string
json
reference {
id
... on MapValue {
map: value {
...AttrParts
}
}
}
}
+138
View File
@@ -0,0 +1,138 @@
//
// Copyright 2020 DXOS.org
//
import clsx from "clsx";
import React from "react";
import { useHistory, useParams } from "react-router";
// import { useQuery } from '@apollo/react-hooks';
import { makeStyles } from "@material-ui/core";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import ListItemIcon from "@material-ui/core/ListItemIcon";
import LinkIcon from "@material-ui/icons/ExitToApp";
import ListItemText from "@material-ui/core/ListItemText";
// import EXTENSIONS from '../gql/extensions.graphql';
// import { useQueryStatusReducer } from '../hooks';
const useStyles = makeStyles((theme) => ({
root: {
display: "flex",
flex: 1,
flexDirection: "column",
justifyContent: "space-between",
},
list: {
padding: 0,
},
listItem: {
display: "flex",
alignItems: "center",
backgroundColor: theme.palette.background.default,
},
selected: {
backgroundColor: theme.palette.background.secondary,
},
itemText: {
fontFamily: '"DM Mono", monospace',
fontWeight: 400,
},
icon: {
minWidth: 40,
color: theme.palette.grey[500],
},
selected: {
color: theme.palette.text.primary,
},
expand: {
flex: 1,
},
}));
const Sidebar = ({ modules: { services, settings } }) => {
const classes = useStyles();
const history = useHistory();
const { module } = useParams();
// const { data: extensionsData } = useQueryStatusReducer(useQuery(EXTENSIONS));
// const extensions = extensionsData ? JSON.parse(extensionsData.extensions.json) : [];
const extensions = [];
const isSelected = (path) => path === `/${module}`;
const Modules = ({ modules }) => (
<List aria-label="items" className={classes.list}>
{modules.map(({ path, title, icon: Icon }) => (
<ListItem
button
selected={isSelected(path)}
key={path}
onClick={() => history.push(path)}
classes={{ root: classes.listItem, selected: classes.selected }}
>
<ListItemIcon classes={{ root: classes.icon }}>
<Icon
className={clsx(
classes.icon,
isSelected(path) && classes.selected,
)}
/>
</ListItemIcon>
<ListItemText
primary={title.toUpperCase()}
classes={{ primary: classes.itemText }}
/>
</ListItem>
))}
</List>
);
const Extensions = ({ extensions }) => (
<List aria-label="items" className={classes.list}>
{extensions.map(({ url, title }) => {
url = url
.replace("%HOST%", window.location.host)
.replace("%PORT%", window.location.port)
.replace("%PROTOCOL%", window.location.protocol);
return (
<ListItem
button
key={url}
onClick={() => {
window.location = url;
return true;
}}
>
<ListItemIcon classes={{ root: classes.icon }}>
<LinkIcon className={clsx(classes.icon)} />
</ListItemIcon>
<ListItemText
primary={title.toUpperCase()}
classes={{ primary: classes.itemText }}
/>
</ListItem>
);
})}
</List>
);
return (
<div className={classes.root}>
<Modules modules={services} />
<Extensions extensions={extensions} />
<div className={classes.expand} />
<Modules modules={settings} />
</div>
);
};
export default Sidebar;
+33
View File
@@ -0,0 +1,33 @@
//
// Copyright 2020 DXOS.org
//
import React from "react";
import { makeStyles } from "@material-ui/core";
import MuiToolbar from "@material-ui/core/Toolbar";
const useStyles = makeStyles((theme) => ({
toolbar: {
display: "flex",
justifyContent: "space-between",
whiteSpace: "nowrap",
"& > button": {
margin: theme.spacing(0.5),
},
color: "primary",
},
}));
// TODO(burdon): Tabs.
const Toolbar = ({ children }) => {
const classes = useStyles();
return (
<MuiToolbar disableGutters className={classes.toolbar}>
{children}
</MuiToolbar>
);
};
export default Toolbar;
@@ -28,7 +28,10 @@ const useStyles = makeStyles((theme) => ({
flexDirection: 'row',
flex: 1,
justifyContent: 'space-between',
backgroundColor: grey[900],
backgroundColor: theme.palette.background.default,
borderTop: 1,
borderTopColor: "rgba(255, 255, 255, 0.12)",
borderTopStyle: "solid",
color: grey[400]
},
left: {
@@ -2,43 +2,48 @@
// Copyright 2020 DXOS.org
//
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core';
import Paper from '@material-ui/core/Paper';
import Tab from '@material-ui/core/Tab';
import Tabs from '@material-ui/core/Tabs';
import TabContext from '@material-ui/lab/TabContext';
import React, { useState } from "react";
import { makeStyles } from "@material-ui/core";
import Paper from "@material-ui/core/Paper";
import Tab from "@material-ui/core/Tab";
import Tabs from "@material-ui/core/Tabs";
import TabContext from "@material-ui/lab/TabContext";
import Panel from '../../../components/Panel';
import Toolbar from '../../../components/Toolbar';
import Panel from "../../../components/Panel";
import Toolbar from "../../../components/Toolbar";
// import LogPoller from '../../../components/LogPoller';
import RegistryLookup, { LookupType } from './RegistryLookup';
import RegistryStatus from './RegistryStatus';
import RegistryRecords from './RegistryRecords';
import RegistryLookup, { LookupType } from "./RegistryLookup";
import RegistryStatus from "./RegistryStatus";
import RegistryRecords from "./RegistryRecords";
// import RegistryRecords, { RecordType } from './RegistryRecords';
const TAB_RECORDS = 'records';
const TAB_STATUS = 'status';
const TAB_LOOKUP = 'lookup';
const TAB_RECORDS = "records";
const TAB_STATUS = "status";
const TAB_LOOKUP = "lookup";
// const TAB_LOG = 'log';
const useStyles = makeStyles(() => ({
expand: {
flex: 1
flex: 1,
},
panel: {
display: 'flex',
overflowY: 'scroll',
flex: 1
display: "flex",
overflowY: "scroll",
flex: 1,
},
paper: {
display: 'flex',
overflow: 'hidden',
flex: 1
}
display: "flex",
overflow: "hidden",
flex: 1,
},
tabs: {
fontFamily: '"DM Mono", monospace',
fontWeight: 400,
},
}));
const Registry = () => {
@@ -51,10 +56,14 @@ const Registry = () => {
<Panel
toolbar={
<Toolbar>
<Tabs value={tab} onChange={(_, value) => setTab(value)}>
<Tab value={TAB_RECORDS} label='Records' />
<Tab value={TAB_LOOKUP} label='Lookup' />
<Tab value={TAB_STATUS} label='Status' />
<Tabs
value={tab}
onChange={(_, value) => setTab(value)}
indicatorColor="primary"
>
<Tab value={TAB_RECORDS} label="Records" className={classes.tabs} />
<Tab value={TAB_LOOKUP} label="Lookup" className={classes.tabs} />
<Tab value={TAB_STATUS} label="Status" className={classes.tabs} />
{/* <Tab value={TAB_LOG} label='Log' /> */}
</Tabs>
@@ -37,7 +37,7 @@ const useStyles = makeStyles(theme => ({
const types = [
{ key: 'authority', label: 'Authority' },
{ key: 'crn', label: 'CRN' }
{ key: 'lrn', label: 'LRN' }
];
export const LookupType = ({ scope = types[0].key, onChange }) => {
@@ -87,7 +87,7 @@ const RegistryLookup = ({ scope }) => {
const getNames = () => {
let ret;
switch (scope) {
case 'crn': {
case 'lrn': {
ret = [];
records.forEach(item => ret.push(...(item.names || [])));
break;
@@ -99,8 +99,8 @@ const RegistryLookup = ({ scope }) => {
const names = new Set();
for (const record of records) {
for (const name of (record.names || [])) {
// TODO(telackey): We need a general purpose CRN handling library.
names.add(name.replace('crn://', '').split('/')[0]);
// TODO(telackey): We need a general purpose LRN handling library.
names.add(name.replace('lrn://', '').split('/')[0]);
}
}
ret = Array.from(names.values());
@@ -120,7 +120,7 @@ const RegistryLookup = ({ scope }) => {
let result;
switch (scope) {
case 'crn':
case 'lrn':
result = await registry.lookupNames([newInputValue], true);
break;
@@ -31,13 +31,13 @@ const useStyles = makeStyles(theme => ({
const types = [
{ key: null, label: 'ALL' },
{ key: 'crn:kube', label: 'Kube' },
{ key: 'crn:service', label: 'Service' },
{ key: 'crn:app', label: 'App' },
{ key: 'crn:bot', label: 'Bot' },
{ key: 'crn:bot-factory', label: 'Bot Factory' },
{ key: 'crn:file', label: 'File' },
{ key: 'crn:type', label: 'Type' }
{ key: 'lrn:kube', label: 'Kube' },
{ key: 'lrn:service', label: 'Service' },
{ key: 'lrn:app', label: 'App' },
{ key: 'lrn:bot', label: 'Bot' },
{ key: 'lrn:bot-factory', label: 'Bot Factory' },
{ key: 'lrn:file', label: 'File' },
{ key: 'lrn:type', label: 'Type' }
];
export const RecordType = ({ type = types[0].key, onChange }) => {
@@ -104,12 +104,12 @@ const RegistryRecords = ({ type }) => {
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
}
if (type === 'crn:app') {
if (type === 'lrn:app') {
appLinks = (
<>
{(names || []).map(crn =>
<div key={crn}>
<AppLink config={config} crn={crn} />
{(names || []).map(lrn =>
<div key={lrn}>
<AppLink config={config} lrn={lrn} />
</div>
)}
</>
@@ -2,7 +2,7 @@
// Copyright 2020 DXOS.org
//
import { Registry } from '@cerc-io/laconic-sdk';
import { Registry } from '@cerc-io/registry-sdk';
import { getServiceUrl } from '../util/config';
+49
View File
@@ -0,0 +1,49 @@
//
// Copyright 2020 DXOS.org
//
import React from "react";
import SvgIcon from "@material-ui/core/SvgIcon";
// TODO(burdon): Fixed color?
const Icon = (props) => (
<SvgIcon {...props} viewBox="0 0 115 20">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M3.37388 10.5194C5.70149 8.19185 7.14225 4.97748 7.1416 1.42853C7.14246 0.94681 7.11586 0.470456 7.063 0L-0.000488281 0.000643078L-0.000273922 13.5723C-0.000917354 15.2174 0.62632 16.863 1.88091 18.1175C3.1356 19.3721 4.78235 20.0001 6.42772 19.9993L6.42729 19.9997L19.9995 20L19.999 12.9355C19.5296 12.8838 19.0532 12.857 18.5704 12.8569C15.0224 12.8574 11.8079 14.298 9.48026 16.6255C7.78654 18.2768 5.07093 18.2771 3.39812 16.6043C1.72638 14.9325 1.72562 12.2161 3.37388 10.5194ZM18.5344 1.46863C16.5837 -0.481929 13.4146 -0.48268 11.4633 1.46863C9.512 3.41984 9.51276 6.58895 11.4633 8.53941C13.415 10.491 16.5831 10.4907 18.5344 8.53941C20.4857 6.5882 20.4861 3.42016 18.5344 1.46863Z"
fill="#FBFBFB"
/>
<path
d="M31.4741 18.5838H39.2552V16.3302H34.075V1.41351H31.4741V18.5838Z"
fill="#FBFBFB"
/>
<path
d="M49.8108 1.41351H45.4976L40.9893 18.5838H43.6769L44.8039 14.2913H50.3744L51.5014 18.5838H54.3191L49.8108 1.41351ZM45.3458 12.145L47.6 3.2593H47.6866L49.8541 12.145H45.3458Z"
fill="#FBFBFB"
/>
<path
d="M62.9292 8.06885H65.9636C65.9636 3.17534 64.3813 1.07196 60.6967 1.07196C56.8169 1.07196 55.1479 3.73341 55.1479 9.97909C55.1479 16.2462 56.8169 18.9291 60.6967 18.9291C64.3813 18.9291 65.9636 16.8901 65.9853 12.1468H62.9508C62.9292 15.8599 62.474 16.7828 60.6967 16.7828C58.6593 16.7828 58.1607 15.4307 58.1824 9.97909C58.1824 4.54896 58.6809 3.19678 60.6967 3.21823C62.474 3.21823 62.9292 4.18413 62.9292 8.06885Z"
fill="#FBFBFB"
/>
<path
d="M73.7781 1.07209C77.7229 1.09364 79.4135 3.77643 79.4135 10.0007C79.4135 16.2249 77.7229 18.9078 73.7781 18.9292C69.8117 18.9507 68.1211 16.2678 68.1211 10.0007C68.1211 3.73354 69.8117 1.05064 73.7781 1.07209ZM71.1555 10.0007C71.1555 15.4308 71.6757 16.783 73.7781 16.783C75.8589 16.783 76.3791 15.4308 76.3791 10.0007C76.3791 4.54909 75.8589 3.19691 73.7781 3.21847C71.6757 3.23992 71.1555 4.59209 71.1555 10.0007Z"
fill="#FBFBFB"
/>
<path
d="M85.0819 18.5624L82.481 18.5838V1.41351H87.0544L91.3243 15.4073H91.3676V1.41351H93.968V18.5838H89.677L85.1254 3.51689H85.0819V18.5624Z"
fill="#FBFBFB"
/>
<path
d="M100.468 1.41351H97.8677V18.5838H100.468V1.41351Z"
fill="#FBFBFB"
/>
<path
d="M111.139 8.06885H114.174C114.174 3.17534 112.591 1.07196 108.906 1.07196C105.028 1.07196 103.358 3.73341 103.358 9.97909C103.358 16.2462 105.028 18.9291 108.906 18.9291C112.591 18.9291 114.174 16.8901 114.195 12.1468H111.161C111.139 15.8599 110.684 16.7828 108.906 16.7828C106.869 16.7828 106.371 15.4307 106.393 9.97909C106.393 4.54896 106.891 3.19678 108.906 3.21823C110.684 3.21823 111.139 4.18413 111.139 8.06885Z"
fill="#FBFBFB"
/>
</SvgIcon>
);
export default Icon;

Some files were not shown because too many files have changed in this diff Show More