Skip to content

Commit

Permalink
update: tiny png
Browse files Browse the repository at this point in the history
  • Loading branch information
veaba committed Jul 28, 2022
1 parent b8e524f commit 560b1c6
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
dist
mock.ts
mock.js
build
.vscode
.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default {
![](repos/vuejs-translations/docs-zh-cn.svg)


<p align="center"> :point_up: :point_up: :point_up: ↑↑↑↑↑↑ :point_up: :point_up: :point_up: :point_up:</p>
<p align="center"> :point_up: :point_up: :point_up: ↑↑↑↑↑↑ :point_up: :point_up: :point_up:</p>

in `config.js`:

Expand Down
2 changes: 1 addition & 1 deletion auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by 'unplugin-auto-import'
export {}
declare global {

const ElNotification: typeof import('element-plus/es')['ElNotification']
}
243 changes: 243 additions & 0 deletions dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,246 @@
- d - Number of deletions
- c - Number of commits
```


### 对 vuejs-translation/docs-zh-cn 数据处理

```js
const contributors = {
CONTRIBUTOR: {
jiacongluo: {
total: 2,
login: 'jiacongluo',
number: 477,
id: 43315267,
avatar_url: 'https://avatars.githubusercontent.com/u/43315267?v=4'
},
chunjin666: {
total: 1,
login: 'chunjin666',
number: 476,
id: 4099685,
avatar_url: 'https://avatars.githubusercontent.com/u/4099685?v=4'
},
sxzz: {
total: 1,
login: 'sxzz',
number: 472,
id: 6481596,
avatar_url: 'https://avatars.githubusercontent.com/u/6481596?v=4'
},
Duanxs: {
total: 1,
login: 'Duanxs',
number: 471,
id: 10006810,
avatar_url: 'https://avatars.githubusercontent.com/u/10006810?v=4'
},
awxiaoxian2020: {
total: 1,
login: 'awxiaoxian2020',
number: 470,
id: 69554233,
avatar_url: 'https://avatars.githubusercontent.com/u/69554233?v=4'
},
KiritaniAyaka: {
total: 10,
login: 'KiritaniAyaka',
number: 469,
id: 26200808,
avatar_url: 'https://avatars.githubusercontent.com/u/26200808?v=4'
},
HyattXt: {
total: 1,
login: 'HyattXt',
number: 468,
id: 89585280,
avatar_url: 'https://avatars.githubusercontent.com/u/89585280?v=4'
},
BruceYuj: {
total: 1,
login: 'BruceYuj',
number: 467,
id: 19621739,
avatar_url: 'https://avatars.githubusercontent.com/u/19621739?v=4'
},
inc904: {
total: 1,
login: 'inc904',
number: 462,
id: 40587817,
avatar_url: 'https://avatars.githubusercontent.com/u/40587817?v=4'
},
// 这是一个 author_association: 'MEMBER',
wxsms: {
total: 8,
login: 'wxsms',
number: 460,
id: 5960988,
avatar_url: 'https://avatars.githubusercontent.com/u/5960988?v=4'
},
itsyuxuan: {
total: 2,
login: 'itsyuxuan',
number: 458,
id: 62364938,
avatar_url: 'https://avatars.githubusercontent.com/u/62364938?v=4'
},
ch1lam: {
total: 2,
login: 'ch1lam',
number: 455,
id: 39334548,
avatar_url: 'https://avatars.githubusercontent.com/u/39334548?v=4'
},
KimYangOfCat: {
total: 1,
login: 'KimYangOfCat',
number: 453,
id: 32960305,
avatar_url: 'https://avatars.githubusercontent.com/u/32960305?v=4'
},
bigyifeng: {
total: 1,
login: 'bigyifeng',
number: 451,
id: 66539215,
avatar_url: 'https://avatars.githubusercontent.com/u/66539215?v=4'
},
linxiang07: {
total: 1,
login: 'linxiang07',
number: 447,
id: 40119767,
avatar_url: 'https://avatars.githubusercontent.com/u/40119767?v=4'
},
xfq: {
total: 5,
login: 'xfq',
number: 445,
id: 2863444,
avatar_url: 'https://avatars.githubusercontent.com/u/2863444?v=4'
},
iamxiyang: {
total: 1,
login: 'iamxiyang',
number: 442,
id: 40079272,
avatar_url: 'https://avatars.githubusercontent.com/u/40079272?v=4'
},
btea: {
total: 1,
login: 'btea',
number: 437,
id: 24516654,
avatar_url: 'https://avatars.githubusercontent.com/u/24516654?v=4'
},
earthaYan: {
total: 3,
login: 'earthaYan',
number: 406,
id: 25888900,
avatar_url: 'https://avatars.githubusercontent.com/u/25888900?v=4'
},
Justineo: {
total: 1,
login: 'Justineo',
number: 387,
id: 1726061,
avatar_url: 'https://avatars.githubusercontent.com/u/1726061?v=4'
},
pakchoily: {
total: 3,
login: 'pakchoily',
number: 385,
id: 59410698,
avatar_url: 'https://avatars.githubusercontent.com/u/59410698?v=4'
},
SkyeYoung: {
total: 2,
login: 'SkyeYoung',
number: 383,
id: 48400568,
avatar_url: 'https://avatars.githubusercontent.com/u/48400568?v=4'
},
'Mister-Hope': {
total: 5,
login: 'Mister-Hope',
number: 382,
id: 33315834,
avatar_url: 'https://avatars.githubusercontent.com/u/33315834?v=4'
},
'donggua-nor': {
total: 1,
login: 'donggua-nor',
number: 367,
id: 37831399,
avatar_url: 'https://avatars.githubusercontent.com/u/37831399?v=4'
},
byog: {
total: 6,
login: 'byog',
number: 365,
id: 7764115,
avatar_url: 'https://avatars.githubusercontent.com/u/7764115?v=4'
},
ice2shell: {
total: 1,
login: 'ice2shell',
number: 357,
id: 43178043,
avatar_url: 'https://avatars.githubusercontent.com/u/43178043?v=4'
},
lyking90: {
total: 1,
login: 'lyking90',
number: 354,
id: 56106787,
avatar_url: 'https://avatars.githubusercontent.com/u/56106787?v=4'
},
watonyweng: {
total: 2,
login: 'watonyweng',
number: 348,
id: 2574065,
avatar_url: 'https://avatars.githubusercontent.com/u/2574065?v=4'
},
Argun: {
total: 1,
login: 'Argun',
number: 347,
id: 1279340,
avatar_url: 'https://avatars.githubusercontent.com/u/1279340?v=4'
},
hezhongfeng: {
total: 1,
login: 'hezhongfeng',
id: 40707695,
avatar_url: 'https://avatars.githubusercontent.com/u/40707695?v=4'
},
baixiaoyu2997: {
total: 1,
login: 'baixiaoyu2997',
number: 338,
id: 9149999,
avatar_url: 'https://avatars.githubusercontent.com/u/9149999?v=4'
},
dboooo: {
total: 1,
login: 'dboooo',
number: 335,
id: 72451061,
avatar_url: 'https://avatars.githubusercontent.com/u/72451061?v=4'
}
},
MEMBER: {
Jinjiang: {
total: 26,
login: 'Jinjiang',
number: 450,
id: 206848,
avatar_url: 'https://avatars.githubusercontent.com/u/206848?v=4'
}
}
}
```
Binary file modified public/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/components/DisplaySVG.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const onSearch = () => {
return
}
getGithubContributors(`${owner}/${repo}`)
// test(`${owner}/${repo}`)
}
// TODO 有些迟滞
Expand Down Expand Up @@ -71,6 +72,13 @@ const init = async () => {
isNoFountSearchRepo.value = false
isNoContributors.value = false
}
const test = async ( repoKey: string) => {
const cleanData = getTotalList(defaultSort, defaultRepoConfig.value)
await generate(searchRepo, defaultRepoConfig, cleanData)
}
// for get contributors api
const getGithubContributors = async (repoKey: string) => {
// TODO test
// await generate(searchRepo.value, defaultRepoConfig.value, sortList.slice(0, 60))// .slice(0,20)
Expand All @@ -83,7 +91,7 @@ const getGithubContributors = async (repoKey: string) => {
contributorList.value = resp
const sortTotalList = sortBy(resp, (o) => -o.total);
originData.value = sortTotalList
const cleanData = getTotalList(sortTotalList, defaultRepoConfig)
const cleanData = getTotalList(sortTotalList, defaultRepoConfig.value)
await generate(searchRepo, defaultRepoConfig, cleanData)
} else {
Expand All @@ -106,6 +114,11 @@ const getGithubContributors = async (repoKey: string) => {
}
}
// TODO for has upstream repo, like vuejs-translations/docs-zh-cn
const getContributorsForPulls = async ()=>{
}
const generate = async (repo: string, userConfig: UserConfig, contributors: UserItem[]) => {
console.time('generate time');
svgData.value = await generateUserListSVG(contributors, userConfig)
Expand Down
7 changes: 5 additions & 2 deletions src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provide('defaultRepo', {defaultRepo, defaultRepoConfig, setDefaultRepo})
</script>
<template>
<ElHeader>
<ElMenu :default-avtive="activeMenuIndex" mode="horizontal" :ellipsis="false">
<ElMenu class="el-menu" :default-avtive="activeMenuIndex" mode="horizontal" :ellipsis="false">
<ElMenuItem index="3">veaba/Contributors</ElMenuItem>
<div class="flex-grow"></div>
<ElMenuItem index="1">Home</ElMenuItem>
Expand All @@ -39,7 +39,7 @@ provide('defaultRepo', {defaultRepo, defaultRepoConfig, setDefaultRepo})
<DisplaySVG></DisplaySVG>
</ElMain>
</ElContainer>
<ElFooter>
<ElFooter class="el-footer">
<Footer></Footer>
</ElFooter>
</template>
Expand All @@ -61,4 +61,7 @@ provide('defaultRepo', {defaultRepo, defaultRepoConfig, setDefaultRepo})
background-image: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff);
filter: var(--vp-home-hero-image-filter);
}
.el-footer{
background: #1e1e1e;
}
</style>

0 comments on commit 560b1c6

Please sign in to comment.