Compare commits

..

73 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
5 years ago
kaireewu eeff4c0eaf
feat: upgrade dependencies
BREAKING CHANGE:
- react-scripts upgraded to v5
- semantic-release upgraded to v19
- dropped support for Node <= 15
5 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
semantic-release-bot e542d1d06f chore(release): 1.1.4 [skip ci]
## [1.1.4](https://github.com/krwu/ServerStatus-web/compare/v1.1.3...v1.1.4) (2020-05-05)

### Bug Fixes

* display name with host or name from json ([a19256c](a19256c9e8)), closes [#2](https://github.com/krwu/ServerStatus-web/issues/2)
7 years ago
Kairee Wu 4aeeeb7245
style: fix eslint style issues 7 years ago
Kairee Wu a19256c9e8
fix: display name with host or name from json
See #2.
7 years ago
Kairee Wu 443dd4ee8f
build(ci): split build pipeline and deploy pipeline 7 years ago
semantic-release-bot dfdfa1979d chore(release): 1.1.3 [skip ci]
## [1.1.3](https://github.com/krwu/ServerStatus-web/compare/v1.1.2...v1.1.3) (2020-04-09)

### Bug Fixes

* pull data once page loaded instead of wait 5m ([f244dec](f244decff1))
7 years ago
Kairee Wu f244decff1
fix: pull data once page loaded instead of wait 5m 7 years ago
Kairee Wu 8ec10d4904
docs: remove readme for traditional Chinese [skip ci] 7 years ago
semantic-release-bot 31ab9acd59 chore(release): 1.1.2 [skip ci]
## [1.1.2](https://github.com/krwu/ServerStatus-web/compare/v1.1.1...v1.1.2) (2020-02-04)

### Performance Improvements

* **data:** improve fetch interval from 2s to 5s ([4bd86e3](4bd86e3f7b))
7 years ago
Kairee Wu 4bd86e3f7b
perf(data): improve fetch interval from 2s to 5s 7 years ago
Kairee Wu f1e2cc2be5
ci(deploy): deploy to webserver by travis 7 years ago
Kairee Wu 030f4f6e3a
docs: update badges in README [skip-ci] 7 years ago
kairee 23b8055203
docs: change url of jetbrains logo 7 years ago
kairee 297be94dad
build(npm): upgrade packages 7 years ago
kairee a7979bc6d9
docs: add special thanks to Jetbrains [skip ci] 7 years ago
kairee b7733f3d2a
chore: change license to match project [skip ci] 7 years ago
Kairee Wu 9a7f55a1be
docs: fix demo link in README.zh_TW [skip ci] 7 years ago
kairee e3b9a4a2af
docs: fix links to locale readme [skip ci] 7 years ago
semantic-release-bot 1f5fc19495 chore(release): 1.1.1 [skip ci]
## [1.1.1](https://github.com/krwu/ServerStatus-web/compare/v1.1.0...v1.1.1) (2019-12-22)

### Bug Fixes

* add missed locale entities ([88245b6](88245b68d9))
7 years ago
kairee 88245b68d9
fix: add missed locale entities 7 years ago
kairee 84101abf5c
docs: add Chinese readme files 7 years ago
semantic-release-bot 62e457f9e8 chore(release): 1.1.0 [skip ci]
# [1.1.0](https://github.com/krwu/ServerStatus-web/compare/v1.0.1...v1.1.0) (2019-12-21)

### Features

* add international support ([5391fea](5391feab9f))
7 years ago
kairee 119ef1808d
ci: fix semantic-release config syntax 7 years ago
kairee 9e726cc8f4
ci: add travis ci config
:skip
7 years ago
kairee 5391feab9f
feat: add international support
add Chinese and English support
7 years ago
kairee 3e3647e9db
docs: add build status to README 7 years ago
kairee 83902e76c5
ci: add travis config file 7 years ago
kairee 88367c5bc5
ci: switch release tool to semantic-release 7 years ago
kairee 81b103a3a5
docs: add badges to README 7 years ago
kairee d3c6ab9eb1
build(npm): update dependencies 7 years ago
kairee c5b4f12f88
chore(git): introduce commitizen and standard-version to project 7 years ago
kairee 79eab7d780
chore: bump version v1.0.1 7 years ago
kairee f8f73d314a
feat: change footer link target
change the link for WebUI in the footer to github
7 years ago
Kairee Wu 436920061d
Update README.md 7 years ago
kairee 09f2aafd81
add license file
add "Do What The F*ck You Want To Public License" to the project
7 years ago

@ -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 }}

