Skip to content

Commit 9bf5e83

Browse files
committed
feat: initial import
0 parents  commit 9bf5e83

File tree

294 files changed

+42286
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+42286
-0
lines changed

.eslintrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": ["@yandex-cloud/eslint-config", "prettier"],
3+
"root": true
4+
}

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
/dist
14+
15+
# misc
16+
.idea
17+
.DS_Store
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@yandex-cloud/prettier-config');

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ydb-embedded-ui
2+
3+
Local viewer for YDB clusters
4+
5+
## How to work with this repo
6+
7+
### Development
8+
9+
1) Run on a machine with Docker installed:
10+
```
11+
docker pull registry.yandex.net/yandex-docker-local-ydb:testing`
12+
docker run --hostname localhost -e YDB_ALLOW_ORIGIN="http://localhost:3000" -dp 2135:2135 -dp 8765:8765 registry.yandex.net/yandex-docker-local-ydb:testing
13+
```
14+
2) Run the frontend app in the development mode, via invoking `npm run dev`
15+
3) Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\
16+
You will also see any lint errors in the console.
17+
18+
### Making a production bundle.
19+
20+
Base command `npm run build` builds the app for production to the `build` folder.\
21+
It correctly bundles React in production mode and optimizes the build for the best performance.
22+
23+
The build is minified and the filenames include the hashes.
24+
25+
To test production bundle with latest YDB backend release, do the following:
26+
1) Build a production bundle with a few tweaks for embedded version: `npm run build:embedded`.
27+
2) Invoke `docker run -it --hostname localhost -e YDB_LOCAL_SURVIVE_RESTART=true -dp 2135:2135 -p 8765:8765 -v ~/projects/ydb-embedded-ui-opensource/build:/ydb_data/node_1/contentmonitoring cr.yandex/yc/yandex-docker-local-ydb:latest`
28+
3) Open [embedded YDB UI](http://localhost:8765/monitoring) to view it in the browser.

config-overrides.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const _ = require('lodash');
2+
const path = require('path');
3+
4+
const srcRoot = path.resolve(__dirname, 'src');
5+
const commonRoot = path.resolve(__dirname, 'node_modules/@yandex-data-ui/common');
6+
7+
module.exports = function override(config, env) {
8+
//do stuff with the webpack config...
9+
10+
const oneOfRule = config.module.rules.find((r) => r.oneOf);
11+
oneOfRule.oneOf.splice(0, 0, {
12+
test: /\.svg$/,
13+
include: [path.resolve(srcRoot, 'assets/icons'), path.resolve(commonRoot, 'assets/icons')],
14+
loader: '@svgr/webpack',
15+
options: {dimensions: false},
16+
});
17+
if (env === 'production') {
18+
config.output.publicPath = 'resources/';
19+
config.output.path = path.resolve(__dirname, 'build/');
20+
}
21+
return config;
22+
};

0 commit comments

Comments
 (0)