2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

fhemweb.js: show .js version info (Forum #48362)

git-svn-id: https://svn.fhem.de/fhem/trunk@13579 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-03-02 12:39:59 +00:00
parent 3f975c3925
commit d46186c42e
4 changed files with 31 additions and 6 deletions

View File

@ -1,5 +1,5 @@
"use strict";
// $Id$
FW_version["console.js"] = "$Id$";
var consConn;

View File

@ -1,6 +1,6 @@
"use strict";
// $Id$
var FW_version={};
FW_version["fhemweb.js"] = "$Id$";
var FW_serverGenerated;
var FW_serverFirstMsg = (new Date()).getTime()/1000;
@ -165,7 +165,13 @@ FW_jqueryReadyFn()
return;
$(this).on("submit", function(e) {
var val = $(input).val();
if(val.match(/^\s*shutdown/)) {
if(val.match(/^\s*ver.*/)) {
e.preventDefault();
$(input).val("");
return FW_showVersion(val);
} else if(val.match(/^\s*shutdown/)) {
FW_cmd(FW_root+"?XHR=1&cmd="+val);
$(input).val("");
return false;
@ -236,6 +242,25 @@ FW_jqueryReadyFn()
FW_rawDef();
}
function
FW_showVersion(val)
{
FW_cmd(FW_root+"?cmd="+encodeURIComponent(val)+"&XHR=1", function(data){
var list = Object.keys(FW_version);
list.sort();
for(var i1=0; i1<list.length; i1++) {
var ma = /\$Id: ([^ ]*) (.*) \$/.exec(FW_version[list[i1]]);
if(ma) {
if(ma[1].length < 18)
ma[1] = (ma[1]+" ").substr(0,18);
data += "\n"+ma[1]+" "+ma[2];
}
}
FW_okDialog('<pre>'+data+'</pre>');
});
return false;
}
function
FW_filterIcons()
{

View File

@ -1,5 +1,5 @@
"use strict";
// $Id$"
FW_version["svg.js"] = "$Id$";
if(!svgNS) {
var svgNS = "http://www.w3.org/2000/svg";

View File

@ -1,5 +1,5 @@
"use strict";
// $Id$
FW_version["zwave_neighborlist.js"] = "$Id$";
var zw_visible;
var svgns = 'xmlns="http://www.w3.org/2000/svg"';