timer in runindex odmdb abd duist package json for wwws

This commit is contained in:
philc 2025-05-06 10:09:36 +02:00
parent 8e373b3dca
commit 3b9d50417d
3 changed files with 16 additions and 11 deletions

View File

@ -788,7 +788,7 @@ Odmdb.cud = (objectPathname, crud, itm, role, runindex = true) => {
* *
*/ */
Odmdb.runidx = (objectPathname, schema) => { Odmdb.runidx = (objectPathname, schema) => {
//if (log) console.log(currentmod, `idx for ${objectPathname}`); const starttime=process.hrtime.bigint();
if (!schema || !schema.apxid) { if (!schema || !schema.apxid) {
const getschema = Odmdb.Schema(objectPathname, true); const getschema = Odmdb.Schema(objectPathname, true);
if (getschema.status != 200) { if (getschema.status != 200) {
@ -898,6 +898,8 @@ Odmdb.runidx = (objectPathname, schema) => {
ventil[n].data ventil[n].data
); );
}); });
const duration= Number(process.hrtime.bigint()-starttime)/1e6;
if (log) console.log(currentmod, `idx for ${objectPathname} elapse time: ${duration.toFixed(3)} ms`);
}; };
module.exports = Odmdb; module.exports = Odmdb;

View File

@ -100,8 +100,8 @@ Wwws.getwco = (wconame, ctx) => {
: webpageinit; : webpageinit;
// check that webconf for tailwindcsscontent property exist for this wco request // check that webconf for tailwindcsscontent property exist for this wco request
const pathtocheckfortw = [ const pathtocheckfortw = [
`../adminapi/objects/wco/${wconame}/*.{html,js,mustache}`, `../../../../../../../adminapi/objects/wco/${wconame}/*.{html,js,mustache}`,
`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/**/*.{html,js,mustache}`, `../../../../../../../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/**/*.{html,js,mustache}`,
]; ];
if (!webpage.tailwindcsscontent) { if (!webpage.tailwindcsscontent) {
webpage.tailwindcsscontent = []; webpage.tailwindcsscontent = [];
@ -202,8 +202,11 @@ Wwws.getwco = (wconame, ctx) => {
// save the conf for update localdb when the web page request it // save the conf for update localdb when the web page request it
fs.outputJSONSync(webconf, webpage, { spaces: 2 }); fs.outputJSONSync(webconf, webpage, { spaces: 2 });
// create a text file with component to watch for tailwind // create a text file with component to watch for tailwind
let sourcetw=""
fs.outputFileSync(`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/static/css/watchtailwind.txt`,webpage.tailwindcsscontent.join("\n"),"utf-8"); webpage.tailwindcsscontent.forEach(s=>{
sourcetw+=`@source "${s}";\n`
})
fs.outputFileSync(`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/static/css/sourcetw.css`,sourcetw,"utf-8");
return { return {
status: 200, status: 200,
ref: "Wwws", ref: "Wwws",

View File

@ -20,8 +20,8 @@
"publishwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/wall-ants/tribes/$space/..", "publishwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/wall-ants/tribes/$space/..",
"publishhouse": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@house-ants://home/phil/apxtowns/house-ants/tribes/$space/..", "publishhouse": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@house-ants://home/phil/apxtowns/house-ants/tribes/$space/..",
"src": "echo '$tribe -- $webapp'", "src": "echo '$tribe -- $webapp'",
"src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch --config ../$tribe/objects/wwws/$webapp/tailwind.config.js", "src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch",
"dist:css": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/twstyle.css" "dist:jscss": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/twstyle.css"
}, },
"commentscript": "cf wiki apxtri doc for details: yarn startpm2 -n teswallants, yarn pm2 stop testwallants, yarn pm2 delete testwallants, yarn pm2 logs --lines 200 testwall, yarn pm2 monit -n testwallants, yarn pm2 save tribe=tribeid yarn apidoc to build apidoc // space=adminapi/www/cdn/apidoc yarn publishtestwall ", "commentscript": "cf wiki apxtri doc for details: yarn startpm2 -n teswallants, yarn pm2 stop testwallants, yarn pm2 delete testwallants, yarn pm2 logs --lines 200 testwall, yarn pm2 monit -n testwallants, yarn pm2 save tribe=tribeid yarn apidoc to build apidoc // space=adminapi/www/cdn/apidoc yarn publishtestwall ",
"maintainers": [ "maintainers": [
@ -55,13 +55,13 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/cli": "^4.1.4",
"apidoc": "^1.2.0", "apidoc": "^1.2.0",
"async": "^3.2.0", "async": "^3.2.0",
"axios": "^1.7.8", "axios": "^1.7.8",
"bcrypt": "^5.0.0", "bcrypt": "^5.0.0",
"cors": "^2.8.4", "cors": "^2.8.4",
"daisyui": "^5.0.12", "daisyui": "^5.0.28",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dns-sync": "^0.2.1", "dns-sync": "^0.2.1",
"express": "^4.21.1", "express": "^4.21.1",
@ -81,7 +81,7 @@
"sharp": "^0.33.5", "sharp": "^0.33.5",
"smtp-client": "^0.4.0", "smtp-client": "^0.4.0",
"stripe": "^17.3.1", "stripe": "^17.3.1",
"tailwindcss": "^4.0.15", "tailwindcss": "^4.1.4",
"uuid": "^11.0.2" "uuid": "^11.0.2"
}, },
"devDependencies": { "devDependencies": {