mirror of
https://github.com/oceanprotocol/status-frontend.git
synced 2024-12-22 09:13:36 +01:00
Merge pull request #3 from oceanprotocol/feature/updates
UI & project updates
This commit is contained in:
commit
0c527853e7
@ -1,2 +1 @@
|
||||
NEXT_STATUS_API_URI='http://localhost:8080'
|
||||
NEXT_NETWORKS='["mainnet","polygon","bsc","moonriver","energyweb","mumbai","moonbase","goerli"]'
|
||||
NEXT_PUBLIC_STATUS_API_URI='http://localhost:8080'
|
||||
|
15
.eslintrc
15
.eslintrc
@ -1,16 +1,3 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.json"]
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-function-return-type": "off"
|
||||
},
|
||||
"env": { "es6": true, "node": true }
|
||||
"extends": ["eslint:recommended", "next/core-web-vitals"]
|
||||
}
|
||||
|
66
.github/workflows/ci.yml
vendored
Normal file
66
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
name: 'CI'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: ['16']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: ['16']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-${{ matrix.node }}-test-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-${{ matrix.node }}-test-${{ env.cache-name }}-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm test
|
73
README.md
73
README.md
@ -1,40 +1,77 @@
|
||||
# status-frontend
|
||||
[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
|
||||
|
||||
<h1 align="center">status-frontend</h1>
|
||||
|
||||
> Frontend client for showing the status of Ocean Protocol services.
|
||||
|
||||
[![Netlify Status](https://api.netlify.com/api/v1/badges/70cdb7df-cc24-43a0-96fc-5ac501dc31ac/deploy-status)](https://app.netlify.com/sites/ocean-status/deploys)
|
||||
|
||||
Frontend client for showing the status of Ocean Protocol services
|
||||
- [🦑 Features](#-features)
|
||||
- [🏄 Get Started](#-get-started)
|
||||
- [✨ Code Style](#-code-style)
|
||||
- [🛳 Production](#-production)
|
||||
- [⬆️ Deployment](#️-deployment)
|
||||
- [🏛 License](#-license)
|
||||
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
## 🦑 Features
|
||||
|
||||
## Getting Started
|
||||
- Fetches and displays information for each of Ocean's remote components, grouped by network
|
||||
- fetched from `https://status-api.oceanprotocol.com`, which is built with:
|
||||
- [oceanprotocol/status-api](https://github.com/oceanprotocol/status-api)
|
||||
- [oceanprotocol/status-monitoring-service](https://github.com/oceanprotocol/status-monitoring-service)
|
||||
|
||||
First, run the development server:
|
||||
## 🏄 Get Started
|
||||
|
||||
The app is a React app built with [Next.js](https://nextjs.org). To start local development:
|
||||
|
||||
```bash
|
||||
git clone git@github.com:oceanprotocol/status-frontend.git
|
||||
cd status
|
||||
|
||||
npm install
|
||||
cp .env.example .env
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
|
||||
## ✨ Code Style
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
|
||||
For linting checks you can use from the root of the project:
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
```bash
|
||||
# lint all js with eslint
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## Learn More
|
||||
## 🛳 Production
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
To create a production build, run from the root of the project:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
Outputs to `./next`.
|
||||
|
||||
## Deploy on Vercel
|
||||
## ⬆️ Deployment
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
Every branch or Pull Request is automatically deployed by [Netlify](https://netlify.com) with their GitHub integration. A link to a deployment will appear under each Pull Request.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
## 🏛 License
|
||||
|
||||
```text
|
||||
Copyright ((C)) 2022 Ocean Protocol Foundation Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
@ -1,7 +1,4 @@
|
||||
module.exports = {
|
||||
statusApiUri:
|
||||
process.env.NEXT_PUBLIC_STATUS_API_URI || 'http://localhost:8000',
|
||||
availableNetworks:
|
||||
process.env.NEXT_PUBLIC_NETWORKS ||
|
||||
'["mainnet","polygon","bsc","moonriver","energyweb","mumbai","moonbase","goerli"]'
|
||||
process.env.NEXT_PUBLIC_STATUS_API_URI || 'http://localhost:8000'
|
||||
}
|
||||
|
@ -1,7 +1,28 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
swcMinify: true,
|
||||
}
|
||||
module.exports = (phase, { defaultConfig }) => {
|
||||
/**
|
||||
* @type {import('next').NextConfig}
|
||||
*/
|
||||
const nextConfig = {
|
||||
webpack: (config, options) => {
|
||||
config.module.rules.push(
|
||||
{
|
||||
test: /\.svg$/,
|
||||
issuer: /\.(tsx|ts)$/,
|
||||
use: [{ loader: '@svgr/webpack', options: { icon: true } }]
|
||||
},
|
||||
{
|
||||
test: /\.gif$/,
|
||||
// yay for webpack 5
|
||||
// https://webpack.js.org/guides/asset-management/#loading-images
|
||||
type: 'asset/resource'
|
||||
}
|
||||
)
|
||||
|
||||
module.exports = nextConfig
|
||||
return typeof defaultConfig.webpack === 'function'
|
||||
? defaultConfig.webpack(config, options)
|
||||
: config
|
||||
}
|
||||
}
|
||||
|
||||
return nextConfig
|
||||
}
|
||||
|
1
node_modules/.bin/loose-envify
generated
vendored
1
node_modules/.bin/loose-envify
generated
vendored
@ -1 +0,0 @@
|
||||
../loose-envify/cli.js
|
3981
node_modules/.package-lock.json
generated
vendored
3981
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
151
node_modules/js-tokens/CHANGELOG.md
generated
vendored
151
node_modules/js-tokens/CHANGELOG.md
generated
vendored
@ -1,151 +0,0 @@
|
||||
### Version 4.0.0 (2018-01-28) ###
|
||||
|
||||
- Added: Support for ES2018. The only change needed was recognizing the `s`
|
||||
regex flag.
|
||||
- Changed: _All_ tokens returned by the `matchToToken` function now have a
|
||||
`closed` property. It is set to `undefined` for the tokens where “closed”
|
||||
doesn’t make sense. This means that all tokens objects have the same shape,
|
||||
which might improve performance.
|
||||
|
||||
These are the breaking changes:
|
||||
|
||||
- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but
|
||||
`['/a/s']`. (There are of course other variations of this.)
|
||||
- Code that rely on some token objects not having the `closed` property could
|
||||
now behave differently.
|
||||
|
||||
|
||||
### Version 3.0.2 (2017-06-28) ###
|
||||
|
||||
- No code changes. Just updates to the readme.
|
||||
|
||||
|
||||
### Version 3.0.1 (2017-01-30) ###
|
||||
|
||||
- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched
|
||||
correctly.
|
||||
|
||||
|
||||
### Version 3.0.0 (2017-01-11) ###
|
||||
|
||||
This release contains one breaking change, that should [improve performance in
|
||||
V8][v8-perf]:
|
||||
|
||||
> So how can you, as a JavaScript developer, ensure that your RegExps are fast?
|
||||
> If you are not interested in hooking into RegExp internals, make sure that
|
||||
> neither the RegExp instance, nor its prototype is modified in order to get the
|
||||
> best performance:
|
||||
>
|
||||
> ```js
|
||||
> var re = /./g;
|
||||
> re.exec(''); // Fast path.
|
||||
> re.new_property = 'slow';
|
||||
> ```
|
||||
|
||||
This module used to export a single regex, with `.matchToToken` bolted
|
||||
on, just like in the above example. This release changes the exports of
|
||||
the module to avoid this issue.
|
||||
|
||||
Before:
|
||||
|
||||
```js
|
||||
import jsTokens from "js-tokens"
|
||||
// or:
|
||||
var jsTokens = require("js-tokens")
|
||||
var matchToToken = jsTokens.matchToToken
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```js
|
||||
import jsTokens, {matchToToken} from "js-tokens"
|
||||
// or:
|
||||
var jsTokens = require("js-tokens").default
|
||||
var matchToToken = require("js-tokens").matchToToken
|
||||
```
|
||||
|
||||
[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html
|
||||
|
||||
|
||||
### Version 2.0.0 (2016-06-19) ###
|
||||
|
||||
- Added: Support for ES2016. In other words, support for the `**` exponentiation
|
||||
operator.
|
||||
|
||||
These are the breaking changes:
|
||||
|
||||
- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`.
|
||||
- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`.
|
||||
|
||||
|
||||
### Version 1.0.3 (2016-03-27) ###
|
||||
|
||||
- Improved: Made the regex ever so slightly smaller.
|
||||
- Updated: The readme.
|
||||
|
||||
|
||||
### Version 1.0.2 (2015-10-18) ###
|
||||
|
||||
- Improved: Limited npm package contents for a smaller download. Thanks to
|
||||
@zertosh!
|
||||
|
||||
|
||||
### Version 1.0.1 (2015-06-20) ###
|
||||
|
||||
- Fixed: Declared an undeclared variable.
|
||||
|
||||
|
||||
### Version 1.0.0 (2015-02-26) ###
|
||||
|
||||
- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That
|
||||
type is now equivalent to the Punctuator token in the ECMAScript
|
||||
specification. (Backwards-incompatible change.)
|
||||
- Fixed: A `-` followed by a number is now correctly matched as a punctuator
|
||||
followed by a number. It used to be matched as just a number, but there is no
|
||||
such thing as negative number literals. (Possibly backwards-incompatible
|
||||
change.)
|
||||
|
||||
|
||||
### Version 0.4.1 (2015-02-21) ###
|
||||
|
||||
- Added: Support for the regex `u` flag.
|
||||
|
||||
|
||||
### Version 0.4.0 (2015-02-21) ###
|
||||
|
||||
- Improved: `jsTokens.matchToToken` performance.
|
||||
- Added: Support for octal and binary number literals.
|
||||
- Added: Support for template strings.
|
||||
|
||||
|
||||
### Version 0.3.1 (2015-01-06) ###
|
||||
|
||||
- Fixed: Support for unicode spaces. They used to be allowed in names (which is
|
||||
very confusing), and some unicode newlines were wrongly allowed in strings and
|
||||
regexes.
|
||||
|
||||
|
||||
### Version 0.3.0 (2014-12-19) ###
|
||||
|
||||
- Changed: The `jsTokens.names` array has been replaced with the
|
||||
`jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no
|
||||
longer part of the public API; instead use said function. See this [gist] for
|
||||
an example. (Backwards-incompatible change.)
|
||||
- Changed: The empty string is now considered an “invalid” token, instead an
|
||||
“empty” token (its own group). (Backwards-incompatible change.)
|
||||
- Removed: component support. (Backwards-incompatible change.)
|
||||
|
||||
[gist]: https://gist.github.com/lydell/be49dbf80c382c473004
|
||||
|
||||
|
||||
### Version 0.2.0 (2014-06-19) ###
|
||||
|
||||
- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own
|
||||
category (“functionArrow”), for simplicity. (Backwards-incompatible change.)
|
||||
- Added: ES6 splats (`...`) are now matched as an operator (instead of three
|
||||
punctuations). (Backwards-incompatible change.)
|
||||
|
||||
|
||||
### Version 0.1.0 (2014-03-08) ###
|
||||
|
||||
- Initial release.
|
21
node_modules/js-tokens/LICENSE
generated
vendored
21
node_modules/js-tokens/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
240
node_modules/js-tokens/README.md
generated
vendored
240
node_modules/js-tokens/README.md
generated
vendored
@ -1,240 +0,0 @@
|
||||
Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens)
|
||||
========
|
||||
|
||||
A regex that tokenizes JavaScript.
|
||||
|
||||
```js
|
||||
var jsTokens = require("js-tokens").default
|
||||
|
||||
var jsString = "var foo=opts.foo;\n..."
|
||||
|
||||
jsString.match(jsTokens)
|
||||
// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...]
|
||||
```
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
`npm install js-tokens`
|
||||
|
||||
```js
|
||||
import jsTokens from "js-tokens"
|
||||
// or:
|
||||
var jsTokens = require("js-tokens").default
|
||||
```
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
### `jsTokens` ###
|
||||
|
||||
A regex with the `g` flag that matches JavaScript tokens.
|
||||
|
||||
The regex _always_ matches, even invalid JavaScript and the empty string.
|
||||
|
||||
The next match is always directly after the previous.
|
||||
|
||||
### `var token = matchToToken(match)` ###
|
||||
|
||||
```js
|
||||
import {matchToToken} from "js-tokens"
|
||||
// or:
|
||||
var matchToToken = require("js-tokens").matchToToken
|
||||
```
|
||||
|
||||
Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type:
|
||||
String, value: String}` object. The following types are available:
|
||||
|
||||
- string
|
||||
- comment
|
||||
- regex
|
||||
- number
|
||||
- name
|
||||
- punctuator
|
||||
- whitespace
|
||||
- invalid
|
||||
|
||||
Multi-line comments and strings also have a `closed` property indicating if the
|
||||
token was closed or not (see below).
|
||||
|
||||
Comments and strings both come in several flavors. To distinguish them, check if
|
||||
the token starts with `//`, `/*`, `'`, `"` or `` ` ``.
|
||||
|
||||
Names are ECMAScript IdentifierNames, that is, including both identifiers and
|
||||
keywords. You may use [is-keyword-js] to tell them apart.
|
||||
|
||||
Whitespace includes both line terminators and other whitespace.
|
||||
|
||||
[is-keyword-js]: https://github.com/crissdev/is-keyword-js
|
||||
|
||||
|
||||
ECMAScript support
|
||||
==================
|
||||
|
||||
The intention is to always support the latest ECMAScript version whose feature
|
||||
set has been finalized.
|
||||
|
||||
If adding support for a newer version requires changes, a new version with a
|
||||
major verion bump will be released.
|
||||
|
||||
Currently, ECMAScript 2018 is supported.
|
||||
|
||||
|
||||
Invalid code handling
|
||||
=====================
|
||||
|
||||
Unterminated strings are still matched as strings. JavaScript strings cannot
|
||||
contain (unescaped) newlines, so unterminated strings simply end at the end of
|
||||
the line. Unterminated template strings can contain unescaped newlines, though,
|
||||
so they go on to the end of input.
|
||||
|
||||
Unterminated multi-line comments are also still matched as comments. They
|
||||
simply go on to the end of the input.
|
||||
|
||||
Unterminated regex literals are likely matched as division and whatever is
|
||||
inside the regex.
|
||||
|
||||
Invalid ASCII characters have their own capturing group.
|
||||
|
||||
Invalid non-ASCII characters are treated as names, to simplify the matching of
|
||||
names (except unicode spaces which are treated as whitespace). Note: See also
|
||||
the [ES2018](#es2018) section.
|
||||
|
||||
Regex literals may contain invalid regex syntax. They are still matched as
|
||||
regex literals. They may also contain repeated regex flags, to keep the regex
|
||||
simple.
|
||||
|
||||
Strings may contain invalid escape sequences.
|
||||
|
||||
|
||||
Limitations
|
||||
===========
|
||||
|
||||
Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be
|
||||
perfect. But that’s not the point either.
|
||||
|
||||
You may compare jsTokens with [esprima] by using `esprima-compare.js`.
|
||||
See `npm run esprima-compare`!
|
||||
|
||||
[esprima]: http://esprima.org/
|
||||
|
||||
### Template string interpolation ###
|
||||
|
||||
Template strings are matched as single tokens, from the starting `` ` `` to the
|
||||
ending `` ` ``, including interpolations (whose tokens are not matched
|
||||
individually).
|
||||
|
||||
Matching template string interpolations requires recursive balancing of `{` and
|
||||
`}`—something that JavaScript regexes cannot do. Only one level of nesting is
|
||||
supported.
|
||||
|
||||
### Division and regex literals collision ###
|
||||
|
||||
Consider this example:
|
||||
|
||||
```js
|
||||
var g = 9.82
|
||||
var number = bar / 2/g
|
||||
|
||||
var regex = / 2/g
|
||||
```
|
||||
|
||||
A human can easily understand that in the `number` line we’re dealing with
|
||||
division, and in the `regex` line we’re dealing with a regex literal. How come?
|
||||
Because humans can look at the whole code to put the `/` characters in context.
|
||||
A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also
|
||||
look backwards. See the [ES2018](#es2018) section).
|
||||
|
||||
When the `jsTokens` regex scans throught the above, it will see the following
|
||||
at the end of both the `number` and `regex` rows:
|
||||
|
||||
```js
|
||||
/ 2/g
|
||||
```
|
||||
|
||||
It is then impossible to know if that is a regex literal, or part of an
|
||||
expression dealing with division.
|
||||
|
||||
Here is a similar case:
|
||||
|
||||
```js
|
||||
foo /= 2/g
|
||||
foo(/= 2/g)
|
||||
```
|
||||
|
||||
The first line divides the `foo` variable with `2/g`. The second line calls the
|
||||
`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only
|
||||
sees forwards, it cannot tell the two cases apart.
|
||||
|
||||
There are some cases where we _can_ tell division and regex literals apart,
|
||||
though.
|
||||
|
||||
First off, we have the simple cases where there’s only one slash in the line:
|
||||
|
||||
```js
|
||||
var foo = 2/g
|
||||
foo /= 2
|
||||
```
|
||||
|
||||
Regex literals cannot contain newlines, so the above cases are correctly
|
||||
identified as division. Things are only problematic when there are more than
|
||||
one non-comment slash in a single line.
|
||||
|
||||
Secondly, not every character is a valid regex flag.
|
||||
|
||||
```js
|
||||
var number = bar / 2/e
|
||||
```
|
||||
|
||||
The above example is also correctly identified as division, because `e` is not a
|
||||
valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*`
|
||||
(any letter) as flags, but it is not worth it since it increases the amount of
|
||||
ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are
|
||||
allowed. This means that the above example will be identified as division as
|
||||
long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6
|
||||
characters long.
|
||||
|
||||
Lastly, we can look _forward_ for information.
|
||||
|
||||
- If the token following what looks like a regex literal is not valid after a
|
||||
regex literal, but is valid in a division expression, then the regex literal
|
||||
is treated as division instead. For example, a flagless regex cannot be
|
||||
followed by a string, number or name, but all of those three can be the
|
||||
denominator of a division.
|
||||
- Generally, if what looks like a regex literal is followed by an operator, the
|
||||
regex literal is treated as division instead. This is because regexes are
|
||||
seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division
|
||||
could likely be part of such an expression.
|
||||
|
||||
Please consult the regex source and the test cases for precise information on
|
||||
when regex or division is matched (should you need to know). In short, you
|
||||
could sum it up as:
|
||||
|
||||
If the end of a statement looks like a regex literal (even if it isn’t), it
|
||||
will be treated as one. Otherwise it should work as expected (if you write sane
|
||||
code).
|
||||
|
||||
### ES2018 ###
|
||||
|
||||
ES2018 added some nice regex improvements to the language.
|
||||
|
||||
- [Unicode property escapes] should allow telling names and invalid non-ASCII
|
||||
characters apart without blowing up the regex size.
|
||||
- [Lookbehind assertions] should allow matching telling division and regex
|
||||
literals apart in more cases.
|
||||
- [Named capture groups] might simplify some things.
|
||||
|
||||
These things would be nice to do, but are not critical. They probably have to
|
||||
wait until the oldest maintained Node.js LTS release supports those features.
|
||||
|
||||
[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html
|
||||
[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html
|
||||
[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
[MIT](LICENSE).
|
23
node_modules/js-tokens/index.js
generated
vendored
23
node_modules/js-tokens/index.js
generated
vendored
@ -1,23 +0,0 @@
|
||||
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
||||
// License: MIT. (See LICENSE.)
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
})
|
||||
|
||||
// This regex comes from regex.coffee, and is inserted here by generate-index.js
|
||||
// (run `npm run build`).
|
||||
exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g
|
||||
|
||||
exports.matchToToken = function(match) {
|
||||
var token = {type: "invalid", value: match[0], closed: undefined}
|
||||
if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
|
||||
else if (match[ 5]) token.type = "comment"
|
||||
else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
|
||||
else if (match[ 8]) token.type = "regex"
|
||||
else if (match[ 9]) token.type = "number"
|
||||
else if (match[10]) token.type = "name"
|
||||
else if (match[11]) token.type = "punctuator"
|
||||
else if (match[12]) token.type = "whitespace"
|
||||
return token
|
||||
}
|
30
node_modules/js-tokens/package.json
generated
vendored
30
node_modules/js-tokens/package.json
generated
vendored
@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "js-tokens",
|
||||
"version": "4.0.0",
|
||||
"author": "Simon Lydell",
|
||||
"license": "MIT",
|
||||
"description": "A regex that tokenizes JavaScript.",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
"js",
|
||||
"token",
|
||||
"tokenize",
|
||||
"regex"
|
||||
],
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"repository": "lydell/js-tokens",
|
||||
"scripts": {
|
||||
"test": "mocha --ui tdd",
|
||||
"esprima-compare": "node esprima-compare ./index.js everything.js/es5.js",
|
||||
"build": "node generate-index.js",
|
||||
"dev": "npm run build && npm test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coffeescript": "2.1.1",
|
||||
"esprima": "4.0.0",
|
||||
"everything.js": "1.0.3",
|
||||
"mocha": "5.0.0"
|
||||
}
|
||||
}
|
21
node_modules/loose-envify/LICENSE
generated
vendored
21
node_modules/loose-envify/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Andres Suarez <zertosh@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
45
node_modules/loose-envify/README.md
generated
vendored
45
node_modules/loose-envify/README.md
generated
vendored
@ -1,45 +0,0 @@
|
||||
# loose-envify
|
||||
|
||||
[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify)
|
||||
|
||||
Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster.
|
||||
|
||||
## Gotchas
|
||||
|
||||
* Doesn't handle broken syntax.
|
||||
* Doesn't look inside embedded expressions in template strings.
|
||||
- **this won't work:**
|
||||
```js
|
||||
console.log(`the current env is ${process.env.NODE_ENV}`);
|
||||
```
|
||||
* Doesn't replace oddly-spaced or oddly-commented expressions.
|
||||
- **this won't work:**
|
||||
```js
|
||||
console.log(process./*won't*/env./*work*/NODE_ENV);
|
||||
```
|
||||
|
||||
## Usage/Options
|
||||
|
||||
loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI.
|
||||
|
||||
## Benchmark
|
||||
|
||||
```
|
||||
envify:
|
||||
|
||||
$ for i in {1..5}; do node bench/bench.js 'envify'; done
|
||||
708ms
|
||||
727ms
|
||||
791ms
|
||||
719ms
|
||||
720ms
|
||||
|
||||
loose-envify:
|
||||
|
||||
$ for i in {1..5}; do node bench/bench.js '../'; done
|
||||
51ms
|
||||
52ms
|
||||
52ms
|
||||
52ms
|
||||
52ms
|
||||
```
|
16
node_modules/loose-envify/cli.js
generated
vendored
16
node_modules/loose-envify/cli.js
generated
vendored
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var looseEnvify = require('./');
|
||||
var fs = require('fs');
|
||||
|
||||
if (process.argv[2]) {
|
||||
fs.createReadStream(process.argv[2], {encoding: 'utf8'})
|
||||
.pipe(looseEnvify(process.argv[2]))
|
||||
.pipe(process.stdout);
|
||||
} else {
|
||||
process.stdin.resume()
|
||||
process.stdin
|
||||
.pipe(looseEnvify(__filename))
|
||||
.pipe(process.stdout);
|
||||
}
|
4
node_modules/loose-envify/custom.js
generated
vendored
4
node_modules/loose-envify/custom.js
generated
vendored
@ -1,4 +0,0 @@
|
||||
// envify compatibility
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./loose-envify');
|
3
node_modules/loose-envify/index.js
generated
vendored
3
node_modules/loose-envify/index.js
generated
vendored
@ -1,3 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./loose-envify')(process.env);
|
36
node_modules/loose-envify/loose-envify.js
generated
vendored
36
node_modules/loose-envify/loose-envify.js
generated
vendored
@ -1,36 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var stream = require('stream');
|
||||
var util = require('util');
|
||||
var replace = require('./replace');
|
||||
|
||||
var jsonExtRe = /\.json$/;
|
||||
|
||||
module.exports = function(rootEnv) {
|
||||
rootEnv = rootEnv || process.env;
|
||||
return function (file, trOpts) {
|
||||
if (jsonExtRe.test(file)) {
|
||||
return stream.PassThrough();
|
||||
}
|
||||
var envs = trOpts ? [rootEnv, trOpts] : [rootEnv];
|
||||
return new LooseEnvify(envs);
|
||||
};
|
||||
};
|
||||
|
||||
function LooseEnvify(envs) {
|
||||
stream.Transform.call(this);
|
||||
this._data = '';
|
||||
this._envs = envs;
|
||||
}
|
||||
util.inherits(LooseEnvify, stream.Transform);
|
||||
|
||||
LooseEnvify.prototype._transform = function(buf, enc, cb) {
|
||||
this._data += buf;
|
||||
cb();
|
||||
};
|
||||
|
||||
LooseEnvify.prototype._flush = function(cb) {
|
||||
var replaced = replace(this._data, this._envs);
|
||||
this.push(replaced);
|
||||
cb();
|
||||
};
|
36
node_modules/loose-envify/package.json
generated
vendored
36
node_modules/loose-envify/package.json
generated
vendored
@ -1,36 +0,0 @@
|
||||
{
|
||||
"name": "loose-envify",
|
||||
"version": "1.4.0",
|
||||
"description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST",
|
||||
"keywords": [
|
||||
"environment",
|
||||
"variables",
|
||||
"browserify",
|
||||
"browserify-transform",
|
||||
"transform",
|
||||
"source",
|
||||
"configuration"
|
||||
],
|
||||
"homepage": "https://github.com/zertosh/loose-envify",
|
||||
"license": "MIT",
|
||||
"author": "Andres Suarez <zertosh@gmail.com>",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"loose-envify": "cli.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/zertosh/loose-envify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-tokens": "^3.0.0 || ^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.1.1",
|
||||
"envify": "^3.4.0",
|
||||
"tap": "^8.0.0"
|
||||
}
|
||||
}
|
65
node_modules/loose-envify/replace.js
generated
vendored
65
node_modules/loose-envify/replace.js
generated
vendored
@ -1,65 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var jsTokens = require('js-tokens').default;
|
||||
|
||||
var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/;
|
||||
var spaceOrCommentRe = /^(?:\s|\/[/*])/;
|
||||
|
||||
function replace(src, envs) {
|
||||
if (!processEnvRe.test(src)) {
|
||||
return src;
|
||||
}
|
||||
|
||||
var out = [];
|
||||
var purge = envs.some(function(env) {
|
||||
return env._ && env._.indexOf('purge') !== -1;
|
||||
});
|
||||
|
||||
jsTokens.lastIndex = 0
|
||||
var parts = src.match(jsTokens);
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
if (parts[i ] === 'process' &&
|
||||
parts[i + 1] === '.' &&
|
||||
parts[i + 2] === 'env' &&
|
||||
parts[i + 3] === '.') {
|
||||
var prevCodeToken = getAdjacentCodeToken(-1, parts, i);
|
||||
var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4);
|
||||
var replacement = getReplacementString(envs, parts[i + 4], purge);
|
||||
if (prevCodeToken !== '.' &&
|
||||
nextCodeToken !== '.' &&
|
||||
nextCodeToken !== '=' &&
|
||||
typeof replacement === 'string') {
|
||||
out.push(replacement);
|
||||
i += 4;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
out.push(parts[i]);
|
||||
}
|
||||
|
||||
return out.join('');
|
||||
}
|
||||
|
||||
function getAdjacentCodeToken(dir, parts, i) {
|
||||
while (true) {
|
||||
var part = parts[i += dir];
|
||||
if (!spaceOrCommentRe.test(part)) {
|
||||
return part;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getReplacementString(envs, name, purge) {
|
||||
for (var j = 0; j < envs.length; j++) {
|
||||
var env = envs[j];
|
||||
if (typeof env[name] !== 'undefined') {
|
||||
return JSON.stringify(env[name]);
|
||||
}
|
||||
}
|
||||
if (purge) {
|
||||
return 'undefined';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = replace;
|
21
node_modules/react/LICENSE
generated
vendored
21
node_modules/react/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
37
node_modules/react/README.md
generated
vendored
37
node_modules/react/README.md
generated
vendored
@ -1,37 +0,0 @@
|
||||
# `react`
|
||||
|
||||
React is a JavaScript library for creating user interfaces.
|
||||
|
||||
The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments.
|
||||
|
||||
**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { useState } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
function Counter() {
|
||||
const [count, setCount] = useState(0);
|
||||
return (
|
||||
<>
|
||||
<h1>{count}</h1>
|
||||
<button onClick={() => setCount(count + 1)}>
|
||||
Increment
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const root = createRoot(document.getElementById('root'));
|
||||
root.render(<App />);
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
See https://reactjs.org/
|
||||
|
||||
## API
|
||||
|
||||
See https://reactjs.org/docs/react-api.html
|
1296
node_modules/react/cjs/react-jsx-dev-runtime.development.js
generated
vendored
1296
node_modules/react/cjs/react-jsx-dev-runtime.development.js
generated
vendored
File diff suppressed because it is too large
Load Diff
10
node_modules/react/cjs/react-jsx-dev-runtime.production.min.js
generated
vendored
10
node_modules/react/cjs/react-jsx-dev-runtime.production.min.js
generated
vendored
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-dev-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.
|
||||
*/
|
||||
'use strict';var a=Symbol.for("react.fragment");exports.Fragment=a;exports.jsxDEV=void 0;
|
10
node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js
generated
vendored
10
node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js
generated
vendored
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-dev-runtime.profiling.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.
|
||||
*/
|
||||
'use strict';var a=Symbol.for("react.fragment");exports.Fragment=a;exports.jsxDEV=void 0;
|
1314
node_modules/react/cjs/react-jsx-runtime.development.js
generated
vendored
1314
node_modules/react/cjs/react-jsx-runtime.development.js
generated
vendored
File diff suppressed because it is too large
Load Diff
11
node_modules/react/cjs/react-jsx-runtime.production.min.js
generated
vendored
11
node_modules/react/cjs/react-jsx-runtime.production.min.js
generated
vendored
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
'use strict';var f=require("react"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
||||
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
|
11
node_modules/react/cjs/react-jsx-runtime.profiling.min.js
generated
vendored
11
node_modules/react/cjs/react-jsx-runtime.profiling.min.js
generated
vendored
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.profiling.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.
|
||||
*/
|
||||
'use strict';var f=require("react"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
||||
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
|
2739
node_modules/react/cjs/react.development.js
generated
vendored
2739
node_modules/react/cjs/react.development.js
generated
vendored
File diff suppressed because it is too large
Load Diff
26
node_modules/react/cjs/react.production.min.js
generated
vendored
26
node_modules/react/cjs/react.production.min.js
generated
vendored
@ -1,26 +0,0 @@
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
'use strict';var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null}
|
||||
var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};
|
||||
E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;
|
||||
H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
|
||||
function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
|
||||
function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
||||
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
|
||||
a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
|
||||
function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}
|
||||
var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;
|
||||
exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
|
||||
exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
|
||||
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};
|
||||
exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.");};
|
||||
exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};
|
||||
exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};
|
||||
exports.useTransition=function(){return U.current.useTransition()};exports.version="18.2.0";
|
20
node_modules/react/cjs/react.shared-subset.development.js
generated
vendored
20
node_modules/react/cjs/react.shared-subset.development.js
generated
vendored
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react.shared-subset.development.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.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// eslint-disable-next-line react-internal/prod-error-codes
|
||||
throw new Error('This entry point is not yet supported outside of experimental channels');
|
||||
})();
|
||||
}
|
10
node_modules/react/cjs/react.shared-subset.production.min.js
generated
vendored
10
node_modules/react/cjs/react.shared-subset.production.min.js
generated
vendored
@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react.shared-subset.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.
|
||||
*/
|
||||
'use strict';throw Error("This entry point is not yet supported outside of experimental channels");
|
7
node_modules/react/index.js
generated
vendored
7
node_modules/react/index.js
generated
vendored
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react.production.min.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react.development.js');
|
||||
}
|
7
node_modules/react/jsx-dev-runtime.js
generated
vendored
7
node_modules/react/jsx-dev-runtime.js
generated
vendored
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react-jsx-dev-runtime.development.js');
|
||||
}
|
7
node_modules/react/jsx-runtime.js
generated
vendored
7
node_modules/react/jsx-runtime.js
generated
vendored
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react-jsx-runtime.production.min.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react-jsx-runtime.development.js');
|
||||
}
|
47
node_modules/react/package.json
generated
vendored
47
node_modules/react/package.json
generated
vendored
@ -1,47 +0,0 @@
|
||||
{
|
||||
"name": "react",
|
||||
"description": "React is a JavaScript library for building user interfaces.",
|
||||
"keywords": [
|
||||
"react"
|
||||
],
|
||||
"version": "18.2.0",
|
||||
"homepage": "https://reactjs.org/",
|
||||
"bugs": "https://github.com/facebook/react/issues",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"index.js",
|
||||
"cjs/",
|
||||
"umd/",
|
||||
"jsx-runtime.js",
|
||||
"jsx-dev-runtime.js",
|
||||
"react.shared-subset.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"react-server": "./react.shared-subset.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./package.json": "./package.json",
|
||||
"./jsx-runtime": "./jsx-runtime.js",
|
||||
"./jsx-dev-runtime": "./jsx-dev-runtime.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/react.git",
|
||||
"directory": "packages/react"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.1.0"
|
||||
},
|
||||
"browserify": {
|
||||
"transform": [
|
||||
"loose-envify"
|
||||
]
|
||||
}
|
||||
}
|
7
node_modules/react/react.shared-subset.js
generated
vendored
7
node_modules/react/react.shared-subset.js
generated
vendored
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react.shared-subset.production.min.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react.shared-subset.development.js');
|
||||
}
|
3342
node_modules/react/umd/react.development.js
generated
vendored
3342
node_modules/react/umd/react.development.js
generated
vendored
File diff suppressed because it is too large
Load Diff
31
node_modules/react/umd/react.production.min.js
generated
vendored
31
node_modules/react/umd/react.production.min.js
generated
vendored
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
(function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=V&&a[V]||a["@@iterator"];return"function"===typeof a?a:null}function w(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Y(){}function K(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Z(a,b,
|
||||
e){var m,d={},c=null,h=null;if(null!=b)for(m in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(c=""+b.key),b)aa.call(b,m)&&!ba.hasOwnProperty(m)&&(d[m]=b[m]);var l=arguments.length-2;if(1===l)d.children=e;else if(1<l){for(var f=Array(l),k=0;k<l;k++)f[k]=arguments[k+2];d.children=f}if(a&&a.defaultProps)for(m in l=a.defaultProps,l)void 0===d[m]&&(d[m]=l[m]);return{$$typeof:y,type:a,key:c,ref:h,props:d,_owner:L.current}}function na(a,b){return{$$typeof:y,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}
|
||||
function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===y}function oa(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}function N(a,b){return"object"===typeof a&&null!==a&&null!=a.key?oa(""+a.key):b.toString(36)}function B(a,b,e,m,d){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var h=!1;if(null===a)h=!0;else switch(c){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case y:case pa:h=!0}}if(h)return h=a,d=d(h),a=""===m?"."+
|
||||
N(h,0):m,ca(d)?(e="",null!=a&&(e=a.replace(da,"$&/")+"/"),B(d,b,e,"",function(a){return a})):null!=d&&(M(d)&&(d=na(d,e+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(da,"$&/")+"/")+a)),b.push(d)),1;h=0;m=""===m?".":m+":";if(ca(a))for(var l=0;l<a.length;l++){c=a[l];var f=m+N(c,l);h+=B(c,b,e,f,d)}else if(f=x(a),"function"===typeof f)for(a=f.call(a),l=0;!(c=a.next()).done;)c=c.value,f=m+N(c,l++),h+=B(c,b,e,f,d);else if("object"===c)throw b=String(a),Error("Objects are not valid as a React child (found: "+
|
||||
("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}function C(a,b,e){if(null==a)return a;var c=[],d=0;B(a,c,"","",function(a){return b.call(e,a,d++)});return c}function qa(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=
|
||||
0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}function O(a,b){var e=a.length;a.push(b);a:for(;0<e;){var c=e-1>>>1,d=a[c];if(0<D(d,b))a[c]=b,a[e]=d,e=c;else break a}}function p(a){return 0===a.length?null:a[0]}function E(a){if(0===a.length)return null;var b=a[0],e=a.pop();if(e!==b){a[0]=e;a:for(var c=0,d=a.length,k=d>>>1;c<k;){var h=2*(c+1)-1,l=a[h],f=h+1,g=a[f];if(0>D(l,e))f<d&&0>D(g,l)?(a[c]=g,a[f]=e,c=f):(a[c]=l,a[h]=e,c=h);else if(f<d&&0>D(g,e))a[c]=g,a[f]=e,c=f;else break a}}return b}
|
||||
function D(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)E(r);else if(b.startTime<=a)E(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}}function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,R(S);else{var b=p(r);null!==b&&T(Q,b.startTime-a)}}function S(a,b){u=!1;z&&(z=!1,ea(A),A=-1);F=!0;var c=k;try{P(b);for(n=p(q);null!==n&&(!(n.expirationTime>b)||a&&!fa());){var m=n.callback;if("function"===typeof m){n.callback=null;
|
||||
k=n.priorityLevel;var d=m(n.expirationTime<=b);b=v();"function"===typeof d?n.callback=d:n===p(q)&&E(q);P(b)}else E(q);n=p(q)}if(null!==n)var g=!0;else{var h=p(r);null!==h&&T(Q,h.startTime-b);g=!1}return g}finally{n=null,k=c,F=!1}}function fa(){return v()-ha<ia?!1:!0}function R(a){G=a;H||(H=!0,I())}function T(a,b){A=ja(function(){a(v())},b)}var y=Symbol.for("react.element"),pa=Symbol.for("react.portal"),ra=Symbol.for("react.fragment"),sa=Symbol.for("react.strict_mode"),ta=Symbol.for("react.profiler"),
|
||||
ua=Symbol.for("react.provider"),va=Symbol.for("react.context"),wa=Symbol.for("react.forward_ref"),xa=Symbol.for("react.suspense"),ya=Symbol.for("react.memo"),za=Symbol.for("react.lazy"),V=Symbol.iterator,X={isMounted:function(a){return!1},enqueueForceUpdate:function(a,b,c){},enqueueReplaceState:function(a,b,c,m){},enqueueSetState:function(a,b,c,m){}},ka=Object.assign,W={};w.prototype.isReactComponent={};w.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
||||
this.updater.enqueueSetState(this,a,b,"setState")};w.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};Y.prototype=w.prototype;var t=K.prototype=new Y;t.constructor=K;ka(t,w.prototype);t.isPureReactComponent=!0;var ca=Array.isArray,aa=Object.prototype.hasOwnProperty,L={current:null},ba={key:!0,ref:!0,__self:!0,__source:!0},da=/\/+/g,g={current:null},J={transition:null};if("object"===typeof performance&&"function"===typeof performance.now){var Aa=performance;
|
||||
var v=function(){return Aa.now()}}else{var la=Date,Ba=la.now();v=function(){return la.now()-Ba}}var q=[],r=[],Ca=1,n=null,k=3,F=!1,u=!1,z=!1,ja="function"===typeof setTimeout?setTimeout:null,ea="function"===typeof clearTimeout?clearTimeout:null,ma="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var H=!1,G=null,A=-1,ia=5,ha=
|
||||
-1,U=function(){if(null!==G){var a=v();ha=a;var b=!0;try{b=G(!0,a)}finally{b?I():(H=!1,G=null)}}else H=!1};if("function"===typeof ma)var I=function(){ma(U)};else if("undefined"!==typeof MessageChannel){t=new MessageChannel;var Da=t.port2;t.port1.onmessage=U;I=function(){Da.postMessage(null)}}else I=function(){ja(U,0)};t={ReactCurrentDispatcher:g,ReactCurrentOwner:L,ReactCurrentBatchConfig:J,Scheduler:{__proto__:null,unstable_ImmediatePriority:1,unstable_UserBlockingPriority:2,unstable_NormalPriority:3,
|
||||
unstable_IdlePriority:5,unstable_LowPriority:4,unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=k;k=a;try{return b()}finally{k=c}},unstable_next:function(a){switch(k){case 1:case 2:case 3:var b=3;break;default:b=k}var c=k;k=b;try{return a()}finally{k=c}},unstable_scheduleCallback:function(a,b,c){var e=v();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?e+c:e):c=e;switch(a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=
|
||||
1073741823;break;case 4:d=1E4;break;default:d=5E3}d=c+d;a={id:Ca++,callback:b,priorityLevel:a,startTime:c,expirationTime:d,sortIndex:-1};c>e?(a.sortIndex=c,O(r,a),null===p(q)&&a===p(r)&&(z?(ea(A),A=-1):z=!0,T(Q,c-e))):(a.sortIndex=d,O(q,a),u||F||(u=!0,R(S)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=k;return function(){var c=k;k=b;try{return a.apply(this,arguments)}finally{k=c}}},unstable_getCurrentPriorityLevel:function(){return k},unstable_shouldYield:fa,
|
||||
unstable_requestPaint:function(){},unstable_continueExecution:function(){u||F||(u=!0,R(S))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)},get unstable_now(){return v},unstable_forceFrameRate:function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ia=0<a?Math.floor(1E3/a):5},unstable_Profiling:null}};c.Children={map:C,forEach:function(a,b,c){C(a,function(){b.apply(this,
|
||||
arguments)},c)},count:function(a){var b=0;C(a,function(){b++});return b},toArray:function(a){return C(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};c.Component=w;c.Fragment=ra;c.Profiler=ta;c.PureComponent=K;c.StrictMode=sa;c.Suspense=xa;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+
|
||||
a+".");var e=ka({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=L.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var l=a.type.defaultProps;for(f in b)aa.call(b,f)&&!ba.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==l?l[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){l=Array(f);for(var g=0;g<f;g++)l[g]=arguments[g+2];e.children=l}return{$$typeof:y,type:a.type,key:d,ref:k,props:e,_owner:h}};c.createContext=function(a){a={$$typeof:va,
|
||||
_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:ua,_context:a};return a.Consumer=a};c.createElement=Z;c.createFactory=function(a){var b=Z.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:wa,render:a}};c.isValidElement=M;c.lazy=function(a){return{$$typeof:za,_payload:{_status:-1,_result:a},_init:qa}};c.memo=function(a,b){return{$$typeof:ya,type:a,
|
||||
compare:void 0===b?null:b}};c.startTransition=function(a,b){b=J.transition;J.transition={};try{a()}finally{J.transition=b}};c.unstable_act=function(a){throw Error("act(...) is not supported in production builds of React.");};c.useCallback=function(a,b){return g.current.useCallback(a,b)};c.useContext=function(a){return g.current.useContext(a)};c.useDebugValue=function(a,b){};c.useDeferredValue=function(a){return g.current.useDeferredValue(a)};c.useEffect=function(a,b){return g.current.useEffect(a,
|
||||
b)};c.useId=function(){return g.current.useId()};c.useImperativeHandle=function(a,b,c){return g.current.useImperativeHandle(a,b,c)};c.useInsertionEffect=function(a,b){return g.current.useInsertionEffect(a,b)};c.useLayoutEffect=function(a,b){return g.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return g.current.useMemo(a,b)};c.useReducer=function(a,b,c){return g.current.useReducer(a,b,c)};c.useRef=function(a){return g.current.useRef(a)};c.useState=function(a){return g.current.useState(a)};
|
||||
c.useSyncExternalStore=function(a,b,c){return g.current.useSyncExternalStore(a,b,c)};c.useTransition=function(){return g.current.useTransition()};c.version="18.2.0"});
|
||||
})();
|
31
node_modules/react/umd/react.profiling.min.js
generated
vendored
31
node_modules/react/umd/react.profiling.min.js
generated
vendored
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* @license React
|
||||
* react.profiling.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(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=V&&a[V]||a["@@iterator"];return"function"===typeof a?a:null}function w(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Y(){}function K(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Z(a,b,
|
||||
e){var m,d={},c=null,h=null;if(null!=b)for(m in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(c=""+b.key),b)aa.call(b,m)&&!ba.hasOwnProperty(m)&&(d[m]=b[m]);var l=arguments.length-2;if(1===l)d.children=e;else if(1<l){for(var f=Array(l),k=0;k<l;k++)f[k]=arguments[k+2];d.children=f}if(a&&a.defaultProps)for(m in l=a.defaultProps,l)void 0===d[m]&&(d[m]=l[m]);return{$$typeof:y,type:a,key:c,ref:h,props:d,_owner:L.current}}function na(a,b){return{$$typeof:y,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}
|
||||
function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===y}function oa(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}function N(a,b){return"object"===typeof a&&null!==a&&null!=a.key?oa(""+a.key):b.toString(36)}function B(a,b,e,m,d){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var h=!1;if(null===a)h=!0;else switch(c){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case y:case pa:h=!0}}if(h)return h=a,d=d(h),a=""===m?"."+
|
||||
N(h,0):m,ca(d)?(e="",null!=a&&(e=a.replace(da,"$&/")+"/"),B(d,b,e,"",function(a){return a})):null!=d&&(M(d)&&(d=na(d,e+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(da,"$&/")+"/")+a)),b.push(d)),1;h=0;m=""===m?".":m+":";if(ca(a))for(var l=0;l<a.length;l++){c=a[l];var f=m+N(c,l);h+=B(c,b,e,f,d)}else if(f=x(a),"function"===typeof f)for(a=f.call(a),l=0;!(c=a.next()).done;)c=c.value,f=m+N(c,l++),h+=B(c,b,e,f,d);else if("object"===c)throw b=String(a),Error("Objects are not valid as a React child (found: "+
|
||||
("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}function C(a,b,e){if(null==a)return a;var c=[],d=0;B(a,c,"","",function(a){return b.call(e,a,d++)});return c}function qa(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=
|
||||
0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}function O(a,b){var e=a.length;a.push(b);a:for(;0<e;){var c=e-1>>>1,d=a[c];if(0<D(d,b))a[c]=b,a[e]=d,e=c;else break a}}function p(a){return 0===a.length?null:a[0]}function E(a){if(0===a.length)return null;var b=a[0],e=a.pop();if(e!==b){a[0]=e;a:for(var c=0,d=a.length,k=d>>>1;c<k;){var h=2*(c+1)-1,l=a[h],f=h+1,g=a[f];if(0>D(l,e))f<d&&0>D(g,l)?(a[c]=g,a[f]=e,c=f):(a[c]=l,a[h]=e,c=h);else if(f<d&&0>D(g,e))a[c]=g,a[f]=e,c=f;else break a}}return b}
|
||||
function D(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)E(r);else if(b.startTime<=a)E(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}}function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,R(S);else{var b=p(r);null!==b&&T(Q,b.startTime-a)}}function S(a,b){u=!1;z&&(z=!1,ea(A),A=-1);F=!0;var c=k;try{P(b);for(n=p(q);null!==n&&(!(n.expirationTime>b)||a&&!fa());){var m=n.callback;if("function"===typeof m){n.callback=null;
|
||||
k=n.priorityLevel;var d=m(n.expirationTime<=b);b=v();"function"===typeof d?n.callback=d:n===p(q)&&E(q);P(b)}else E(q);n=p(q)}if(null!==n)var g=!0;else{var h=p(r);null!==h&&T(Q,h.startTime-b);g=!1}return g}finally{n=null,k=c,F=!1}}function fa(){return v()-ha<ia?!1:!0}function R(a){G=a;H||(H=!0,I())}function T(a,b){A=ja(function(){a(v())},b)}var y=Symbol.for("react.element"),pa=Symbol.for("react.portal"),ra=Symbol.for("react.fragment"),sa=Symbol.for("react.strict_mode"),ta=Symbol.for("react.profiler"),
|
||||
ua=Symbol.for("react.provider"),va=Symbol.for("react.context"),wa=Symbol.for("react.forward_ref"),xa=Symbol.for("react.suspense"),ya=Symbol.for("react.memo"),za=Symbol.for("react.lazy"),V=Symbol.iterator,X={isMounted:function(a){return!1},enqueueForceUpdate:function(a,b,c){},enqueueReplaceState:function(a,b,c,m){},enqueueSetState:function(a,b,c,m){}},ka=Object.assign,W={};w.prototype.isReactComponent={};w.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
||||
this.updater.enqueueSetState(this,a,b,"setState")};w.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};Y.prototype=w.prototype;var t=K.prototype=new Y;t.constructor=K;ka(t,w.prototype);t.isPureReactComponent=!0;var ca=Array.isArray,aa=Object.prototype.hasOwnProperty,L={current:null},ba={key:!0,ref:!0,__self:!0,__source:!0},da=/\/+/g,g={current:null},J={transition:null};if("object"===typeof performance&&"function"===typeof performance.now){var Aa=performance;
|
||||
var v=function(){return Aa.now()}}else{var la=Date,Ba=la.now();v=function(){return la.now()-Ba}}var q=[],r=[],Ca=1,n=null,k=3,F=!1,u=!1,z=!1,ja="function"===typeof setTimeout?setTimeout:null,ea="function"===typeof clearTimeout?clearTimeout:null,ma="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var H=!1,G=null,A=-1,ia=5,ha=
|
||||
-1,U=function(){if(null!==G){var a=v();ha=a;var b=!0;try{b=G(!0,a)}finally{b?I():(H=!1,G=null)}}else H=!1};if("function"===typeof ma)var I=function(){ma(U)};else if("undefined"!==typeof MessageChannel){t=new MessageChannel;var Da=t.port2;t.port1.onmessage=U;I=function(){Da.postMessage(null)}}else I=function(){ja(U,0)};t={ReactCurrentDispatcher:g,ReactCurrentOwner:L,ReactCurrentBatchConfig:J,Scheduler:{__proto__:null,unstable_ImmediatePriority:1,unstable_UserBlockingPriority:2,unstable_NormalPriority:3,
|
||||
unstable_IdlePriority:5,unstable_LowPriority:4,unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=k;k=a;try{return b()}finally{k=c}},unstable_next:function(a){switch(k){case 1:case 2:case 3:var b=3;break;default:b=k}var c=k;k=b;try{return a()}finally{k=c}},unstable_scheduleCallback:function(a,b,c){var e=v();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?e+c:e):c=e;switch(a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=
|
||||
1073741823;break;case 4:d=1E4;break;default:d=5E3}d=c+d;a={id:Ca++,callback:b,priorityLevel:a,startTime:c,expirationTime:d,sortIndex:-1};c>e?(a.sortIndex=c,O(r,a),null===p(q)&&a===p(r)&&(z?(ea(A),A=-1):z=!0,T(Q,c-e))):(a.sortIndex=d,O(q,a),u||F||(u=!0,R(S)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=k;return function(){var c=k;k=b;try{return a.apply(this,arguments)}finally{k=c}}},unstable_getCurrentPriorityLevel:function(){return k},unstable_shouldYield:fa,
|
||||
unstable_requestPaint:function(){},unstable_continueExecution:function(){u||F||(u=!0,R(S))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)},get unstable_now(){return v},unstable_forceFrameRate:function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ia=0<a?Math.floor(1E3/a):5},unstable_Profiling:null}};c.Children={map:C,forEach:function(a,b,c){C(a,function(){b.apply(this,
|
||||
arguments)},c)},count:function(a){var b=0;C(a,function(){b++});return b},toArray:function(a){return C(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};c.Component=w;c.Fragment=ra;c.Profiler=ta;c.PureComponent=K;c.StrictMode=sa;c.Suspense=xa;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+
|
||||
a+".");var e=ka({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=L.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var l=a.type.defaultProps;for(f in b)aa.call(b,f)&&!ba.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==l?l[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){l=Array(f);for(var g=0;g<f;g++)l[g]=arguments[g+2];e.children=l}return{$$typeof:y,type:a.type,key:d,ref:k,props:e,_owner:h}};c.createContext=function(a){a={$$typeof:va,
|
||||
_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:ua,_context:a};return a.Consumer=a};c.createElement=Z;c.createFactory=function(a){var b=Z.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:wa,render:a}};c.isValidElement=M;c.lazy=function(a){return{$$typeof:za,_payload:{_status:-1,_result:a},_init:qa}};c.memo=function(a,b){return{$$typeof:ya,type:a,
|
||||
compare:void 0===b?null:b}};c.startTransition=function(a,b){b=J.transition;J.transition={};try{a()}finally{J.transition=b}};c.unstable_act=function(a){throw Error("act(...) is not supported in production builds of React.");};c.useCallback=function(a,b){return g.current.useCallback(a,b)};c.useContext=function(a){return g.current.useContext(a)};c.useDebugValue=function(a,b){};c.useDeferredValue=function(a){return g.current.useDeferredValue(a)};c.useEffect=function(a,b){return g.current.useEffect(a,
|
||||
b)};c.useId=function(){return g.current.useId()};c.useImperativeHandle=function(a,b,c){return g.current.useImperativeHandle(a,b,c)};c.useInsertionEffect=function(a,b){return g.current.useInsertionEffect(a,b)};c.useLayoutEffect=function(a,b){return g.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return g.current.useMemo(a,b)};c.useReducer=function(a,b,c){return g.current.useReducer(a,b,c)};c.useRef=function(a){return g.current.useRef(a)};c.useState=function(a){return g.current.useState(a)};
|
||||
c.useSyncExternalStore=function(a,b,c){return g.current.useSyncExternalStore(a,b,c)};c.useTransition=function(){return g.current.useTransition()};c.version="18.2.0"});
|
||||
})();
|
4803
package-lock.json
generated
4803
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@ -6,26 +6,31 @@
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
"lint": "next lint",
|
||||
"type-check": "tsc --noEmit",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"@oceanprotocol/art": "^3.2.0",
|
||||
"@oceanprotocol/contracts": "^1.1.7",
|
||||
"@oceanprotocol/typographies": "^0.1.0",
|
||||
"@svgr/webpack": "^6.5.0",
|
||||
"axios": "^1.1.3",
|
||||
"dotenv": "^16.0.3",
|
||||
"next": "12.3.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
"react-dom": "18.2.0",
|
||||
"swr": "^1.3.0",
|
||||
"tiny-relative-date": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.7.23",
|
||||
"@types/react": "18.0.21",
|
||||
"@types/react-dom": "18.0.6",
|
||||
"eslint": "8.24.0",
|
||||
"eslint": "^8.25.0",
|
||||
"eslint-config-next": "12.3.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"ethers": "^5.7.1",
|
||||
"husky": "^7.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"typescript": "4.8.4"
|
||||
}
|
||||
|
@ -1,82 +1,36 @@
|
||||
import { BigNumber } from 'ethers'
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
export enum State {
|
||||
Up = 'UP',
|
||||
Down = 'DOWN',
|
||||
Warning = 'WARNING'
|
||||
Normal = 'Normal',
|
||||
Degraded = 'Degraded',
|
||||
Outage = 'Outage'
|
||||
}
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
export interface Status {
|
||||
network: string
|
||||
currentBlock: number
|
||||
market: State
|
||||
port: State
|
||||
faucet: FaucetStatus | Record<string, never>
|
||||
aquarius: AquariusStatus
|
||||
provider: ProviderStatus
|
||||
subgraph: SubgraphStatus
|
||||
operator: OperatorStatus
|
||||
dataFarming: State
|
||||
daoGrants: State
|
||||
lastUpdatedOn: number
|
||||
}
|
||||
export interface ProviderStatus {
|
||||
status: State
|
||||
response?: number
|
||||
version?: string
|
||||
latestRelease?: string
|
||||
currentBlock?: number
|
||||
components: Component[]
|
||||
}
|
||||
|
||||
export interface AquariusStatus {
|
||||
export interface Component {
|
||||
name: string
|
||||
status: State
|
||||
response?: number
|
||||
validChainList?: boolean
|
||||
version?: string
|
||||
monitorVersion?: string
|
||||
statusMessages: string[]
|
||||
response: number
|
||||
version: string
|
||||
latestRelease?: string
|
||||
url?: string
|
||||
validChainList?: boolean
|
||||
monitorVersion?: string
|
||||
block?: number
|
||||
validQuery?: boolean
|
||||
}
|
||||
export interface SubgraphStatus {
|
||||
status: State
|
||||
response?: number
|
||||
version?: string
|
||||
latestRelease?: string
|
||||
block?: number
|
||||
}
|
||||
|
||||
export interface OperatorStatus {
|
||||
status: State
|
||||
response?: number
|
||||
version?: string
|
||||
latestRelease?: string
|
||||
environments?: number
|
||||
limitReached?: boolean
|
||||
}
|
||||
export interface FaucetStatus {
|
||||
status: State
|
||||
response?: number
|
||||
ethBalance?: BigNumber
|
||||
ethBalanceSufficient?: boolean
|
||||
oceanBalance?: BigNumber
|
||||
oceanBalanceSufficient?: boolean
|
||||
}
|
||||
|
||||
export interface Network {
|
||||
name: string
|
||||
chainId: string
|
||||
test?: boolean
|
||||
faucetWallet?: string
|
||||
rpcUrl?: string
|
||||
oceanAddress?: string
|
||||
}
|
||||
|
||||
export interface Summary {
|
||||
component: string
|
||||
status: State
|
||||
}
|
||||
|
||||
export interface NetworkSummary {
|
||||
name: string
|
||||
status: State
|
||||
}
|
||||
|
3
src/images/check.svg
Normal file
3
src/images/check.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="26" viewBox="0 0 32 26">
|
||||
<polygon points="11.941 25.754 0 13.812 5.695 8.117 11.941 14.363 26.305 0 32 5.695"/>
|
||||
</svg>
|
After Width: | Height: | Size: 180 B |
1
src/images/github.svg
Normal file
1
src/images/github.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
|
After Width: | Height: | Size: 527 B |
@ -1,3 +1,4 @@
|
||||
import '@oceanprotocol/typographies/css/ocean-typo.css'
|
||||
import '../styles/globals.css'
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
|
@ -1,99 +1,171 @@
|
||||
import Head from 'next/head'
|
||||
import React, { ReactElement, useEffect, useState } from 'react'
|
||||
import { Status, State, Summary, NetworkSummary } from '../@types'
|
||||
import React, { Fragment, ReactElement } from 'react'
|
||||
import { State } from '../@types'
|
||||
import styles from '../styles/Home.module.css'
|
||||
import { getData, getNetworkSUmmary, getSummary } from '../utils/getData'
|
||||
import Logo from '../images/logo.svg'
|
||||
import Image from 'next/image'
|
||||
import { getData } from '../utils/getData'
|
||||
import LogoAsset from '../images/logo.svg'
|
||||
import CheckAsset from '../images/check.svg'
|
||||
import GithubAsset from '../images/github.svg'
|
||||
import addresses from '@oceanprotocol/contracts/addresses/address.json'
|
||||
import { statusApiUri } from '../../app.config'
|
||||
import relativeDate from 'tiny-relative-date'
|
||||
import useSWR from 'swr'
|
||||
|
||||
function statusIcon(state: State): ReactElement {
|
||||
if (state === State.Normal) {
|
||||
return <CheckAsset className={`${styles.icon} ${styles.check}`} />
|
||||
} else if (state === State.Outage) {
|
||||
return <span className={styles.icon}>🚨</span>
|
||||
} else {
|
||||
return <span className={styles.icon}>🚧</span>
|
||||
}
|
||||
}
|
||||
|
||||
function statusStyle(state: State) {
|
||||
if (state === State.Outage) {
|
||||
return styles.outage
|
||||
} else if (state === State.Degraded) {
|
||||
return styles.degraded
|
||||
} else {
|
||||
return styles.normal
|
||||
}
|
||||
}
|
||||
|
||||
export default function HomePage(): ReactElement {
|
||||
const [network, setNetwork] = useState<string>('mainnet')
|
||||
const [summary, setSummary] = useState<Summary[]>()
|
||||
const [networks, setNetworks] = useState<NetworkSummary[]>()
|
||||
|
||||
function statusIcon(state: State): string {
|
||||
if (state === State.Up) {
|
||||
return '✅'
|
||||
} else if (state === State.Down) {
|
||||
return '🚨'
|
||||
} else {
|
||||
return '🚧'
|
||||
}
|
||||
}
|
||||
|
||||
function statusStyle(state: State) {
|
||||
if (state === State.Down) {
|
||||
return styles.down
|
||||
} else if (state === State.Warning) {
|
||||
return styles.warning
|
||||
} else {
|
||||
return styles.up
|
||||
}
|
||||
}
|
||||
|
||||
function networkStyle(currentNet: string) {
|
||||
if (currentNet === network) {
|
||||
return styles.networkSelected
|
||||
} else return styles.networkUnselected
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
async function getStatuses() {
|
||||
const statusData = await getData()
|
||||
const summaryData = getSummary(network, statusData)
|
||||
if (summaryData) setSummary(summaryData)
|
||||
const networkSummary = getNetworkSUmmary(statusData)
|
||||
if (networkSummary) setNetworks(networkSummary)
|
||||
}
|
||||
getStatuses()
|
||||
}, [network])
|
||||
const { data, error } = useSWR(statusApiUri, getData, {
|
||||
refreshInterval: 60000
|
||||
})
|
||||
const isLoading = !data && !error
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.app}>
|
||||
<Head>
|
||||
<title>Ocean Protocol Status</title>
|
||||
<meta name="description" content="Generated by create next app" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Status overview of all deployed components hosted by the Ocean Protocol Foundation."
|
||||
/>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<main className={styles.main}>
|
||||
<Image src={Logo} height="80rem" />
|
||||
{/* <img src={require('../images/logo.svg')} alt="Ocean Protocol Logo" /> */}
|
||||
<h1 className={styles.title}>Ocean Status</h1>
|
||||
|
||||
<header className={styles.header}>
|
||||
<LogoAsset className={styles.logo} />
|
||||
|
||||
<h1 className={styles.title}>Ocean Protocol Status</h1>
|
||||
<p className={styles.description}>
|
||||
Current Status of Ocean Components{' '}
|
||||
Status overview of all{' '}
|
||||
<a href="https://docs.oceanprotocol.com/core-concepts/networks">
|
||||
deployed components
|
||||
</a>{' '}
|
||||
hosted by the Ocean Protocol Foundation.
|
||||
</p>
|
||||
<div className={styles.grid}>
|
||||
{networks && (
|
||||
<>
|
||||
{networks.map((network: NetworkSummary, i: number) => (
|
||||
<button
|
||||
key={i}
|
||||
className={`${styles.network} ${networkStyle(network.name)}`}
|
||||
onClick={() => setNetwork(network.name)}
|
||||
>
|
||||
<span>
|
||||
{network.name} {statusIcon(network.status)}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.grid}>
|
||||
{summary && (
|
||||
<>
|
||||
{summary.map((value: Summary) => (
|
||||
<div
|
||||
key={value.component}
|
||||
className={`${styles.card} ${statusStyle(value.status)}`}
|
||||
>
|
||||
<h2>{value?.component}</h2>
|
||||
<p>{value?.status}</p>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className={styles.content}>
|
||||
{isLoading ? (
|
||||
<div className={styles.loading}>Loading...</div>
|
||||
) : error ? (
|
||||
<div className={styles.loading}>{error}</div>
|
||||
) : (
|
||||
Object.entries(data || {}).map(([networkName, value]) => (
|
||||
<Fragment key={networkName}>
|
||||
<h2 className={styles.networkName}>
|
||||
{networkName == 'general' ? null : (
|
||||
<>
|
||||
{networkName}
|
||||
<span
|
||||
className={styles.date}
|
||||
title={`Last update: ${new Date(value.lastUpdatedOn)}`}
|
||||
>
|
||||
{relativeDate(new Date(value.lastUpdatedOn))}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</h2>
|
||||
<div className={styles.grid}>
|
||||
{value.components.map((component) => (
|
||||
<div
|
||||
key={component.name}
|
||||
className={`${styles.card} ${statusStyle(
|
||||
component.status
|
||||
)}`}
|
||||
>
|
||||
<h2 className={styles.titleComponent}>
|
||||
{statusIcon(component.status)}{' '}
|
||||
<a
|
||||
href={component.url}
|
||||
title="Go to tested endpoint"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{component.name}
|
||||
</a>
|
||||
<code className={styles.version} title="deployed version">
|
||||
{component.version}
|
||||
</code>
|
||||
</h2>
|
||||
|
||||
{component.statusMessages?.length ? (
|
||||
<ul className={styles.messages}>
|
||||
{component.statusMessages.map(
|
||||
(message: string, i: number) => (
|
||||
<li key={i} className={styles.statusMessage}>
|
||||
{message}
|
||||
</li>
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
) : null}
|
||||
<footer className={styles.links}>
|
||||
{component.name !== 'data-farming' &&
|
||||
component.name !== 'cexa' && (
|
||||
<a
|
||||
href={`https://github.com/oceanprotocol/${
|
||||
component.name === 'subgraph' ? 'ocean-' : ''
|
||||
}${component.name}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
title="Go to GitHub repository"
|
||||
>
|
||||
<GithubAsset className={styles.icon} />
|
||||
</a>
|
||||
)}
|
||||
</footer>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{networkName !== 'general' && (
|
||||
<details className={styles.contracts}>
|
||||
<summary>
|
||||
<h3 className={styles.titleComponent}>
|
||||
Deployed Contracts
|
||||
</h3>
|
||||
</summary>
|
||||
<ul>
|
||||
{Object.entries((addresses as any)[networkName]).map(
|
||||
([key, value]: [
|
||||
key: string,
|
||||
value: string | { [key: number]: string }
|
||||
]) =>
|
||||
key !== 'chainId' &&
|
||||
key !== 'startBlock' && (
|
||||
<li key={key}>
|
||||
<code className={styles.key}>{key}</code>
|
||||
<code>
|
||||
{typeof value === 'string'
|
||||
? value
|
||||
: JSON.stringify(value, null, 2)}
|
||||
</code>
|
||||
</li>
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
</Fragment>
|
||||
))
|
||||
)}
|
||||
</main>
|
||||
|
||||
<footer className={styles.footer}></footer>
|
||||
|
@ -1,49 +1,31 @@
|
||||
.container {
|
||||
padding: 0 2rem;
|
||||
.app {
|
||||
padding: var(--spacer);
|
||||
margin: 0 auto;
|
||||
background: url('../../node_modules/@oceanprotocol/art/waves/waves.svg')
|
||||
no-repeat center 13.5rem;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.main {
|
||||
min-height: 100vh;
|
||||
padding: 2rem 0;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-family: 'Sharp Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
Helvetica, Arial, sans-serif;
|
||||
@media screen and (min-width: 50rem) {
|
||||
.app {
|
||||
padding: calc(var(--spacer) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
.header,
|
||||
.content,
|
||||
.footer {
|
||||
max-width: 70rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: 2rem 0;
|
||||
border-top: 1px solid #eaeaea;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.title a {
|
||||
color: #0070f3;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.title a:hover,
|
||||
.title a:focus,
|
||||
.title a:active {
|
||||
text-decoration: underline;
|
||||
padding: var(--spacer) 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
line-height: 1.15;
|
||||
font-size: 4rem;
|
||||
margin-bottom: calc(var(--spacer) / 4);
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
||||
.title,
|
||||
@ -52,112 +34,183 @@
|
||||
}
|
||||
|
||||
.description {
|
||||
line-height: 1.5;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.code {
|
||||
background: #fafafa;
|
||||
border-radius: 5px;
|
||||
padding: 0.75rem;
|
||||
font-size: 1.1rem;
|
||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||
font-size: var(--font-size-large);
|
||||
margin: 0 auto;
|
||||
max-width: 50rem;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
max-width: 800px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
|
||||
gap: var(--spacer);
|
||||
}
|
||||
|
||||
.networkName {
|
||||
margin-top: calc(var(--spacer) * 3);
|
||||
margin-bottom: var(--spacer);
|
||||
text-transform: capitalize;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin: 1rem;
|
||||
padding: 1.5rem;
|
||||
text-align: left;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
border-radius: 10px;
|
||||
transition: color 0.15s ease, border-color 0.15s ease;
|
||||
max-width: 300px;
|
||||
min-width: 150px;
|
||||
}
|
||||
.network {
|
||||
display: inline-block;
|
||||
border: 1px solid;
|
||||
border-radius: 0.2rem;
|
||||
margin-right: calc(2rem / 6);
|
||||
margin-bottom: calc(2rem / 6);
|
||||
padding: calc(2rem / 6);
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
width: fit-content;
|
||||
min-width: auto;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
transition: 0.2s ease-out;
|
||||
}
|
||||
.networkUnselected {
|
||||
color: #8b98a9;
|
||||
background: #fff;
|
||||
border-color: #e2e2e2;
|
||||
}
|
||||
.networkUnselected:hover {
|
||||
color: #41474e;
|
||||
}
|
||||
.networkSelected {
|
||||
color: #fcfcfc;
|
||||
background: #41474e;
|
||||
border-color: #fcfcfc;
|
||||
}
|
||||
.up {
|
||||
border: 2px solid #5fb359;
|
||||
background: var(--background-content);
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: 0 6px 17px 0 var(--box-shadow-color);
|
||||
border: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.warning {
|
||||
border: 2px solid #eac146;
|
||||
}
|
||||
|
||||
.down {
|
||||
border: 2px solid #d80606;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0 0 1rem 0;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.card p {
|
||||
.titleComponent {
|
||||
font-size: var(--font-size-large);
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.titleComponent a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.titleComponent a:hover,
|
||||
.titleComponent a:focus {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.links {
|
||||
width: calc(100% + 1rem);
|
||||
margin-top: calc(var(--spacer) / 2);
|
||||
font-size: var(--font-size-small);
|
||||
text-align: right;
|
||||
margin-bottom: -1.2rem;
|
||||
margin-right: -1rem;
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.links svg {
|
||||
display: inline-block;
|
||||
stroke: var(--color-secondary);
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
}
|
||||
|
||||
.links a:hover svg,
|
||||
.links a:focus svg {
|
||||
stroke: var(--color-primary);
|
||||
}
|
||||
|
||||
.degraded {
|
||||
border-color: var(--brand-alert-yellow);
|
||||
}
|
||||
|
||||
.outage {
|
||||
border-color: var(--brand-alert-red);
|
||||
}
|
||||
|
||||
.version {
|
||||
color: var(--color-secondary);
|
||||
font-size: var(--font-size-small);
|
||||
margin-left: calc(var(--spacer) / 4);
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 1em;
|
||||
margin-left: 0.5rem;
|
||||
fill: var(--font-color-heading);
|
||||
height: 4rem;
|
||||
width: 4rem;
|
||||
margin: 0 auto calc(var(--spacer) / 2) auto;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.grid {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
.icon {
|
||||
display: inline-block;
|
||||
margin-right: calc(var(--spacer) / 6);
|
||||
}
|
||||
|
||||
.check {
|
||||
fill: var(--brand-alert-green);
|
||||
}
|
||||
|
||||
.messages {
|
||||
width: 100%;
|
||||
list-style-type: square;
|
||||
margin-left: 1rem;
|
||||
margin-top: calc(var(--spacer) / 4);
|
||||
color: var(--color-secondary);
|
||||
font-size: var(--font-size-small);
|
||||
}
|
||||
|
||||
.messages li {
|
||||
display: list-item;
|
||||
margin-top: calc(var(--spacer) / 8);
|
||||
list-style-position: outside;
|
||||
}
|
||||
|
||||
.degraded .messages {
|
||||
color: var(--brand-alert-orange);
|
||||
}
|
||||
|
||||
.outage .messages {
|
||||
color: var(--brand-alert-red);
|
||||
}
|
||||
|
||||
.contracts {
|
||||
margin-top: var(--spacer);
|
||||
}
|
||||
|
||||
.contracts summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.contracts .titleComponent {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
margin-bottom: calc(var(--spacer) / 2);
|
||||
}
|
||||
|
||||
.contracts li {
|
||||
padding: calc(var(--spacer) / 6) calc(var(--spacer) / 2);
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.contracts li:hover {
|
||||
background: var(--background-highlight);
|
||||
}
|
||||
|
||||
.contracts li:last-child {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.contracts li code {
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 55rem) {
|
||||
.contracts li {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 4fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.card,
|
||||
.footer {
|
||||
border-color: #222;
|
||||
}
|
||||
.code {
|
||||
background: #111;
|
||||
}
|
||||
.logo img {
|
||||
filter: invert(1);
|
||||
}
|
||||
.contracts .key {
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
|
||||
.loading {
|
||||
margin-top: 30vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.date {
|
||||
display: inline;
|
||||
margin-left: calc(var(--spacer) / 4);
|
||||
font-size: var(--font-size-small);
|
||||
color: var(--color-secondary);
|
||||
text-transform: lowercase;
|
||||
font-family: var(--font-family-base);
|
||||
font-weight: var(--font-weight-base);
|
||||
}
|
||||
|
82
src/styles/_variables.css
Normal file
82
src/styles/_variables.css
Normal file
@ -0,0 +1,82 @@
|
||||
:root {
|
||||
--brand-white: #ffffff;
|
||||
--brand-black: #141414;
|
||||
--brand-pink: #ff4092;
|
||||
--brand-purple: #7b1173;
|
||||
--brand-violet: #e000cf;
|
||||
|
||||
--brand-grey-darker: #201f1f;
|
||||
--brand-grey-dark: #303030;
|
||||
--brand-grey: #41474e;
|
||||
--brand-grey-light: #8b98a9;
|
||||
--brand-grey-lighter: #e2e2e2;
|
||||
--brand-grey-dimmed: #f7f7f7;
|
||||
|
||||
--brand-gradient: linear-gradient(to right bottom, #7b1173, #ff4092);
|
||||
|
||||
--brand-alert-green: #5fb359;
|
||||
--brand-alert-red: #d80606;
|
||||
--brand-alert-orange: #b35f36;
|
||||
--brand-alert-yellow: #eac146;
|
||||
|
||||
--color-primary: #ff4092;
|
||||
--color-secondary: #8b98a9;
|
||||
|
||||
/* Only use these vars for most color referencing for easy light/dark mode */
|
||||
--font-color-text: #41474e;
|
||||
--font-color-heading: #141414;
|
||||
--background-body: #fcfcfc;
|
||||
--background-body-transparent: rgba(255, 255, 255, 0.8);
|
||||
--background-content: #fff;
|
||||
--background-highlight: #f7f7f7;
|
||||
--border-color: #e2e2e2;
|
||||
--box-shadow-color: rgba(0, 0, 0, 0.05);
|
||||
|
||||
--font-family-base: 'Sharp Sans', -apple-system, BlinkMacSystemFont,
|
||||
'Segoe UI', Helvetica, Arial, sans-serif;
|
||||
--font-family-heading: 'Sharp Sans Display', -apple-system, BlinkMacSystemFont,
|
||||
'Segoe UI', Helvetica, Arial, sans-serif;
|
||||
--font-family-monospace: 'Fira Code', 'Fira Mono', Menlo, Monaco, Consolas,
|
||||
'Courier New', monospace;
|
||||
|
||||
--font-size-root: 15px;
|
||||
--font-size-base: 1rem;
|
||||
--font-size-large: 1.2rem;
|
||||
--font-size-small: 0.85rem;
|
||||
--font-size-mini: 0.65rem;
|
||||
--font-size-text: 1rem;
|
||||
--font-size-label: 1rem;
|
||||
--font-size-title: 1.4rem;
|
||||
--font-size-h1: 3rem;
|
||||
--font-size-h2: 2.5rem;
|
||||
--font-size-h3: 1.7rem;
|
||||
--font-size-h4: 1.3rem;
|
||||
--font-size-h5: 1.1rem;
|
||||
--font-weight-base: 500;
|
||||
--font-weight-bold: 600;
|
||||
--line-height: 1.6;
|
||||
|
||||
--spacer: 2rem;
|
||||
--border-radius: 0.2rem;
|
||||
|
||||
--layout-max-width: 85rem;
|
||||
--checkbox-size: 1.6em;
|
||||
|
||||
--break-point--small: 640px;
|
||||
--break-point--medium: 860px;
|
||||
--break-point--large: 1140px;
|
||||
--break-point--huge: 1400px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--font-color-text: #e2e2e2;
|
||||
--font-color-heading: #f7f7f7;
|
||||
--background-body: rgb(10, 10, 10);
|
||||
--background-body-transparent: rgba(10, 10, 10, 0.9);
|
||||
--background-content: #141414;
|
||||
--background-highlight: #201f1f;
|
||||
--border-color: #303030;
|
||||
--box-shadow-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
@ -1,26 +1,156 @@
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||
}
|
||||
@import '_variables.css';
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
* {
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: var(--font-size-root);
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
@media screen and (prefers-reduced-motion: reduce) {
|
||||
html {
|
||||
color-scheme: dark;
|
||||
}
|
||||
body {
|
||||
color: white;
|
||||
background: black;
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--font-color-text);
|
||||
font-size: var(--font-size-base);
|
||||
font-family: var(--font-family-base);
|
||||
font-weight: var(--font-weight-base);
|
||||
line-height: var(--line-height);
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
position: relative;
|
||||
background: var(--background-body);
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: var(--brand-pink);
|
||||
transition: 0.2s ease-out;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
margin-bottom: calc(var(--spacer) / var(--line-height));
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
font-family: var(--font-family-heading);
|
||||
color: var(--font-color-heading);
|
||||
line-height: 1.2;
|
||||
font-weight: var(--font-weight-bold);
|
||||
margin-top: 0;
|
||||
margin-bottom: var(--spacer);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: var(--font-size-h2);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: var(--font-size-h3);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--font-size-h4);
|
||||
}
|
||||
|
||||
@media (min-width: 30rem) {
|
||||
h1 {
|
||||
font-size: var(--font-size-h1);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: var(--font-size-h2);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--font-size-h3);
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: var(--font-size-h4);
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: var(--font-size-h5);
|
||||
}
|
||||
|
||||
figure,
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
audio,
|
||||
embed,
|
||||
canvas,
|
||||
picture {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--font-color-heading);
|
||||
color: var(--background-body);
|
||||
}
|
||||
|
||||
form,
|
||||
fieldset {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
display: block;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
table th,
|
||||
table td {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: calc(var(--spacer) / 2);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
text-align: left;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
table th {
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
|
@ -1,80 +1,21 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
import { NetworkSummary, State, Status, Summary } from '../@types'
|
||||
import { statusApiUri } from '../../app.config'
|
||||
import { availableNetworks } from '../../app.config'
|
||||
import { Status } from '../@types'
|
||||
|
||||
export async function getData(): Promise<Status[][]> {
|
||||
export async function getData(url: string): Promise<{ [key: string]: Status }> {
|
||||
try {
|
||||
const response: AxiosResponse<Status[][]> = await axios.get(
|
||||
`${statusApiUri}`
|
||||
const response: AxiosResponse<Status[]> = await axios.get(url)
|
||||
if (!response?.data || response.status !== 200)
|
||||
throw Error('ERROR: no data recieved')
|
||||
|
||||
// transform data into object with network names as keys
|
||||
let output = Object.fromEntries(
|
||||
response.data?.map((item) => [item.network, item])
|
||||
)
|
||||
if (!response || response.status !== 200 || !response.data)
|
||||
console.log('ERROR: no data recieved')
|
||||
|
||||
const data = response.data
|
||||
|
||||
return data
|
||||
// make sure 'general' is always the first key
|
||||
output = Object.assign({ general: output['general'] }, output)
|
||||
console.log('Got new data', output)
|
||||
return output
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
console.error(error.message)
|
||||
}
|
||||
}
|
||||
|
||||
export function getSummary(network: string, data: Status[][]): Summary[] {
|
||||
try {
|
||||
if (data) {
|
||||
let status: Status
|
||||
|
||||
data.forEach((element) => {
|
||||
if (element[0].network === network) return (status = element[0])
|
||||
})
|
||||
|
||||
const summary: Summary[] = [
|
||||
{ component: 'Aquarius', status: status?.aquarius?.status },
|
||||
{ component: 'Provider', status: status?.provider?.status },
|
||||
{ component: 'Subgraph', status: status?.subgraph?.status },
|
||||
{ component: 'Market', status: status?.market },
|
||||
{ component: 'Port', status: status?.port },
|
||||
{
|
||||
component: 'Data Farming',
|
||||
status: status?.dataFarming
|
||||
},
|
||||
{
|
||||
component: 'Operator Service',
|
||||
status: status?.operator?.status
|
||||
},
|
||||
{
|
||||
component: 'DAO Grants',
|
||||
status: status?.daoGrants
|
||||
}
|
||||
]
|
||||
status?.faucet?.status &&
|
||||
summary.push({
|
||||
component: 'Faucet',
|
||||
status: status.faucet.status
|
||||
})
|
||||
|
||||
return summary
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
export function getNetworkSUmmary(data: Status[][]): NetworkSummary[] {
|
||||
const networks: string[] = JSON.parse(availableNetworks)
|
||||
const networkSummary: NetworkSummary[] = []
|
||||
networks.forEach((network) => {
|
||||
const summary = getSummary(network, data)
|
||||
let status = State.Up
|
||||
summary.forEach((service) => {
|
||||
if (service.status === State.Down) return (status = State.Down)
|
||||
})
|
||||
if (status === State.Up) {
|
||||
summary.forEach((service) => {
|
||||
if (service.status === State.Warning) return (status = State.Warning)
|
||||
})
|
||||
}
|
||||
networkSummary.push({ name: network, status })
|
||||
})
|
||||
return networkSummary
|
||||
}
|
||||
|
@ -1,33 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "ES2020",
|
||||
"lib": ["dom", "ES2020"],
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"jsx": "preserve",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"noEmit": true,
|
||||
"sourceMap": true,
|
||||
"noImplicitAny": true,
|
||||
"paths": {
|
||||
"@shared/*": ["./src/components/@shared/*"],
|
||||
"@hooks/*": ["./src/@hooks/*"],
|
||||
"@context/*": ["./src/@context/*"],
|
||||
"@images/*": ["./src/@images/*"],
|
||||
"@utils/*": ["./src/@utils/*"],
|
||||
"@content/*": ["./@content/*"]
|
||||
},
|
||||
"baseUrl": ".",
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true,
|
||||
"allowJs": true,
|
||||
"noEmit": true,
|
||||
"incremental": true,
|
||||
"esModuleInterop": true,
|
||||
"incremental": true
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"exclude": ["node_modules", ".next", "*.js"],
|
||||
"include": ["./src/**/*", "./tests/**/*", "./next-env.d.ts", "./content/**/*"]
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user