add gcode macro link, rm dynamic style loader, add contributed ender 7 profile

This commit is contained in:
Stewart Allen 2025-11-29 01:08:44 -05:00
commit fd8a374eed
8 changed files with 183 additions and 160 deletions

View file

@ -1,9 +1,9 @@
// back end for device export in dev mode
module.exports = function(server) {
server.inject("kiri", "kiri.js");
if (!server.env.debug) {
return;
}
server.inject("kiri", "kiri.js");
const fs = require('fs');
server.api.postDevice = (req, res, next) => {
server.handler.decodePost(req, res, () => {
@ -16,7 +16,7 @@ module.exports = function(server) {
}
const { mode } = device;
const { deviceName } = device;
const path = `${server.const.rootdir}/src/kiri-dev/${mode.toLowerCase()}/${deviceName.replace(/\ /g,'.')}`;
const path = `${server.const.rootdir}/src/kiri/dev/${mode.toLowerCase()}/${deviceName.replace(/\ /g,'.')}`;
// console.log({ mode, device, process, path });
fs.writeFileSync(path, JSON.stringify(device, undefined, 4));
res.end('profile saved');

View file

@ -4,7 +4,7 @@ self.kiri.load(api => {
let deviceExport = api.device.export;
api.device.export = (exp, name, opt = {}) => {
const { event, record } = opt;
if (event && event.shiftKey & api.const.LOCAL) {
if (event && event.shiftKey) {
const { code, process, profiles } = record;
fetch("/api/postDevice", {
method: "POST",
@ -12,7 +12,7 @@ self.kiri.load(api => {
})
.then(r => r.text())
.then(t => {
// console.log({server_said: t});
console.log({server_said: t});
api.show.alert('profile saved to server');
});
} else {