Skip to content

Commit

Permalink
Merge pull request #37 from fraunhoferfokus/development
Browse files Browse the repository at this point in the history
* improved progress
  • Loading branch information
JGottschick authored Jun 11, 2024
2 parents 34182f5 + a9d82ea commit b67a92d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.26
0.2.27
2 changes: 1 addition & 1 deletion generator/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func generateFrontend(spec *openapi3.T, conf GeneratorConfig) {

// files in pages directory
fs.CopyWebFile("web/pages", restPath, "render.go", true)
fs.CopyWebFile("web/pages", restPath, "progress.go", true)
createFileFromTemplate(filepath.Join(restPath, "progress.go"), "templates/web/pages/progress.go.tmpl", conf)
createFileFromTemplate(filepath.Join(pagesPath, "localize.go"), "templates/web/pages/localize.go.tmpl", conf)
if _, err := os.Stat(filepath.Join(pagesPath, "languages.templ")); errors.Is(err, os.ErrNotExist) {
createFileFromTemplate(filepath.Join(pagesPath, "languages.templ"), "templates/web/pages/languages.templ.tmpl", conf)
Expand Down
3 changes: 2 additions & 1 deletion templates/core/config.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type Config struct {
Tracing bool `default:"false"`
Language string `default:"de"`
Languages []string `default:"en,de"`
UseSse bool `default:"false"`
UseSse bool `default:"false" split_words:"true"`
ProgressDuration int `default:"100" split_words:"true"`
ConfigExt
}

Expand Down
1 change: 1 addition & 0 deletions templates/web/pages/index.templ.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ templ Index(lzr *i18n.Localizer) {
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/htmx.min.js"></script>
<script src="/js/hyperscript.js"></script>
<script src="js/sse.js"></script>
</head>
<body>
@Content(lzr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import (
"time"

"github.com/r3labs/sse/v2"

"{{ lcfirst ( camelcase .ModuleName ) }}/core"
)

// learn medium duration
var durationSum int = 100 // 10 Seconds as initial duration
// ToDo: use a map for more than one progress case
var durationSum int = core.AppConfig.ProgressDuration // initial duration in deciseconds
var durationNb int = 1

const picoNull = `<progress value="0" max="100" />`
Expand Down

0 comments on commit b67a92d

Please sign in to comment.