Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit 578765b

Browse files
committed
update frontend
1 parent c186179 commit 578765b

2 files changed

Lines changed: 45 additions & 2 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ Use in repository introduction! use in pull request! use in issue! use it anywhe
3737
> **Warning**
3838
> by default, we can't get the data of private repo, please use your own [token](https://github.com/settings/tokens/new) to deploy. Don't forget to check the box to access your private repositories!
3939
40+
## 🍎 Contributor Card
41+
Use in repository introduction!
42+
```markdown
43+
[![Web ChatGPT QQ Bot's Contributors](https://stats.deeptrain.net/contributor/lss233/chatgpt-mirai-qq-bot)](https://github.com/zmh-program/code-statistic)
44+
```
45+
[![Web ChatGPT QQ Bot's Contributors](https://stats.deeptrain.net/contributor/lss233/chatgpt-mirai-qq-bot)](https://github.com/zmh-program/code-statistic)
46+
47+
custom columns (min columns is *4*, default is *8*, max is *6*):
48+
```markdown
49+
[![Web ChatGPT QQ Bot's Contributors](https://stats.deeptrain.net/contributor/lss233/chatgpt-mirai-qq-bot?column=12)](https://github.com/zmh-program/code-statistic)
50+
```
51+
[![Web ChatGPT QQ Bot's Contributors](https://stats.deeptrain.net/contributor/lss233/chatgpt-mirai-qq-bot?column=12)](https://github.com/zmh-program/code-statistic)
52+
4053
## 🥝 Dark Theme
4154
Very easy, just add `?theme=dark` after it in any kind of card!
4255
```markdown

gui/src/App.vue

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ const repo = reactive({
1212
username: '',
1313
repo: '',
1414
});
15+
const contributor = reactive({
16+
username: '',
17+
repo: '',
18+
column: 6,
19+
})
20+
21+
function validate(map: Record<string, string>) {
22+
for (const key in map) {
23+
if (!map[key]) {
24+
return false;
25+
}
26+
}
27+
return true;
28+
}
1529
1630
function tabChanged(value: string) {
1731
tab.value = value;
@@ -23,13 +37,16 @@ function join(src: string) {
2337
function generate() {
2438
switch (tab.value) {
2539
case 'user':
40+
if (!validate(user)) return;
2641
link.value = join(`/user/${user.username}?theme=${theme.value}`);
2742
break;
2843
case 'repo':
44+
if (!validate(repo)) return;
2945
link.value = join(`/repo/${repo.username}/${repo.repo}/?theme=${theme.value}`);
3046
break;
31-
case 'release':
32-
//link.value = `https://code-statistic.vercel.app/api?username=zmh-program&repo=code-statistic&theme=${theme}`;
47+
case 'contributor':
48+
if (!validate(contributor)) return;
49+
link.value = join(`/contributor/${contributor.username}/${contributor.repo}/?column=${contributor.column}&theme=${theme.value}`);
3350
break;
3451
}
3552
}
@@ -55,6 +72,19 @@ function generate() {
5572
<t-input placeholder="repository" v-model="repo.repo" />
5673
</t-form-item>
5774
</t-tab-panel>
75+
<t-tab-panel value="contributor" label="Contributor"><br>
76+
<t-form-item label="User">
77+
<t-input-adornment prepend="github.com/">
78+
<t-input placeholder="username" v-model="contributor.username" />
79+
</t-input-adornment>
80+
</t-form-item>
81+
<t-form-item label="Repo">
82+
<t-input placeholder="repository" v-model="contributor.repo" />
83+
</t-form-item>
84+
<t-form-item label="Column">
85+
<t-input placeholder="repository" v-model="contributor.column" />
86+
</t-form-item>
87+
</t-tab-panel>
5888
<t-tab-panel value="release" label="Release">
5989
</t-tab-panel>
6090
</t-tabs>

0 commit comments

Comments
 (0)