change cdn/log by cdn/trkret to avoid confusion

This commit is contained in:
philc 2025-02-26 08:53:37 +01:00
parent f9fa110208
commit b1e925a5d8
3 changed files with 6 additions and 4 deletions

View File

@ -35,7 +35,7 @@ Wwws.getwco = (wconame, ctx) => {
if (
!fs.existsSync(filereq) ||
!fs.existsSync(wcoconf) ||
!fs.pathExistsSync(`../${ctx.wcotribe}`)
!fs.pathExistsSync(`../${ctx.tribe}`)
) {
return {
status: 404,
@ -49,11 +49,11 @@ Wwws.getwco = (wconame, ctx) => {
//check that all tpl, tpldata, ... are available for this pagename
if (
wconame == "tracker" &&
!fs.pathExistsSync(`../${ctx.tribe}/objects/wwws/cdn/log`)
!fs.pathExistsSync(`../${ctx.tribe}/objects/wwws/cdn/trkret`)
) {
fs.mkdirSync(`../${ctx.tribe}/objects/wwws/cdn/`, { recursive: true });
fs.cpSync(
`../adminapi/objects/wwws/cdn/log`,
`../adminapi/objects/wwws/cdn/trkret`,
`../${ctx.tribe}/objects/wwws/cdn/`,
{ recursive: true }
);

View File

@ -38,6 +38,7 @@ router.post("/newdevice", checkHeaders, async (req, res) => {
xalias: req.session.header.xalias,
xprofils: req.session.header.xprofils,
};
console.log(req.session.header)
if (!fs.pathExistsSync(`../${req.session.header.xtribe}/objects/devices`)) {
fs.mkdirSync(`../${req.session.header.xtribe}/objects/devices/itm/`, {
recursive: true,
@ -51,7 +52,7 @@ router.post("/newdevice", checkHeaders, async (req, res) => {
lastupdate: 0,
lastupdatedata: "2025-02-23T09:23:56.266Z",
};
fs.outputFileSync(
fs.outputJSONSync(
`../${req.session.header.xtribe}/objects/devices/conf.json`,
confdevice
);

View File

@ -58,6 +58,7 @@ router.get("/getwco/:wconame", (req, res) => {
}else{
const getwco=Wwws.getwco(req.params.wconame.replace(/\.js$/,''),req.query)
if (getwco.status==200){
res.set('Content-Type', 'application/javascript');
res.sendFile(getwco.data.file)
}else{
res.status(getwco.status).json(getwco);