Skip to content

Commit 2d00120

Browse files
authored
Update proxymanager.go (#135)
1 parent afc9aef commit 2d00120

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

proxy/proxymanager.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,31 @@ func (pm *ProxyManager) upstreamIndex(c *gin.Context) {
334334

335335
// Iterate over sorted keys
336336
for _, modelID := range modelIDs {
337-
html.WriteString(fmt.Sprintf("<li><a href=\"/upstream/%s\">%s</a></li>", modelID, modelID))
337+
// Get process state
338+
processGroup := pm.findGroupByModelName(modelID)
339+
var state string
340+
if processGroup != nil {
341+
process := processGroup.processes[modelID]
342+
if process != nil {
343+
var stateStr string
344+
switch process.CurrentState() {
345+
case StateReady:
346+
stateStr = "Ready"
347+
case StateStarting:
348+
stateStr = "Starting"
349+
case StateStopping:
350+
stateStr = "Stopping"
351+
case StateFailed:
352+
stateStr = "Failed"
353+
case StateShutdown:
354+
stateStr = "Shutdown"
355+
default:
356+
stateStr = "Unknown"
357+
}
358+
state = stateStr
359+
}
360+
}
361+
html.WriteString(fmt.Sprintf("<li><a href=\"/upstream/%s\">%s</a> - %s</li>", modelID, modelID, state))
338362
}
339363
html.WriteString("</ul></body></html>")
340364
c.Header("Content-Type", "text/html")

0 commit comments

Comments
 (0)