Version Info

This commit is contained in:
vexorian 2020-07-27 17:13:52 -04:00
parent f9dd2af4d4
commit 3d9673a13d
9 changed files with 43 additions and 4 deletions

View File

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

View File

@ -34,7 +34,6 @@
"dist/resources/**/*"
],
"targets": [
"x86",
"x64",
"linux",
"macos",

View File

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

View File

@ -1,3 +1,4 @@
module.exports = {
SLACK: 9999,
VERSION_NAME: "0.5.4"
}

View File

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

View File

@ -0,0 +1,8 @@
module.exports = function ($scope, pseudotv) {
$scope.version = "Getting PseudoTV version..."
pseudotv.getVersion().then((version) => {
$scope.version = version.pseudotv
})
}

View File

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

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

View File

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