3
.gitignore vendored

@ -10,6 +10,8 @@
# production # production
/build /build
/sergate
/*.zip
# misc # misc
.DS_Store .DS_Store
@ -21,3 +23,4 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
yarn.lock

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

@ -0,0 +1,33 @@
{
"branch": "master",
"ci": "true",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": {
"path": "sergate.zip",
"name": "sergate-${nextRelease.version}.zip"
}
}
]
],
"publicConfig": "next"
}

@ -0,0 +1,122 @@
## [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)
### Bug Fixes
* display name with host or name from json ([a19256c](https://github.com/krwu/ServerStatus-web/commit/a19256c9e83345ec18916ce7620e57461228face)), closes [#2](https://github.com/krwu/ServerStatus-web/issues/2)
## [1.1.3](https://github.com/krwu/ServerStatus-web/compare/v1.1.2...v1.1.3) (2020-04-09)
### Bug Fixes
* pull data once page loaded instead of wait 5m ([f244dec](https://github.com/krwu/ServerStatus-web/commit/f244decff163a847ee9da3999b352a33f554c15b))
## [1.1.2](https://github.com/krwu/ServerStatus-web/compare/v1.1.1...v1.1.2) (2020-02-04)
### Performance Improvements
* **data:** improve fetch interval from 2s to 5s ([4bd86e3](https://github.com/krwu/ServerStatus-web/commit/4bd86e3f7b18fd33054cbddeae185bc5cde6338e))
## [1.1.1](https://github.com/krwu/ServerStatus-web/compare/v1.1.0...v1.1.1) (2019-12-22)
### Bug Fixes
* add missed locale entities ([88245b6](https://github.com/krwu/ServerStatus-web/commit/88245b68d90373870cd7b9b000c2dcb85af3fad0))
# [1.1.0](https://github.com/krwu/ServerStatus-web/compare/v1.0.1...v1.1.0) (2019-12-21)
### Features
* add international support ([5391fea](https://github.com/krwu/ServerStatus-web/commit/5391feab9f36d625293b70066cbb9838a7075ea5))
# Changelog
## [1.0.1](https://github.com/krwu/ServerStatus-web/compare/v1.0.0...v1.0.1) (2019-09-16)
### Features
* change footer link target ([f8f73d3](https://github.com/krwu/ServerStatus-web/commit/f8f73d3))
# [1.0.0](https://github.com/krwu/ServerStatus-web/compare/9097c1b...v1.0.0) (2019-08-29)
### Features
* implement web ui development ([9097c1b](https://github.com/krwu/ServerStatus-web/commit/9097c1b))
* update footer ([467de09](https://github.com/krwu/ServerStatus-web/commit/467de09))

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2019 Kairee Wu <kairee@udev.bid>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

@ -1,13 +1,23 @@
# Web UI for ServerStatus # Web UI for ServerStatus
**English** | [简体中文](README.zh_CN.md)
This is a web ui for [BotoX's ServerStatus](https://github.com/BotoX/ServerStatus/). This is a web ui for [BotoX's ServerStatus](https://github.com/BotoX/ServerStatus/).
[![Build Status](https://travis-ci.com/krwu/ServerStatus-web.svg?branch=master)](https://travis-ci.com/krwu/ServerStatus-web)
[![codebeat badge](https://codebeat.co/badges/038ea692-7cec-47dc-add2-2a59b6a5d89c)](https://codebeat.co/projects/github-com-krwu-serverstatus-web-master)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/krwu/serverstatus-web.svg)
[![downloads](https://img.shields.io/github/downloads/krwu/ServerStatus-web/total)](https://github.com/krwu/ServerStatus-web/releases)
[![GitHub](https://img.shields.io/github/license/krwu/ServerStatus-web)](https://github.com/krwu/ServerStatus-web/blob/master/COPYING.txt)
## Live demo: ## Live demo:
[https://udev.bid/sergate/](https://udev.bid/sergate/) [https://udev.bid/sergate/](https://udev.bid/sergate/)
## Useage: ## Useage:
You MUST install and run [BotoX's ServerStatus](https://github.com/BotoX/ServerStatus/) first. This is just a drop-in replacement for its web interface.
### **With release version:** ### **With release version:**
1. Download the latest prebuilt files on the [release page](https://github.com/krwu/ServerStatus-web/releases). 1. Download the latest prebuilt files on the [release page](https://github.com/krwu/ServerStatus-web/releases).
@ -22,12 +32,20 @@ This is a web ui for [BotoX's ServerStatus](https://github.com/BotoX/ServerStatu
4. Install dependecies with npm / yarn. 4. Install dependecies with npm / yarn.
5. Run `npm run build` to build web files. 5. Run `npm run build` to build web files.
``` bash ```bash
git clone https://github.com/krwu/ServerStatus-web.git git clone https://github.com/krwu/ServerStatus-web.git
cd ./ServerStatus-web/ cd ./ServerStatus-web/
## you can also run "yarn" instead of the next command ## you can also run "yarn" instead of the next command
npm i npm i
npm run build npm run build
``` ```
6. Copy all files in the `build` directory to your web directory of ServerStatus(you can delete all files except `json/status.json` in it, this is recommended). 6. Copy all files in the `build` directory to your web directory of ServerStatus(you can delete all files except `json/status.json` in it, this is recommended).
---
## Special thanks
[![Jetbrains Logo](https://krwu.github.io/img/jetbrains.svg)](https://www.jetbrains.com/?from=WebUiForServerStatus)
Thanks to [Jetbrains](https://www.jetbrains.com/?from=WebUiForServerStatus) for supporting this small open source project! I used WebStorm and PhpStorm for years, they are the best tools!

@ -0,0 +1,50 @@
# Web UI for ServerStatus
[English](README.md) | **简体中文**
本项目是为 [BotoX's ServerStatus](https://github.com/BotoX/ServerStatus/) 开发的前端展示界面.
[![Build Status](https://travis-ci.com/krwu/ServerStatus-web.svg?branch=master)](https://travis-ci.com/krwu/ServerStatus-web)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/krwu/ServerStatus-Web)
[![GitHub All Releases](https://img.shields.io/github/downloads/krwu/ServerStatus-web/total)](https://github.com/krwu/ServerStatus-web/releases)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![GitHub](https://img.shields.io/github/license/krwu/ServerStatus-web)](https://github.com/krwu/ServerStatus-web/blob/master/COPYING.txt)
![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/krwu/ServerStatus-Web/react)
## 演示:
[https://udev.bid/sergate/](https://udev.bid/sergate/)
## 使用方法:
你必须首先成功安装和运行 [BotoX's ServerStatus](https://github.com/BotoX/ServerStatus/)。因为这个项目仅仅是一个可以即插即用的可替换的 web 界面。
### **使用预编译版:**
1. 从 [release 页面](https://github.com/krwu/ServerStatus-web/releases)下载最新的预编译压缩包。
2. 解压下载的文件。
3. 把 `sergate` 目录下的所有文件上传到你的 ServerStatus 的 web 目录(推荐操作:你可以先删除**原目录**下除了 `json/status.json` 以外的所有文件)。
### **自己编译:**
1. 你需要安装有 Node.js, npm 或者 yarn.
2. 克隆本项目,或者下载打包的源代码到你的机器。
3. 进入项目根目录(或解压后的文件夹)。
4. 通过 npm(推荐) 或者 yarn 安装依赖项。
5. 执行 `npm run build` 来编译 web 文件:
```bash
git clone https://github.com/krwu/ServerStatus-web.git
cd ./ServerStatus-web/
## 你也可以用 yarn 代替下面的 npm
npm i
npm run build
```
6. 把 `build` 目录下的所有文件上传到你的 ServerStatus 的 web 目录(推荐操作:你可以先删除**原目录**下除了 `json/status.json` 以外的所有文件)。
---
## 特别鸣谢
[![Jetbrains Logo](https://krwu.github.io/img/jetbrains.svg)](https://www.jetbrains.com/?from=WebUiForServerStatus)
非常感谢 [Jetbrains](https://www.jetbrains.com/?from=WebUiForServerStatus) 对这个小小开源项目的支持!我一直是 PhpStorm 和 WebStorm 的死忠粉,它们是最棒的开发工具。

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

34748
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,5 @@
{ {
"name": "serverstatus-webui", "name": "serverstatus-webui",
"version": "1.0.0",
"description": "It's a simple, clean webui for ServerStatus, built with react and Ant Design", "description": "It's a simple, clean webui for ServerStatus, built with react and Ant Design",
"keywords": [ "keywords": [
"ServerStatus", "ServerStatus",
@ -10,42 +9,40 @@
"ant design" "ant design"
], ],
"private": true, "private": true,
"engines": {
"node": ">=18"
},
"homepage": ".", "homepage": ".",
"bugs": { "bugs": {
"url": "https://github.com/krwu/ServerStatus-web/issues" "url": "https://github.com/krwu/ServerStatus-web/issues"
}, },
"license": "MIT", "license": "WTFPL",
"author": "Kairee <kairee@udev.bid> (https://www.ofcss.com/)", "author": "Kairee <kairee@udev.bid> (https://www.ofcss.com/)",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/krwu/ServerStatus-web.git" "url": "https://github.com/krwu/ServerStatus-web.git"
}, },
"dependencies": { "dependencies": {
"@types/jest": "24.0.17", "@ant-design/icons": "^4.6.4",
"@types/node": "12.7.1", "antd": "^4.0.0",
"@types/react": "16.9.1", "react": "18",
"@types/react-dom": "16.8.5", "react-dom": "18",
"antd": "^3.21.4", "react-intl-universal": "^2.5.3"
"babel-plugin-import": "^1.12.0",
"customize-cra": "^0.4.1",
"react": "^16.9.0",
"react-app-rewired": "^2.1.3",
"react-dom": "^16.9.0",
"react-scripts": "3.1.0",
"typescript": "3.5.3"
}, },
"scripts": { "scripts": {
"start": "react-app-rewired start", "start": "react-scripts start",
"build": "react-app-rewired build && rm -rf build/json", "build": "react-scripts build",
"test": "react-app-rewired test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": [
"react-app",
"react-app/jest"
]
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
">0.2%", ">5%",
"not dead", "not dead",
"not op_mini all" "not op_mini all"
], ],
@ -54,5 +51,23 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"devDependencies": {
"@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"
},
"overrides": {
"@svgr/webpack": "$@svgr/webpack"
} }
} }

@ -5,10 +5,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="Web site created using create-react-app" />
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" /> <link rel="apple-touch-icon" href="logo192.png" />
<!-- <!--
manifest.json provides metadata used when your web app is installed on a 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. 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`. 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> <title>ServerStatus</title>
</head> </head>
<body> <body>

@ -0,0 +1,15 @@
{
"NAME": "Name",
"TYPE": "Type",
"LOC": "Location",
"UPTIME": "Uptime",
"LOAD": "Load",
"NETWORK": "Network",
"CPU": "CPU",
"RAM": "RAM",
"HDD": "HDD",
"LOADING": "Data loading...",
"WAIT": "Loading data from the server, please wait for a while...",
"LAST_UPDATE": "Last updated: {updatedTime}",
"DAYS": "days"
}

@ -0,0 +1,15 @@
{
"NAME": "名称",
"TYPE": "类型",
"LOC": "地区",
"UPTIME": "运行",
"LOAD": "负载",
"NETWORK": "网络",
"CPU": "CPU",
"RAM": "RAM",
"HDD": "HDD",
"LOADING": "数据加载中...",
"WAIT": "正在首次从服务器端加载监控数据,请稍候...",
"LAST_UPDATE": "数据最后更新时间:{updatedTime}",
"DAYS": "天"
}

@ -0,0 +1,15 @@
{
"NAME": "名稱",
"TYPE": "類型",
"LOC": "地區",
"UPTIME": "運行",
"LOAD": "負載",
"NETWORK": "網絡",
"CPU": "CPU",
"RAM": "RAM",
"HDD": "HDD",
"LOADING": "數據載入中...",
"WAIT": "正在從伺服器載入數據,請稍候...",
"LAST_UPDATE": "數據最後更新時間:{updatedTime}",
"DAYS": "天"
}

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

@ -1,52 +1,102 @@
import './App.css'; import "./App.css";
import React, { useState, useEffect } from 'react'; import intl from "react-intl-universal";
import { Layout, Row, Col, Spin } from 'antd'; import React, { useState, useEffect } from "react";
import ServerRow from './ServerRow'; import { Layout, Row, Col, Spin } from "antd";
import ServerRow from "./ServerRow";
require("intl/locale-data/jsonp/en.js");
require("intl/locale-data/jsonp/zh.js");
const { Header, Footer, Content } = Layout; const { Header, Footer, Content } = Layout;
const App: React.FC = () => { const App: React.FC = () => {
const [serverData, setServerData] = useState({servers: [], updated: "0"}); const [serverData, setServerData] = useState({ servers: [], updated: "0" });
const [isOnline, setIsOnline] = useState(false); const [isOnline, setIsOnline] = useState(false);
useEffect(() => { useEffect(() => {
let fetchData = setInterval(() => { const fetchData = () => {
fetch('json/stats.json') fetch("json/stats.json")
.then(res => res.json()) .then((res) => res.json())
.then(data => { .then((data) => {
setServerData(data); setServerData(data);
setIsOnline(true); setIsOnline(true);
console.log(data);
}) })
.catch(e => console.log('错误:',e)) .catch((e) => console.log("错误:", e));
}, 2000); };
fetchData();
let itv = setInterval(fetchData, 5000);
return () => { return () => {
clearInterval(fetchData); clearInterval(itv);
} };
}, []); }, []);
const [initDone, setInitDone] = useState(false);
let currentLocale = navigator.language || "zh-CN";
if (currentLocale === "zh-TW" || currentLocale === "zh-HK") {
currentLocale = "zh-TW";
} else if (currentLocale.startsWith("zh")) {
currentLocale = "zh-CN";
} else {
currentLocale = "en-US";
}
initDone ||
fetch(`locales/${currentLocale}.json`)
.then((res) => res.json())
.then((data) => {
return intl.init({
currentLocale,
locales: {
[currentLocale]: data,
},
});
})
.then(() => {
setInitDone(true);
});
return ( return (
<div className="App"> <div className="App">
<Layout> <Layout>
<Header> <Header>
<div className="logo">ServerStatus</div> <div className="logo">ServerStatus</div>
</Header> </Header>
<Content style={{background:'#fff'}}> <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}> <Col xs={24} sm={23} md={23} lg={22} xl={20} xxl={16}>
<Spin size="large" spinning={!isOnline} tip="Loading..."> {initDone ? (
<ServerRow {...serverData} /> <Spin size="large" spinning={!isOnline} tip="Loading...">
</Spin> <ServerRow {...serverData} />
</Spin>
) : (
<div />
)}
</Col> </Col>
</Row> </Row>
</Content> </Content>
<Footer className="footer"> <Footer className="footer">
<a href="https://udev.bid/sergate/" rel="external noopener">WebUI</a> for <a href="https://github.com/BotoX/ServerStatus/" rel="external noopener">ServerStatus</a>, made by <a href="https://www.ofcss.com/" rel="external noopener">Kairee</a> <a
href="https://github.com/krwu/ServerStatus-web"
rel="external noopener"
>
WebUI
</a>{" "}
for{" "}
<a
href="https://github.com/BotoX/ServerStatus/"
rel="external noopener"
>
ServerStatus
</a>
, made by{" "}
<a href="https://www.ofcss.com/" rel="external noopener">
Kairee
</a>
</Footer> </Footer>
</Layout> </Layout>
</div> </div>
); );
} };
export default App; export default App;

@ -1,5 +1,15 @@
/* eslint-disable no-param-reassign */
/* eslint-disable no-unused-vars */
/* eslint-disable camelcase */
import intl from 'react-intl-universal';
import React, { ReactNode } from 'react'; import React, { ReactNode } from 'react';
import { Row, Col, Tag, Progress, Tooltip, Alert } from 'antd'; import {
Row, Col, Progress, Tooltip, Alert,
} from 'antd';
import {
CheckCircleFilled,
WarningFilled
} from '@ant-design/icons';
interface RawData { interface RawData {
name: string; name: string;
@ -27,122 +37,155 @@ interface SergateData {
updated?: string; updated?: string;
} }
const resGutter = { xs: 8, sm: 16, md: 24, lg: 32 };
function onlineTag(online: boolean, label: string): React.ReactElement { 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 { function transUptime(uptime: string): string {
uptime = uptime || ''; uptime = uptime || '';
return uptime.replace('days', '天'); return uptime.replace(/days|day/, intl.get('DAYS'));
} }
function networkUnit(network: number): string { function networkUnit(network: number): string {
network = network || 0; network = network || 0;
if (network < 1000) { if (network < 1000) {
return network.toFixed(0) + 'B'; return `${network.toFixed(0)}B`;
} else if (network < 1000*1000) { } if (network < 1000 * 1000) {
return (network / 1000).toFixed(0) + 'K'; return `${(network / 1000).toFixed(0)}K`;
} else {
return (network / 1000 / 1000).toFixed(0) + 'M';
} }
return `${(network / 1000 / 1000).toFixed(0)}M`;
} }
function bytesToSize(bytes: number, precision: number = 1, si: number = 0) { function bytesToSize(bytes: number, precision: number = 1, si: number = 0) {
const kilobyte = si === 0 ? 1024 : 1000; const kilobyte = si === 0 ? 1024 : 1000;
const megabyte = kilobyte * kilobyte; const megabyte = kilobyte * kilobyte;
const gigabyte = megabyte * kilobyte; const gigabyte = megabyte * kilobyte;
const terabyte = gigabyte * kilobyte; const terabyte = gigabyte * kilobyte;
bytes = bytes || 0; bytes = bytes || 0;
bytes *= 1024 bytes *= 1024;
if ( bytes >= 0 && bytes < kilobyte) { if (bytes >= 0 && bytes < kilobyte) {
return bytes + 'B'; return `${bytes}B`;
} }
if (bytes >= kilobyte && bytes < megabyte) { if (bytes >= kilobyte && bytes < megabyte) {
return (bytes / kilobyte).toFixed(precision) + 'K'; return `${(bytes / kilobyte).toFixed(precision)}K`;
} }
if (bytes >= megabyte && bytes < gigabyte) { if (bytes >= megabyte && bytes < gigabyte) {
return (bytes / megabyte).toFixed(precision) + 'M'; return `${(bytes / megabyte).toFixed(precision)}M`;
} }
if (bytes >= gigabyte && bytes < terabyte) { if (bytes >= gigabyte && bytes < terabyte) {
return (bytes / gigabyte).toFixed(precision) + 'G'; return `${(bytes / gigabyte).toFixed(precision)}G`;
} }
return (bytes / terabyte).toFixed(precision) + 'T'; return `${(bytes / terabyte).toFixed(precision)}T`;
} }
function memTips(props: RawData): ReactNode { function memTips(props: RawData): ReactNode {
const { memory_used, memory_total, swap_used, swap_total } = props; const {
return (<dl> memory_used, memory_total, swap_used, swap_total,
<dt>Mem:</dt> } = props;
<dd>{bytesToSize(memory_used)}/{bytesToSize(memory_total)}</dd> return (
<dt>Swap:</dt> <dl>
<dd>{bytesToSize(swap_used)}/{bytesToSize(swap_total)}</dd> <dt>Mem:</dt>
</dl>); <dd>
{bytesToSize(memory_used)}
/
{bytesToSize(memory_total)}
</dd>
<dt>Swap:</dt>
<dd>
{bytesToSize(swap_used)}
/
{bytesToSize(swap_total)}
</dd>
</dl>
);
} }
const Flag: React.FC<{ loc: string}> = ({ loc }) => ( function formatDateTime(time: Date) {
<i className={`flag-icon flag-icon-${loc.toLowerCase()}`}></i> const year = time.getFullYear();
) const month = (`${time.getMonth() + 1}`).padStart(2, '0');
const day = (`${time.getDate()}`).padStart(2, '0');
const hour = (`${time.getHours()}`).padStart(2, '0');
const minute = (`${time.getMinutes()}`).padStart(2, '0');
const second = (`${time.getSeconds()}`).padStart(2, '0');
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
interface FlagProps {
loc: string
}
const Flag: React.FC<FlagProps> = ({ loc }: FlagProps) => (
<i className={`flag-icon flag-icon-${loc.toLowerCase()}`} />
);
const ServerRow: React.FC<SergateData> = (props) => { const ServerRow: React.FC<SergateData> = (props: SergateData) => {
let { servers, updated } = props; let { servers, updated } = props;
servers = servers || []; servers = servers || [];
updated = updated || '0'; updated = updated || '0';
const updatedTime = parseInt(updated) * 1000; const updatedInt = parseInt(updated, 10) * 1000;
const updatedTime = formatDateTime(new Date(updatedInt));
return (<div className="sergate"> let idx = 1;
<Row className="sr-head" type="flex" justify="space-around" gutter={8}>
<Col xs={3} sm={3} md={1} lg={1}>IPv4</Col> return (
<Col xs={0} sm={0} md={0} lg={1}>IPv6</Col> <div className="sergate">
<Col xs={3} sm={3} md={3} lg={2}>节点</Col> <Row className="sr-head" justify="space-around" gutter={10}>
<Col xs={3} sm={3} md={2} lg={2}>类型</Col> <Col xs={3} sm={3} md={1} lg={1}>IPv4</Col>
<Col xs={3} sm={2} md={2} lg={2}>地区</Col> <Col xs={0} sm={0} md={1} lg={1}>IPv6</Col>
<Col xs={3} sm={4} md={3} lg={2}>运行</Col> <Col xs={5} sm={4} md={2} lg={2}>{intl.get('NAME')}</Col>
<Col xs={0} sm={0} md={0} lg={2}>负载</Col> <Col xs={0} sm={2} md={2} lg={2}>{intl.get('TYPE')}</Col>
<Col xs={0} sm={0} md={4} lg={3}>网络</Col> <Col xs={2} sm={2} md={1} lg={1}>{intl.get('LOC')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>CPU</Col> <Col xs={4} sm={4} md={3} lg={2}>{intl.get('UPTIME')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>RAM</Col> <Col xs={0} sm={0} md={0} lg={1}>{intl.get('LOAD')}</Col>
<Col xs={3} sm={3} md={3} lg={3}>HDD</Col> <Col xs={0} sm={0} md={5} lg={4}>{intl.get('NETWORK')}</Col>
</Row> <Col xs={3} sm={3} md={3} lg={3}>{intl.get('CPU')}</Col>
{servers && servers.length > 0 ? servers.map(server => ( <Col xs={3} sm={3} md={3} lg={3}>{intl.get('RAM')}</Col>
<Row key={server.host} className="sr-body" type="flex" justify="center" gutter={resGutter}> <Col xs={4} sm={3} md={3} lg={3}>{intl.get('HDD')}</Col>
<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 }</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}>{ 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" />
</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" />
</Tooltip>
</Col>
<Col xs={3} 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" />
</Tooltip>
</Col>
</Row> </Row>
)) : <Alert {servers && servers.length > 0 ? servers.map((server) => (
showIcon={true} <Row key={server.host} className="sr-body" justify="space-around" gutter={10}>
type="info" <span className="col-num">{idx++}</span>
message="数据加载中" <Col xs={3} sm={3} md={1} lg={1}>{onlineTag(server.online4, 'IPv4')}</Col>
description="正在首次从服务器段加载监控数据,请稍候。" <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>
{updatedTime > 0 && <Alert className="lastUpdated" type="info" message={'数据最后更新时间:'+new Date(updatedTime).toISOString()} />} <Col xs={0} sm={2} md={2} lg={2}>{server.type}</Col>
</div>) <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 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 className="sg-progress" strokeLinecap="square" strokeWidth={12} percent={parseFloat(((server.memory_used / server.memory_total) * 100).toFixed(1))} status="active" />
</Tooltip>
</Col>
<Col xs={4} sm={3} md={3} lg={3}>
<Tooltip placement="left" title={`${bytesToSize(server.hdd_used * 1024)}/${bytesToSize(server.hdd_total * 1024)}`}>
<Progress className="sg-progress" strokeLinecap="square" strokeWidth={12} percent={parseFloat(((server.hdd_used / server.hdd_total) * 100).toFixed(1))} status="active" />
</Tooltip>
</Col>
</Row>
)) : (
<Alert
showIcon
type="info"
message={intl.get('LOADING')}
description={intl.get('WAIT')}
/>
)}
{updatedInt > 0 && <Alert className="lastUpdated" type="info" message={intl.get('LAST_UPDATE', { updatedTime })} />}
</div>
);
};
export default ServerRow; export default ServerRow;

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

@ -1,12 +1,17 @@
import React from 'react'; import { StrictMode } from 'react';
import ReactDOM from 'react-dom'; import { createRoot } from 'react-dom/client';
import './index.css'; import './index.css';
import App from './App'; 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 // If you want to start measuring performance in your app, pass a function
// unregister() to register() below. Note this comes with some pitfalls. // to log results (for example: reportWebVitals(console.log))
// Learn more about service workers: https://bit.ly/CRA-PWA // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
serviceWorker.unregister(); // 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();
});
}
}

@ -12,12 +12,13 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"strict": true, "strict": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "react" "jsx": "react-jsx"
}, },
"include": [ "include": [
"src" "src"

Loading…
Cancel
Save