From 0876786b6e28b637fd2c8e33e89881f98ecb0069 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Sat, 17 Nov 2018 08:24:47 +0800 Subject: [PATCH] add new page --- docs/_sidebar.md | 1 + docs/onlinejudge/guide/update_fe.md | 30 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 docs/onlinejudge/guide/update_fe.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index e4f153a..c93bab5 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -12,6 +12,7 @@ - [HTTPS相关问题](onlinejudge/guide/https.md) - [使用CDN](onlinejudge/guide/using_cdn.md) - [数据备份](onlinejudge/guide/backup.md) + - [修改前端](onlinejudge/guide/update_fe.md) - [常见问题](onlinejudge/faq.md) - [交流群](onlinejudge/guide/qq_group.md) - [从旧版迁移](onlinejudge/from_old.md) diff --git a/docs/onlinejudge/guide/update_fe.md b/docs/onlinejudge/guide/update_fe.md new file mode 100644 index 0000000..d40f4b9 --- /dev/null +++ b/docs/onlinejudge/guide/update_fe.md @@ -0,0 +1,30 @@ +# 修改前端 + +参考 https://github.com/QingdaoU/OnlineJudgefe 进行开发和构建 + +然后 `npm run build` 就可以得到一个 dist 文件夹,文件结构如下 + +``` +➜ OnlineJudgeFE git:(master) ✗ tree dist +dist +├── admin +│   └── index.html +├── index.html +└── static + ├── css + │   ├── admin.127f3da5b09451926728de2829ebb32e.css + │   ├── loader.css + │   ├── oj.0ba722f43ddbeb758cde2f9dc804455e.css + │   └── vendor.f033d6c4c74b6b40e92ca86f168fd0be.css + ├── fonts + │   ├── KaTeX_AMS-Regular.3d8245d.woff2 + │   ├── KaTeX_AMS-Regular.ac1d46d.woff + +.... +.... + +``` + +将 `dist` 文件夹复制到服务器上某个目录下,比如 `/data/OnlineJudgeDeploy/data/backend`,然后修改 `docker-compose.yml`,在 `oj-backend` 模块中的 `volumes` 中增加一行 `- /data/OnlineJudgeDeploy/data/backend:/app/dist` (冒号前面的请修改为实际的路径),然后 `docker-compose up -d` 即可。 + +注意,这种修改方式将覆盖容器内的前端文件,未来发布新版本前端的时候,请自行使用相同的方式更新。 \ No newline at end of file