ui fixes
This commit is contained in:
parent
b8725f33af
commit
4538d122c5
9
index.js
9
index.js
|
@ -26,6 +26,7 @@ app.use(express.urlencoded({
|
|||
}));
|
||||
app.use(express.static('public'));
|
||||
app.use(cookieParser());
|
||||
var week = 7 * 24 * 3600 * 1000;
|
||||
|
||||
|
||||
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];
|
||||
if(ipass == udata["pass"]){
|
||||
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.nr("sids",'`sid`,`uid`',`'${cook["sid"]}','${udata["id"]}'`);
|
||||
|
@ -150,8 +151,7 @@ app.post("/sid_log",(req,res) =>{
|
|||
app.post("/get_sid" , (req,res) =>{
|
||||
let inp = req.body;
|
||||
let sid = func.get_uuid(inp["name"]);
|
||||
var week = 7 * 24 * 3600 * 1000;
|
||||
res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=Lax"});
|
||||
res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=None"});
|
||||
res.send({out:"good"});
|
||||
});
|
||||
|
||||
|
@ -210,12 +210,13 @@ app.post("/save_proj", (req,res) => {
|
|||
if(projin == null){
|
||||
// console.log("proj not in");
|
||||
// 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}'`);
|
||||
} else if (projin != null){
|
||||
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(`${udata["uuid"]} saved project ${projin["name"]} from ${cook["sid"]}`);
|
||||
})
|
||||
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<style>
|
||||
header{
|
||||
#proj_top_panel{
|
||||
display: flex;
|
||||
/* width: 90%; */
|
||||
justify-content: space-between;
|
||||
|
@ -8,11 +8,11 @@
|
|||
margin: auto;
|
||||
}
|
||||
#top_panel_right{
|
||||
float: right;
|
||||
/* float: right; */
|
||||
display: flex;
|
||||
}
|
||||
#top_panel_left{
|
||||
float: left;
|
||||
/* float: left; */
|
||||
display: flex;
|
||||
}
|
||||
/* button{
|
||||
|
@ -36,8 +36,10 @@
|
|||
});
|
||||
</script>
|
||||
<!-- <div id="user_name"></div> -->
|
||||
<div id="proj_top_panel">
|
||||
<div id="top_panel_left"></div>
|
||||
<div>puzzle</div>
|
||||
<!-- <div>puzzle</div> -->
|
||||
<div id="top_panel_right"></div>
|
||||
</div>
|
||||
<!-- <div><button onclick="logout();">logout</button></div> -->
|
||||
</header>
|
|
@ -38,13 +38,27 @@
|
|||
border-color: #fff;
|
||||
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>
|
||||
|
||||
<%- include('./static/start.ejs',{name:proj_name,async: true}) %>
|
||||
<%- include('./header.ejs') %>
|
||||
<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 class="dropzone"></div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user