-
Notifications
You must be signed in to change notification settings - Fork 0
/
probe.go
87 lines (67 loc) · 2.15 KB
/
probe.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// generated code - do not edit
package probe
import (
"embed"
"github.com/gin-gonic/gin"
gongtable_fullstack "github.com/fullstack-lang/gongtable/go/fullstack"
gongtree_fullstack "github.com/fullstack-lang/gongtree/go/fullstack"
gong_fullstack "github.com/fullstack-lang/gong/go/fullstack"
gong_models "github.com/fullstack-lang/gong/go/models"
gongdoc_load "github.com/fullstack-lang/gongdoc/go/load"
form "github.com/fullstack-lang/gongtable/go/models"
tree "github.com/fullstack-lang/gongtree/go/models"
"github.com/fullstack-lang/gongsim/go/models"
"github.com/fullstack-lang/gongsim/go/orm"
)
type Probe struct {
r *gin.Engine
stageOfInterest *models.StageStruct
backRepoOfInterest *orm.BackRepoStruct
gongStage *gong_models.StageStruct
treeStage *tree.StageStruct
formStage *form.StageStruct
tableStage *form.StageStruct
}
func NewProbe(
r *gin.Engine,
goModelsDir embed.FS,
goDiagramsDir embed.FS,
embeddedDiagrams bool,
stackPath string,
stageOfInterest *models.StageStruct,
backRepoOfInterest *orm.BackRepoStruct) (probe *Probe) {
gongStage, _ := gong_fullstack.NewStackInstance(r, stackPath)
gong_models.LoadEmbedded(gongStage, goModelsDir)
// treeForSelectingDate that is on the sidebar
treeStage, _ := gongtree_fullstack.NewStackInstance(r, stackPath+"-sidebar")
// stage for main table
tableStage, _ := gongtable_fullstack.NewStackInstance(r, stackPath+"-table")
tableStage.Commit()
// stage for reusable form
formStage, _ := gongtable_fullstack.NewStackInstance(r, stackPath+"-form")
formStage.Commit()
probe = new(Probe)
probe.r = r
probe.stageOfInterest = stageOfInterest
probe.backRepoOfInterest = backRepoOfInterest
probe.gongStage = gongStage
probe.treeStage = treeStage
probe.formStage = formStage
probe.tableStage = tableStage
fillUpTree(probe)
gongdoc_load.Load(
"",
probe.stageOfInterest.GetType(),
goModelsDir,
goDiagramsDir,
r,
embeddedDiagrams,
&stageOfInterest.Map_GongStructName_InstancesNb)
return
}
func (probe *Probe) Refresh() {
fillUpTree(probe)
}
func (probe *Probe) GetFormStage() *form.StageStruct {
return probe.formStage
}