marlin-conf
Advanced tools
Comparing version 2.5.5 to 2.5.6
@@ -15,12 +15,12 @@ var express = require('express'); | ||
var http = require('http'); | ||
var ua = require('universal-analytics'); | ||
var promisify = require('./helpers').promisify; | ||
var port = 3000; | ||
var server = http.Server(app); | ||
var visitor = ua('UA-99239389-1'); | ||
app.use('/static', express.static(path.join(__dirname,'..', 'static'))); | ||
app.use('/static/libs', express.static(path.join(__dirname,'..', 'node_modules'))); | ||
app.use('/', express.static(path.join(__dirname,'..', 'static'))); | ||
app.use('/libs', express.static(path.join(__dirname,'..', 'node_modules'))); | ||
app.get('/', function (req, res) { | ||
res.send('Hello World!'); | ||
}); | ||
app.get('/tags', function (req, res) { | ||
@@ -106,3 +106,3 @@ git.Tags().then(data=>{ | ||
}); | ||
list.push({type:'info',pkg:pjson}) | ||
// list.push({type:'info',pkg:pjson}) | ||
return Promise.all(list) | ||
@@ -114,9 +114,20 @@ } | ||
}); | ||
app.get('/version', function (req, res) { | ||
res.set('Content-Type', 'image/svg+xml'); | ||
var badge={ | ||
text: { name:"marlin-conf", version:pjson.version }, | ||
width: { text:83, version:39, total:122 }, | ||
position: { version:88 } | ||
}; | ||
var file=path.join(__dirname,'..','views','version.html'); | ||
return promisify(fs.readFile)(file,'utf8') | ||
.then(v=>{ | ||
res.end(v.replace(/{{([\w.]+)}}/g,(m,r)=>r.split('.').reduce((p,o)=>(p=p&&p[o],p),badge))); | ||
}); | ||
}); | ||
app.get('/version/:screen', function (req, res) { | ||
res.set('Content-Type', 'text/plain'); | ||
if (1||!/\/jes/.test(process.cwd())) | ||
res.write(` | ||
ga('create', 'UA-99239389-1', 'auto'); | ||
ga('send', 'screenview',{ 'appName': 'marlin-conf', 'appVersion': '${pjson.version}', 'screenName': '${req.params.screen}' }); | ||
`); | ||
if (!/\/jes/.test(process.cwd())) | ||
visitor.screenview(req.params.screen, pjson.name,pjson.version).send() | ||
pio.isPIO() | ||
@@ -129,3 +140,3 @@ // .then(pio.list) | ||
var s=JSON.stringify(a); | ||
res.write(`var config={pio:${s}};`); | ||
res.write(`var config={pio:${s},version:"${pjson.version}"}`); | ||
res.end(); | ||
@@ -141,4 +152,13 @@ }) | ||
}); | ||
function atob(b64string){ | ||
if (typeof Buffer.from === "function") | ||
// Node 5.10+ | ||
return Buffer.from(b64string, 'base64'); | ||
else | ||
// older Node versions | ||
return new Buffer(b64string, 'base64'); | ||
} | ||
app.get('/pio-flash/:port', function (req, res) { | ||
var port=Buffer.from(req.params.port,'base64').toString(); | ||
var port=atob(req.params.port).toString(); | ||
var params=['run','-t','upload']; | ||
@@ -256,5 +276,5 @@ var close=false; | ||
server.listen(port, function () { | ||
console.log('Marlin config tooll started on port http://localhost:'+port); | ||
console.log('Marlin config tool started on port http://localhost:'+port); | ||
}); | ||
opn('http://localhost:'+port+'/static'); | ||
opn('http://localhost:'+port+'/'); | ||
}); | ||
@@ -261,0 +281,0 @@ }) |
{ | ||
"name": "marlin-conf", | ||
"version": "2.5.5", | ||
"version": "2.5.6", | ||
"description": "configuration tool for Marlin project", | ||
@@ -40,2 +40,3 @@ "scripts": { | ||
"tty2html": "^1.0.0", | ||
"universal-analytics": "^0.4.13", | ||
"which": "^1.2.14" | ||
@@ -42,0 +43,0 @@ }, |
# marlin-config | ||
This is a help tool, intended for easy configuration of [Marlin firmware](https://github.com/MarlinFirmware/Marlin) supported OS: Linux,Mac,Windows | ||
This is a help tool, intended for easy configuration of [Marlin firmware](https://github.com/MarlinFirmware/Marlin) | ||
supported OS: Linux,Mac,Windows | ||
# Features: | ||
@@ -25,5 +27,8 @@ | ||
# Installation | ||
[](https://badge.fury.io/js/marlin-conf) | ||
`sudo npm -g i marlin-conf` | ||
some hints for [Windows-Installation](https://github.com/akaJes/marlin-config/wiki/Windows-Installation) | ||
# Dependencies | ||
@@ -30,0 +35,0 @@ |
@@ -298,6 +298,2 @@ function _add(tmpl){ | ||
}) | ||
if (file.type=='info'){ | ||
$('.mct-version').attr('href',file.pkg.homepage).text(file.pkg.name+' v'+file.pkg.version) | ||
return; | ||
} | ||
$('.mct-tags').eq(0).text(file.tag) | ||
@@ -304,0 +300,0 @@ var href='card-'+file.file.name; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
397260
186
2590
93
18
+ Addeduniversal-analytics@^0.4.13
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduniversal-analytics@0.4.23(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)