Version Info
This commit is contained in:
parent
f9dd2af4d4
commit
3d9673a13d
4
index.js
4
index.js
@ -1,4 +1,3 @@
|
||||
var pseudotvVersion = "0.5.3-testing";
|
||||
|
||||
const db = require('diskdb')
|
||||
const fs = require('fs')
|
||||
@ -14,8 +13,9 @@ const HDHR = require('./src/hdhr')
|
||||
const xmltv = require('./src/xmltv')
|
||||
const Plex = require('./src/plex');
|
||||
const channelCache = require('./src/channel-cache');
|
||||
const constants = require('./src/constants')
|
||||
|
||||
console.log("PseudoTV Version: " + pseudotvVersion)
|
||||
console.log("PseudoTV Version: " + constants.VERSION_NAME)
|
||||
|
||||
for (let i = 0, l = process.argv.length; i < l; i++) {
|
||||
if ((process.argv[i] === "-p" || process.argv[i] === "--port") && i + 1 !== l)
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
"dist/resources/**/*"
|
||||
],
|
||||
"targets": [
|
||||
"x86",
|
||||
"x64",
|
||||
"linux",
|
||||
"macos",
|
||||
|
||||
@ -3,11 +3,16 @@ const express = require('express')
|
||||
const fs = require('fs')
|
||||
const defaultSettings = require('./defaultSettings')
|
||||
const channelCache = require('./channel-cache')
|
||||
const constants = require('./constants')
|
||||
|
||||
module.exports = { router: api }
|
||||
function api(db, xmltvInterval) {
|
||||
let router = express.Router()
|
||||
|
||||
router.get('/api/version', (req, res) => {
|
||||
res.send( { "pseudotv" : constants.VERSION_NAME } )
|
||||
})
|
||||
|
||||
// Plex Servers
|
||||
router.get('/api/plex-servers', (req, res) => {
|
||||
let servers = db['plex-servers'].find()
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
module.exports = {
|
||||
SLACK: 9999,
|
||||
VERSION_NAME: "0.5.4"
|
||||
}
|
||||
@ -20,6 +20,7 @@ app.directive('channelConfig', require('./directives/channel-config'))
|
||||
|
||||
app.controller('settingsCtrl', require('./controllers/settings'))
|
||||
app.controller('channelsCtrl', require('./controllers/channels'))
|
||||
app.controller('versionCtrl', require('./controllers/version'))
|
||||
|
||||
app.config(function ($routeProvider) {
|
||||
$routeProvider
|
||||
@ -31,6 +32,10 @@ app.config(function ($routeProvider) {
|
||||
templateUrl: "views/channels.html",
|
||||
controller: 'channelsCtrl'
|
||||
})
|
||||
.when("/version", {
|
||||
templateUrl: "views/version.html",
|
||||
controller: 'versionCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: "channels"
|
||||
})
|
||||
|
||||
8
web/controllers/version.js
Normal file
8
web/controllers/version.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = function ($scope, pseudotv) {
|
||||
$scope.version = "Getting PseudoTV version..."
|
||||
pseudotv.getVersion().then((version) => {
|
||||
$scope.version = version.pseudotv
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
@ -18,7 +18,7 @@
|
||||
</a>
|
||||
</small>
|
||||
</h1>
|
||||
<a href="#!/channels">Channels</a> - <a href="#!/settings">Settings</a>
|
||||
<a href="#!/channels">Channels</a> - <a href="#!/settings">Settings</a> - <a href="#!/version">Version</a>
|
||||
<span class="pull-right">
|
||||
<span style="margin-right: 15px;">
|
||||
<a href="/api/xmltv.xml">XMLTV <span class="fa fa-file-code-o"></span></a>
|
||||
|
||||
18
web/public/views/version.html
Normal file
18
web/public/views/version.html
Normal file
@ -0,0 +1,18 @@
|
||||
<div>
|
||||
|
||||
<h5>
|
||||
Version Info
|
||||
</h5>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th width="120">Component</th>
|
||||
<th width="120">Version</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PseudoTV</td>
|
||||
<td>{{version}}</td>
|
||||
</tr>
|
||||
<!-- coming soon, ffmpeg version, nodejs version, plex version, whatever can be used to help debug things-->
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@ -1,5 +1,8 @@
|
||||
module.exports = function ($http) {
|
||||
return {
|
||||
getVersion: () => {
|
||||
return $http.get('/api/version').then((d) => { return d.data })
|
||||
},
|
||||
getPlexServers: () => {
|
||||
return $http.get('/api/plex-servers').then((d) => { return d.data })
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user