diff --git a/README.md b/README.md index ff7bfa3854..a54f3b678b 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,17 @@ supported OS: Linux,Mac,Windows * automatically clone repository from github if you don't have it * instant changing of Configuration*.h files -* filter only changed options overall and for each section -* show help for options +* allow to filter only changed options overall and for each section +* show help for all options * show help for G-codes * show allowed options/gcodes depends your configuration * reset configuration changes -* switch between releases (available after reset) +* switch between releases and update git repository from github * **uploading your old configuration over current** * **compiling and uploading firmware** via PlatformIO * **access to all serial ports** using console manager (Linux/Mac with auto ports changing detection) +* simple 3D tool for positioning printer head in console manager +* **snippets** allow edit upload BootScreen, calculate a step values for various stepper motors * quick navigate with a right sided navigation bar * creating an issue on [Marlin github](https://github.com/MarlinFirmware/Marlin) with your configuration @@ -28,7 +30,7 @@ in project used documentation from [MarlinDocumentation](https://github.com/Marl * [git](https://git-scm.com/downloads) * [PlatformIO](http://docs.platformio.org/en/latest/installation.html) (optional) ## Using -after run - choose a folder with Marlin repo or an empty folder for cloning +After run appears a File dialog and asks to open any empty folder (then will be cloning for last version of marlin from github) or folder with the Marlin git repository # Installation NPM [![npm version](https://badge.fury.io/js/marlin-conf.svg)](https://badge.fury.io/js/marlin-conf) @@ -46,7 +48,7 @@ open terminal in an empty folder or in a folder with Marlin repository and type `mct` and confirm action # Preview -![image](https://cloud.githubusercontent.com/assets/3035266/26492336/2934c98c-421c-11e7-8aab-3ddab57525f3.png) +![image](https://user-images.githubusercontent.com/3035266/26917440-f626e258-4c36-11e7-9d1c-3ae199a497ee.png) ## hints * In clean/unchanged configuration you can change current release version diff --git a/app/server.js b/app/server.js index ea30a6e244..699c8470f9 100644 --- a/app/server.js +++ b/app/server.js @@ -1,4 +1,5 @@ var express = require('express'); +var bodyParser = require('body-parser'); var path = require('path'); var opn = require('opn'); var mctool = require('./mc-tool'); @@ -28,6 +29,8 @@ if (serial_enabled) app.use('/', express.static(path.join(__dirname,'..', 'static'))); app.use('/libs', express.static(path.join(__dirname,'..', 'node_modules'))); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); app.get('/tags', function (req, res) { git.Tags().then(data=>{ @@ -267,6 +270,16 @@ app.get('/bs/default', function (req, res) { .then(a=>res.send(a)) .catch(e=>res.status(403).send(e)) }); +app.post('/bs/custom', function (req, res) { + var name='_Bootscreen.h'; + Promise + .resolve(path.join(__dirname,'..','views',name)) + .then(file=>promisify(fs.readFile)(file,'utf8')) + .then(text=>text.replace(/{{([\w.]+)}}/g,(m,r)=>r.split('.').reduce((p,o)=>(p=p&&p[o],p),req.body))) + .then(file=>git.root().then(p=>promisify(fs.writeFile)(path.join(p,'Marlin',name),file))) + .then(a=>res.end('writed')) + .catch(e=>res.status(403).send(e)) +}); app.get('/bs/custom', function (req, res) { git.root() .then(f=>path.join(f,'Marlin','_Bootscreen.h')) diff --git a/package.json b/package.json index f655d3a0cd..ca7ce120ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "marlin-conf", - "version": "2.7.1", + "version": "2.7.2", "description": "configuration tool for Marlin project", "main": "./index.js", "scripts": { @@ -51,6 +51,7 @@ }, "homepage": "https://github.com/akaJes/marlin-config#readme", "dependencies": { + "body-parser": "^1.17.2", "bootstrap": "4.0.0-alpha.6", "cropper": "^3.0.0-rc.2", "express": "^4.15.2", diff --git a/static/css/toggle.css b/static/css/toggle.css index 0a8204097d..af53d9356f 100644 --- a/static/css/toggle.css +++ b/static/css/toggle.css @@ -24,6 +24,7 @@ display: block; overflow: hidden; cursor: pointer; border: 1px solid #999999; border-radius: 20px; margin-bottom:0; + text-align: left; } .onoffswitch-inner { display: block; width: 200%; margin-left: -100%; diff --git a/static/index.html b/static/index.html index 844f5aa662..b12c9cf0da 100644 --- a/static/index.html +++ b/static/index.html @@ -307,7 +307,7 @@