Splash tweaks

This commit is contained in:
Christopher LaPointe
2023-05-25 22:06:16 -04:00
parent 6cf0ab301c
commit af94d29dd3
5 changed files with 15 additions and 7 deletions

View File

@@ -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
} }

View File

@@ -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 {

View File

@@ -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>

View File

@@ -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,
}) })

View File

@@ -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
} }