modified: docker-compose.yaml
modified: index.js modified: views/inputs.ejs
This commit is contained in:
parent
af41db4b4d
commit
f7ded6fa57
|
@ -1,7 +1,8 @@
|
|||
services:
|
||||
pills:
|
||||
image: n0rdye/pills
|
||||
container_name: nodejs_pills
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 70:8080
|
||||
volumes:
|
||||
- ./:/usr/src/app
|
||||
|
|
6
index.js
6
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] = {
|
||||
|
|
|
@ -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":"";
|
||||
%>
|
||||
<li class="pill"><label for="<%= i %>"><%= el %></label> <input id="<%= i %>" type="radio" name="pill" value="<%= el %>"></li>
|
||||
<li class="pill"><label for="<%= i %>"><%= el %></label> <input id="<%= i %>" type="radio" name="pill" value="<%= el %>" <%= check %>></li>
|
||||
<%
|
||||
i++;
|
||||
});
|
||||
%>
|
||||
</ul>
|
||||
<input type="text" name="comment" value="-" placeholder="comment">
|
||||
<input type="text" name="comment" value=" " placeholder="comment">
|
||||
<input type="hidden" name="func" value="save">
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user