assayo/documents/ZH.md

242 lines
19 KiB
Markdown
Raw Normal View History

2024-04-30 15:13:34 +00:00
> [English](https://github.com/bakhirev/assayo) | [Español](https://github.com/bakhirev/assayo/blob/main/documents/ES.md) | __[中文](https://github.com/bakhirev/assayo/blob/main/documents/ZH.md)__ | [Français](https://github.com/bakhirev/assayo/blob/main/documents/FR.md) | [Deutsch](https://github.com/bakhirev/assayo/blob/main/documents/DE.md) | [Português](https://github.com/bakhirev/assayo/blob/main/documents/PT.md) | [日本語](https://github.com/bakhirev/assayo/blob/main/documents/JA.md) | [Русский](https://github.com/bakhirev/assayo/blob/main/documents/RU.md)
2024-02-28 20:17:21 +00:00
2024-04-30 15:13:34 +00:00
> [主要文件是俄文。](https://github.com/bakhirev/assayo/blob/main/documents/RU.md) 这是一个翻译。 它可能包含错误。 如果您是母语人士,您可以帮助改进此翻译。 谢谢!
2024-02-28 20:17:21 +00:00
2024-03-22 22:22:07 +00:00
# [Assayo](https://assayo.online/?ref=github&lang=zh)
2024-07-15 11:16:13 +00:00
对您的git仓库的数据进行可视化和分析 ([示范表现](https://assayo.online/demo/?ref=github&lang=zh&dump=./test.txt), [install](https://assayo.online/demo/?ref=github), [docker](https://hub.docker.com/r/bakhirev/assayo)).
2024-05-05 08:54:25 +00:00
2024-04-30 15:13:34 +00:00
<a href="http://www.facebook.com/sharer.php?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/facebook.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository" target="_blank"><img src="https://assayo.online/assets/seo/social/reddit.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&via=&hashtags=IT%2Cgit%2Cstatistics%2Caudit%2Cdata-visualization%2Creport" target="_blank"><img src="https://assayo.online/assets/seo/social/twitter.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/linkedin.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository&caption=Check%20your%20git%20stats%21&tags=IT%2Cgit%2Cstatistics%2Caudit%2Cdata-visualization%2Creport" target="_blank"><img src="https://assayo.online/assets/seo/social/tumblr.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.blogger.com/blog-this.g?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&n=Visualization%20and%20analysis%20of%20git%20repository&t=Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/blogger.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.evernote.com/clip.action?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/evernote.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://www.addthis.com/bookmark.php?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/add.this.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://getpocket.com/edit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/getpocket.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&t=Visualization%20and%20analysis%20of%20git%20repository" target="_blank"><img src="https://assayo.online/assets/seo/social/hacker.news.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://buffer.com/add?text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/buffer.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://share.flipboard.com/bookmarklet/popout?v=2&title=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/flipboard.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://www.instapaper.com/edit?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20g
2024-05-05 08:54:25 +00:00
<a href="https://assayo.online/demo/?dump=./test.txt" target="_blank"><img src="https://assayo.online/seo/github/index.png" width="100%" /></a>
2024-04-30 15:13:34 +00:00
<a name="link-0"></a>
##### 👨‍💻 工作人员可以评估新工作场所
2024-02-28 20:17:21 +00:00
- 工作节奏;
- 加班数量;
- 责任范围;
- 新功能和错误量;
- 同事工作方式。;
2024-04-30 15:13:34 +00:00
<a name="link-1"></a>
##### ‍👨‍💼 管理者可以评估员工
2024-02-28 20:17:21 +00:00
- 发现闲置工作者;
- 估算代码量;
- 了解工作速度;
- 注意行为异常;
- 查看工作周期动态。;
2024-04-30 15:13:34 +00:00
<a name="link-2"></a>
##### 👑 投资者可以评估产品
2024-02-28 20:17:21 +00:00
- 产品的成本;
- 新功能的成本;
- 开发时间;
- 修改时间预测;
- 成本预测;
2024-04-30 15:13:34 +00:00
<a name="link-3"></a>
### Table of contents
- [如何 quickly 查阅 commit 的 次数?](#link-4)
2024-08-27 06:15:26 +00:00
- [How to create a report?](#link-5)
- [如何 combine 作者?](#link-6)
- [如何从 git 导出数据?](#link-7)
- [供网上浏览](#link-8)
- [在没有互联网的情况下观看](#link-9)
- [If you use PowerShell in Windows](#link-10)
- [如何在线查看报告?](#link-11)
2024-08-27 06:41:04 +00:00
- [如何在没有网络环境下查看报告? ](#link-12)
- [如何在没有网络环境下查看报告?](#link-13)
- [如何重打包报告文件?](#link-14)
- [如何查看微服务组的报告?](#link-15)
- [如何将界面重新配色为公司专有颜色?](#link-16)
- [如何签署提交?](#link-17)
- [How to add checking for commit message?](#link-18)
- [ Use file commit-msg](#link-19)
- [ Use package pre-commit](#link-20)
- [如何自动化数据采集?](#link-21)
- [With backend](#link-22)
- [没有后端](#link-23)
- [DevOps ](#link-24)
- [公共服务器](#link-25)
- [专用服务器](#link-26)
- [Docker 图像更新](#link-27)
- [ About application](#link-28)
- [Architecture](#link-29)
- [释出版本大约每半年一次。接下来发生什么情况:](#link-30)
- [如何添加或编辑翻译?](#link-31)
- [愿望,建议,意见](#link-32)
2024-04-30 15:13:34 +00:00
<a name="link-4"></a>
### 🚀 如何 quickly 查阅 commit 的 次数?
2024-02-28 20:17:21 +00:00
在项目的根目录中执行以下命令:
```
git shortlog -s -n -e
```
2024-04-30 15:13:34 +00:00
<a name="link-5"></a>
2024-08-27 06:41:04 +00:00
### 🏭 How to create a report?
2024-08-27 06:15:26 +00:00
If you have NodeJS, you can run:
```
npx assayo
```
The script will create a folder `./assayo` with a report about repository:
```
./assayo/index.html - report
./assayo/log.txt - information from git
```
If you do not have NodeJS , see the items "How to download data from git?" and "How to view the report?"
<a name="link-6"></a>
2024-04-30 15:13:34 +00:00
### ‍🎭 如何 combine 作者?
2024-02-28 20:17:21 +00:00
在项目的 根目录 创建一个文件 `.mailmap`.
文件内容示例:
```
Alex B <alex@mail.uk>
Alex B <alex@mail.uk> <alex@gov.tk>
Alex B <alex@mail.uk> <bakhirev@ya.kz>
Alex B <alex@mail.uk> <man64@yahoo.com>
2024-04-30 15:13:34 +00:00
```
2024-02-28 20:17:21 +00:00
关于这个文件格式的 详情 可以 参考 [这里](https://git-scm.com/docs/gitmailmap).
2024-04-30 15:13:34 +00:00
<a name="link-7"></a>
2024-08-27 06:15:26 +00:00
### 📤 如何从 git 导出数据?
<a name="link-8"></a>
2024-04-30 15:13:34 +00:00
#### 供网上浏览
2024-02-28 20:17:21 +00:00
在项目的根目录执行:
```
2024-07-01 12:57:57 +00:00
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" > log.txt
2024-02-28 20:17:21 +00:00
```
2024-08-27 06:15:26 +00:00
<a name="link-9"></a>
2024-04-30 15:13:34 +00:00
#### 在没有互联网的情况下观看
2024-02-28 20:17:21 +00:00
```
2024-07-01 12:57:57 +00:00
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" | sed -e 's/\\/\\\\/g' | sed -e 's/`/"/g' | sed -e 's/^/report.push(\`/g' | sed 's/$/\`\);/g' | sed 's/\$/_/g' > log.txt
2024-02-28 20:17:21 +00:00
```
2024-08-19 13:17:30 +00:00
Git会创建一个文件 `log.txt`. 这个文件包含了构建报告的数据。 字符串格式的区别在于它们具有的包装。无网络格式将会像您只是简单地打开了js文件一样被加载。 `/build/index.html`
2024-08-27 06:15:26 +00:00
<a name="link-10"></a>
2024-08-19 13:17:30 +00:00
#### If you use PowerShell in Windows
By default, the output encoding may not match UTF-8 and the resulting log file will be unreadable. Before saving the log, you can change the encoding with the command.
```
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
```
Or open a saved file and manually change the encoding to UTF-8.
2024-08-27 06:15:26 +00:00
<a name="link-11"></a>
2024-04-30 15:13:34 +00:00
### 📈 如何在线查看报告?
2024-03-22 22:22:07 +00:00
- 切换到 [网站](https://assayo.online/)
- 按下按钮 “[示范](https://assayo.online/demo?lang=ru)”
2024-02-28 20:17:21 +00:00
- 拖放文件 `log.txt` 在浏览器窗口中
2024-08-27 06:15:26 +00:00
<a name="link-12"></a>
2024-08-27 06:41:04 +00:00
#### 如何在没有网络环境下查看报告? (NodeJS)
- Run `npx assayo`
- Open `./assayo/index.html`
<a name="link-13"></a>
2024-04-30 15:13:34 +00:00
### 如何在没有网络环境下查看报告?
2024-02-28 20:17:21 +00:00
- 下载这个存储库
- 拖放文件 `log.txt` 到文件夹 `/build`
- 要运行 `/build/index.html`
- 或是拖放文件夹 `/build` 到我的仓库 (它所在的地方 `log.txt`). 可以改变名称。比如,从名称 `/build` 到名称 `/report`
重要的事情是必须让log.txt这个文件是通过命令创建出来的这样它就可以在没有网的时候查看了。
2024-08-27 06:41:04 +00:00
<a name="link-14"></a>
2024-04-30 15:13:34 +00:00
### 如何重打包报告文件?
2024-02-28 20:17:21 +00:00
- 下载这个储存库
- 要执行 `npm install`
2024-07-14 12:13:04 +00:00
- 要执行 `npm run build:local`
2024-02-28 20:17:21 +00:00
- 最新的构建将在文件夹 `/build`
2024-08-27 06:41:04 +00:00
<a name="link-15"></a>
2024-04-30 15:13:34 +00:00
### 🏭 如何查看微服务组的报告?
2024-02-28 20:17:21 +00:00
- 为每个微服务生成文件 `log.txt` (`log-1.txt`, `log-2.txt`, `log-3.txt` 等等)
- 参见“如何在有网络环境下查看报告”。在最后一步,将所有文件同时拖入浏览器窗口。
- 参见“如何在没有网络环境下查看报告”。第二步将所有微服务文件拖动到 (`log-1.txt`, `log-2.txt`, `log-3.txt` 等等) 到报表文件夹 (`/build`).
2024-08-27 06:41:04 +00:00
<a name="link-16"></a>
2024-04-30 15:13:34 +00:00
### 🗃️ 如何将界面重新配色为公司专有颜色?
2024-02-28 20:17:21 +00:00
您可以为界面创建自己的主题。可以修改:
- **标题**. 你可以在网址参数中指定它 ```title```. 例如: ```?title=You Company```
- **CSS样式**. 为了做到这一点你需要准备一个CSS文件并在网址参数中指明其地址 ```theme```. 例如: ```?theme=//company.com/some.css```. 你可以使用类名作为选择器。大多数情况下,他们在新版本发布时不会发生变化。
- **语言**. 你可以把它放在网址的参数中。 ```lang```. 例如: ```?lang=es```
2024-08-27 06:41:04 +00:00
<a name="link-17"></a>
2024-04-30 15:13:34 +00:00
### 🎨 如何签署提交?
2024-02-28 20:17:21 +00:00
遵循实践 [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/). 例如:
```
JIRA-1234 feat(profile): Added avatar for user
```
- 任务号 `(JIRA-1234)`
- 工作类别 `(feat, fix, style, refactor, test, doc 等等)`
- 工作领域 `(profile - 地盘组, 网页 或新功能, 一句话)`
- 职位描述 `(Added avatar for user)`
2024-08-27 06:15:26 +00:00
<a name="link-18"></a>
2024-08-27 06:41:04 +00:00
### 📝 How to add checking for commit message?
<a name="link-19"></a>
2024-04-30 15:13:34 +00:00
#### 👮 Use file `commit-msg`
1. Create file `commit-msg` in folder `.git/hooks/`
2. Add this text in file:
```
#!/usr/bin/env bash
if ! grep -iqE "(JIRA-[0-9]{1,5})(\s)(feat|fix|docs|style|refactor|test|chore)((\([a-z0-9_-]{1,}\)){0,})(:\s)([a-z]{1,})" "$1"; then
echo "Need commit message like: JIRA-12 fix(profile): some text. Read Semantic Commit Messages" >&2
exit 1
fi
```
2024-08-27 06:41:04 +00:00
<a name="link-20"></a>
2024-04-30 15:13:34 +00:00
#### Use package [pre-commit](https://www.npmjs.com/package/pre-commit)
1. Add in file `package.json` property `commit-msg`:
```
...
"commit-msg": {
"regex": "(JIRA-[0-9]{1,5})(\\s)(feat|fix|docs|style|refactor|test|chore)((\\([a-z0-9_-]{1,}\\)){0,})(:\\s)([a-z]{1,})",
"error-message": "Need commit message like: JIRA-12 fix(profile): some text Read Semantic Commit Messages"
},
...
```
2. Run command `npm install pre-commit`
2024-08-27 06:15:26 +00:00
<a name="link-21"></a>
2024-08-27 06:41:04 +00:00
### 如何自动化数据采集?
<a name="link-22"></a>
2024-04-30 15:13:34 +00:00
#### 📚 With backend
- use module [Assayo Crawler](https://github.com/bakhirev/assayo-crawler);
2024-08-27 06:41:04 +00:00
<a name="link-23"></a>
2024-04-30 15:13:34 +00:00
#### 没有后端
- 克隆您的仓库;
2024-02-28 20:17:21 +00:00
- 复制文件夹 `build` 从当前仓库;
- 打开 `build/index.html` 在浏览器中添加书签;
- 添加一个快捷方式 `build/assets/ci-cd.sh` 自动启动文件夹 (Windows);
每次重启计算机,该脚本将更新统计数据,这些数据自动添加到主分支中。
2024-08-27 06:15:26 +00:00
<a name="link-24"></a>
2024-08-27 06:41:04 +00:00
### DevOps (CI/CD)
<a name="link-25"></a>
2024-04-30 15:13:34 +00:00
#### 🛠️ 公共服务器
2024-03-22 22:22:07 +00:00
您可以将数据构建报告文件发布到公共URL可以使用网站来显示它。 [assayo](https://assayo.online/). 指定数据所在的地址作为URL参数 ```dump```:
2024-02-28 20:17:21 +00:00
```
2024-03-22 22:22:07 +00:00
https://assayo.online/demo/?dump=//you_site.com/some/log.txt
2024-02-28 20:17:21 +00:00
```
2024-08-27 06:41:04 +00:00
<a name="link-26"></a>
2024-04-30 15:13:34 +00:00
#### 专用服务器
2024-02-28 20:17:21 +00:00
- 下载 [docker镜像](https://hub.docker.com/r/bakhirev/assayo);
- 在本地网络中运行它;
- 使用web界面查看报告并指定数据所在地址作为URL参数 ```dump```:
```
http://assayo_url/?dump=//you_url/some/log.txt
assayo_url - assayo容器的URL地址它监听80端口;
you_url - git日志的容器的URL地址;
```
默认情况下,镜像会被启动在地址 ```http://127.0.0.1:80/```. 如果没有成功请检查你的80端口是否可用.
2024-08-27 06:41:04 +00:00
<a name="link-27"></a>
2024-04-30 15:13:34 +00:00
#### Docker 图像更新
2024-07-15 07:57:59 +00:00
- 运行命令 ```npm run build:docker```
2024-02-28 20:17:21 +00:00
- 运行命令 ```docker build -t assayo .```
- 检查结果 ```docker run --name assayo -p 80:80 -d assayo```;
2024-04-30 15:13:34 +00:00
- 运行命令 ```docker tag assayo bakhirev/assayo:latest```;
- 提交容器映像到 Docker Hub ```docker push bakhirev/assayo:latest```;
2024-08-27 06:15:26 +00:00
<a name="link-28"></a>
2024-08-27 06:41:04 +00:00
### About application
<a name="link-29"></a>
2024-04-30 15:13:34 +00:00
#### 🛠️ Architecture
<img src="https://raw.githubusercontent.com/bakhirev/assayo-crawler/12af4410fc93384cafb108a4429e43f9a874dbaa/schema.svg" width="70%" />
2024-05-07 06:37:18 +00:00
1. [Reports showcase UI](https://github.com/bakhirev/assayo-showcase) displays a list of available reports. Each report consists of a title, description, and a list of repositories.
2024-04-30 15:13:34 +00:00
2. [Crawler service](https://github.com/bakhirev/assayo-crawler) collects repository logs for the report.
3. [Log visualization UI](https://github.com/bakhirev/assayo) **(you here)** displays report. Needs a log file for work.
2024-08-27 06:41:04 +00:00
<a name="link-30"></a>
2024-04-30 15:13:34 +00:00
#### 📐 释出版本大约每半年一次。接下来发生什么情况:
2024-02-28 20:17:21 +00:00
看 [主要文件](https://github.com/bakhirev/assayo/blob/main/documents/RU.md)
2024-08-27 06:41:04 +00:00
<a name="link-31"></a>
2024-04-30 15:13:34 +00:00
#### 🈯 如何添加或编辑翻译?
2024-02-28 20:17:21 +00:00
您可以在“翻译”部分添加新翻译或更正当前翻译。 ```ts/translations/```.
2024-03-22 22:22:07 +00:00
[指示手册](https://github.com/firstcontributions/first-contributions)
2024-08-27 06:41:04 +00:00
<a name="link-32"></a>
2024-04-30 15:13:34 +00:00
#### 🗺️ 愿望,建议,意见
2024-02-28 20:17:21 +00:00
- telegramm [@bakhirev](https://t.me/bakhirev) (优先通信方法)
- [alexey-bakhirev@yandex.ru](mailto:alexey-bakhirev@yandex.ru)
2024-05-05 09:22:34 +00:00
- 网站 [https://assayo.online/](https://assayo.online/?ref=github&lang=zh)
2024-05-05 09:49:12 +00:00
<img src="https://mc.yandex.ru/watch/94903985" style="position:absolute; left:-9999px;" alt="" />