From f7ded6fa57e2b9c4f674cb402503fe9d9383f25d Mon Sep 17 00:00:00 2001 From: n0rdye Date: Wed, 22 Feb 2023 02:44:08 +0500 Subject: [PATCH] modified: docker-compose.yaml modified: index.js modified: views/inputs.ejs --- docker-compose.yaml | 3 ++- index.js | 6 +++++- views/inputs.ejs | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 72709c4..62416e2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,8 @@ services: pills: image: n0rdye/pills + container_name: nodejs_pills ports: - - 8080:8080 + - 70:8080 volumes: - ./:/usr/src/app diff --git a/index.js b/index.js index bf1d3cf..25bf066 100644 --- a/index.js +++ b/index.js @@ -84,8 +84,12 @@ function jwrite(jdata){ } }) } + + + function jwrite_pill(name,pill,date,comment){ - comment = (comment==""||comment==null&&comment==" ")? "-":comment; + comment = (comment==""||comment==null||comment==" "||comment==undefined||comment==" ")? "-":comment; + // console.log(comment,"||"); fs.readFile('./pills.json','utf8',(err,data)=>{ let jdata = JSON.parse(data); jdata[name] = { diff --git a/views/inputs.ejs b/views/inputs.ejs index ae69ed4..6c64319 100644 --- a/views/inputs.ejs +++ b/views/inputs.ejs @@ -32,13 +32,14 @@ let pills = ["4/2","4/1","4","2","2/1","1","0"]; let i=0; pills.forEach(el => { + let check = (el=="4")? "checked":""; %> -
  • +
  • >
  • <% i++; }); %> - + \ No newline at end of file