assayo/documents/ZH.md
2024-09-06 17:00:28 +03:00

257 lines
19 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> [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)
> [主要文件是俄文。](https://github.com/bakhirev/assayo/blob/main/documents/RU.md) 这是一个翻译。 它可能包含错误。 如果您是母语人士,您可以帮助改进此翻译。 谢谢!
# [Assayo](https://assayo.online/?ref=github&lang=zh)
对您的git仓库的数据进行可视化和分析 团队领导及资讯科技审核的表现工具
Links: [示范表现](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), [reddit](https://www.reddit.com/r/ITManagers/comments/1e5k291/the_visualization_and_analysis_of_git_commit/), [habr](https://habr.com/ru/articles/763342/).
<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%20git%20repository&description=Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/instapaper.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://share.diasporafoundation.org/?title=Visualization%20and%20analysis%20of%20git%20repository&url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/diaspora.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/qzone.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://vk.com/share.php?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository&comment=Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/vk.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://service.weibo.com/share/share.php?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&appkey=&title=Visualization%20and%20analysis%20of%20git%20repository&pic=&ralateUid=" target="_blank"><img src="https://assayo.online/assets/seo/social/weibo.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/ok.ru.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://www.douban.com/recommend/?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/douban.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://www.xing.com/spi/shares/new?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo" target="_blank"><img src="https://assayo.online/assets/seo/social/xing.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="http://widget.renren.com/dialog/share?resourceUrl=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&srcUrl=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&title=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&description=Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/renren.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="threema://compose?text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21&id=" target="_blank"><img src="https://assayo.online/assets/seo/social/threema.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a><a href="https://lineit.line.me/share/ui?url=https%3A%2F%2Fgithub.com%2Fbakhirev%2Fassayo&text=Visualization%20and%20analysis%20of%20git%20repository%20%3A%20Check%20your%20git%20stats%21" target="_blank"><img src="https://assayo.online/assets/seo/social/line.me.jpg" title="Visualization and analysis of git repository" width="24px" height="24px"/></a>
<a href="https://assayo.online/demo/?dump=./test.txt" target="_blank"><img src="https://assayo.online/seo/github/index.png" width="100%" /></a>
<a name="link-0"></a>
##### 👨‍💻 工作人员可以评估新工作场所
- 工作节奏;
- 加班数量;
- 责任范围;
- 新功能和错误量;
- 同事工作方式。;
<a name="link-1"></a>
##### ‍👨‍💼 管理者可以评估员工
- 发现闲置工作者;
- 估算代码量;
- 了解工作速度;
- 注意行为异常;
- 查看工作周期动态。;
<a name="link-2"></a>
##### 👑 投资者可以评估产品
- 产品的成本;
- 新功能的成本;
- 开发时间;
- 修改时间预测;
- 成本预测;
<a name="link-3"></a>
### Table of contents
- [如何 quickly 查阅 commit 的 次数?](#link-4)
- [How to create a local report with using library?](#link-5)
- [如何 combine 作者?](#link-6)
- [如何从 git 导出数据?](#link-7)
- [供网上浏览](#link-8)
- [在没有互联网的情况下观看](#link-9)
- [If you use PowerShell in Windows](#link-10)
- [如何在线查看报告?](#link-11)
- [Using website](#link-12)
- [Use the library ](#link-13)
- [Use the library ](#link-14)
- [Use source code](#link-15)
- [如何重打包报告文件?](#link-16)
- [如何查看微服务组的报告?](#link-17)
- [如何将界面重新配色为公司专有颜色?](#link-18)
- [如何签署提交?](#link-19)
- [How to add checking for commit message?](#link-20)
- [ Use file commit-msg](#link-21)
- [ Use package pre-commit](#link-22)
- [如何自动化数据采集?](#link-23)
- [With backend](#link-24)
- [没有后端](#link-25)
- [DevOps ](#link-26)
- [公共服务器](#link-27)
- [专用服务器](#link-28)
- [Docker 图像更新](#link-29)
- [ About application](#link-30)
- [Architecture](#link-31)
- [释出版本大约每半年一次。接下来发生什么情况:](#link-32)
- [如何添加或编辑翻译?](#link-33)
- [愿望,建议,意见](#link-34)
<a name="link-4"></a>
### 🚀 如何 quickly 查阅 commit 的 次数?
在项目的根目录中执行以下命令:
```
git shortlog -s -n -e
```
<a name="link-5"></a>
### 🏭 How to create a local report with using library?
NodeJS:
```
npx assayo
```
PHP:
```
composer require bakhirev/assayo
vendor/bin/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>
### ‍🎭 如何 combine 作者?
在项目的 根目录 创建一个文件 `.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>
```
关于这个文件格式的 详情 可以 参考 [这里](https://git-scm.com/docs/gitmailmap).
<a name="link-7"></a>
### 📤 如何从 git 导出数据?
<a name="link-8"></a>
#### 供网上浏览
在项目的根目录执行:
```
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" > log.txt
```
<a name="link-9"></a>
#### 在没有互联网的情况下观看
```
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/^/r(f\`/g' | sed 's/$/\`\);/g' | sed 's/\$/_/g' > log.txt
```
Git会创建一个文件 `log.txt`. 这个文件包含了构建报告的数据。 字符串格式的区别在于它们具有的包装。无网络格式将会像您只是简单地打开了js文件一样被加载。 `/build/index.html`
<a name="link-10"></a>
#### 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.
<a name="link-11"></a>
### 如何在线查看报告?
<a name="link-12"></a>
#### 📈 Using website
- 切换到 [网站](https://assayo.online/)
- 按下按钮 “[示范](https://assayo.online/demo?lang=ru)”
- 拖放文件 `log.txt` 在浏览器窗口中
<a name="link-13"></a>
#### Use the library (NodeJS)
- run `npx assayo`
- open `./assayo/index.html`
<a name="link-14"></a>
#### Use the library (PHP)
- run `composer require bakhirev/assayo`
- run `vendor/bin/assayo`
- open `./assayo/index.html`
<a name="link-15"></a>
#### Use source code
- 下载这个存储库
- 拖放文件 `log.txt` 到文件夹 `/build`
- 要运行 `/build/index.html`
- 或是拖放文件夹 `/build` 到我的仓库 (它所在的地方 `log.txt`). 可以改变名称。比如,从名称 `/build` 到名称 `/report`
重要的事情是必须让log.txt这个文件是通过命令创建出来的这样它就可以在没有网的时候查看了。
<a name="link-16"></a>
### 🏭 如何重打包报告文件?
- 下载这个储存库
- 要执行 `npm install`
- 要执行 `npm run build:local`
- 最新的构建将在文件夹 `/build`
<a name="link-17"></a>
### 🗃️ 如何查看微服务组的报告?
- 为每个微服务生成文件 `log.txt` (`log-1.txt`, `log-2.txt`, `log-3.txt` 等等)
- 参见“如何在有网络环境下查看报告”。在最后一步,将所有文件同时拖入浏览器窗口。
- 参见“如何在没有网络环境下查看报告”。第二步将所有微服务文件拖动到 (`log-1.txt`, `log-2.txt`, `log-3.txt` 等等) 到报表文件夹 (`/build`).
<a name="link-18"></a>
### 🎨 如何将界面重新配色为公司专有颜色?
您可以为界面创建自己的主题。可以修改:
- **标题**. 你可以在网址参数中指定它 ```title```. 例如: ```?title=You Company```
- **CSS样式**. 为了做到这一点你需要准备一个CSS文件并在网址参数中指明其地址 ```theme```. 例如: ```?theme=//company.com/some.css```. 你可以使用类名作为选择器。大多数情况下,他们在新版本发布时不会发生变化。
- **语言**. 你可以把它放在网址的参数中。 ```lang```. 例如: ```?lang=es```
<a name="link-19"></a>
### 📝 如何签署提交?
遵循实践 [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)`
<a name="link-20"></a>
### 👮 How to add checking for commit message?
<a name="link-21"></a>
#### 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
```
<a name="link-22"></a>
#### 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`
<a name="link-23"></a>
### 📚 如何自动化数据采集?
<a name="link-24"></a>
#### With backend
- use module [Assayo Crawler](https://github.com/bakhirev/assayo-crawler);
<a name="link-25"></a>
#### 没有后端
- 克隆您的仓库;
- 复制文件夹 `build` 从当前仓库;
- 打开 `build/index.html` 在浏览器中添加书签;
- 添加一个快捷方式 `build/assets/ci-cd.sh` 自动启动文件夹 (Windows);
每次重启计算机,该脚本将更新统计数据,这些数据自动添加到主分支中。
<a name="link-26"></a>
### 🛠️ DevOps (CI/CD)
<a name="link-27"></a>
#### 公共服务器
您可以将数据构建报告文件发布到公共URL可以使用网站来显示它。 [assayo](https://assayo.online/). 指定数据所在的地址作为URL参数 ```dump```:
```
https://assayo.online/demo/?dump=//you_site.com/some/log.txt
```
<a name="link-28"></a>
#### 专用服务器
- 下载 [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端口是否可用.
<a name="link-29"></a>
#### Docker 图像更新
- 运行命令 ```npm run build:docker```
- 运行命令 ```docker build -t assayo .```
- 检查结果 ```docker run --name assayo -p 80:80 -d assayo```;
- 运行命令 ```docker tag assayo bakhirev/assayo:latest```;
- 提交容器映像到 Docker Hub ```docker push bakhirev/assayo:latest```;
<a name="link-30"></a>
### 🛠️ About application
<a name="link-31"></a>
#### 📐 Architecture
<img src="https://raw.githubusercontent.com/bakhirev/assayo-crawler/12af4410fc93384cafb108a4429e43f9a874dbaa/schema.svg" width="70%" />
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.
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.
<a name="link-32"></a>
#### 🈯 释出版本大约每半年一次。接下来发生什么情况:
看 [主要文件](https://github.com/bakhirev/assayo/blob/main/documents/RU.md)
<a name="link-33"></a>
#### 🗺️ 如何添加或编辑翻译?
您可以在“翻译”部分添加新翻译或更正当前翻译。 ```ts/translations/```.
[指示手册](https://github.com/firstcontributions/first-contributions)
<a name="link-34"></a>
#### 📧 愿望,建议,意见
- telegramm [@bakhirev](https://t.me/bakhirev) (优先通信方法)
- [alexey-bakhirev@yandex.ru](mailto:alexey-bakhirev@yandex.ru)
- 网站 [https://assayo.online/](https://assayo.online/?ref=github&lang=zh)
<img src="https://mc.yandex.ru/watch/94903985" style="position:absolute; left:-9999px;" alt="" />