Compare commits

..

39 Commits

Author SHA1 Message Date
Kairee Wu 80df346ec3
Merge pull request #12 from krwu/dependabot/npm_and_yarn/webpack-5.82.0
build(deps): bump webpack from 5.75.0 to 5.82.0
4 years ago
dependabot[bot] da6726e223
build(deps): bump webpack from 5.75.0 to 5.82.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.82.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.82.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
semantic-release-bot bed2cd0724 chore(release): 2.0.3 [skip ci]
## [2.0.3](https://github.com/krwu/ServerStatus-web/compare/v2.0.2...v2.0.3) (2023-03-07)

### Bug Fixes

* http-cache-semantics vulnerable ([dac1abc](dac1abc111))
4 years ago
kaireewu dac1abc111
fix: http-cache-semantics vulnerable 4 years ago
Kairee Wu 0394e1e410
Merge pull request #11 from krwu/dependabot/npm_and_yarn/json5-1.0.2
build(deps): bump json5 from 1.0.1 to 1.0.2
4 years ago
dependabot[bot] b3f50add57
build(deps): bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
Kairee Wu d25d7fa890
Merge pull request #10 from krwu/dependabot/npm_and_yarn/minimatch-and-recursive-readdir-3.1.2
build(deps): bump minimatch and recursive-readdir
4 years ago
dependabot[bot] 1dfa29f3d1
build(deps): bump minimatch and recursive-readdir
Bumps [minimatch](https://github.com/isaacs/minimatch) and [recursive-readdir](https://github.com/jergason/recursive-readdir). These dependencies needed to be updated together.

Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `recursive-readdir` from 2.2.2 to 2.2.3
- [Release notes](https://github.com/jergason/recursive-readdir/releases)
- [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
Kairee Wu 3c2d44013e
Merge pull request #9 from krwu/dependabot/npm_and_yarn/loader-utils-2.0.4
build(deps): bump loader-utils from 2.0.3 to 2.0.4
4 years ago
dependabot[bot] 54b7548879
build(deps): bump loader-utils from 2.0.3 to 2.0.4
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
Kairee Wu e419c00c50
Merge pull request #8 from krwu/dependabot/npm_and_yarn/loader-utils-2.0.3
build(deps): bump loader-utils from 2.0.2 to 2.0.3
4 years ago
dependabot[bot] 4872457bfb
build(deps): bump loader-utils from 2.0.2 to 2.0.3
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.3/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
semantic-release-bot fab7d28d70 chore(release): 2.0.2 [skip ci]
## [2.0.2](https://github.com/krwu/ServerStatus-web/compare/v2.0.1...v2.0.2) (2022-09-13)

### Bug Fixes

* **npm:** potential security vulnerabilities ([10db0cb](10db0cbb2d))
4 years ago
Kairee Wu 10db0cbb2d
fix(npm): potential security vulnerabilities 4 years ago
kaireewu 35bdebe5d9
build(npm): upgrade dependencies [skip ci] 4 years ago
semantic-release-bot 33e6bfb1b5 chore(release): 2.0.1 [skip ci]
## [2.0.1](https://github.com/krwu/ServerStatus-web/compare/v2.0.0...v2.0.1) (2022-07-14)

### Performance Improvements

* clean unnecessary packages ([d5a1dd0](d5a1dd007c))
4 years ago
kaireewu d5a1dd007c
perf: clean unnecessary packages 4 years ago
kaireewu 556d0f31ff
build(react): upgrade to react 18 4 years ago
semantic-release-bot 487fd2b6c8 chore(release): 2.0.0 [skip ci]
# [2.0.0](https://github.com/krwu/ServerStatus-web/compare/v1.4.0...v2.0.0) (2022-06-14)

### Features

* upgrade dependencies ([eeff4c0](eeff4c0eaf))

### BREAKING CHANGES

* - react-scripts upgraded to v5
- semantic-release upgraded to v19
- dropped support for Node <= 15
4 years ago
kaireewu eeff4c0eaf
feat: upgrade dependencies
BREAKING CHANGE:
- react-scripts upgraded to v5
- semantic-release upgraded to v19
- dropped support for Node <= 15
4 years ago
semantic-release-bot e22bbe70ea chore(release): 1.4.0 [skip ci]
# [1.4.0](https://github.com/krwu/ServerStatus-web/compare/v1.3.0...v1.4.0) (2022-02-19)

### Features

* upgrade dependencies ([c9a4f11](c9a4f11286))
5 years ago
Kairee Wu c9a4f11286
feat: upgrade dependencies 5 years ago
semantic-release-bot 6e1968fd18 chore(release): 1.3.0 [skip ci]
# [1.3.0](https://github.com/krwu/ServerStatus-web/compare/v1.2.0...v1.3.0) (2021-09-22)

### Features

* bump antd version to 4.0 ([664003d](664003df1b))
5 years ago
Kairee Wu 664003df1b
feat: bump antd version to 4.0 5 years ago
semantic-release-bot 576ae9734c chore(release): 1.2.0 [skip ci]
# [1.2.0](https://github.com/krwu/ServerStatus-web/compare/v1.1.5...v1.2.0) (2021-09-22)

### Bug Fixes

* ignore local registry ([15158f4](15158f4c8d))
* serviceWorker cause building failed ([bc548af](bc548af585))

### Features

* **ui:** add index for each row ([1c0fbfe](1c0fbfe86e))
5 years ago
Kairee Wu bc548af585
fix: serviceWorker cause building failed 5 years ago
Kairee Wu 15158f4c8d
fix: ignore local registry 5 years ago
Kairee Wu 6ab4977fc2
build: remove husky 5 years ago
Kairee Wu 97658483ff
build: specific node version to 14 5 years ago
Kairee Wu 7616241682
build(npm): upgrade dependencies 5 years ago
Kairee Wu 1c0fbfe86e
feat(ui): add index for each row 5 years ago
Kairee Wu de2736e2b5
Merge pull request #5 from krwu/dependabot/npm_and_yarn/semantic-release-17.2.3
build(deps-dev): bump semantic-release from 15.14.0 to 17.2.3
6 years ago
dependabot[bot] 66692e56e2
build(deps-dev): bump semantic-release from 15.14.0 to 17.2.3
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 15.14.0 to 17.2.3.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v15.14.0...v17.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
6 years ago
Kairee Wu 08012b2054
build(npm): upgrade dependencies for development 6 years ago
semantic-release-bot a41e294cfe chore(release): 1.1.5 [skip ci]
## [1.1.5](https://github.com/krwu/ServerStatus-web/compare/v1.1.4...v1.1.5) (2020-11-05)

### Bug Fixes

* locale ('1 day' doesn't work), mobile style ('name' item size) ([cf5c3b6](cf5c3b6638))
6 years ago
Kairee Wu a4d17234d4
build(ci): switch from travis to github actions 6 years ago
Kairee Wu c11917cf30
Merge pull request #4 from wjy20030407/master
fix: locale ('1 day' doesn't work), mobile style ('name' item size)
6 years ago
Dreamy.WJY cf5c3b6638
fix: locale ('1 day' doesn't work), mobile style ('name' item size) 6 years ago
Kairee Wu 6d063b133e
chore(license): rename copying.txt to LICENSE [skip ci] 7 years ago

@ -1 +0,0 @@
module.exports = {extends: ['@commitlint/config-conventional']}

@ -1,23 +0,0 @@
{
"env": {
"es6": true,
"node": true
},
"extends": ["plugin:react/recommended", "airbnb"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }]
}
}

@ -0,0 +1,31 @@
name: release
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Rename output dir
run: mv build sergate
- name: Make zip file
run: zip -r -9 sergate.zip ./sergate -x .gitignore
- name: Semantic release
run: npx semantic-release
env:
CI: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored

@ -23,3 +23,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock

@ -0,0 +1 @@
registry=https://registry.npmjs.org/

@ -4,7 +4,6 @@
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/changelog",
{
@ -15,7 +14,6 @@
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
@ -32,4 +30,4 @@
]
],
"publicConfig": "next"
}
}

@ -1,15 +0,0 @@
language: node_js
node_js:
- lts/*
branches:
only:
- master
script:
- npm run build
after_success:
- mv build sergate
- zip -r -9 sergate.zip ./sergate -x .gitignore
- npx semantic-release

@ -1,3 +1,72 @@
## [2.0.3](https://github.com/krwu/ServerStatus-web/compare/v2.0.2...v2.0.3) (2023-03-07)
### Bug Fixes
* http-cache-semantics vulnerable ([dac1abc](https://github.com/krwu/ServerStatus-web/commit/dac1abc1112c6a6388f691e7697bb0dc5fd93558))
## [2.0.2](https://github.com/krwu/ServerStatus-web/compare/v2.0.1...v2.0.2) (2022-09-13)
### Bug Fixes
* **npm:** potential security vulnerabilities ([10db0cb](https://github.com/krwu/ServerStatus-web/commit/10db0cbb2d37d2be7a43e9279c2c60099237c1fa))
## [2.0.1](https://github.com/krwu/ServerStatus-web/compare/v2.0.0...v2.0.1) (2022-07-14)
### Performance Improvements
* clean unnecessary packages ([d5a1dd0](https://github.com/krwu/ServerStatus-web/commit/d5a1dd007cecafe7b4461e98667410ae099b6e3d))
# [2.0.0](https://github.com/krwu/ServerStatus-web/compare/v1.4.0...v2.0.0) (2022-06-14)
### Features
* upgrade dependencies ([eeff4c0](https://github.com/krwu/ServerStatus-web/commit/eeff4c0eaf59122bc984be4ab3970dbaf72164d1))
### BREAKING CHANGES
* - react-scripts upgraded to v5
- semantic-release upgraded to v19
- dropped support for Node <= 15
# [1.4.0](https://github.com/krwu/ServerStatus-web/compare/v1.3.0...v1.4.0) (2022-02-19)
### Features
* upgrade dependencies ([c9a4f11](https://github.com/krwu/ServerStatus-web/commit/c9a4f11286bd6d4788a78853af81104940b62fff))
# [1.3.0](https://github.com/krwu/ServerStatus-web/compare/v1.2.0...v1.3.0) (2021-09-22)
### Features
* bump antd version to 4.0 ([664003d](https://github.com/krwu/ServerStatus-web/commit/664003df1bf2d2f4eed04cc0334dcb22db0baa31))
# [1.2.0](https://github.com/krwu/ServerStatus-web/compare/v1.1.5...v1.2.0) (2021-09-22)
### Bug Fixes
* ignore local registry ([15158f4](https://github.com/krwu/ServerStatus-web/commit/15158f4c8d1523f2d2983a5bbf164660113211be))
* serviceWorker cause building failed ([bc548af](https://github.com/krwu/ServerStatus-web/commit/bc548af585014c29f2621c98599d63c4955c83ee))
### Features
* **ui:** add index for each row ([1c0fbfe](https://github.com/krwu/ServerStatus-web/commit/1c0fbfe86ea034d2bda0c32cc861bef52accac7d))
## [1.1.5](https://github.com/krwu/ServerStatus-web/compare/v1.1.4...v1.1.5) (2020-11-05)
### Bug Fixes
* locale ('1 day' doesn't work), mobile style ('name' item size) ([cf5c3b6](https://github.com/krwu/ServerStatus-web/commit/cf5c3b6638400203f694d1776488057dfbf42e87))
## [1.1.4](https://github.com/krwu/ServerStatus-web/compare/v1.1.3...v1.1.4) (2020-05-05)

@ -1,9 +0,0 @@
const { override, fixBabelImports } = require('customize-cra');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css',
}),
);

@ -1,2 +0,0 @@
\¯o²7]gŠþù‹É 3yºT0ØG´t~)ÜÜsõrü@¨mµŠùõ¥ÇJYA¨«Áлn4‚t!£ ß<1B>«==†ft2ŒM<C592>Ø.n¿D®õɲž`š}ÜñÄ´J°e¡-ñÖºM<C2BA>ð I~Ax•]Ԝ௢Õ<C2A2>Z^j„IaàÇ„>;âjÌ:Q—Þ]‘ǘmÿ˜»uQ\2<><32>4OáÃÚñÄÌ5úùžn‹=óG?Aen©Å•]6úJãÈðœ±T_*sôP¢¸ß}Õ­¹º²k{kq «Zí†déB<C3A9>ûC<C3BB>„mWujfíÅ<C3AD>ÊJ< ÉªŠ–Sy×<11>9è5}è-S<>CÕ‰fã<SÀç¼R½úÀ5Ÿ.I.¸{O—Úëì‚ó½\Ï“›dgW\’ë†
ýáy§câðpùÆ=ƒ8Ë;HU;µàÕ$V¾qbQQQ¬ôáîdî4œ vË÷Ÿõ$á¤!<1F>¦Cw<¿1dÉ©æaäŸøØ&Z’ì"Lv§„µÝÑкúó<ÆWa

43577
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,5 @@
{
"name": "serverstatus-webui",
"version": "1.1.4",
"description": "It's a simple, clean webui for ServerStatus, built with react and Ant Design",
"keywords": [
"ServerStatus",
@ -10,6 +9,9 @@
"ant design"
],
"private": true,
"engines": {
"node": ">=18"
},
"homepage": ".",
"bugs": {
"url": "https://github.com/krwu/ServerStatus-web/issues"
@ -21,33 +23,26 @@
"url": "https://github.com/krwu/ServerStatus-web.git"
},
"dependencies": {
"@types/jest": "^24.0.0",
"@types/node": "^12.12.22",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.0",
"antd": "^3.26.0",
"babel-plugin-import": "^1.12.0",
"customize-cra": "^0.9.1",
"react": "^16.9.0",
"react-app-rewired": "^2.1.5",
"react-dom": "^16.9.0",
"react-intl-universal": "^2.2.2",
"react-scripts": "^3.4.1",
"typescript": "~3.7.2"
"@ant-design/icons": "^4.6.4",
"antd": "^4.0.0",
"react": "18",
"react-dom": "18",
"react-intl-universal": "^2.5.3"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"cz": "git-cz"
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
">5%",
"not dead",
"not op_mini all"
],
@ -58,24 +53,21 @@
]
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/git": "^7.0.16",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1",
"husky": "^4.2.5",
"semantic-release": "^15.13.24"
"@babel/core": ">=7.0.0-0 <8.0.0",
"@babel/plugin-syntax-flow": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@svgr/webpack": "^6.2.1",
"@types/node": "^18.14.6",
"@types/react": "18",
"@types/react-dom": "18",
"babel-plugin-import": "^1.13.1",
"react-scripts": "^5.0.1",
"semantic-release": "^20.1.1",
"typescript": "^4.1.2"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"overrides": {
"@svgr/webpack": "$@svgr/webpack"
}
}

@ -5,10 +5,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
@ -24,7 +21,12 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flag-icon-css@3.3.0/css/flag-icon.min.css" integrity="sha256-NkXMfPcpoih3/xWDcrJcAX78pHpfwxkhNj0bAf8AMTs=" crossorigin="anonymous">
<link
crossorigin="anonymous"
integrity="sha384-jjBocnsQb7zTYSozEemReuje+/6FUtVswDdIPdDMA6SVLBCt51rVkrz/V/sTnKOu"
href="https://lib.baomitu.com/flag-icon-css/3.5.0/css/flag-icon.min.css"
rel="stylesheet"
/>
<title>ServerStatus</title>
</head>
<body>

@ -0,0 +1 @@
@import '~antd/dist/antd.css';

@ -3,6 +3,7 @@ import "./App.css";
import intl from "react-intl-universal";
import React, { useState, useEffect } from "react";
import { Layout, Row, Col, Spin } from "antd";
import ServerRow from "./ServerRow";
require("intl/locale-data/jsonp/en.js");
@ -62,7 +63,7 @@ const App: React.FC = () => {
<div className="logo">ServerStatus</div>
</Header>
<Content style={{ background: "#fff" }}>
<Row type="flex" justify="center">
<Row justify="center">
<Col xs={24} sm={23} md={23} lg={22} xl={20} xxl={16}>
{initDone ? (
<Spin size="large" spinning={!isOnline} tip="Loading...">

@ -4,8 +4,12 @@
import intl from 'react-intl-universal';
import React, { ReactNode } from 'react';
import {
Row, Col, Tag, Progress, Tooltip, Alert,
Row, Col, Progress, Tooltip, Alert,
} from 'antd';
import {
CheckCircleFilled,
WarningFilled
} from '@ant-design/icons';
interface RawData {
name: string;
@ -33,17 +37,14 @@ interface SergateData {
updated?: string;
}
const resGutter = {
xs: 8, sm: 16, md: 24, lg: 32,
};
function onlineTag(online: boolean, label: string): React.ReactElement {
return <Tag color={online ? '#87d068' : '#f50'}>{online ? 'ON' : 'OFF'}</Tag>;
//return <Tag color={online ? '#87d068' : '#f50'}>{online ? 'O N' : 'OFF'}</Tag>;
return online ? <CheckCircleFilled /> : <WarningFilled />;
}
function transUptime(uptime: string): string {
uptime = uptime || '';
return uptime.replace('days', intl.get('DAYS'));
return uptime.replace(/days|day/, intl.get('DAYS'));
}
function networkUnit(network: number): string {
@ -128,47 +129,49 @@ const ServerRow: React.FC<SergateData> = (props: SergateData) => {
updated = updated || '0';
const updatedInt = parseInt(updated, 10) * 1000;
const updatedTime = formatDateTime(new Date(updatedInt));
let idx = 1;
return (
<div className="sergate">
<Row className="sr-head" type="flex" justify="space-around" gutter={8}>
<Row className="sr-head" justify="space-around" gutter={10}>
<Col xs={3} sm={3} md={1} lg={1}>IPv4</Col>
<Col xs={0} sm={0} md={0} lg={1}>IPv6</Col>
<Col xs={3} sm={3} md={3} lg={2}>{intl.get('NAME')}</Col>
<Col xs={3} sm={3} md={2} lg={2}>{intl.get('TYPE')}</Col>
<Col xs={3} sm={2} md={2} lg={2}>{intl.get('LOC')}</Col>
<Col xs={3} sm={4} md={3} lg={2}>{intl.get('UPTIME')}</Col>
<Col xs={0} sm={0} md={0} lg={2}>{intl.get('LOAD')}</Col>
<Col xs={0} sm={0} md={4} lg={3}>{intl.get('NETWORK')}</Col>
<Col xs={0} sm={0} md={1} lg={1}>IPv6</Col>
<Col xs={5} sm={4} md={2} lg={2}>{intl.get('NAME')}</Col>
<Col xs={0} sm={2} md={2} lg={2}>{intl.get('TYPE')}</Col>
<Col xs={2} sm={2} md={1} lg={1}>{intl.get('LOC')}</Col>
<Col xs={4} sm={4} md={3} lg={2}>{intl.get('UPTIME')}</Col>
<Col xs={0} sm={0} md={0} lg={1}>{intl.get('LOAD')}</Col>
<Col xs={0} sm={0} md={5} lg={4}>{intl.get('NETWORK')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>{intl.get('CPU')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>{intl.get('RAM')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>{intl.get('HDD')}</Col>
<Col xs={4} sm={3} md={3} lg={3}>{intl.get('HDD')}</Col>
</Row>
{servers && servers.length > 0 ? servers.map((server) => (
<Row key={server.host} className="sr-body" type="flex" justify="center" gutter={resGutter}>
<Row key={server.host} className="sr-body" justify="space-around" gutter={10}>
<span className="col-num">{idx++}</span>
<Col xs={3} sm={3} md={1} lg={1}>{onlineTag(server.online4, 'IPv4')}</Col>
<Col xs={0} sm={0} md={0} lg={1}>{onlineTag(server.online6, 'IPv6')}</Col>
<Col xs={3} sm={3} md={3} lg={2}>{server.host || server.name}</Col>
<Col xs={3} sm={3} md={2} lg={2}>{server.type}</Col>
<Col xs={3} sm={2} md={2} lg={2}><Flag loc={server.location} /></Col>
<Col xs={3} sm={4} md={3} lg={2}>{transUptime(server.uptime)}</Col>
<Col xs={0} sm={0} md={0} lg={2}>{server.load}</Col>
<Col xs={0} sm={0} md={4} lg={3}>
<Col xs={0} sm={0} md={1} lg={1}>{onlineTag(server.online6, 'IPv6')}</Col>
<Col xs={5} sm={4} md={2} lg={2}>{server.host || server.name}</Col>
<Col xs={0} sm={2} md={2} lg={2}>{server.type}</Col>
<Col xs={2} sm={2} md={1} lg={1}><Flag loc={server.location} /></Col>
<Col xs={4} sm={4} md={3} lg={2}>{transUptime(server.uptime)}</Col>
<Col xs={0} sm={0} md={0} lg={1}>{server.load}</Col>
<Col xs={0} sm={0} md={5} lg={4}>
{networkUnit(server.network_rx)}
↓ | ↑
{networkUnit(server.network_tx)}
</Col>
<Col xs={3} sm={3} md={3} lg={3}>
<Progress strokeWidth={12} percent={server.cpu} status="active" />
<Progress className="sg-progress" strokeLinecap="square" strokeWidth={12} percent={server.cpu} status="active" />
</Col>
<Col xs={3} sm={3} md={3} lg={3}>
<Tooltip placement="left" title={memTips(server)}>
<Progress strokeWidth={12} percent={parseFloat(((server.memory_used / server.memory_total) * 100).toFixed(1))} status="active" />
<Progress className="sg-progress" strokeLinecap="square" strokeWidth={12} percent={parseFloat(((server.memory_used / server.memory_total) * 100).toFixed(1))} status="active" />
</Tooltip>
</Col>
<Col xs={3} sm={3} md={3} lg={3}>
<Col xs={4} sm={3} md={3} lg={3}>
<Tooltip placement="left" title={`${bytesToSize(server.hdd_used * 1024)}/${bytesToSize(server.hdd_total * 1024)}`}>
<Progress strokeWidth={12} percent={parseFloat(((server.hdd_used / server.hdd_total) * 100).toFixed(1))} status="active" />
<Progress className="sg-progress" strokeLinecap="square" strokeWidth={12} percent={parseFloat(((server.hdd_used / server.hdd_total) * 100).toFixed(1))} status="active" />
</Tooltip>
</Col>
</Row>

@ -1,7 +1,6 @@
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}
.logo {
color: #fff;
@ -11,9 +10,15 @@ body {
.sergate {
margin: 16px 0;
}
.sergate .ant-row {
position: relative;
flex-wrap: nowrap;
}
.sergate .sg-progress .ant-progress-outer {
margin-right: calc(-3em - 8px);
padding-right: calc(3em + 8px);
}
.sr-head {
font-weight: bold;
padding-top: 8px;
padding-bottom: 8px;
}
@ -26,12 +31,28 @@ body {
padding-bottom: 8px;
border-top: 1px solid #ebebeb;
}
.col-num {
position: absolute;
width: 16px;
line-height: 40px;
left: -16px;
top: 0;
text-align: right;
}
.sergate .lastUpdated {
margin-top: 16px;
text-align: center;
}
.sergate .anticon-check-circle {
color: #389e0d;
}
.sergate .anticon-warning {
color: #cf1322;
}
.ant-layout .footer {
position: fixed;
bottom: 0;
@ -54,19 +75,29 @@ body {
}
@media (max-width: 768px) {
.logo {
text-align: center;
}
.sr-head {
font-size: 0.8rem;
}
.sr-body .ant-col {
font-size: 0.8rem;
}
.sergate .ant-tag {
margin-right: 0;
}
}
@media (max-width: 900px) {
.sergate .ant-col .ant-progress-outer {
display: none;
}
.sergate .ant-col .ant-progress-text {
margin-left: 0;
}
.sergate .ant-tag {
margin-right:0;
.sr-head {
font-size: 12px;
}
}

@ -1,12 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
// import reportWebVitals from './reportWebVitals';
ReactDOM.render(<App />, document.getElementById('root'));
const el = document.getElementById('root');
if (el === null) {
throw new Error('root container missing in index.html');
}
const root = createRoot(el);
root.render(<StrictMode><App /></StrictMode>);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals();

@ -1,143 +0,0 @@
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
type Config = {
onSuccess?: (registration: ServiceWorkerRegistration) => void;
onUpdate?: (registration: ServiceWorkerRegistration) => void;
};
export function register(config?: Config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(
(process as { env: { [key: string]: string } }).env.PUBLIC_URL,
window.location.href
);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}

@ -1,25 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}

Loading…
Cancel
Save