Assign links outside repair
This commit is contained in:
@@ -26,6 +26,7 @@ type RootResponse struct {
|
||||
Infuse string `json:"infuse"`
|
||||
Logs string `json:"logs"`
|
||||
UserInfo *realdebrid.User `json:"user_info"` // Replace UserInfoType with the actual type
|
||||
LibrarySize int `json:"library_size"` // Number of torrents in the library
|
||||
MemAlloc uint64 `json:"mem_alloc"` // Memory allocation in MB
|
||||
TotalAlloc uint64 `json:"total_alloc"` // Total memory allocated in MB
|
||||
Sys uint64 `json:"sys"` // System memory in MB
|
||||
@@ -47,20 +48,23 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
|
||||
var mem runtime.MemStats
|
||||
runtime.ReadMemStats(&mem)
|
||||
|
||||
allTorrents, _ := zr.torMgr.DirectoryMap.Get(config.ALL_TORRENTS)
|
||||
|
||||
response := RootResponse{
|
||||
Version: version.GetVersion(),
|
||||
BuiltAt: version.GetBuiltAt(),
|
||||
GitCommit: version.GetGitCommit(),
|
||||
Html: fmt.Sprintf("//%s/http/", req.Host),
|
||||
Dav: fmt.Sprintf("//%s/dav/", req.Host),
|
||||
Infuse: fmt.Sprintf("//%s/infuse/", req.Host),
|
||||
Logs: fmt.Sprintf("//%s/logs/", req.Host),
|
||||
UserInfo: userInfo,
|
||||
MemAlloc: bToMb(mem.Alloc),
|
||||
TotalAlloc: bToMb(mem.TotalAlloc),
|
||||
Sys: bToMb(mem.Sys),
|
||||
NumGC: mem.NumGC,
|
||||
PID: os.Getpid(),
|
||||
Version: version.GetVersion(),
|
||||
BuiltAt: version.GetBuiltAt(),
|
||||
GitCommit: version.GetGitCommit(),
|
||||
Html: fmt.Sprintf("//%s/http/", req.Host),
|
||||
Dav: fmt.Sprintf("//%s/dav/", req.Host),
|
||||
Infuse: fmt.Sprintf("//%s/infuse/", req.Host),
|
||||
Logs: fmt.Sprintf("//%s/logs/", req.Host),
|
||||
UserInfo: userInfo,
|
||||
LibrarySize: allTorrents.Count(),
|
||||
MemAlloc: bToMb(mem.Alloc),
|
||||
TotalAlloc: bToMb(mem.TotalAlloc),
|
||||
Sys: bToMb(mem.Sys),
|
||||
NumGC: mem.NumGC,
|
||||
PID: os.Getpid(),
|
||||
Sponsor: SponsorResponse{
|
||||
Patreon: "https://www.patreon.com/debridmediamanager",
|
||||
Github: "https://github.com/sponsors/debridmediamanager",
|
||||
@@ -103,6 +107,10 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
|
||||
<td>Logs</td>
|
||||
<td colspan="2"><a href="%s">%s</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Library Size</td>
|
||||
<td colspan="2">%d items</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory Allocation</td>
|
||||
<td colspan="2">%d MB</td>
|
||||
@@ -162,7 +170,7 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
|
||||
<td>%s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="23">Config</td>
|
||||
<td rowspan="22">Config</td>
|
||||
<td>Version</td>
|
||||
<td>%s</td>
|
||||
</tr>
|
||||
@@ -298,6 +306,7 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
|
||||
response.Infuse,
|
||||
response.Logs,
|
||||
response.Logs,
|
||||
response.LibrarySize,
|
||||
response.MemAlloc,
|
||||
response.TotalAlloc,
|
||||
response.Sys,
|
||||
|
||||
Reference in New Issue
Block a user