node-red-contrib-hikvision-ultimate
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -7,4 +7,4 @@ <p align="center"><img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/logo.png' width="40%"></p> | ||
<p> | ||
<b>Version 1.0.19</b> December 2020<br/> | ||
- NEW: you can now share your model and firmware number with other users. Click "Connect and Send" in the config node window. the list will be shown here https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/blob/master/TESTEDWITH.md<br/> | ||
<b>Version 1.0.20</b> December 2020<br/> | ||
- NEW: you can now choose to tell Supergiovane (the developer) that your camera model works with the node. You'll help other users. The list will be shown here https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/blob/master/TESTEDWITH.md<br/> | ||
</p> | ||
@@ -11,0 +11,0 @@ <p> |
{ | ||
"name": "node-red-contrib-hikvision-ultimate", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "A native set of nodes for Hikvision Cameras, Alarms, Radars etc.", | ||
@@ -5,0 +5,0 @@ "author": "Supergiovane (https://github.com/Supergiovane)", |
@@ -332,5 +332,5 @@ | ||
# HIKVISION DEVICES TESTED WITH THE NODE | ||
This is a list of Hikvision models the users own and decided to share. <br/> | ||
This is only a partial model list. Hikvision-Ultimate should work with basically all Hikvision devices.<br/> | ||
[View the list](https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/blob/master/TESTEDWITH.md) | ||
This is a list of Hikvision models the users own and decided to share because it checked working with Hikvision-Ultimate. <br/> | ||
This is only a partial model list. Hikvision-Ultimate should work with basically ALL Hikvision devices.<br/> | ||
[Click HERE to view the list of tested devices](http://www.supergiovane.it:8080/?read=true&md=noCD&fw=no) | ||
@@ -337,0 +337,0 @@ <br/> |
@@ -17,9 +17,11 @@ var http = require('http'); | ||
const sFilePath = "c:\\web\\nodejs\\hik.txt"; | ||
if (!fs.existsSync(sFilePath)) fs.writeFileSync(sFilePath, "NEW LIST CREATED ON " + shortStartDate + "<br/><br/>"); | ||
const sFilePathPage = "c:\\web\\nodejs\\a.htm"; | ||
if (!fs.existsSync(sFilePath)) fs.writeFileSync(sFilePath, ""); | ||
var sFileContent = fs.readFileSync(sFilePath, "utf8"); | ||
var sFileContentPage = fs.readFileSync(sFilePathPage, "utf8"); | ||
var q = url.parse(req.url, true).query; | ||
console.log(shortStartDate + " Received: " + JSON.stringify(q) + " from: " + req.connection.remoteAddress); | ||
if (q.md === undefined || q.fw === undefined || q.nodeid === undefined || q.read === undefined) { | ||
res.writeHead(200, { 'Content-Type': 'text/html' }); | ||
res.write("<b>Sorry but... who are you? An Hacker i suppose</b>.<br/>There is nothing here for you, so please go away.<br/>I've already called the FBI, CSI, NCIS and my bad friend."); | ||
if (q.md === undefined || q.fw === undefined || q.read === undefined) { | ||
res.writeHead(404, { 'Content-Type': 'text/html' }); | ||
res.write("<b>Sorry but... who are you? An Hacker i suppose</b>.<br/>There is nothing here for you, so please go away."); | ||
res.end(); | ||
@@ -30,4 +32,9 @@ return; | ||
// Get the file content | ||
res.writeHead(200, { 'Content-Type': 'text/html' }); | ||
res.write(sFileContent); | ||
var sHTML = sFileContentPage.replace("##MODELLI##", sFileContent); | ||
res.writeHead(200, { | ||
'Content-Length': Buffer.byteLength(sHTML, 'utf8'), | ||
'Content-Type': 'text/html' | ||
}); | ||
//console.log(sHTML) | ||
res.write(sHTML); | ||
res.end(); | ||
@@ -37,13 +44,13 @@ return; | ||
const sModel = decodeURIComponent(q.md); | ||
const sFirmware = decodeURIComponent(q.fw); | ||
const sNodeId = decodeURIComponent(q.nodeid); | ||
//const sFirmware = decodeURIComponent(q.fw); | ||
// Controllo che non esista già | ||
const sArrivato = "<br/>" + sModel + " (Firmware " + sFirmware + ") -- ID: " + sNodeId; | ||
//const sArrivato = "<br/>" + sModel + " (Firmware " + sFirmware + ")"; | ||
const sArrivato = "<br/>" + sModel; | ||
res.writeHead(200, { 'Content-Type': 'text/html' }); | ||
if (sFileContent.indexOf(sArrivato) === -1) { | ||
sFileContent += sArrivato + " -- Sent on " + shortStartDate; | ||
sFileContent += sArrivato; | ||
fs.writeFileSync(sFilePath, sFileContent); | ||
res.write("<b>You sent</b>" + sArrivato + "<br/>No other data nor personal infos have been sent.<br/>Thank you very much."); //write a response to the client | ||
} else { | ||
res.write("<b>You've already sent</b>" + sArrivato + "<br/>Thank you anyway"); | ||
res.write("<b>There is already a </b>" + sArrivato + "<br/>Thank you anyway"); | ||
} | ||
@@ -58,2 +65,2 @@ res.end(); //end the response | ||
// Read | ||
// http://www.supergiovane.it:8080/?read=true&md=noCD&fw=no&nodeid=no | ||
// http://www.supergiovane.it:8080/?read=true&md=noCD&fw=no |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1225827
1133
40