ui fixes
This commit is contained in:
		
							
								
								
									
										9
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								index.js
									
									
									
									
									
								
							| @ -26,6 +26,7 @@ app.use(express.urlencoded({ | |||||||
| })); | })); | ||||||
| app.use(express.static('public')); | app.use(express.static('public')); | ||||||
| app.use(cookieParser()); | app.use(cookieParser()); | ||||||
|  | var week = 7 * 24 * 3600 * 1000; | ||||||
|  |  | ||||||
|  |  | ||||||
| app.post('/back_login', (req, res) => { | app.post('/back_login', (req, res) => { | ||||||
| @ -42,7 +43,7 @@ app.post('/back_login', (req, res) => { | |||||||
|             db.gv("users","login",`'${ilogin}'`,(udata)=>{udata = udata[0]; |             db.gv("users","login",`'${ilogin}'`,(udata)=>{udata = udata[0]; | ||||||
|                 if(ipass == udata["pass"]){ |                 if(ipass == udata["pass"]){ | ||||||
|                     console.log(udata["uuid"]+" logged in by login & pass from "+cook["sid"]); |                     console.log(udata["uuid"]+" logged in by login & pass from "+cook["sid"]); | ||||||
|                     res.cookie("uuid",udata["uuid"],{maxAge:1000000,path:"/;SameSite=Lax"}); |                     res.cookie("uuid",udata["uuid"],{maxAge:week,path:"/;SameSite=None"}); | ||||||
|  |  | ||||||
|                     // db.sv("users","sids",sids += inp["sid"]+";","uuid",udata["uuid"],()=>{});  |                     // db.sv("users","sids",sids += inp["sid"]+";","uuid",udata["uuid"],()=>{});  | ||||||
|                     db.nr("sids",'`sid`,`uid`',`'${cook["sid"]}','${udata["id"]}'`); |                     db.nr("sids",'`sid`,`uid`',`'${cook["sid"]}','${udata["id"]}'`); | ||||||
| @ -150,8 +151,7 @@ app.post("/sid_log",(req,res) =>{ | |||||||
| app.post("/get_sid" , (req,res) =>{ | app.post("/get_sid" , (req,res) =>{ | ||||||
|     let inp = req.body; |     let inp = req.body; | ||||||
|     let sid = func.get_uuid(inp["name"]); |     let sid = func.get_uuid(inp["name"]); | ||||||
|     var week = 7 * 24 * 3600 * 1000; |     res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=None"}); | ||||||
|     res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=Lax"}); |  | ||||||
|     res.send({out:"good"}); |     res.send({out:"good"}); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| @ -210,12 +210,13 @@ app.post("/save_proj", (req,res) => { | |||||||
|             if(projin == null){ |             if(projin == null){ | ||||||
|                 // console.log("proj not in"); |                 // console.log("proj not in"); | ||||||
|                 // console.log(pname,udata["id"],proj); |                 // console.log(pname,udata["id"],proj); | ||||||
|  |                 console.log(`${udata["uuid"]} created project ${pname} from ${cook["sid"]}`); | ||||||
|                 db.nr("projects","`uid`,`name`,`body`",`'${udata["id"]}','${pname}','${proj}'`); |                 db.nr("projects","`uid`,`name`,`body`",`'${udata["id"]}','${pname}','${proj}'`); | ||||||
|             } else if (projin != null){ |             } else if (projin != null){ | ||||||
|                 db.sv("projects","body",proj,"id",projin["id"],()=>{}); |                 db.sv("projects","body",proj,"id",projin["id"],()=>{}); | ||||||
|  |                 console.log(`${udata["uuid"]} saved project ${projin["name"]} from ${cook["sid"]}`); | ||||||
|                 // console.log("proj in"); |                 // console.log("proj in"); | ||||||
|             } |             } | ||||||
|             console.log(`${udata["uuid"]} saved project ${projin["name"]} from ${cook["sid"]}`); |  | ||||||
|         }) |         }) | ||||||
|  |  | ||||||
|     }) |     }) | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| <style> | <style> | ||||||
|     header{ |     #proj_top_panel{ | ||||||
|         display: flex; |         display: flex; | ||||||
|         /* width: 90%; */ |         /* width: 90%; */ | ||||||
|         justify-content: space-between; |         justify-content: space-between; | ||||||
| @ -8,11 +8,11 @@ | |||||||
|         margin: auto; |         margin: auto; | ||||||
|     } |     } | ||||||
|     #top_panel_right{ |     #top_panel_right{ | ||||||
|         float: right; |         /* float: right; */ | ||||||
|         display: flex; |         display: flex; | ||||||
|     } |     } | ||||||
|     #top_panel_left{ |     #top_panel_left{ | ||||||
|         float: left; |         /* float: left; */ | ||||||
|         display: flex; |         display: flex; | ||||||
|     } |     } | ||||||
|     /* button{ |     /* button{ | ||||||
| @ -36,8 +36,10 @@ | |||||||
|     }); |     }); | ||||||
|     </script> |     </script> | ||||||
|     <!-- <div id="user_name"></div> --> |     <!-- <div id="user_name"></div> --> | ||||||
|  |     <div id="proj_top_panel"> | ||||||
|         <div id="top_panel_left"></div> |         <div id="top_panel_left"></div> | ||||||
|     <div>puzzle</div> |         <!-- <div>puzzle</div> --> | ||||||
|         <div id="top_panel_right"></div> |         <div id="top_panel_right"></div> | ||||||
|  |     </div> | ||||||
|     <!-- <div><button onclick="logout();">logout</button></div> --> |     <!-- <div><button onclick="logout();">logout</button></div> --> | ||||||
| </header> | </header> | ||||||
| @ -38,13 +38,27 @@ | |||||||
|         border-color: #fff; |         border-color: #fff; | ||||||
|         border-style: solid; |         border-style: solid; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     #proj_top{ | ||||||
|  |         margin: auto; | ||||||
|  |         width: 90%; | ||||||
|  |         display: flex; | ||||||
|  |         justify-content: space-around; | ||||||
|  |     } | ||||||
|  |     #proj_name{ | ||||||
|  |         background-color: #aaa; | ||||||
|  |         border: 0px; | ||||||
|  |         text-align: center; | ||||||
|  |     } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
| <%- include('./static/start.ejs',{name:proj_name,async: true}) %> | <%- include('./static/start.ejs',{name:proj_name,async: true}) %> | ||||||
| <%- include('./header.ejs') %> | <%- include('./header.ejs') %> | ||||||
| <script src="/lib/interact.min.js"></script> | <script src="/lib/interact.min.js"></script> | ||||||
|  |  | ||||||
| <input id="proj_name"></input> | <div id="proj_top"> | ||||||
|  |     <input id="proj_name"></input> | ||||||
|  | </div> | ||||||
| <div id="drags"></div> | <div id="drags"></div> | ||||||
|  |  | ||||||
| <div class="dropzone"></div> | <div class="dropzone"></div> | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user