11import { Config } from '@/common'
22import { components } from 'node-karin'
3+ import { RepoInfo } from '@/types/web'
4+ import { EventType } from '@/types'
35
4- export const web = ( ) => {
6+ export const web = ( list : RepoInfo [ ] ) => {
57 return [
68 components . accordion . create ( 'github' , {
79 label : 'Github 相关' ,
@@ -20,5 +22,56 @@ export const web = () => {
2022 } ) ,
2123 ] ,
2224 } ) ,
25+ components . accordionPro . create (
26+ 'pushlist:github' ,
27+ list . map ( ( repo ) => {
28+ return {
29+ title : `${ repo . owner } /${ repo . repo } :${ repo . branch } ` ,
30+ subtitle : `${ repo . botId } :${ repo . groupId } ` ,
31+ ...repo ,
32+ }
33+ } ) ,
34+ {
35+ label : 'Github 推送仓库列表' ,
36+ children : components . accordion . createItem ( 'accordion-item-github' , {
37+ children : [
38+ components . input . string ( 'owner' , {
39+ label : '仓库所有者' ,
40+ placeholder : '请输入 Github 仓库所有者' ,
41+ } ) ,
42+ components . input . string ( 'repo' , {
43+ label : '仓库名称' ,
44+ placeholder : '请输入 Github 仓库名称' ,
45+ } ) ,
46+ components . input . string ( 'branch' , {
47+ label : '仓库分支' ,
48+ placeholder : '请输入 Github 仓库分支' ,
49+ } ) ,
50+ components . input . string ( 'botId' , {
51+ label : '推送机器人' ,
52+ placeholder : '请输入 推送机器人账号' ,
53+ } ) ,
54+ components . input . string ( 'groupId' , {
55+ label : '推送群组' ,
56+ placeholder : '请输入 推送群组ID' ,
57+ } ) ,
58+ components . checkbox . group ( 'event' , {
59+ label : '推送事件' ,
60+ checkbox : [
61+ components . checkbox . create ( 'event:push' , {
62+ label : 'push' ,
63+ value : EventType . Push ,
64+ } ) ,
65+ components . checkbox . create ( 'event:release' , {
66+ label : 'release' ,
67+ value : EventType . Release ,
68+ isDisabled : true ,
69+ } ) ,
70+ ] ,
71+ } ) ,
72+ ] ,
73+ } ) ,
74+ } ,
75+ ) ,
2376 ]
2477}
0 commit comments