mirror of
https://github.com/zix99/traefik-lazyload.git
synced 2025-12-21 13:23:04 +01:00
Splash tweaks
This commit is contained in:
@@ -15,6 +15,7 @@ const httpAssetPrefix = "/__llassets/"
|
|||||||
|
|
||||||
type SplashModel struct {
|
type SplashModel struct {
|
||||||
Name string
|
Name string
|
||||||
|
CID string
|
||||||
WaitForCode int
|
WaitForCode int
|
||||||
WaitForPath string
|
WaitForPath string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,13 @@ body {
|
|||||||
|
|
||||||
.message {
|
.message {
|
||||||
margin: 16px;
|
margin: 16px;
|
||||||
font-size: 1.6em;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message h1,h2,h3 {
|
||||||
|
margin: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.square {
|
.square {
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
<div class="square last"></div>
|
<div class="square last"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="message">
|
<div class="message">
|
||||||
Starting {{.Name}}
|
<h2>Starting {{.Name}}</h2>
|
||||||
|
<h3>{{.CID}}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
1
main.go
1
main.go
@@ -78,6 +78,7 @@ func ContainerHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusAccepted)
|
w.WriteHeader(http.StatusAccepted)
|
||||||
renderErr := splashTemplate.Execute(w, SplashModel{
|
renderErr := splashTemplate.Execute(w, SplashModel{
|
||||||
Name: host,
|
Name: host,
|
||||||
|
CID: sOpts.ContainerName,
|
||||||
WaitForCode: sOpts.WaitForCode,
|
WaitForCode: sOpts.WaitForCode,
|
||||||
WaitForPath: sOpts.WaitForPath,
|
WaitForPath: sOpts.WaitForPath,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -56,8 +56,9 @@ func (s *Core) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type StartResult struct {
|
type StartResult struct {
|
||||||
WaitForCode int
|
WaitForCode int
|
||||||
WaitForPath string
|
WaitForPath string
|
||||||
|
ContainerName string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Core) StartHost(hostname string) (*StartResult, error) {
|
func (s *Core) StartHost(hostname string) (*StartResult, error) {
|
||||||
@@ -75,8 +76,9 @@ func (s *Core) StartHost(hostname string) (*StartResult, error) {
|
|||||||
if ets, exists := s.active[ct.ID]; exists {
|
if ets, exists := s.active[ct.ID]; exists {
|
||||||
logrus.Debugf("Asked to start host, but we already think it's started: %s", ets.name)
|
logrus.Debugf("Asked to start host, but we already think it's started: %s", ets.name)
|
||||||
return &StartResult{
|
return &StartResult{
|
||||||
WaitForCode: ets.waitForCode,
|
WaitForCode: ets.waitForCode,
|
||||||
WaitForPath: ets.waitForPath,
|
WaitForPath: ets.waitForPath,
|
||||||
|
ContainerName: containerShort(ct),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user