File tree Expand file tree Collapse file tree 5 files changed +27
-5
lines changed Expand file tree Collapse file tree 5 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ type Repo struct {
20
20
Timeout string `yaml:"timeout"`
21
21
Pull string `yaml:"pull"`
22
22
Push string `yaml:"push"`
23
+ AddPush string `yaml:"addpush"`
23
24
}
24
25
25
26
// GuiData - web gui data
@@ -28,5 +29,4 @@ type GuiData struct {
28
29
Icon string
29
30
Repos []Repo
30
31
Themes []string
31
- Path string
32
32
}
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ func updateHandler(w http.ResponseWriter, r *http.Request) {
50
50
repo .Pull = r .FormValue ("pull" )
51
51
repo .Push = r .FormValue ("push" )
52
52
repo .Timeout = r .FormValue ("timeout" )
53
+ repo .AddPush = r .FormValue ("addpush" )
53
54
54
55
var newRepos []models.Repo
55
56
for i := range AllRepos {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ func editHandler(w http.ResponseWriter, r *http.Request) {
21
21
22
22
for _ , oneRepo := range AllRepos {
23
23
if oneRepo .ID == id {
24
- guiData .Path = oneRepo . Path
24
+ guiData .Repos = append ( guiData . Repos , oneRepo )
25
25
26
26
file1 , err := os .ReadFile (oneRepo .Path + "/.git/config" )
27
27
check .IfError (err )
Original file line number Diff line number Diff line change 7
7
< p > Edit .git/config</ p >
8
8
< form action ="/save_file/ " method ="post ">
9
9
< input name ="file " value ="config " type ="hidden ">
10
+ {{ range .Repos }}
10
11
< input name ="path " value ="{{ .Path }} " type ="hidden ">
11
- < textarea name ="text " rows ="15 " class ="form-control "> {{index .Themes 0}}</ textarea >
12
+ {{ end }}
13
+ < textarea name ="text " rows ="15 " class ="form-control "> {{ index .Themes 0 }}</ textarea >
12
14
< button type ="submit " class ="btn btn-primary "> Save</ button >
13
15
</ form >
14
16
</ div >
15
17
< div class ="col ">
16
18
< p > Edit .gitignore</ p >
17
19
< form action ="/save_file/ " method ="post ">
18
20
< input name ="file " value ="ignore " type ="hidden ">
21
+ {{ range .Repos }}
19
22
< input name ="path " value ="{{ .Path }} " type ="hidden ">
20
- < textarea name ="text " rows ="15 " class ="form-control "> {{index .Themes 1}}</ textarea >
23
+ {{ end }}
24
+ < textarea name ="text " rows ="15 " class ="form-control "> {{ index .Themes 1 }}</ textarea >
21
25
< button type ="submit " class ="btn btn-primary "> Save</ button >
22
26
</ form >
23
27
</ div >
24
28
</ div >
29
+ < br >
30
+ < div class ="row ">
31
+ < p > Additional push command</ p >
32
+ {{ range .Repos }}
33
+ < form action ="/update_repo/ " method ="post " class ="input-group ">
34
+ < input name ="id " value ="{{ .ID }} " type ="hidden ">
35
+ < input name ="name " value ="{{ .Name }} " type ="hidden ">
36
+ < input name ="path " value ="{{ .Path }} " type ="hidden ">
37
+ < input name ="timeout " value ="{{ .Timeout }} " type ="hidden ">
38
+ < input name ="pull " value ="{{ .Pull }} " type ="hidden ">
39
+ < input name ="push " value ="{{ .Push }} " type ="hidden ">
40
+ < input name ="addpush " type ="text " class ="form-control " value ="{{ .AddPush }} ">
41
+ < button type ="submit " class ="btn btn-primary "> Save</ button >
42
+ </ form >
43
+ {{ end }}
44
+ </ div >
25
45
</ div >
26
46
27
47
Original file line number Diff line number Diff line change 42
42
</ a >
43
43
</ td >
44
44
< form action ="/update_repo/ " method ="post ">
45
- < input name ="id " type ="hidden " class ="form-control " value ="{{ .ID }} ">
45
+ < input name ="id " type ="hidden " value ="{{ .ID }} ">
46
+ < input name ="addpush " type ="hidden " value ="{{ .AddPush }} ">
46
47
< td > < input name ="name " type ="text " class ="form-control " value ="{{ .Name }} "> </ td >
47
48
< td > < input name ="path " type ="text " class ="form-control " value ="{{ .Path }} "> </ td >
48
49
{{ if eq .Pull "yes" }}
You can’t perform that action at this time.
0 commit comments