mirror of
https://github.com/Kxsso/jcutmirror.git
synced 2026-02-09 01:16:58 +08:00
@@ -13,13 +13,15 @@ module.exports = {
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: './',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['react', '@typescript-eslint', 'prettier'],
|
||||
plugins: ['react', '@typescript-eslint', 'import', 'prettier'],
|
||||
rules: {
|
||||
// needed by prettier
|
||||
'prettier/prettier': 'warn',
|
||||
|
||||
2
.github/workflows/testbuild.yml
vendored
2
.github/workflows/testbuild.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
node-version: [20.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
image: node:lts-bullseye
|
||||
image:
|
||||
name: node:20
|
||||
pull_policy: if-not-present
|
||||
|
||||
stages:
|
||||
- build
|
||||
@@ -8,12 +10,16 @@ gatsby-build:
|
||||
stage: build
|
||||
variables:
|
||||
CHOKIDAR_USEPOLLING: 1
|
||||
GATSBY_TELEMETRY_DISABLED: 1
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
- .npm/
|
||||
script:
|
||||
- bash cached-restore.sh
|
||||
- yarn run build
|
||||
- apt-get update && apt-get install -y libvips42 libvips-dev
|
||||
- npm config set registry https://registry.npmmirror.com
|
||||
- npm install -g npm@10.5.1
|
||||
- npm ci --cache .npm --prefer-offline
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
||||
@@ -2,156 +2,234 @@
|
||||
auto_https disable_redirects
|
||||
}
|
||||
(mirrorsite) {
|
||||
@blockedBots {
|
||||
header_regexp User-Agent (Amazonbot|Sogou|Baiduspider|Bytespider|bingbot)
|
||||
}
|
||||
handle /rocky/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /centos/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /epel/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /archlinux/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /archlinuxcn/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /kali/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /lyx/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /apache/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
root /mirrors/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /kali-images/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /debian/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /debian-security/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /debian-cd/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /ubuntu/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
root /mirrors2/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /ubuntu-releases/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /centos-vault/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /openjdk/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /Adoptium/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /alpine/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /manjaro/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /GNU/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /Adoptium/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /nodejs-release/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /github-release/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors2/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /CTAN/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
index index.html
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /CPAN/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
index index.html
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /CRAN/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors2/
|
||||
index index.html
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /mysql/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /openeuler/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors2/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /kubernetes/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors2/
|
||||
browse
|
||||
}
|
||||
}
|
||||
handle /jobs {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
reverse_proxy 127.0.0.1:12345 {
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
header_down Access-Control-Allow-Headers *
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
header_down Access-Control-Allow-Headers *
|
||||
header_down Access-Control-Allow-Origin *
|
||||
}
|
||||
}
|
||||
handle /1GB.bin {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
file_server {
|
||||
root /mirrors1/
|
||||
}
|
||||
}
|
||||
handle /api/* {
|
||||
respond @blockedBots "Access Denied" 403
|
||||
reverse_proxy 127.0.0.1:7000 {
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
header_down Access-Control-Allow-Headers *
|
||||
header_up Host {http.reverse_proxy.upstream.hostport}
|
||||
header_down Access-Control-Allow-Headers *
|
||||
header_down Access-Control-Allow-Origin *
|
||||
}
|
||||
}
|
||||
@@ -167,6 +245,9 @@
|
||||
}
|
||||
log {
|
||||
output file /var/log/caddy/access.log
|
||||
format transform `{request>remote_ip} - {user_id} [{ts}] "{request>method} {request>uri} {request>proto}" {status} {size} "{request>headers>Referer>[0]}" "{request>headers>User-Agent>[0]}"` {
|
||||
time_format "02/Jan/2006:15:04:05 -0700"
|
||||
}
|
||||
}
|
||||
}
|
||||
http://mirrors.jcut.edu.cn {
|
||||
@@ -175,4 +256,4 @@ http://mirrors.jcut.edu.cn {
|
||||
https://mirrors.jcut.edu.cn {
|
||||
import mirrorsite
|
||||
tls /etc/ssl/jcut.edu.cn.crt /etc/ssl/jcut.edu.cn.key
|
||||
}
|
||||
}
|
||||
|
||||
45
docs/en/alpine.mdx
Normal file
45
docs/en/alpine.mdx
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
mirrorId: alpine
|
||||
---
|
||||
|
||||
## Alpine Image Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
https://mirrors.jcut.edu.cn/alpine/
|
||||
|
||||
### Description
|
||||
|
||||
Alpine Linux Package Repository
|
||||
|
||||
### Included Architectures
|
||||
|
||||
x86_64
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
Under normal circumstances, you can replace the default Alpine source address `http://dl-cdn.alpinelinux.org/` in the `/etc/apk/repositories` file with `http://mirrors.jcut.edu.cn/`.
|
||||
|
||||
You may use the following command:
|
||||
|
||||
```shell
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.jcut.edu.cn/g' /etc/apk/repositories
|
||||
```
|
||||
|
||||
Alternatively, you can directly edit the `/etc/apk/repositories` file. Below is the reference configuration for version v3.19:
|
||||
|
||||
```text
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.19/main
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.19/community
|
||||
```
|
||||
|
||||
You can also use `latest-stable` to point to the latest stable version:
|
||||
|
||||
```text
|
||||
https://mirrors.jcut.edu.cn/alpine/latest-stable/main
|
||||
https://mirrors.jcut.edu.cn/alpine/latest-stable/community
|
||||
```
|
||||
|
||||
### Note
|
||||
|
||||
After changing the `/etc/apk/repositories` file, please run `apk update` to update the index for the changes to take effect.
|
||||
49
docs/en/archlinux.mdx
Normal file
49
docs/en/archlinux.mdx
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
mirrorId: archlinux
|
||||
---
|
||||
|
||||
## ArchLinux Mirror Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
https://mirrors.jcut.edu.cn/archlinux/
|
||||
|
||||
### Description
|
||||
|
||||
Arch Linux software repository.
|
||||
|
||||
### Supported Architectures
|
||||
|
||||
i686, x86_64
|
||||
|
||||
---
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
Pacman prioritizes the servers in the `mirrorlist` based on their order, so to add a mirror, it should be placed at the very top of the file; you may also comment out all other mirrors.
|
||||
|
||||
For detailed instructions on using mirrors for Arch Linux, please see the [official documentation](https://wiki.archlinux.org/title/mirrors).
|
||||
|
||||
Edit `/etc/pacman.d/mirrorlist` and add the following at the very top of the file:
|
||||
|
||||
```text
|
||||
Server = https://mirrors.jcut.edu.cn/archlinux/$repo/os/$arch
|
||||
```
|
||||
|
||||
It is also recommended to enable the `archlinuxcn` repository. For information about the `archlinuxcn` repository, please check [archlinuxcn Mirror Usage Help](#/doc/archlinuxcn).
|
||||
|
||||
### Note
|
||||
|
||||
After modifying the `mirrorlist`, please update the package cache:
|
||||
|
||||
```bash
|
||||
sudo pacman -Syyu
|
||||
```
|
||||
|
||||
Using two `y` flags helps to avoid problems when switching from a corrupted mirror to a working one.
|
||||
|
||||
If you switch from a newer mirror to an older one, the following command can be used to downgrade certain packages to prevent partial system updates:
|
||||
|
||||
```bash
|
||||
sudo pacman -Syyuu
|
||||
```
|
||||
196
docs/en/centos.mdx
Normal file
196
docs/en/centos.mdx
Normal file
@@ -0,0 +1,196 @@
|
||||
---
|
||||
mirrorId: centos
|
||||
---
|
||||
|
||||
## CentOS Mirror Usage Guide
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/centos/](https://mirrors.jcut.edu.cn/centos/)
|
||||
|
||||
### Description
|
||||
|
||||
CentOS Repository
|
||||
|
||||
### Supported Architectures
|
||||
x86_64, aarch64, ppc64le
|
||||
|
||||
### Supported Versions
|
||||
7, 8 Stream
|
||||
|
||||
#### Note
|
||||
|
||||
> CentOS 8 (non-Stream version) has been officially removed from this repository.
|
||||
|
||||
---
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
For CentOS 8 Stream, use the following commands to replace the default configuration:
|
||||
|
||||
```shell
|
||||
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
|
||||
-e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.jcut.edu.cn/centos|g' \
|
||||
-i.bak \
|
||||
/etc/yum.repos.d/CentOS-Stream-AppStream.repo \
|
||||
/etc/yum.repos.d/CentOS-Stream-BaseOS.repo \
|
||||
/etc/yum.repos.d/CentOS-Stream-Extras.repo \
|
||||
/etc/yum.repos.d/CentOS-Stream-PowerTools.repo
|
||||
```
|
||||
|
||||
For CentOS 7, use the following command to replace the default configuration:
|
||||
|
||||
```bash
|
||||
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
|
||||
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.jcut.edu.cn/centos|g' \
|
||||
-i.bak \
|
||||
/etc/yum.repos.d/CentOS-Base.repo
|
||||
```
|
||||
|
||||
The above commands only replace the default enabled repositories. After replacement, please run `yum makecache` to update the cache.
|
||||
|
||||
Below are the files after replacement:
|
||||
|
||||
Warning
|
||||
|
||||
The given CentOS-Stream-PowerTools.repo is set to disabled by default. To enable it, change `enabled=0` to `enabled=1`.
|
||||
|
||||
CentOS 8 Stream:
|
||||
|
||||
`/etc/yum.repos.d/CentOS-Stream-BaseOS.repo` file:
|
||||
|
||||
```shell
|
||||
# CentOS-Stream-BaseOS.repo
|
||||
#
|
||||
# The mirrorlist system uses the connecting IP address of the client and the
|
||||
# update status of each mirror to pick current mirrors that are geographically
|
||||
# close to the client. You should use this for CentOS updates unless you are
|
||||
# manually picking other mirrors.
|
||||
#
|
||||
# If the mirrorlist does not work for you, you can try the commented out
|
||||
# baseurl line instead.
|
||||
|
||||
[baseos]
|
||||
name=CentOS Stream $releasever - BaseOS
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$stream/BaseOS/$basearch/os/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
```
|
||||
|
||||
`/etc/yum.repos.d/CentOS-Stream-Extras.repo` file:
|
||||
|
||||
```shell
|
||||
# CentOS-Stream-Extras.repo
|
||||
#
|
||||
# The mirrorlist system uses the connecting IP address of the client and the
|
||||
# update status of each mirror to pick current mirrors that are geographically
|
||||
# close to the client. You should use this for CentOS updates unless you are
|
||||
# manually picking other mirrors.
|
||||
#
|
||||
# If the mirrorlist does not work for you, you can try the commented out
|
||||
# baseurl line instead.
|
||||
|
||||
[extras]
|
||||
name=CentOS Stream $releasever - Extras
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=extras&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$stream/extras/$basearch/os/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
```
|
||||
|
||||
`/etc/yum.repos.d/CentOS-Stream-AppStream.repo` file:
|
||||
|
||||
```shell
|
||||
# CentOS-Stream-AppStream.repo
|
||||
#
|
||||
# The mirrorlist system uses the connecting IP address of the client and the
|
||||
# update status of each mirror to pick current mirrors that are geographically
|
||||
# close to the client. You should use this for CentOS updates unless you are
|
||||
# manually picking other mirrors.
|
||||
#
|
||||
# If the mirrorlist does not work for you, you can try the commented out
|
||||
# baseurl line instead.
|
||||
|
||||
[appstream]
|
||||
name=CentOS Stream $releasever - AppStream
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$stream/AppStream/$basearch/os/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
```
|
||||
|
||||
`/etc/yum.repos.d/CentOS-Stream-PowerTools.repo` file:
|
||||
|
||||
```shell
|
||||
# CentOS-Stream-PowerTools.repo
|
||||
#
|
||||
# The mirrorlist system uses the connecting IP address of the client and the
|
||||
# update status of each mirror to pick current mirrors that are geographically
|
||||
# close to the client. You should use this for CentOS updates unless you are
|
||||
# manually picking other mirrors.
|
||||
#
|
||||
# If the mirrorlist does not work for you, you can try the commented out
|
||||
# baseurl line instead.
|
||||
|
||||
[powertools]
|
||||
name=CentOS Stream $releasever - PowerTools
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=PowerTools&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$stream/PowerTools/$basearch/os/
|
||||
gpgcheck=1
|
||||
enabled=0
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
```
|
||||
|
||||
CentOS 7:
|
||||
|
||||
`/etc/yum.repos.d/CentOS-Base.repo` file:
|
||||
|
||||
```shell
|
||||
# CentOS-Base.repo
|
||||
#
|
||||
# The mirror system uses the connecting IP address of the client and the
|
||||
# update status of each mirror to pick mirrors that are updated to and
|
||||
# geographically close to the client. You should use this for CentOS updates
|
||||
# unless you are manually picking other mirrors.
|
||||
#
|
||||
# If the mirrorlist= does not work for you, as a fall back you can try the
|
||||
# remarked out baseurl= line instead.
|
||||
#
|
||||
#
|
||||
|
||||
[base]
|
||||
name=CentOS-$releasever - Base
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$releasever/os/$basearch/
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
|
||||
#released updates
|
||||
[updates]
|
||||
name=CentOS-$releasever - Updates
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$releasever/updates/$basearch/
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
|
||||
#additional packages that may be useful
|
||||
[extras]
|
||||
name=CentOS-$releasever - Extras
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$releasever/extras/$basearch/
|
||||
gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
|
||||
#additional packages that extend functionality of existing packages
|
||||
[centosplus]
|
||||
name=CentOS-$releasever - Plus
|
||||
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
|
||||
baseurl=https://mirrors.jcut.edu.cn/centos/$releasever/centosplus/$basearch/
|
||||
gpgcheck=1
|
||||
enabled=0
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
```
|
||||
138
docs/en/debian.mdx
Normal file
138
docs/en/debian.mdx
Normal file
@@ -0,0 +1,138 @@
|
||||
---
|
||||
mirrorId: debian
|
||||
---
|
||||
|
||||
import ConfigGenerator from '../../src/components/config-generator'
|
||||
|
||||
export const debianVersions = [
|
||||
"bookworm", // 12
|
||||
"bullseye", // 11
|
||||
"buster", // 10
|
||||
"stretch", // 9
|
||||
"jessie", // 8
|
||||
"testing", // next stable in development
|
||||
"sid", // unstable
|
||||
]
|
||||
|
||||
export const GenDebianConfig = (version) => {
|
||||
if (version === 'sid') { // unstable
|
||||
return `# Source mirrors are commented out by default to improve apt update speed, uncomment if necessary
|
||||
deb https://mirrors.jcut.edu.cn/debian/ sid main contrib non-free non-free-firmware
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ sid main contrib non-free non-free-firmware`
|
||||
} else if (version === 'bullseye') { // 11
|
||||
return `# Source mirrors are commented out by default to improve apt update speed, uncomment if necessary
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free\n
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free\n
|
||||
deb https://mirrors.jcut.edu.cn/debian-security ${version}-security main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian-security ${version}-security main contrib non-free`
|
||||
} else if (version === 'buster' || version === 'stretch') { // 9, 10
|
||||
return `# Source mirrors are commented out by default to improve apt update speed, uncomment if necessary
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian-security ${version}/updates main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian-security ${version}/updates main contrib non-free`
|
||||
} else if (version === 'jessie') { // 8
|
||||
return `# Source mirrors are commented out by default to improve apt update speed, uncomment if necessary
|
||||
deb https://mirrors.jcut.edu.cn/debian/ jessie main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ jessie main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian/ jessie-updates main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ jessie-updates main contrib non-free
|
||||
deb https://mirrors.jcut.edu.cn/debian-security jessie/updates main contrib non-free
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian-security jessie/updates main contrib non-free`
|
||||
}
|
||||
return `# Source mirrors are commented out by default to improve apt update speed, uncomment if necessary
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free non-free-firmware
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version} main contrib non-free non-free-firmware
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free non-free-firmware
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-updates main contrib non-free non-free-firmware
|
||||
deb https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free non-free-firmware
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian/ ${version}-backports main contrib non-free non-free-firmware
|
||||
deb https://mirrors.jcut.edu.cn/debian-security ${version}-security main contrib non-free non-free-firmware
|
||||
# deb-src https://mirrors.jcut.edu.cn/debian-security ${version}-security main contrib non-free non-free-firmware`
|
||||
}
|
||||
|
||||
## Debian Mirror Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/debian/](https://mirrors.jcut.edu.cn/debian/)
|
||||
|
||||
### Description
|
||||
|
||||
*Debian* repository source
|
||||
|
||||
### Supported Architectures
|
||||
|
||||
amd64(X86_64), i386, arm
|
||||
|
||||
### Included Versions
|
||||
Debian Old Stable, Stable, Testing, Unstable (sid)
|
||||
|
||||
The current Stable is Debian 12, codenamed Bookworm
|
||||
|
||||
---
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
#### Method One
|
||||
|
||||
Under normal circumstances, simply replace the *Debian* default source address `http://deb.debian.org/` with `http://mirrors.jcut.edu.cn` in the `/etc/apt/sources.list` file.
|
||||
|
||||
You can use the following command:
|
||||
|
||||
```shell
|
||||
sudo sed -i 's/deb.debian.org/mirrors.jcut.edu.cn/g' /etc/apt/sources.list
|
||||
```
|
||||
|
||||
For Debian 12 (bookworm) **container** images that start using the DEB822 format instead of the traditional One-Line-Style format mentioned above, you would need to modify the `/etc/apt/sources.list.d/debian.sources` file. You can also use the following command:
|
||||
|
||||
```shell
|
||||
sudo sed -i 's/deb.debian.org/mirrors.jcut.edu.cn/g' /etc/apt/sources.list.d/debian.sources
|
||||
```
|
||||
|
||||
#### Method Two
|
||||
|
||||
Directly edit the /etc/apt/sources.list file (sudo is required). Below is the reference configuration content:
|
||||
<ConfigGenerator promptString="Please select your Debian version:" versionList={debianVersions} configGen={GenDebianConfig} language="bash" />
|
||||
|
||||
Below is the reference configuration content for Debian 12 **container images** after modifying both Debian and Debian Security sources:
|
||||
|
||||
```text
|
||||
Types: deb
|
||||
URIs: http://mirrors.jcut.edu.cn/debian
|
||||
Suites: bookworm bookworm-updates
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
Types: deb
|
||||
URIs: http://mirrors.jcut.edu.cn/debian-security
|
||||
Suites: bookworm-security
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
```
|
||||
|
||||
#### Note
|
||||
|
||||
After you change the `sources.list` file, please run `sudo apt-get update` to update the index and apply the changes.
|
||||
|
||||
In version 2.1.9 and later of apt, the HTTP Pipelining feature of apt seems to have some compatibility issues with Nginx servers, which may cause occasional Connection reset by peer errors when downloading large packages (such as system upgrades) from mirror sites (see Debian bug #973581).
|
||||
|
||||
Currently, users can solve this problem by turning off the HTTP Pipelining feature. If you need to turn it off, you can add the `-o Acquire::http::Pipeline-Depth=0` parameter when using the `apt` command, or add the relevant settings to the apt system configuration with the following command:
|
||||
|
||||
```bash
|
||||
echo "Acquire::http::Pipeline-Depth \"0\";" > /etc/apt/apt.conf.d/99nopipelining
|
||||
```
|
||||
|
||||
If you encounter problems pulling from https sources, first use http sources and install:
|
||||
|
||||
```bash
|
||||
sudo apt install apt-transport-https ca-certificates
|
||||
```
|
||||
49
docs/en/kali.mdx
Normal file
49
docs/en/kali.mdx
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
mirrorId: kali
|
||||
---
|
||||
|
||||
## Kali Mirror Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/kali/](https://mirrors.jcut.edu.cn/kali/)
|
||||
|
||||
### Description
|
||||
|
||||
*Kali Linux* software repository.
|
||||
|
||||
### Supported System Architectures
|
||||
|
||||
amd64, armel, armhf, i386
|
||||
|
||||
---
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
#### Method 1
|
||||
|
||||
Edit the `/etc/apt/sources.list` file and add the following entries at the top:
|
||||
|
||||
```shell
|
||||
deb https://mirrors.jcut.edu.cn/kali kali-rolling main non-free contrib
|
||||
deb-src https://mirrors.jcut.edu.cn/kali kali-rolling main non-free contrib
|
||||
```
|
||||
|
||||
#### Method 2
|
||||
Use the sed command to replace
|
||||
|
||||
```shell
|
||||
sudo sed -i "s@http://http.kali.org/kali@https://mirrors.jcut.edu.cn/kali@g" /etc/apt/sources.list
|
||||
```
|
||||
|
||||
### Note
|
||||
|
||||
> After changing the `sources.list` file, please run `sudo apt-get update` to update the index and apply the changes.
|
||||
|
||||
Since the Kali repository does not use the by-hash mechanism, consistency during synchronization cannot be guaranteed. If you run `apt update` during synchronization, you may see an error like this:
|
||||
|
||||
```text
|
||||
E: Failed to fetch https://mirrors.jcut.edu.cn/kali/dists/kali-rolling/main/source/Sources.gz File has unexpected size (14593053 != 14592993). Mirror sync in progress?
|
||||
```
|
||||
|
||||
If you encounter the above error, you will need to wait for the synchronization to complete before running `apt update` again.
|
||||
61
docs/en/mysql.mdx
Normal file
61
docs/en/mysql.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
mirrorId: mysql
|
||||
---
|
||||
|
||||
## MySQL Source Use Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/mysql/](https://mirrors.jcut.edu.cn/mysql/)
|
||||
|
||||
### Description
|
||||
|
||||
Mirror for MySQL software repositories.
|
||||
|
||||
### Included Versions
|
||||
|
||||
Currently supported Linux distributions' MySQL APT/YUM packages (without debug symbols).
|
||||
|
||||
The file directory structure is consistent with the upstream.
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
For Debian/Ubuntu users, refer to the following commands:
|
||||
|
||||
```bash
|
||||
## Please modify the version as needed, 8.0 and 5.7 are supported
|
||||
Mysql_version='8.0'
|
||||
source /etc/os-release && echo "deb https://mirrors.jcut.edu.cn/mysql/apt/${ID,,} ${VERSION_CODENAME} mysql-${Mysql_version} mysql-tools" > /etc/apt/sources.list.d/mysql-community.list
|
||||
## Update repository
|
||||
apt-get update
|
||||
```
|
||||
|
||||
For RHEL7/Fedora 7 users, refer to the following commands:
|
||||
```bash
|
||||
## Please modify the version as needed, 8.0 and 5.7 are supported
|
||||
Mysql_version='8.0'
|
||||
cat <<EOT > /etc/yum.repos.d/mysql-community.repo
|
||||
[mysql-connectors-community]
|
||||
name=MySQL Connectors Community
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-connectors-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
|
||||
[mysql-tools-community]
|
||||
name=MySQL Tools Community
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-tools-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
|
||||
[mysql-8.0-community]
|
||||
name=MySQL 8.0 Community Server
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-${Mysql_version}-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
EOT
|
||||
## Update repository cache
|
||||
yum makecache
|
||||
```
|
||||
76
docs/en/nodejs-release.mdx
Normal file
76
docs/en/nodejs-release.mdx
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
mirrorId: nodejs-release
|
||||
---
|
||||
|
||||
## Node Source Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/nodejs-release/](https://mirrors.jcut.edu.cn/nodejs-release/)
|
||||
|
||||
### Description
|
||||
|
||||
Mirror for the Node.js repository, containing the content from https://nodejs.org/dist/
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
You can manually select and download the required version, or you can use it in conjunction with version managers such as `n`, `nvm`, or `fnm`. The methods are as follows:
|
||||
|
||||
#### n
|
||||
|
||||
```bash
|
||||
# Set environment variable
|
||||
|
||||
export NODE_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# Then use n as usual
|
||||
|
||||
sudo n stable
|
||||
```
|
||||
|
||||
#### nvm
|
||||
|
||||
```bash
|
||||
# Set environment variable
|
||||
|
||||
export NVM_NODEJS_ORG_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# Then use nvm as normal
|
||||
|
||||
nvm install <version>
|
||||
```
|
||||
|
||||
#### fnm
|
||||
|
||||
```bash
|
||||
# Set environment variable
|
||||
|
||||
export FNM_NODE_DIST_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# Then use fnm as normal
|
||||
|
||||
fnm install <version>
|
||||
```
|
||||
|
||||
#### volta
|
||||
|
||||
Create or edit `~/.volta/hooks.json` (Linux/MacOS), or `%LOCALAPPDATA%\Volta\hooks.json` (Windows), replacing its contents with:
|
||||
|
||||
```json
|
||||
{
|
||||
"node": {
|
||||
"index": {
|
||||
"template": "https://mirrors.jcut.edu.cn/nodejs-release/index.json"
|
||||
},
|
||||
"distro": {
|
||||
"template": "https://mirrors.jcut.edu.cn/nodejs-release/v{{version}}/node-v{{version}}-{{os}}-{{arch}}.tar.gz"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After this, you can use `volta` as normal:
|
||||
|
||||
```bash
|
||||
volta install node@<version>
|
||||
```
|
||||
51
docs/en/rocky.mdx
Normal file
51
docs/en/rocky.mdx
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
mirrorId: rocky
|
||||
---
|
||||
|
||||
## Rocky Linux Repository Usage Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/rocky/](https://mirrors.jcut.edu.cn/rocky/)
|
||||
|
||||
### Description
|
||||
|
||||
Rocky Linux software repository mirror.
|
||||
|
||||
### Supported Architectures
|
||||
|
||||
x86_64, aarch64
|
||||
|
||||
### Included Versions
|
||||
|
||||
8, 9
|
||||
|
||||
---
|
||||
|
||||
### Usage Instructions
|
||||
|
||||
For Rocky Linux 8, use the following commands to replace the default configuration:
|
||||
|
||||
```shell
|
||||
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
|
||||
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.jcut.edu.cn/rocky|g' \
|
||||
-i.bak \
|
||||
/etc/yum.repos.d/Rocky-AppStream.repo \
|
||||
/etc/yum.repos.d/Rocky-BaseOS.repo \
|
||||
/etc/yum.repos.d/Rocky-Extras.repo \
|
||||
/etc/yum.repos.d/Rocky-PowerTools.repo
|
||||
```
|
||||
|
||||
For Rocky Linux 9, use the following commands to replace the default configuration:
|
||||
|
||||
```shell
|
||||
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
|
||||
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.jcut.edu.cn/rocky|g' \
|
||||
-i.bak \
|
||||
/etc/yum.repos.d/rocky-extras.repo \
|
||||
/etc/yum.repos.d/rocky.repo
|
||||
```
|
||||
|
||||
The above commands only replace the default enabled repositories. After replacing, please run `dnf makecache` to update the cache.
|
||||
|
||||
> This document was written with reference to http://mirrors.ustc.edu.cn/help/rocky.html.
|
||||
77
docs/en/ubuntu.mdx
Normal file
77
docs/en/ubuntu.mdx
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
mirrorId: ubuntu
|
||||
---
|
||||
|
||||
import ConfigGenerator from '../../src/components/config-generator'
|
||||
|
||||
export const ubuntuVersionMap = {
|
||||
"24.04 LTS": "noble",
|
||||
"23.04": "lunar",
|
||||
"22.10": "kinetic",
|
||||
"22.04 LTS": "jammy",
|
||||
"20.04 LTS": "focal",
|
||||
"18.04 LTS": "bionic",
|
||||
"16.04 LTS": "xenial",
|
||||
"14.04 LTS": "trusty",
|
||||
}
|
||||
|
||||
export const GenUbuntuConfig = (version) => {
|
||||
var ubuntuName = ubuntuVersionMap[version]
|
||||
return `# The source image has been commented out by default to improve the speed of apt update. You can uncomment it if necessary.
|
||||
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
|
||||
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
|
||||
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
|
||||
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
|
||||
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
|
||||
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
|
||||
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse
|
||||
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse\n
|
||||
# Pre-release software sources are not recommended for enabling
|
||||
# deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse
|
||||
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse`
|
||||
}
|
||||
|
||||
export const defaultVersion = Object.keys(ubuntuVersionMap).find(x => x.indexOf("LTS") > 0);
|
||||
|
||||
## Ubuntu Source Use Help
|
||||
|
||||
### Address
|
||||
|
||||
[https://mirrors.jcut.edu.cn/ubuntu/](https://mirrors.jcut.edu.cn/ubuntu/)
|
||||
|
||||
### Description
|
||||
|
||||
*Ubuntu* software sources
|
||||
|
||||
### Included Architectures
|
||||
|
||||
amd64(X86_64), i386
|
||||
|
||||
### Included Versions
|
||||
|
||||
All currently supported versions of *Ubuntu*, including development versions, are listed at [https://wiki.ubuntu.com/Releases](https://wiki.ubuntu.com/Releases)
|
||||
|
||||
---
|
||||
|
||||
### How to Use
|
||||
|
||||
#### Method 1
|
||||
|
||||
Under general conditions, replace the default *Ubuntu* source address `http://archive.ubuntu.com/` in the `/etc/apt/sources.list` file with `http://mirrors.jcut.edu.cn/`.
|
||||
|
||||
You can use the following command:
|
||||
|
||||
```shell
|
||||
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.jcut.edu.cn@g' /etc/apt/sources.list
|
||||
```
|
||||
|
||||
Starting from *Ubuntu 24.04 LTS*, the DEB822 format is used instead of the traditional One-Line-Style format mentioned above. The corresponding file that needs to be modified is `/etc/apt/sources.list.d/ubuntu.sources`. Similarly, you can use the following command:
|
||||
|
||||
```shell
|
||||
sudo sed -i 's/archive.ubuntu.com/mirrors.jcut.edu.cn/g' /etc/apt/sources.list.d/ubuntu.sources
|
||||
```
|
||||
|
||||
#### Method 2
|
||||
|
||||
Directly edit `/etc/apt/sources.list` (using `sudo`).
|
||||
<ConfigGenerator promptString="Please select your Ubuntu version:" versionList={Object.keys(ubuntuVersionMap)} defaultVersion={defaultVersion} configGen={GenUbuntuConfig} language="bash" />
|
||||
@@ -26,11 +26,11 @@ x86_64
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.jcut.edu.cn/g' /etc/apk/repositories
|
||||
```
|
||||
|
||||
也可以直接编辑 `/etc/apk/repositories` 文件。以下是 v3.19 版本的参考配置:
|
||||
也可以直接编辑 `/etc/apk/repositories` 文件。以下是 v3.20 版本的参考配置:
|
||||
|
||||
```text
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.19/main
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.19/community
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.20/main
|
||||
https://mirrors.jcut.edu.cn/alpine/v3.20/community
|
||||
```
|
||||
|
||||
也可以使用 `latest-stable` 指向最新的稳定版本:
|
||||
|
||||
62
docs/zh/mysql.mdx
Normal file
62
docs/zh/mysql.mdx
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
mirrorId: mysql
|
||||
---
|
||||
|
||||
## MySQL 源使用帮助
|
||||
|
||||
### 地址
|
||||
|
||||
[https://mirrors.jcut.edu.cn/mysql/](https://mirrors.jcut.edu.cn/mysql/)
|
||||
|
||||
### 说明
|
||||
|
||||
MySQL 软件仓库镜像
|
||||
|
||||
### 收录版本
|
||||
|
||||
目前仍被支持的 Linux 发行版的 MySQL APT/YUM 软件包(不含调试符号)。
|
||||
|
||||
文件目录结构与上游保持一致。
|
||||
|
||||
### 使用说明
|
||||
|
||||
Debian/Ubuntu 用户参考以下命令
|
||||
|
||||
```bash
|
||||
## 请自行根据需求修改版本,支持8.0及5.7
|
||||
Mysql_version='8.0'
|
||||
source /etc/os-release && echo "deb https://mirrors.jcut.edu.cn/mysql/apt/${ID,,} ${VERSION_CODENAME} mysql-${Mysql_version} mysql-tools" > /etc/apt/sources.list.d/mysql-community.list
|
||||
## 更新仓库
|
||||
apt-get update
|
||||
```
|
||||
|
||||
RHEL7/Fedora 7用户参考以下命令
|
||||
```bash
|
||||
## 请自行根据需求修改版本,支持8.0及5.7
|
||||
Mysql_version='8.0'
|
||||
cat <<EOT > /etc/yum.repos.d/mysql-community.repo
|
||||
[mysql-connectors-community]
|
||||
name=MySQL Connectors Community
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-connectors-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
|
||||
[mysql-tools-community]
|
||||
name=MySQL Tools Community
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-tools-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
|
||||
[mysql-8.0-community]
|
||||
name=MySQL 8.0 Community Server
|
||||
baseurl=https://mirrors.jcut.edu.cn/mysql/yum/mysql-${Mysql_version}-community-el7-\$basearch/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
EOT
|
||||
## 更新仓库缓存
|
||||
yum makecache
|
||||
```
|
||||
|
||||
76
docs/zh/nodejs-release.mdx
Normal file
76
docs/zh/nodejs-release.mdx
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
mirrorId: nodejs-release
|
||||
---
|
||||
|
||||
## Node 源使用帮助
|
||||
|
||||
### 地址
|
||||
|
||||
[https://mirrors.jcut.edu.cn/nodejs-release/](https://mirrors.jcut.edu.cn/nodejs-release/)
|
||||
|
||||
### 说明
|
||||
|
||||
Node.js 仓库镜像,包含了 https://nodejs.org/dist/ 中的内容
|
||||
|
||||
### 使用说明
|
||||
|
||||
可以手工选择下载所需的版本,也可以搭配 `n` 、 `nvm` 或者 `fnm` 等版本管理器使用,方法如下:
|
||||
|
||||
#### n
|
||||
|
||||
```bash
|
||||
# 设定环境变量
|
||||
|
||||
export NODE_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# 然后正常使用 n 即可
|
||||
|
||||
sudo n stable
|
||||
```
|
||||
|
||||
#### nvm
|
||||
|
||||
```bash
|
||||
# 设定环境变量
|
||||
|
||||
export NVM_NODEJS_ORG_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# 然后正常使用 nvm 即可
|
||||
|
||||
sudo nvm install <version>
|
||||
```
|
||||
|
||||
#### fnm
|
||||
|
||||
```bash
|
||||
# 设定环境变量
|
||||
|
||||
export FNM_NODE_DIST_MIRROR=https://mirrors.jcut.edu.cn/nodejs-release/
|
||||
|
||||
# 然后正常使用 fnm 即可
|
||||
|
||||
fnm install <version>
|
||||
```
|
||||
|
||||
#### volta
|
||||
|
||||
创建或编辑 `~/.volta/hooks.json` (Linux/MacOS),或 `%LOCALAPPDATA%\Volta\hooks.json` (Windows),将内容替换如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"node": {
|
||||
"index": {
|
||||
"template": "https://mirrors.jcut.edu.cn/nodejs-release/index.json"
|
||||
},
|
||||
"distro": {
|
||||
"template": "https://mirrors.jcut.edu.cn/nodejs-release/v{{version}}/node-v{{version}}-{{os}}-{{arch}}.tar.gz"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
之后即可正常使用 `volta`
|
||||
|
||||
```bash
|
||||
volta install node@<version>
|
||||
```
|
||||
@@ -5,6 +5,7 @@ mirrorId: ubuntu
|
||||
import ConfigGenerator from '../../src/components/config-generator'
|
||||
|
||||
export const ubuntuVersionMap = {
|
||||
"24.04 LTS": "noble",
|
||||
"23.04": "lunar",
|
||||
"22.10": "kinetic",
|
||||
"22.04 LTS": "jammy",
|
||||
@@ -64,7 +65,13 @@ amd64(X86_64), i386
|
||||
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.jcut.edu.cn@g' /etc/apt/sources.list
|
||||
```
|
||||
|
||||
从 *Ubuntu 24.04 LTS* 开始使用 DEB822 格式,而非上文使用的传统的 One-Line-Style 格式。 对应需要修改的文件为 `/etc/apt/sources.list.d/ubuntu.sources`。同样可以使用如下命令:
|
||||
|
||||
```shell
|
||||
sudo sed -i 's/archive.ubuntu.com/mirrors.jcut.edu.cn/g' /etc/apt/sources.list.d/ubuntu.sources
|
||||
```
|
||||
|
||||
#### 方法二
|
||||
|
||||
直接编辑 `/etc/apt/sources.list` 文件(需要使用 `sudo`)。
|
||||
直接编辑 `/etc/apt/sources.list` (需要使用 `sudo`)。
|
||||
<ConfigGenerator promptString="请选择您的 Ubuntu 版本:" versionList={Object.keys(ubuntuVersionMap)} defaultVersion={defaultVersion} configGen={GenUbuntuConfig} language="bash" />
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
import './src/styles/global.scss';
|
||||
import React from 'react';
|
||||
import RootLayout from './src/utils/root-layout';
|
||||
|
||||
export const wrapRootElement = ({ element }) => <RootLayout>{element}</RootLayout>
|
||||
|
||||
@@ -16,20 +16,6 @@ module.exports = {
|
||||
assetPrefix: config.assetPrefix,
|
||||
pathPrefix: config.pathPrefix,
|
||||
plugins: [
|
||||
{
|
||||
resolve: `gatsby-theme-material-ui`,
|
||||
options: {
|
||||
webFontsConfig: {
|
||||
fonts: {
|
||||
google: [
|
||||
{
|
||||
family: `Metrophobic`
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
@@ -57,7 +43,7 @@ module.exports = {
|
||||
mdxOptions: {
|
||||
remarkPlugins: [
|
||||
// Add GitHub Flavored Markdown (GFM) support
|
||||
// Warning: Most of the remark ecosystem is ESM which means that packages
|
||||
// Warning: Most of the remark ecosystem is ESM which means that packages
|
||||
// like remark-gfm don’t work out of the box with Gatsby v5. To make remark-gfm
|
||||
// compatible with the current Gatsby version, we have to use an old version of
|
||||
// remark-gfm. Please take care in future updates.
|
||||
@@ -72,11 +58,11 @@ module.exports = {
|
||||
rule: {
|
||||
include: /icons/,
|
||||
omitKeys: [
|
||||
'inkscapePageshadow', 'inkscapePageopacity', 'inkscapePagecheckerboard',
|
||||
'inkscapeZoom', 'inkscapeCx', 'inkscapeCy', 'inkscapeWindowWidth', 'inkscapeWindowHeight',
|
||||
'inkscapeWindowX', 'inkscapeWindowY', 'inkscapeWindowMaximized', 'inkscapeCurrentLayer',
|
||||
'inkscapePageshadow', 'inkscapePageopacity', 'inkscapePagecheckerboard',
|
||||
'inkscapeZoom', 'inkscapeCx', 'inkscapeCy', 'inkscapeWindowWidth', 'inkscapeWindowHeight',
|
||||
'inkscapeWindowX', 'inkscapeWindowY', 'inkscapeWindowMaximized', 'inkscapeCurrentLayer',
|
||||
'sodipodiNodetypes', 'sodipodiDocname', 'inkscapeVersion', 'xmlnsInkscape', 'xmlnsSodipodi',
|
||||
'xmlnsSvg',
|
||||
'xmlnsSvg',
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -113,7 +99,6 @@ module.exports = {
|
||||
icon: 'resource/icons/favicon.svg',
|
||||
},
|
||||
},
|
||||
`gatsby-plugin-preact`,
|
||||
`gatsby-plugin-sass`,
|
||||
{
|
||||
resolve: "gatsby-plugin-sitemap",
|
||||
|
||||
@@ -2,6 +2,7 @@ const { match, compile } = require("path-to-regexp");
|
||||
const { createFilePath } = require(`gatsby-source-filesystem`)
|
||||
const { createContentDigest } = require(`gatsby-core-utils`)
|
||||
const config = require('./config');
|
||||
const path = require("path");
|
||||
|
||||
const mdxResolverPassthrough = (fieldName) => async (
|
||||
source,
|
||||
@@ -194,3 +195,13 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
exports.onCreateWebpackConfig = ({ actions }) => {
|
||||
actions.setWebpackConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
'~': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
5
gatsby-ssr.js
Normal file
5
gatsby-ssr.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import './src/styles/global.scss';
|
||||
import React from 'react';
|
||||
import RootLayout from './src/utils/root-layout';
|
||||
|
||||
export const wrapRootElement = ({ element }) => <RootLayout>{element}</RootLayout>
|
||||
@@ -17,13 +17,13 @@
|
||||
"关于我们-JCIOT团队": "About Us - JCIOT Team",
|
||||
"荆楚理工学院开源镜像站是一个致力于助力开发者开发,方便荆楚校内外师生高效访问开源资源的非盈利计划。":"The Open Source Mirror Station of Jingchu University of Technology is a non-profit program dedicated to helping developers develop and facilitate teachers and students inside and outside Jingchu University to access open source resources efficiently.",
|
||||
"本站由荆楚理工学院信息化办公室支持创办": "This site is supported by the information Office of Jingchu University of Technology",
|
||||
"由JCIOT团队开发运行维护,感谢团队成员YangFan,ZhaoYinghao为本站建设作出的贡献": "Developed by JCIOT team, operation and maintenance, thanks to team members Fan Yang,Yinghao Zhao for their contributions to the construction of this site",
|
||||
"由JCIOT团队开发运行维护,感谢团队成员YangFan为本站建设作出的贡献": "Developed by JCIOT team, operation and maintenance, thanks to team members Fan Yang for their contributions to the construction of this site",
|
||||
"荆楚理工学院开源镜像站": "Jingchu University of Technology open source mirror station",
|
||||
"本站基于浙江大学ZJUSCT开源的mirror-front与清华大学TUNA开源的tunasync项目,感谢ZJUSCT与TUNA为国内开源生态作出的伟大贡献 除特殊注明外,本站源码在 Apache License 2.0 许可下发布,本站创作内容均在 CC BY-NC-SA 4.0 许可下发布,相关源码及创作内容可在 GitHub 获取。": "This site is based on the mirror front of ZJUSCT open source of Zhejiang University and tunasync project of TUNA open source of Tsinghua University. Thanks to ZJUSCT and TUNA for their great contribution to the domestic open source ecology. Unless otherwise noted, the source code of this site is released under the Apache License 2.0 license. The content created on this site is published under the CC BY-NC-SA 4.0 license, and the relevant source code and creative content can be obtained on GitHub.",
|
||||
"最近更新于 {{date}}": "Last updated at {{date}}",
|
||||
"本镜像站提供了包括 Docker, PostgreSQL, Ubuntu 等项目源的镜像,以服务教育和科学研究为目的,提倡自由、平等、协作、共享的精神。": "We provide a variety of mirrors including Docker, PostgreSQL, and Ubuntu, for the purpose of serving education and scientific research, and promoting the spirit of freedom, equality, collaboration, and sharing.",
|
||||
"浅色": "Light",
|
||||
"荆楚理工学院开源镜像站是一个致力于助力开发者开发,方便荆楚校内外师生高效访问开源资源的非盈利计划。\n\n本站由荆楚理工学院信息化办公室支持创办\n\n由JCIOT团队开发运行维护,感谢团队成员YangFan,ZhaoYinghao为本站建设作出的贡献\n\n本站基于浙江大学ZJUSCT开源的mirror-front与清华大学TUNA开源的tunasync项目,感谢ZJUSCT与TUNA为国内开源生态作出的伟大贡献 除特殊注明外,本站源码在 Apache License 2.0 许可下发布,本站创作内容均在 CC BY-NC-SA 4.0 许可下发布,相关源码及创作内容可在 GitHub 获取。\n\nIssues & Mirror Request (GitHub)\n\n根据相关法律法规,本站部分内容仅对校内用户提供服务。": "The Open Source Mirror Station of Jingchu University of Technology is a non-profit program dedicated to helping developers develop and facilitate teachers and students inside and outside Jingchu University to access open source resources efficiently.\n\nThis site is supported by the information Office of Jingchu Institute of Technology\n\nDeveloped by JCIOT team, operation and maintenance, thanks to team members YangFan,ZhaoYinghao for their contributions to the construction of this site\n\nThis site is based on the mirror front of ZJUSCT open source of Zhejiang University and tunasync project of TUNA open source of Tsinghua University. Thanks to ZJUSCT and TUNA for their great contribution to the domestic open source ecology. Unless otherwise noted, the source code of this site is released under the Apache License 2.0 license. The content created on this site is published under the CC BY-NC-SA 4.0 license, and the relevant source code and creative content can be obtained on GitHub.\n\nIssues & Mirror Request (GitHub)\n\nAccording to relevant laws and regulations, some contents of this site are only available to campus users.",
|
||||
"荆楚理工学院开源镜像站是一个致力于助力开发者开发,方便荆楚校内外师生高效访问开源资源的非盈利计划。\n\n本站由荆楚理工学院信息化办公室支持创办\n\n由JCIOT团队开发运行维护,感谢团队成员YangFan为本站建设作出的贡献\n\n本站基于浙江大学ZJUSCT开源的mirror-front与清华大学TUNA开源的tunasync项目,感谢ZJUSCT与TUNA为国内开源生态作出的伟大贡献 除特殊注明外,本站源码在 Apache License 2.0 许可下发布,本站创作内容均在 CC BY-NC-SA 4.0 许可下发布,相关源码及创作内容可在 GitHub 获取。\n\nIssues & Mirror Request (GitHub)\n\n根据相关法律法规,本站部分内容仅对校内用户提供服务。": "The Open Source Mirror Station of Jingchu University of Technology is a non-profit program dedicated to helping developers develop and facilitate teachers and students inside and outside Jingchu University to access open source resources efficiently.\n\nThis site is supported by the information Office of Jingchu Institute of Technology\n\nDeveloped by JCIOT team, operation and maintenance, thanks to team members YangFan for their contributions to the construction of this site\n\nThis site is based on the mirror front of ZJUSCT open source of Zhejiang University and tunasync project of TUNA open source of Tsinghua University. Thanks to ZJUSCT and TUNA for their great contribution to the domestic open source ecology. Unless otherwise noted, the source code of this site is released under the Apache License 2.0 license. The content created on this site is published under the CC BY-NC-SA 4.0 license, and the relevant source code and creative content can be obtained on GitHub.\n\nIssues & Mirror Request (GitHub)\n\nAccording to relevant laws and regulations, some contents of this site are only available to campus users.",
|
||||
"荆楚理工学院信息化办公室": "Jingchu University of Technology information office",
|
||||
"浙江大学开源镜像站": "Open Source Software Mirror Site of JingChu University",
|
||||
"浙江大学开源镜像站是一个致力于普及开源软件,方便校内外用户高效访问开源项目的各种资源的非盈利计划。": "JCUT Mirror is a non-profit program aimed at popularizing open source software and facilitating efficient access to various resources of open source projects by all users.",
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
"全新版本": "全新版本",
|
||||
"荆楚理工学院开源镜像站是一个致力于助力开发者开发,方便荆楚校内外师生高效访问开源资源的非盈利计划。": "荆楚理工学院开源镜像站是一个致力于助力开发者开发,方便荆楚校内外师生高效访问开源资源的非盈利计划。",
|
||||
"本站由荆楚理工学院信息化办公室支持创办": "本站由荆楚理工学院信息化办公室支持创办",
|
||||
"由JCIOT团队开发运行维护,感谢团队成员YangFan,ZhaoYinghao为本站建设作出的贡献": "由JCIOT团队开发运行维护,感谢团队成员YangFan,ZhaoYinghao为本站建设作出的贡献",
|
||||
"由JCIOT团队开发运行维护,感谢团队成员YangFan为本站建设作出的贡献": "由JCIOT团队开发运行维护,感谢团队成员YangFan为本站建设作出的贡献",
|
||||
"本站基于浙江大学ZJUSCT开源的mirror-front与清华大学TUNA开源的tunasync项目,感谢ZJUSCT与TUNA为国内开源生态作出的伟大贡献 除特殊注明外,本站源码在 Apache License 2.0 许可下发布,本站创作内容均在 CC BY-NC-SA 4.0 许可下发布,相关源码及创作内容可在 GitHub 获取。": "本站基于浙江大学ZJUSCT开源的mirror-front与清华大学TUNA开源的tunasync项目,感谢ZJUSCT与TUNA为国内开源生态作出的伟大贡献 除特殊注明外,本站源码在 Apache License 2.0 许可下发布,本站创作内容均在 CC BY-NC-SA 4.0 许可下发布,相关源码及创作内容可在 GitHub 获取。",
|
||||
"荆楚理工学院开源镜像站": "荆楚理工学院开源镜像站",
|
||||
"最近更新于 {{date}}": "最近更新于 {{date}}",
|
||||
"浅色": "浅色",
|
||||
"荆楚理工学院信息化办公室": "荆楚理工学院信息化办公室",
|
||||
"荆楚理工学院开源镜像站": "荆楚理工学院开源镜像站",
|
||||
"关于我们-JCIOT团队": "关于我们-JCIOT团队",
|
||||
"根据相关法律法规,本站部分内容仅对校内用户提供服务。": "根据相关法律法规,本站部分内容仅对校内用户提供服务。",
|
||||
"深色": "深色",
|
||||
|
||||
20
news/en/240501_mirror_notice.mdx
Normal file
20
news/en/240501_mirror_notice.mdx
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: Mirror Site Maintenance Notice
|
||||
name: mirror_notice
|
||||
author: ZYH @ JCIOT Mirrors Team
|
||||
date: 2024-05-01
|
||||
---
|
||||
## Mirror Site Maintenance Notice
|
||||
|
||||
Dear users:
|
||||
|
||||
We would like to inform you that due to a backend Ceph OSD service issue, we are scheduled to perform emergency maintenance from **00:00 to 20:00 on May 2, 2024**. During this time, you may experience the following issues:
|
||||
|
||||
- Delays in cache updates for some mirrors
|
||||
- Slower access speeds
|
||||
|
||||
We are committed to minimizing the maintenance duration to mitigate any inconvenience and to ensuring that service is restored to normal as swiftly as possible once maintenance concludes. We suggest scheduling your large data downloads outside of the maintenance window.
|
||||
|
||||
If you encounter any issues during or after the maintenance period, please do not hesitate to contact our technical support team.
|
||||
|
||||
Thank you for your understanding and cooperation.
|
||||
18
news/zh/240501_mirror_notice.mdx
Normal file
18
news/zh/240501_mirror_notice.mdx
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: 镜像站维护通知
|
||||
name: mirror_notice
|
||||
author: ZYH @ JCIOT Mirrors Team
|
||||
date: 2024-05-01
|
||||
---
|
||||
尊敬的用户们:
|
||||
|
||||
我们想通知您,因后端Ceph OSD服务出现故障,我们定于 **2024年5月2日0时至20时** 进行紧急维护工作。维护期间,您可能会遇到以下问题:
|
||||
|
||||
- 部分镜像缓存更新延迟
|
||||
- 访问速度变慢
|
||||
|
||||
我们会尽最大努力来缩短维护时间,减轻对您的影响,并确保维护完成后服务能够迅速恢复正常。我们建议您在维护时间段外进行大容量数据的下载。
|
||||
|
||||
如在维护期间或之后遇到任何问题,请随时与我们的技术支持团队取得联系。
|
||||
|
||||
感谢您的理解与支持。
|
||||
94
package.json
94
package.json
@@ -17,67 +17,67 @@
|
||||
"lint-check": "eslint src/**/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.9.0",
|
||||
"@emotion/styled": "^11.8.1",
|
||||
"@emotion/react": "^11.11.4",
|
||||
"@emotion/server": "^11.11.0",
|
||||
"@emotion/styled": "^11.11.5",
|
||||
"@fontsource/poppins": "^4.5.10",
|
||||
"@formatjs/intl-displaynames": "^5.4.3",
|
||||
"@iconify/icons-file-icons": "^1.2.3",
|
||||
"@iconify/icons-grommet-icons": "^1.2.5",
|
||||
"@iconify/icons-logos": "^1.2.36",
|
||||
"@iconify/icons-mdi": "^1.2.44",
|
||||
"@iconify/icons-mdi": "^1.2.48",
|
||||
"@iconify/icons-simple-icons": "^1.2.74",
|
||||
"@iconify/react": "^3.2.1",
|
||||
"@iconify/react": "^3.2.2",
|
||||
"@mdx-js/mdx": "^3.0.1",
|
||||
"@mdx-js/react": "^2.3.0",
|
||||
"@mui/icons-material": "^5.6.2",
|
||||
"@mui/material": "^5.6.3",
|
||||
"gatsby": "^5.9.1",
|
||||
"gatsby-plugin-manifest": "^5.6.0",
|
||||
"gatsby-plugin-mdx": "^5.6.0",
|
||||
"gatsby-plugin-preact": "^7.6.1",
|
||||
"@mui/icons-material": "^5.15.15",
|
||||
"@mui/material": "^5.15.15",
|
||||
"gatsby": "^5.13.3",
|
||||
"gatsby-plugin-manifest": "^5.13.1",
|
||||
"gatsby-plugin-mdx": "^5.13.1",
|
||||
"gatsby-plugin-react-helmet": "^6.13.1",
|
||||
"gatsby-plugin-react-i18next": "^3.0.1",
|
||||
"gatsby-plugin-react-svg": "^3.1.0",
|
||||
"gatsby-plugin-sass": "^6.6.0",
|
||||
"gatsby-plugin-sitemap": "^6.7.0",
|
||||
"gatsby-source-filesystem": "^5.6.0",
|
||||
"gatsby-theme-material-ui": "^5.2.0",
|
||||
"gatsby-theme-material-ui-top-layout": "^5.2.0",
|
||||
"i18next": "^21.6.16",
|
||||
"js-search": "^2.0.0",
|
||||
"gatsby-plugin-react-svg": "^3.3.0",
|
||||
"gatsby-plugin-sass": "^6.13.1",
|
||||
"gatsby-plugin-sitemap": "^6.13.1",
|
||||
"gatsby-source-filesystem": "^5.13.1",
|
||||
"i18next": "^22.5.1",
|
||||
"js-search": "^2.0.1",
|
||||
"natsort": "^2.0.3",
|
||||
"path-to-regexp": "^6.2.0",
|
||||
"preact": "^10.12.1",
|
||||
"preact-render-to-string": "^5.2.6",
|
||||
"prism-react-renderer": "^1.3.1",
|
||||
"react": "^18.1.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"path-to-regexp": "^6.2.2",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-i18next": "^11.16.7",
|
||||
"remark-gfm": "^1",
|
||||
"sass": "^1.53.0"
|
||||
"react-i18next": "^12.3.1",
|
||||
"remark-gfm": "^1.0.0",
|
||||
"sass": "^1.74.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.17.10",
|
||||
"@babel/plugin-transform-typescript": "^7.16.8",
|
||||
"@types/js-search": "^1.4.0",
|
||||
"@types/mdx": "^2.0.1",
|
||||
"@types/mdx-js__react": "^1.5.5",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/react": "^18.0.14",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
||||
"@typescript-eslint/parser": "^5.28.0",
|
||||
"@babel/cli": "^7.24.1",
|
||||
"@babel/plugin-transform-typescript": "^7.24.4",
|
||||
"@types/js-search": "^1.4.4",
|
||||
"@types/mdx": "^2.0.12",
|
||||
"@types/mdx-js__react": "^1.5.8",
|
||||
"@types/node": "^18.19.31",
|
||||
"@types/react": "^18.2.75",
|
||||
"@types/react-dom": "^18.2.24",
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
"@typescript-eslint/parser": "^5.62.0",
|
||||
"babel-plugin-i18next-extract": "^0.8.3",
|
||||
"eslint": "^8.2.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb": "19.0.4",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-typescript": "^3.2.1",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.30.0",
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"prettier": "2.7.1",
|
||||
"typescript": "^4.7.3"
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-eslint": "^16.3.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Ly_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 108.895 109.621" enable-background="new 0 0 108.895 109.621"
|
||||
xml:space="preserve">
|
||||
<svg version="1.1" id="Ly_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
viewBox="0 0 108.895 109.621" enable-background="new 0 0 108.895 109.621"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#00905A" d="M84.183,6.964c26.275,17.29,32.695,53.977,13.938,79.635c-18.799,25.715-56.018,30.715-80.35,10.795
|
||||
<path fill="#59C1DC" d="M84.183,6.964c26.275,17.29,32.695,53.977,13.938,79.635c-18.799,25.715-56.018,30.715-80.35,10.795
|
||||
c0.143-1.059,0.985-0.66,1.541-0.668c2.573-0.045,5.151-0.086,7.725-0.004c3.746,0.119,7.447-0.125,11.104-0.951
|
||||
c11.298,0.549,21.865-1.939,31.453-7.99c14.036-8.854,22.444-21.531,24.983-37.962c0.959-6.203,0.865-12.442-0.426-18.624
|
||||
c-1.027-5.61-3.06-10.858-5.761-15.86c-1.176-2.259-2.729-4.269-4.194-6.338C83.783,8.418,82.778,7.638,84.183,6.964z"/>
|
||||
<path fill="#33C890" d="M94.748,30.947c2.182,10.698,1.449,21.228-2.734,31.279c-6.596,15.855-18.186,26.564-34.586,31.871
|
||||
<path fill="#79D4D8" d="M94.748,30.947c2.182,10.698,1.449,21.228-2.734,31.279c-6.596,15.855-18.186,26.564-34.586,31.871
|
||||
c-6.057,1.959-12.303,2.727-18.674,2.348c-1.682-0.879-3.379,0.771-5.063-0.027c-4.752-1.355-9.65-2.219-14.191-4.289
|
||||
c-4.762-2.176-9.342-4.623-13.252-8.17c0.164-1.199,1.119-0.717,1.729-0.729c3.063-0.053,6.129-0.076,9.19-0.014
|
||||
c7.443,0.146,14.859-0.695,22.293-0.578c5.861-1.205,11.773-2.188,17.279-4.764C71.461,70.98,81.188,59.806,85.897,44.25
|
||||
c0.401-1.324,0.332-2.844,1.483-3.883c2.506-0.209,2.955-0.85,2.527-3.072c-0.359-1.867,0.102-3.793,0.785-5.45
|
||||
C91.41,30.116,93.162,30.245,94.748,30.947z"/>
|
||||
<path fill="#33C890" d="M84.183,6.964c-0.688,1.555,0.933,2.078,1.5,2.968c1.058,1.653,2.242,3.222,3.074,5.017
|
||||
<path fill="#79D4D8" d="M84.183,6.964c-0.688,1.555,0.933,2.078,1.5,2.968c1.058,1.653,2.242,3.222,3.074,5.017
|
||||
c0.465,0.63,0.273,1.419,0.523,2.129c0.565,1.615,0.365,3.034-1.803,3.154c-1.222,0.067-1.513,0.721-1.464,1.813
|
||||
c0.08,1.771,0.373,3.453,1.527,4.88c0.113,0.359,0.123,0.722,0.06,1.09c-1.091,4.062-3.353,7.415-6.283,10.364
|
||||
c-4.056,3.164-8.524,5.309-13.754,5.566c-1.195,0.221-2.392,0.229-3.586,0.008c-4.351-0.58-8.265-2.172-11.652-4.99
|
||||
c-6.289-6.83-9.563-14.499-6.635-23.886C49.228,3.747,61.76-2.726,72.994,1.107C76.996,2.473,80.763,4.419,84.183,6.964z"/>
|
||||
<path fill="#5CCB93" d="M81.127,37.991c2.562-3.048,4.703-6.35,6.105-10.098c1.229,0.787,1.133,2.061,1.194,3.272
|
||||
<path fill="#ABECE4" d="M81.127,37.991c2.562-3.048,4.703-6.35,6.105-10.098c1.229,0.787,1.133,2.061,1.194,3.272
|
||||
c0.047,0.891-0.047,1.795,0.271,2.659c0.125,0.411,0.182,0.833,0.211,1.26c0.014,1.861,0.027,3.725-1.17,5.316
|
||||
c-1.484,4.645-2.683,9.381-5.033,13.719c-8.598,15.859-21.709,25.384-39.53,28.365c-0.979,0.164-1.959,0.334-2.938,0.502
|
||||
c-0.392,0.268-0.799,0.205-1.211,0.066c-2.816-0.123-5.633-0.289-8.443,0.111c-1.283-0.082-2.596,0.314-3.848-0.248
|
||||
@@ -28,17 +28,17 @@
|
||||
c7.65-0.027,15.303-0.016,22.951-0.02c11.438-0.01,22.238-2.4,31.945-8.711c2.563-1.668,5.184-3.301,7.122-5.757
|
||||
c0.943-0.131,1.277,0.642,1.732,1.201c0.521,0.643,0.965,0.488,1.418-0.051c3.713-4.714,7.092-9.673,10.731-14.439
|
||||
C78.746,40.307,79.806,39.029,81.127,37.991z"/>
|
||||
<path fill="#0A8665" d="M67.264,56.48c-0.465,0.975-0.889,1.98-1.889,0.359c-0.426-0.691-1.012-1.281-1.524-1.917
|
||||
<path fill="#328DAD" d="M67.264,56.48c-0.465,0.975-0.889,1.98-1.889,0.359c-0.426-0.691-1.012-1.281-1.524-1.917
|
||||
c-3.843-5.319-7.685-10.642-11.525-15.962c1.742-0.078,2.705,1.398,4.08,2.061c2.358,1.133,4.889,1.719,7.387,2.408
|
||||
c1.312,0.561,2.672,0.242,4.006,0.188c0.681-0.026,1.301-0.146,1.769,0.488C70.699,48.584,69.443,52.617,67.264,56.48z"/>
|
||||
<path fill="#33C890" d="M26.736,82.917c1.348-0.004,2.694-0.008,4.043-0.012c2.817-0.328,5.635-0.33,8.453,0.002
|
||||
<path fill="#79D4D8" d="M26.736,82.917c1.348-0.004,2.694-0.008,4.043-0.012c2.817-0.328,5.635-0.33,8.453,0.002
|
||||
c0.336,0.027,0.672,0.055,1.006,0.08c-0.756,0.766-1.724,0.445-2.597,0.447c-9.606,0.023-19.213,0.006-28.819,0.029
|
||||
c-0.871,0.002-1.844-0.326-2.574,0.492c-1.504-1.221-0.133-0.986,0.526-0.99c4.657-0.021,9.316-0.006,13.974-0.014
|
||||
C22.744,82.953,24.74,82.929,26.736,82.917z"/>
|
||||
<path fill="#00905A" d="M33.691,96.416c1.688,0.051,3.383-1.137,5.063,0.029c-6.106,0.949-12.26,0.279-18.387,0.498
|
||||
<path fill="#59C1DC" d="M33.691,96.416c1.688,0.051,3.383-1.137,5.063,0.029c-6.106,0.949-12.26,0.279-18.387,0.498
|
||||
c-0.875,0.031-1.844-0.336-2.596,0.453c-1.308-1.389,0.161-0.963,0.682-0.967c4.578-0.029,9.158-0.016,13.738-0.016
|
||||
C32.691,96.414,33.191,96.414,33.691,96.416z"/>
|
||||
<path fill="#33C890" d="M87.74,40.402c0.19-1.822,0.385-3.644,0.578-5.465c0.612-2.062,0.149-4.17,0.258-6.254
|
||||
<path fill="#79D4D8" d="M87.74,40.402c0.19-1.822,0.385-3.644,0.578-5.465c0.612-2.062,0.149-4.17,0.258-6.254
|
||||
c0.049-0.971,0.102-1.941,0.164-2.894c-0.18,0-0.34,0.03-0.494,0.118c-0.439,0.256-0.576,0.798-1.018,1.038
|
||||
c-2.603-1.515-1.396-4.196-1.861-6.344c-0.168-0.775,0.66-1.221,1.568-1.042c2.5,0.492,2.438-0.906,1.672-2.488
|
||||
c-0.41-0.848,0.233-1.417,0.147-2.124c3.027,4.947,4.931,10.315,5.992,16c-0.727-0.027-1.348,0.57-2.158,0.227
|
||||
@@ -47,28 +47,28 @@
|
||||
<path fill="#FFFDFD" d="M73.703,22.35c-0.623,1.887-1.201,3.783-2.91,5.066c-2.627,1.97-5.914,2.082-8.574,0.229
|
||||
c-2.678-1.864-3.785-5.236-2.75-8.38c0.892-2.71,3.945-4.835,6.912-4.809c3.138,0.028,5.883,2.111,6.847,5.19
|
||||
c0.147,0.47,0.315,0.932,0.477,1.398C74.127,21.48,74.127,21.915,73.703,22.35z"/>
|
||||
<path fill="#00964A" d="M67.264,56.48c1.113-4.105,2.513-8.167,1.99-12.533c-0.396-0.494-1.133-0.008-1.518-0.529
|
||||
<path fill="#59C1DC" d="M67.264,56.48c1.113-4.105,2.513-8.167,1.99-12.533c-0.396-0.494-1.133-0.008-1.518-0.529
|
||||
c1.352-1.025,3.002-0.387,4.512-0.814c3.313-0.943,5.907-3.115,8.877-4.611C76.512,44.16,72.175,50.533,67.264,56.48z"/>
|
||||
<path fill="#5BC89F" d="M87.231,26.946c0.438-0.454-0.771-2.052,1.065-1.538c0.84,2.705,0.474,5.446,0.244,8.183
|
||||
<path fill="#ABECE4" d="M87.231,26.946c0.438-0.454-0.771-2.052,1.065-1.538c0.84,2.705,0.474,5.446,0.244,8.183
|
||||
c-0.104,0.114-0.209,0.228-0.313,0.341c-1.074-1.89,0.063-4.146-0.994-6.039C87.233,27.578,87.231,27.262,87.231,26.946z"/>
|
||||
<path fill="#0A8665" d="M67.738,43.418c0.545,0.064,1.162-0.08,1.518,0.529c-1.942-0.004-3.887-0.006-5.83-0.021
|
||||
c-0.045,0-0.088-0.104-0.133-0.161c0.166-0.113,0.332-0.226,0.5-0.339C65.107,43.424,66.422,43.422,67.738,43.418z"/>
|
||||
<path fill="#33C890" d="M73.703,22.35c0-0.436,0-0.871,0-1.306c0.047-0.149,0.094-0.3,0.141-0.45
|
||||
<path fill="#79D4D8" d="M73.703,22.35c0-0.436,0-0.871,0-1.306c0.047-0.149,0.094-0.3,0.141-0.45
|
||||
c0.793,0.655,0.388,1.525,0.277,2.266C74.091,23.058,73.818,22.567,73.703,22.35z"/>
|
||||
<path fill="#33C890" d="M58.646,20.958c0,0.468,0,0.937,0,1.443C58.006,22.005,58.279,21.501,58.646,20.958z"/>
|
||||
<path fill="#33C890" d="M88.748,25.47c0.014-0.081,0.021-0.165,0.047-0.24c0.027-0.075,0.078-0.141,0.117-0.211
|
||||
<path fill="#79D4D8" d="M58.646,20.958c0,0.468,0,0.937,0,1.443C58.006,22.005,58.279,21.501,58.646,20.958z"/>
|
||||
<path fill="#79D4D8" d="M88.748,25.47c0.014-0.081,0.021-0.165,0.047-0.24c0.027-0.075,0.078-0.141,0.117-0.211
|
||||
c0.699,0.999,0.418,8.846-0.361,9.854c-0.041,0.051-0.153,0.044-0.231,0.064c-0.029-0.335-0.062-0.67-0.09-1.005l0.041,0.021
|
||||
C88.963,31.156,88.08,28.27,88.748,25.47z"/>
|
||||
<path fill="#5BC89F" d="M39.23,82.908c-2.816,0-5.636,0-8.451-0.002C33.596,82.154,36.414,82.15,39.23,82.908z"/>
|
||||
<path fill="#33C890" d="M88.748,25.47c-0.258,2.822,0.559,5.706-0.479,8.483c0.01-2.848,0.02-5.696,0.026-8.544
|
||||
<path fill="#ABECE4" d="M39.23,82.908c-2.816,0-5.636,0-8.451-0.002C33.596,82.154,36.414,82.15,39.23,82.908z"/>
|
||||
<path fill="#79D4D8" d="M88.748,25.47c-0.258,2.822,0.559,5.706-0.479,8.483c0.01-2.848,0.02-5.696,0.026-8.544
|
||||
C88.447,25.433,88.595,25.452,88.748,25.47z"/>
|
||||
<path fill="#00905A" d="M64.779,26.407c-3.543-1.289-4.57-4.332-2.531-7.488c0.662-0.326,1.279-0.694,1.477-1.483
|
||||
<path fill="#59C1DC" d="M64.779,26.407c-3.543-1.289-4.57-4.332-2.531-7.488c0.662-0.326,1.279-0.694,1.477-1.483
|
||||
c0.406-0.483,0.939-0.592,1.533-0.519c0.822,0.188,1.646,0.36,2.479,0.068c1.502,0.816,3.174,1.467,3.449,3.494
|
||||
c-0.291,0.815-0.306,1.629,0.01,2.442c-0.486,1.825-1.412,3.216-3.455,3.506C66.754,26.359,65.766,26.4,64.779,26.407z"/>
|
||||
<path fill="#00905A" d="M64.779,26.407c0.992-0.697,1.979-0.72,2.961,0.021C66.75,26.984,65.762,26.922,64.779,26.407z"/>
|
||||
<path fill="#00905A" d="M63.723,17.438c0.207,0.082,0.414,0.163,0.621,0.245c-0.729,0.359-0.926,1.623-2.096,1.238
|
||||
<path fill="#59C1DC" d="M64.779,26.407c0.992-0.697,1.979-0.72,2.961,0.021C66.75,26.984,65.762,26.922,64.779,26.407z"/>
|
||||
<path fill="#59C1DC" d="M63.723,17.438c0.207,0.082,0.414,0.163,0.621,0.245c-0.729,0.359-0.926,1.623-2.096,1.238
|
||||
C62.482,18.169,62.978,17.678,63.723,17.438z"/>
|
||||
<path fill="#00905A" d="M67.736,16.986c-0.847,0.676-1.674,0.728-2.479-0.068C66.096,16.412,66.92,16.626,67.736,16.986z"/>
|
||||
<path fill="#00905A" d="M71.197,22.922c-0.658-0.812-0.648-1.625-0.01-2.442C71.447,21.294,71.449,22.108,71.197,22.922z"/>
|
||||
<path fill="#59C1DC" d="M67.736,16.986c-0.847,0.676-1.674,0.728-2.479-0.068C66.096,16.412,66.92,16.626,67.736,16.986z"/>
|
||||
<path fill="#59C1DC" d="M71.197,22.922c-0.658-0.812-0.648-1.625-0.01-2.442C71.447,21.294,71.449,22.108,71.197,22.922z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.1 KiB |
@@ -38,13 +38,18 @@ export default ({ children, codeStyle, language }: CodeBlockProps) => {
|
||||
...codeStyle,
|
||||
}}
|
||||
>
|
||||
{tokens.map((line, i) => (
|
||||
<div key={i} {...getLineProps({ line, key: i })}>
|
||||
{line.map((token, key) => (
|
||||
<span key={key} {...getTokenProps({ token, key })} />
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
{tokens.map((line, i) => {
|
||||
if (line.length === 1 && line[0].content.indexOf('\u200b') > -1) {
|
||||
return <br />;
|
||||
}
|
||||
return (
|
||||
<div key={i} {...getLineProps({ line, key: i })}>
|
||||
{line.map((token, key) => (
|
||||
<span key={key} {...getTokenProps({ token, key })} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</code>
|
||||
)}
|
||||
</Highlight>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { PaletteMode, ThemeOptions } from '@mui/material';
|
||||
import { PaletteMode, ThemeOptions, createTheme } from '@mui/material';
|
||||
import '@fontsource/poppins';
|
||||
|
||||
export default function configTheme(mode: PaletteMode): ThemeOptions {
|
||||
function configTheme(mode: PaletteMode): ThemeOptions {
|
||||
return {
|
||||
palette:
|
||||
mode === 'light'
|
||||
? {
|
||||
primary: {
|
||||
main: '#21a675',
|
||||
light: '#4db790',
|
||||
dark: '#177451',
|
||||
main: '#59c1dc',
|
||||
light: '#79d4d8',
|
||||
dark: '#328dad',
|
||||
},
|
||||
neutral: {
|
||||
main: '#f2f7f9',
|
||||
},
|
||||
success: {
|
||||
main: '#27a881',
|
||||
main: '#59c1dc',
|
||||
},
|
||||
warning: {
|
||||
main: '#37adc7',
|
||||
main: '#f8903b',
|
||||
},
|
||||
info: {
|
||||
main: '#6780da',
|
||||
light: '#63a0cf;',
|
||||
light: '#63a0cf',
|
||||
},
|
||||
error: {
|
||||
main: '#e44918',
|
||||
@@ -33,28 +33,28 @@ export default function configTheme(mode: PaletteMode): ThemeOptions {
|
||||
}
|
||||
: {
|
||||
primary: {
|
||||
main: '#39DE96',
|
||||
light: '#60e4ab',
|
||||
dark: '#279b69',
|
||||
main: '#79d4d8',
|
||||
light: '#abece4',
|
||||
dark: '#328dad',
|
||||
},
|
||||
neutral: {
|
||||
main: '#070707',
|
||||
main: '#121212',
|
||||
},
|
||||
success: {
|
||||
main: '#27a881',
|
||||
main: '#79d4d8',
|
||||
},
|
||||
warning: {
|
||||
main: '#37adc7',
|
||||
main: '#f8903b',
|
||||
},
|
||||
info: {
|
||||
main: '#6780da',
|
||||
light: '#63a0cf;',
|
||||
light: '#63a0cf',
|
||||
},
|
||||
error: {
|
||||
main: '#e44918',
|
||||
},
|
||||
background: {
|
||||
default: '#070707',
|
||||
default: '#121212',
|
||||
paper: '#161718',
|
||||
},
|
||||
},
|
||||
@@ -91,6 +91,24 @@ export default function configTheme(mode: PaletteMode): ThemeOptions {
|
||||
};
|
||||
}
|
||||
|
||||
export const lightTheme = createTheme(
|
||||
{
|
||||
palette: {
|
||||
mode: 'light',
|
||||
},
|
||||
},
|
||||
configTheme('light')
|
||||
);
|
||||
|
||||
export const darkTheme = createTheme(
|
||||
{
|
||||
palette: {
|
||||
mode: 'dark',
|
||||
},
|
||||
},
|
||||
configTheme('dark')
|
||||
);
|
||||
|
||||
/* the code below decares customized color */
|
||||
|
||||
declare module '@mui/material/styles' {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import React from 'react';
|
||||
import { Card, Grid, Typography } from '@mui/material';
|
||||
import Card from '@mui/material/Card';
|
||||
import Grid from '@mui/material/Grid';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import AlbumIcon from '@mui/icons-material/Album';
|
||||
import { Trans } from 'gatsby-plugin-react-i18next';
|
||||
import { CardActionArea } from 'gatsby-theme-material-ui';
|
||||
import { LinkCardActionArea as CardActionArea } from './link-mui-components';
|
||||
|
||||
export interface FileProps {
|
||||
name: string;
|
||||
|
||||
@@ -43,7 +43,7 @@ export default () => {
|
||||
</Typography>
|
||||
<Typography gutterBottom variant="body2" color="text.secondary">
|
||||
<Trans>
|
||||
由JCIOT团队开发运行维护,感谢团队成员YangFan,ZhaoYinghao为本站建设作出的贡献
|
||||
由JCIOT团队开发运行维护,感谢团队成员YangFan为本站建设作出的贡献
|
||||
</Trans>
|
||||
</Typography>
|
||||
<Typography gutterBottom variant="body2" color="text.secondary">
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { Box, Card, CardContent, Grid, Typography } from '@mui/material';
|
||||
import { CardActionArea } from 'gatsby-theme-material-ui';
|
||||
import Box from '@mui/material/Box';
|
||||
import Card from '@mui/material/Card';
|
||||
import CardContent from '@mui/material/CardContent';
|
||||
import Grid from '@mui/material/Grid';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import * as React from 'react';
|
||||
import { LinkCardActionArea as CardActionArea } from './link-mui-components';
|
||||
|
||||
export type mirrorBrief = {
|
||||
name: string;
|
||||
|
||||
39
src/components/link-mui-components.tsx
Normal file
39
src/components/link-mui-components.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import React, { ForwardedRef } from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
import CardActionArea from '@mui/material/CardActionArea';
|
||||
import Link from '@mui/material/Link';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { navigate } from 'gatsby';
|
||||
import { ButtonBaseProps } from '@mui/material';
|
||||
|
||||
interface LinkProps {
|
||||
to?: string;
|
||||
}
|
||||
|
||||
function linkifyComponent<T, PropType>(
|
||||
ButtonBaseComponent: React.ComponentType<ButtonBaseProps & PropType>
|
||||
) {
|
||||
const f = (
|
||||
props: ButtonBaseProps & PropType & LinkProps,
|
||||
ref: ForwardedRef<T>
|
||||
) => {
|
||||
const propOnClick = props.onClick;
|
||||
const clickHandler: React.MouseEventHandler<HTMLButtonElement> = event => {
|
||||
if (propOnClick) propOnClick(event);
|
||||
if (props.to) navigate(props.to);
|
||||
};
|
||||
return (
|
||||
<ButtonBaseComponent {...props} onClick={clickHandler} ref={ref}>
|
||||
{props.children}
|
||||
</ButtonBaseComponent>
|
||||
);
|
||||
};
|
||||
return React.forwardRef(f);
|
||||
}
|
||||
|
||||
const LinkButton = linkifyComponent(Button);
|
||||
const LinkCardActionArea = linkifyComponent(CardActionArea);
|
||||
const LinkIconButton = linkifyComponent(IconButton);
|
||||
const LinkLink = linkifyComponent(Link);
|
||||
|
||||
export { LinkProps, LinkButton, LinkCardActionArea, LinkIconButton, LinkLink };
|
||||
@@ -1,9 +1,9 @@
|
||||
import InfoIcon from '@mui/icons-material/Info';
|
||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||
import { Tooltip } from '@mui/material';
|
||||
import { IconButton } from 'gatsby-theme-material-ui';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import * as React from 'react';
|
||||
import { LinkIconButton as IconButton } from './link-mui-components';
|
||||
import { usePrefs } from './preferences-context';
|
||||
|
||||
const nameMode = {
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { Card, Grid, Typography, Tooltip } from '@mui/material';
|
||||
import Card from '@mui/material/Card';
|
||||
import Grid from '@mui/material/Grid';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { useI18next } from 'gatsby-plugin-react-i18next';
|
||||
import { CardActionArea } from 'gatsby-theme-material-ui';
|
||||
import * as React from 'react';
|
||||
import VerifiedIcon from '@mui/icons-material/Verified';
|
||||
import { LinkCardActionArea as CardActionArea } from './link-mui-components';
|
||||
import { Locale, Mirror } from '../types/mirror';
|
||||
import StatusIndicator from './status-indicator';
|
||||
import { getUrl } from '../utils/url';
|
||||
import { usePrefs } from './preferences-context';
|
||||
import VerifiedIcon from '@mui/icons-material/Verified';
|
||||
import officialCertificatedMirrorList from '../utils/official-certificated-mirror-list';
|
||||
|
||||
const SearchItemCard = (props: { queryItem: Mirror }) => {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import React from 'react';
|
||||
import { JSX } from 'preact';
|
||||
import { useStaticQuery, graphql } from 'gatsby';
|
||||
import { useTheme } from '@mui/material';
|
||||
import { useI18next } from 'gatsby-plugin-react-i18next';
|
||||
|
||||
type MetaProps = JSX.IntrinsicElements['meta'];
|
||||
type MetaProps = React.JSX.IntrinsicElements['meta'];
|
||||
|
||||
const Helmet: React.FC = ({children, title, meta}) => {
|
||||
const {languages, language, originalPath, defaultLanguage, siteUrl = ''} = useI18next();
|
||||
@@ -16,11 +15,7 @@ const Helmet: React.FC = ({children, title, meta}) => {
|
||||
<>
|
||||
<html lang={language} />
|
||||
<title>{title}</title>
|
||||
{
|
||||
meta?.map((m: MetaProps) => (
|
||||
<meta {...m} />
|
||||
))
|
||||
}
|
||||
{meta?.map((m: MetaProps, i: number) => <meta {...m} key={i}/>)}
|
||||
<link rel="canonical" href={createUrlWithLang(language)} />
|
||||
{languages.map((lng) => (
|
||||
<link rel="alternate" key={lng} href={createUrlWithLang(lng)} hrefLang={lng} />
|
||||
|
||||
@@ -5,14 +5,14 @@ import {
|
||||
} from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import * as React from 'react';
|
||||
import configTheme from './config-theme';
|
||||
import { lightTheme, darkTheme } from './config-theme';
|
||||
import { readCache, writeCache } from '../utils/cache';
|
||||
|
||||
export type ThemeMode = PaletteMode | 'auto';
|
||||
|
||||
export declare type ThemeContextInterface = [
|
||||
ThemeMode,
|
||||
(mode: ThemeMode) => void
|
||||
(mode: ThemeMode) => void,
|
||||
];
|
||||
|
||||
export const ThemeContext = React.createContext<ThemeContextInterface | null>(
|
||||
@@ -27,11 +27,12 @@ export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
const [mode, setMode] = React.useState<ThemeMode>(savedMode);
|
||||
|
||||
let paletteMode: PaletteMode;
|
||||
// ensure renders execute equal number of hooks
|
||||
const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');
|
||||
const prefersLight = useMediaQuery('(prefers-color-scheme: light)');
|
||||
if (mode === 'auto') {
|
||||
// wait for media query result stable
|
||||
// ref: https://github.com/mui/material-ui/issues/15588#issuecomment-567803082
|
||||
const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');
|
||||
const prefersLight = useMediaQuery('(prefers-color-scheme: light)');
|
||||
if (prefersDark !== !prefersLight) return null;
|
||||
const preferredMode = prefersDark ? 'dark' : 'light';
|
||||
paletteMode = preferredMode;
|
||||
@@ -39,18 +40,7 @@ export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
paletteMode = mode;
|
||||
}
|
||||
|
||||
const theme = React.useMemo(
|
||||
() =>
|
||||
createTheme(
|
||||
{
|
||||
palette: {
|
||||
mode: paletteMode,
|
||||
},
|
||||
},
|
||||
configTheme(paletteMode)
|
||||
),
|
||||
[paletteMode]
|
||||
);
|
||||
const theme = paletteMode === 'light' ? lightTheme : darkTheme;
|
||||
|
||||
const updateMode = (newMode: ThemeMode) => {
|
||||
setMode(newMode);
|
||||
|
||||
@@ -2,9 +2,9 @@ import Brightness4Icon from '@mui/icons-material/Brightness4';
|
||||
import BrightnessAutoIcon from '@mui/icons-material/BrightnessAuto';
|
||||
import BrightnessHighIcon from '@mui/icons-material/BrightnessHigh';
|
||||
import ToolTip from '@mui/material/Tooltip';
|
||||
import { IconButton } from 'gatsby-theme-material-ui';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { LinkIconButton as IconButton } from './link-mui-components';
|
||||
import { ThemeMode, useMode } from './theme-context';
|
||||
|
||||
export default () => {
|
||||
|
||||
236
src/components/ubuntu-config-generator.tsx
Normal file
236
src/components/ubuntu-config-generator.tsx
Normal file
@@ -0,0 +1,236 @@
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
FormControl,
|
||||
InputLabel,
|
||||
Select,
|
||||
MenuItem,
|
||||
Box,
|
||||
Grid,
|
||||
Typography,
|
||||
FormControlLabel,
|
||||
Switch,
|
||||
FormGroup,
|
||||
} from '@mui/material';
|
||||
import { Trans } from 'gatsby-plugin-react-i18next';
|
||||
import CodeBlock from './code-block';
|
||||
|
||||
const ubuntuVersionMap: Record<number | string, string> = {
|
||||
2404: 'noble',
|
||||
2310: 'mantic',
|
||||
2304: 'lunar',
|
||||
2210: 'kinetic',
|
||||
2204: 'jammy',
|
||||
2004: 'focal',
|
||||
1804: 'bionic',
|
||||
1604: 'xenial',
|
||||
1404: 'trusty',
|
||||
};
|
||||
|
||||
const isLTSVersion = (version: number) => {
|
||||
return Math.floor(version / 100) % 2 === 0 && version % 100 === 4;
|
||||
};
|
||||
|
||||
const configGenOld = (
|
||||
version: number | string,
|
||||
enableHTTPS: boolean,
|
||||
enableSrc: boolean,
|
||||
enableProposed: boolean,
|
||||
enableSecurity: boolean,
|
||||
ubuntuVariant: string
|
||||
) => {
|
||||
const ubuntuName = ubuntuVersionMap[version];
|
||||
const httpProtocol = enableHTTPS ? 'https' : 'http';
|
||||
const debSrcText = enableSrc ? '' : '# ';
|
||||
const proposedText = enableProposed ? '' : '# ';
|
||||
const securityRepo = enableSecurity
|
||||
? 'mirrors.jcut.edu.cn'
|
||||
: 'security.ubuntu.com';
|
||||
return `deb ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName} main restricted universe multiverse
|
||||
${debSrcText}deb-src ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName} main restricted universe multiverse
|
||||
deb ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-updates main restricted universe multiverse
|
||||
${debSrcText}deb-src ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-updates main restricted universe multiverse
|
||||
deb ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-backports main restricted universe multiverse
|
||||
${debSrcText}deb-src ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-backports main restricted universe multiverse
|
||||
|
||||
deb ${httpProtocol}://${securityRepo}/${ubuntuVariant}/ ${ubuntuName}-security main restricted universe multiverse
|
||||
${debSrcText}deb-src ${httpProtocol}://${securityRepo}/${ubuntuVariant}/ ${ubuntuName}-security main restricted universe multiverse
|
||||
${proposedText}deb ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-proposed main restricted universe multiverse
|
||||
${proposedText}${debSrcText}deb-src ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/ ${ubuntuName}-proposed main restricted universe multiverse`;
|
||||
};
|
||||
|
||||
const configGenNew = (
|
||||
version: number | string,
|
||||
enableHTTPS: boolean,
|
||||
enableSrc: boolean,
|
||||
enableProposed: boolean,
|
||||
enableSecurity: boolean,
|
||||
ubuntuVariant: string
|
||||
) => {
|
||||
const ubuntuName = ubuntuVersionMap[version];
|
||||
const httpProtocol = enableHTTPS ? 'https' : 'http';
|
||||
const debSrcText = enableSrc ? ' deb-src' : '';
|
||||
const securityRepo = enableSecurity
|
||||
? 'mirrors.zju.edu.cn'
|
||||
: 'security.ubuntu.com';
|
||||
let sources = `Types: deb${debSrcText}
|
||||
URIs: ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/
|
||||
Suites: ${ubuntuName} ${ubuntuName}-updates ${ubuntuName}-backports
|
||||
Components: main restricted universe multiverse
|
||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
\u200b
|
||||
Types: deb${debSrcText}
|
||||
URIs: ${httpProtocol}://${securityRepo}/${ubuntuVariant}/
|
||||
Suites: ${ubuntuName}-security
|
||||
Components: main restricted universe multiverse
|
||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
`;
|
||||
if (enableProposed) {
|
||||
sources += `\u200b
|
||||
Types: deb${debSrcText}
|
||||
URIs: ${httpProtocol}://mirrors.jcut.edu.cn/${ubuntuVariant}/
|
||||
Suites: ${ubuntuName}-proposed
|
||||
Components: main restricted universe multiverse
|
||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
`;
|
||||
}
|
||||
return sources;
|
||||
};
|
||||
|
||||
export default ({ ubuntuVariant }: { ubuntuVariant: string }) => {
|
||||
const [version, setVersion] = useState(
|
||||
Object.keys(ubuntuVersionMap)
|
||||
.reverse()
|
||||
.filter(v => isLTSVersion(parseInt(v, 10)))[0]
|
||||
);
|
||||
const [enableHTTPS, setEnableHTTPS] = useState(true);
|
||||
const [enableSrc, setEnableSrc] = useState(false);
|
||||
const [enableProposed, setEnableProposed] = useState(false);
|
||||
const [enableSecurity, setEnableSecurity] = useState(true);
|
||||
const shouldUseNewConf = () => parseInt(version, 10) >= 2404;
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justifyContent="flex-start"
|
||||
alignItems="flex-end"
|
||||
>
|
||||
<Grid item sx={{ mb: 1 }}>
|
||||
<Typography component="p">请选择您的 Ubuntu 版本:</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<FormControl variant="standard" sx={{ m: 1, minWidth: 120 }}>
|
||||
<InputLabel id="demo-simple-select-helper-label">
|
||||
<Trans>版本</Trans>
|
||||
</InputLabel>
|
||||
<Select
|
||||
labelId="demo-simple-select-helper-label"
|
||||
id="demo-simple-select-helper"
|
||||
label="Age"
|
||||
onChange={event => {
|
||||
setVersion(event.target.value as string);
|
||||
}}
|
||||
defaultValue={version}
|
||||
>
|
||||
{Object.keys(ubuntuVersionMap)
|
||||
.reverse()
|
||||
.map((v: string) => {
|
||||
const item = parseInt(v, 10);
|
||||
let desc = (item / 100).toFixed(2);
|
||||
if (isLTSVersion(item)) desc += ' LTS';
|
||||
desc += ` (${ubuntuVersionMap[item]})`;
|
||||
return (
|
||||
<MenuItem key={item} value={item}>
|
||||
{desc}
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<FormGroup>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={enableHTTPS}
|
||||
onChange={e => setEnableHTTPS(e.target.checked)}
|
||||
/>
|
||||
}
|
||||
label="启用 HTTPS (容器镜像可能不支持)"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={enableSrc}
|
||||
onChange={e => setEnableSrc(e.target.checked)}
|
||||
/>
|
||||
}
|
||||
label="启用源码源(默认禁用以提高速度)"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={enableProposed}
|
||||
onChange={e => setEnableProposed(e.target.checked)}
|
||||
/>
|
||||
}
|
||||
label="启用预发布软件源(不建议启用)"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={enableSecurity}
|
||||
onChange={e => setEnableSecurity(e.target.checked)}
|
||||
/>
|
||||
}
|
||||
label="启用安全更新镜像(仅推荐校网内启用)"
|
||||
/>
|
||||
</FormGroup>
|
||||
<Grid container direction="row" my={2}>
|
||||
<Typography>该版本 Ubuntu 的默认软件源配置文件是</Typography>
|
||||
<code
|
||||
style={{ margin: '0 0.5rem', fontWeight: 'bold', color: 'brown' }}
|
||||
>
|
||||
{shouldUseNewConf()
|
||||
? '/etc/apt/sources.list.d/ubuntu.sources'
|
||||
: '/etc/apt/sources.list'}
|
||||
</code>
|
||||
<Typography>
|
||||
。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用我们的软件源镜像。
|
||||
</Typography>
|
||||
{shouldUseNewConf() && (
|
||||
<>
|
||||
<Typography style={{ fontWeight: 'bold' }}>
|
||||
如果您从旧版本 Ubuntu 升级到该版本,可能需要同时备份并清除
|
||||
</Typography>
|
||||
<code style={{ margin: '0 0.5rem', fontWeight: 'bold' }}>
|
||||
/etc/apt/sources.list
|
||||
</code>
|
||||
<Typography style={{ fontWeight: 'bold' }}>的内容。</Typography>
|
||||
</>
|
||||
)}
|
||||
</Grid>
|
||||
<CodeBlock language="bash">
|
||||
{shouldUseNewConf()
|
||||
? configGenNew(
|
||||
version,
|
||||
enableHTTPS,
|
||||
enableSrc,
|
||||
enableProposed,
|
||||
enableSecurity,
|
||||
ubuntuVariant
|
||||
)
|
||||
: configGenOld(
|
||||
version,
|
||||
enableHTTPS,
|
||||
enableSrc,
|
||||
enableProposed,
|
||||
enableSecurity,
|
||||
ubuntuVariant
|
||||
)}
|
||||
</CodeBlock>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
import CssBaseline from '@mui/material/CssBaseline';
|
||||
import Viewport from 'gatsby-theme-material-ui-top-layout/src/components/viewport';
|
||||
import React from 'react';
|
||||
import { ThemeProvider } from '../components/theme-context';
|
||||
import { PrefsProvider } from '../components/preferences-context';
|
||||
|
||||
export default function wrapWithProvider({
|
||||
element,
|
||||
}: {
|
||||
element: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<React.StrictMode>
|
||||
<Viewport />
|
||||
<PrefsProvider>
|
||||
<ThemeProvider>
|
||||
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
|
||||
<CssBaseline />
|
||||
{element}
|
||||
</ThemeProvider>
|
||||
</PrefsProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, Chip, Grid, Link, Typography } from '@mui/material';
|
||||
import { Box, Chip, ChipProps, Grid, Link, Typography } from '@mui/material';
|
||||
import { graphql } from 'gatsby';
|
||||
import { Trans, useI18next } from 'gatsby-plugin-react-i18next';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
@@ -9,7 +9,7 @@ import SearchTable from '../components/search-table';
|
||||
import NavBar from '../components/nav-bar';
|
||||
import Seo from '../components/seo';
|
||||
import ThemeIconButton from '../components/theme-icon-button';
|
||||
import { Mirror, MirrorDto } from '../types/mirror';
|
||||
import { Locale, Mirror, MirrorDto } from '../types/mirror';
|
||||
import frequentlyUsedMirror from '../utils/frequently-used-mirror-list';
|
||||
import { getUrl } from '../utils/url';
|
||||
import { readCache, writeCache } from '../utils/cache';
|
||||
@@ -40,7 +40,12 @@ interface Data {
|
||||
};
|
||||
}
|
||||
|
||||
const networkMap = {
|
||||
const networkMap: {
|
||||
[value: number]: {
|
||||
text: string;
|
||||
color: ChipProps['color'];
|
||||
};
|
||||
} = {
|
||||
0: {
|
||||
text: '全新版本',
|
||||
color: 'primary',
|
||||
@@ -124,12 +129,13 @@ const Index = ({ data }: { data: Data }) => {
|
||||
.filter(d => d.locale === language)
|
||||
.map(
|
||||
d =>
|
||||
[d.frontmatter.title, new Date(d.frontmatter.date), d.slug] as (
|
||||
| Date
|
||||
| string
|
||||
)[]
|
||||
[d.frontmatter.title, new Date(d.frontmatter.date), d.slug] as [
|
||||
string,
|
||||
Date,
|
||||
string,
|
||||
]
|
||||
)
|
||||
.sort((a, b) => b[1] - a[1]),
|
||||
.sort((a, b) => b[1].getTime() - a[1].getTime()),
|
||||
[data, language]
|
||||
);
|
||||
|
||||
@@ -226,17 +232,24 @@ const Index = ({ data }: { data: Data }) => {
|
||||
<Typography gutterBottom variant="h5" component="div">
|
||||
<Trans>常用镜像</Trans>
|
||||
</Typography>
|
||||
<Grid container spacing={{ xs: 2 }} columns={{ xs: 1, sm: 3, md: 6 }}>
|
||||
<Grid
|
||||
container
|
||||
spacing={{ xs: 2 }}
|
||||
columns={{ xs: 1, sm: 3, md: 6 }}
|
||||
>
|
||||
{frequentlyUsedMirror.map((e, i) => {
|
||||
const mirror = mirrors[e.id];
|
||||
return (
|
||||
mirror && (
|
||||
<Grid item xs={1} key={i}>
|
||||
<FrequentlyUsedMirrorCard
|
||||
name={mirror.name[language]}
|
||||
desc={mirror.desc[language]}
|
||||
name={mirror.name[language as Locale]}
|
||||
desc={mirror.desc[language as Locale]}
|
||||
icon={e.icon}
|
||||
url={getUrl(mirror.docUrl || mirror.url, !!mirror.docUrl)}
|
||||
url={getUrl(
|
||||
mirror.docUrl || mirror.url,
|
||||
!!mirror.docUrl
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
)
|
||||
@@ -249,8 +262,8 @@ const Index = ({ data }: { data: Data }) => {
|
||||
<Trans>近期更新</Trans>
|
||||
</Typography>
|
||||
<Grid>
|
||||
{newsUrls.map(([title, date, url], _) => (
|
||||
<Grid container>
|
||||
{newsUrls.map(([title, date, url], i) => (
|
||||
<Grid container key={i}>
|
||||
<Link href={url} underline="hover">
|
||||
{title}
|
||||
</Link>
|
||||
|
||||
@@ -22,9 +22,9 @@ html {
|
||||
|
||||
::selection {
|
||||
color: white;
|
||||
background: #39DE96; /* WebKit/Blink Browsers */
|
||||
background: #59c1dc; /* WebKit/Blink Browsers */
|
||||
}
|
||||
::-moz-selection {
|
||||
color: white;
|
||||
background: #39DE96; /* Gecko Browsers */
|
||||
background: #59c1dc; /* Gecko Browsers */
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@ import TableCell from '@mui/material/TableCell';
|
||||
import TableHead from '@mui/material/TableHead';
|
||||
import TableRow from '@mui/material/TableRow';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { Link } from 'gatsby-theme-material-ui';
|
||||
import React, { memo } from 'react';
|
||||
import { MDXComponents } from '@mdx-js/react/lib';
|
||||
import { LinkLink as Link } from '~/components/link-mui-components';
|
||||
import CodeBlock from '../components/code-block';
|
||||
|
||||
const components = {
|
||||
const components: MDXComponents = {
|
||||
p: (() => {
|
||||
const Paragraph = props => (
|
||||
<Typography {...props} style={{ margin: '8px 0' }} />
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
import { MDXProvider } from '@mdx-js/react';
|
||||
import { ArrowBack, ConnectedTvOutlined } from '@mui/icons-material';
|
||||
import FolderIcon from '@mui/icons-material/Folder';
|
||||
import { Box, Grid, Typography } from '@mui/material';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import { graphql } from 'gatsby';
|
||||
import { Trans, useI18next } from 'gatsby-plugin-react-i18next';
|
||||
import { Button } from 'gatsby-theme-material-ui';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { LinkButton as Button } from '~/components/link-mui-components';
|
||||
import React, { PropsWithChildren, useEffect, useState } from 'react';
|
||||
import Footer from '../components/footer';
|
||||
import FileList from '../components/file-list';
|
||||
import LanguageIconButton from '../components/language-icon-button';
|
||||
import Seo from '../components/seo';
|
||||
import StatusIndicator from '../components/status-indicator';
|
||||
import ThemeIconButton from '../components/theme-icon-button';
|
||||
import { MirrorDto } from '../types/mirror';
|
||||
import { Locale, MirrorDto } from '../types/mirror';
|
||||
import { Link } from '../utils/i18n-link';
|
||||
import components from './components';
|
||||
import { readCache, writeCache } from '../utils/cache';
|
||||
import { popCache, writeCache } from '../utils/cache';
|
||||
import { getUrl } from '../utils/url';
|
||||
import TitleMirrorIcon from '../utils/title-mirror-icon';
|
||||
|
||||
@@ -27,6 +25,10 @@ interface Data {
|
||||
};
|
||||
}
|
||||
|
||||
type MirrorDocProps = {
|
||||
data: Data;
|
||||
};
|
||||
|
||||
async function fetchMirror(id: string): Promise<MirrorDto> {
|
||||
const res = await fetch(`/api/mirrors/${id}`);
|
||||
if (!res.ok) {
|
||||
@@ -37,7 +39,7 @@ async function fetchMirror(id: string): Promise<MirrorDto> {
|
||||
return json;
|
||||
}
|
||||
|
||||
const MirrorDoc = ({ data, children }: { data: Data }) => {
|
||||
const MirrorDoc = ({ data, children }: PropsWithChildren<MirrorDocProps>) => {
|
||||
const { language } = useI18next();
|
||||
|
||||
const defaultData = {
|
||||
@@ -48,11 +50,12 @@ const MirrorDoc = ({ data, children }: { data: Data }) => {
|
||||
},
|
||||
status: 'unknown',
|
||||
} as MirrorDto;
|
||||
const mirrorId = data.document.frontmatter.mirrorId;
|
||||
const { mirrorId } = data.document.frontmatter;
|
||||
|
||||
const [mirror, setMirror] = useState<MirrorDto>(
|
||||
readCache(`mirrors_${mirrorId}`, defaultData)
|
||||
);
|
||||
const [mirror, setMirror] = useState<MirrorDto>({
|
||||
...defaultData,
|
||||
...popCache(`mirrors_${mirrorId}`, defaultData),
|
||||
});
|
||||
useEffect(() => {
|
||||
fetchMirror(mirrorId)
|
||||
.then(d => setMirror(d))
|
||||
@@ -62,7 +65,7 @@ const MirrorDoc = ({ data, children }: { data: Data }) => {
|
||||
const fallbackUrl = `/${mirrorId}`;
|
||||
const mirrorUrl = getUrl(mirror.url ?? fallbackUrl, false);
|
||||
|
||||
const name = mirror.name[language];
|
||||
const name = mirror.name[language as Locale];
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@@ -90,11 +93,9 @@ const MirrorDoc = ({ data, children }: { data: Data }) => {
|
||||
</Typography>
|
||||
</Link>
|
||||
<Grid item>
|
||||
{
|
||||
/* TODO: add English docs
|
||||
{/* TODO: add English docs
|
||||
<LanguageIconButton />
|
||||
*/
|
||||
}
|
||||
*/}
|
||||
<ThemeIconButton />
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -172,7 +173,7 @@ const MirrorDoc = ({ data, children }: { data: Data }) => {
|
||||
zIndex: -1,
|
||||
}}
|
||||
>
|
||||
{TitleMirrorIcon(mirrorId, 'rgb(71 123 210 / 23%)', '20rem')}
|
||||
{TitleMirrorIcon(mirrorId, 'rgba(6,78,119,0.23)', '20rem')}
|
||||
</Box>
|
||||
</Box>
|
||||
<Box zIndex={1} position="sticky">
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
import { MDXProvider } from '@mdx-js/react';
|
||||
import { ArrowBack, DateRange, AccountCircle } from '@mui/icons-material';
|
||||
import FolderIcon from '@mui/icons-material/Folder';
|
||||
import { DateRange, AccountCircle } from '@mui/icons-material';
|
||||
import { Box, Grid, Typography } from '@mui/material';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import { graphql } from 'gatsby';
|
||||
import { Trans, useI18next } from 'gatsby-plugin-react-i18next';
|
||||
import { Button } from 'gatsby-theme-material-ui';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React from 'react';
|
||||
import Footer from '../components/footer';
|
||||
import FileList from '../components/file-list';
|
||||
import LanguageIconButton from '../components/language-icon-button';
|
||||
import Seo from '../components/seo';
|
||||
import StatusIndicator from '../components/status-indicator';
|
||||
import ThemeIconButton from '../components/theme-icon-button';
|
||||
import { NewsDto } from '../types/news';
|
||||
import { Link } from '../utils/i18n-link';
|
||||
import components from './components';
|
||||
import { readCache, writeCache } from '../utils/cache';
|
||||
import { getUrl } from '../utils/url';
|
||||
|
||||
interface Data {
|
||||
document: {
|
||||
|
||||
@@ -20,9 +20,9 @@ export interface MirrorDto {
|
||||
name: Record<Locale, string>;
|
||||
desc: Record<Locale, string>;
|
||||
status: MirrorStatus;
|
||||
lastUpdated: string;
|
||||
nextScheduled: string;
|
||||
lastSuccess: string;
|
||||
lastUpdated: number;
|
||||
nextScheduled: number;
|
||||
lastSuccess: number;
|
||||
url: string;
|
||||
files?: File[];
|
||||
}
|
||||
|
||||
@@ -11,4 +11,10 @@ function readCache<T>(key: string, defaultValue: T): T {
|
||||
return d ? JSON.parse(d) : defaultValue;
|
||||
}
|
||||
|
||||
export { writeCache, readCache };
|
||||
function popCache<T>(key: string, defaultValue: T): T {
|
||||
const d = readCache(key, defaultValue);
|
||||
localStorage.removeItem(`${cachePrefix}${key}`);
|
||||
return d;
|
||||
}
|
||||
|
||||
export { writeCache, readCache, popCache };
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import { useI18next } from 'gatsby-plugin-react-i18next';
|
||||
import { LANGUAGE_KEY } from 'gatsby-plugin-react-i18next/dist/types';
|
||||
import { Link as MuiLink } from 'gatsby-theme-material-ui';
|
||||
import { LinkProps } from '@mui/material';
|
||||
import { LinkLink as MuiLink } from '~/components/link-mui-components';
|
||||
|
||||
export function linkWithI18n<
|
||||
P extends { to: string; onClick?: React.MouseEventHandler }
|
||||
|
||||
19
src/utils/root-layout.tsx
Normal file
19
src/utils/root-layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
import { ThemeProvider } from "../components/theme-context";
|
||||
import { CssBaseline } from "@mui/material";
|
||||
import { PrefsProvider } from "../components/preferences-context";
|
||||
|
||||
export default function RootLayout({ children } : {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<React.StrictMode>
|
||||
<PrefsProvider>
|
||||
<ThemeProvider>
|
||||
<CssBaseline />
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
</PrefsProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import cpanIcon from '@iconify/icons-file-icons/cpan';
|
||||
import debianIcon from '@iconify/icons-simple-icons/debian';
|
||||
import deepinIcon from '@iconify/icons-simple-icons/deepin';
|
||||
import dockerIcon from '@iconify/icons-simple-icons/docker';
|
||||
import epelIcon from '@iconify/icons-simple-icons/epel';
|
||||
import fedoraIcon from '@iconify/icons-simple-icons/fedora';
|
||||
import gentooIcon from '@iconify/icons-simple-icons/gentoo';
|
||||
import gnuIcon from '@iconify/icons-simple-icons/gnu';
|
||||
@@ -30,6 +31,8 @@ import rosIcon from '@iconify/icons-simple-icons/ros';
|
||||
import rustIcon from '@iconify/icons-simple-icons/rust';
|
||||
import texIcon from '@iconify/icons-file-icons/latex';
|
||||
import ubuntuIcon from '@iconify/icons-simple-icons/ubuntu';
|
||||
import nodejsIcon from '@iconify/icons-mdi/nodejs';
|
||||
import mysqlIcon from '@iconify/icons-grommet-icons/mysql';
|
||||
|
||||
export default function TitleMirrorIcon(
|
||||
mirrorName: string,
|
||||
@@ -61,6 +64,8 @@ export default function TitleMirrorIcon(
|
||||
return <Icon height={size} icon={debianIcon} color={color} />;
|
||||
case 'deepin':
|
||||
return <Icon height={size} icon={deepinIcon} color={color} />;
|
||||
case 'epel':
|
||||
return <Icon height={size} icon={epelIcon} color={color} />;
|
||||
case 'docker-ce':
|
||||
return <Icon height={size} icon={dockerIcon} color={color} />;
|
||||
case 'elpa':
|
||||
@@ -87,6 +92,10 @@ export default function TitleMirrorIcon(
|
||||
return <Icon height={size} icon={llvmIcon} color={color} />;
|
||||
case 'manjaro':
|
||||
return <Icon height={size} icon={manjaroIcon} color={color} />;
|
||||
case 'mysql':
|
||||
return <Icon height={size} icon={mysqlIcon} color={color} />;
|
||||
case 'nodejs-release':
|
||||
return <Icon height={size} icon={nodejsIcon} color={color} />;
|
||||
case 'npm':
|
||||
return <Icon height={size} icon={npmIcon} color={color} />;
|
||||
case 'opensuse':
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
"~/*": ["./src/*"]
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
},
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
|
||||
Reference in New Issue
Block a user