mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
update
This commit is contained in:
@@ -28,6 +28,7 @@ func GetTorrentDB(hash metainfo.Hash) *Torrent {
|
||||
torr.TorrentSpec = db.TorrentSpec
|
||||
torr.Title = db.Title
|
||||
torr.Poster = db.Poster
|
||||
torr.Timestamp = db.Timestamp
|
||||
torr.Stat = state.TorrentInDB
|
||||
return torr
|
||||
}
|
||||
@@ -47,6 +48,7 @@ func ListTorrentsDB() map[metainfo.Hash]*Torrent {
|
||||
torr.TorrentSpec = db.TorrentSpec
|
||||
torr.Title = db.Title
|
||||
torr.Poster = db.Poster
|
||||
torr.Timestamp = db.Timestamp
|
||||
torr.Stat = state.TorrentInDB
|
||||
ret[torr.TorrentSpec.InfoHash] = torr
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ func SetupRoute(route *gin.Engine) {
|
||||
temp = template.InitTemplate(route)
|
||||
|
||||
route.GET("/", mainPage)
|
||||
route.GET("/api.js", apijsPage)
|
||||
route.GET("/main.js", mainjsPage)
|
||||
// route.GET("/api.js", apijsPage)
|
||||
// route.GET("/main.js", mainjsPage)
|
||||
}
|
||||
|
||||
@@ -12,22 +12,8 @@ const mainPage = `
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
` + header + `
|
||||
<body ng-app="app">
|
||||
<script src="/api.js"></script>
|
||||
<script src="/main.js"></script>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light {{active}}" ng-click="$event.preventDefault()">
|
||||
<div class="navbar-nav">
|
||||
<a href="#" class="nav-item nav-link torrents" ng-click="active='torrents'">Torrents</a>
|
||||
<a href="#" class="nav-item nav-link settings" ng-click="active='settings'">Settings</a>
|
||||
<a href="#" class="nav-item nav-link cache" ng-click="active='cache'">Cache</a>
|
||||
<a href="#" class="nav-item nav-link about" ng-click="active='about'">About</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<p ng-hide="active">Please click a menu item</p>
|
||||
<p ng-show="active">You chose <b>{{active}}</b></p>
|
||||
|
||||
<body>
|
||||
<p> TorrServer ` + version.Version + `</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -8,24 +8,6 @@ import (
|
||||
|
||||
var ctx *gin.Engine
|
||||
|
||||
//
|
||||
// func InitTemplate(route *gin.Engine) {
|
||||
// ctx = route
|
||||
//
|
||||
// tmpl := getTemplate("favicon", faviconB64)
|
||||
// tmpl = getTemplate("header", header)
|
||||
//
|
||||
// route.SetHTMLTemplate(tmpl)
|
||||
// }
|
||||
//
|
||||
// func getTemplate(name, body string) *template.Template {
|
||||
// tmpl, err := template.New(name).ParseFiles(body)
|
||||
// if err != nil {
|
||||
// log.TLogln("error parse template", err)
|
||||
// }
|
||||
// return tmpl
|
||||
// }
|
||||
|
||||
type Template struct {
|
||||
templates *template.Template
|
||||
}
|
||||
@@ -34,8 +16,8 @@ func InitTemplate(c *gin.Engine) *Template {
|
||||
temp := new(Template)
|
||||
|
||||
temp.parsePage("mainPage", mainPage)
|
||||
temp.parsePage("apijsPage", apiJS)
|
||||
temp.parsePage("mainjsPage", mainJS)
|
||||
// temp.parsePage("apijsPage", apiJS)
|
||||
// temp.parsePage("mainjsPage", mainJS)
|
||||
|
||||
c.SetHTMLTemplate(temp.templates)
|
||||
return temp
|
||||
|
||||
Reference in New Issue
Block a user