Skip to content
Snippets Groups Projects
Commit dd297c54 authored by jan.koester's avatar jan.koester
Browse files

added external stylesheet

parent 0b8fe1bc
No related branches found
No related tags found
No related merge requests found
Pipeline #34 canceled
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<style> <link rel="stylesheet" href="/style.css">
body {
background:#222528;
color:#ffffff;
margin:0;
padding:0;
min-width:1024px;
}
#content {
background: #2F363B;
margin: 2vw 2vh;
padding: 2vw 2vh;
}
#header {
width:100vw;
height:4em;
background: #2F363B;
padding:0;
min-width:1024px;
}
#header .head {
padding:2vh;
margin:0;
font-size:2em;
padding:1em;
}
#maintable{
display: table;
min-width:700px;
min-height:100vh;
}
#navbar {
display: table-cell;
min-width:150px;
width:5vw;
background:#2F363B;
font-size:1em;
}
#navbar li {
list-style:none;
}
#navbar a {
color:#ffffff;
text-decoration:none;
}
#navbar a:visited {
color:#ffffff;
}
#maincell{
display: table-cell;
border:solid 10px #222528;
width:100%;
background:#2F363B;
}
a.button {
padding: 1px 6px;
border: 1px outset buttonborder;
border-radius: 3px;
color: buttontext;
background-color: buttonface;
text-decoration: none;
}
.usertoolbar li{
list-style:none;
display:inline-block;
margin:1em;
}
table.userlist {
margin:1em;
}
input.domaintext {
min-width:30vw;
}
</style>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<style> <link rel="stylesheet" href="/style.css">
body {
background:#222528;
color:#ffffff;
margin:0;
padding:0;
min-width:800px;
}
#login {
min-width:640px;
min-height:480px;
padding:2%;
font-size:1.5em;
border:solid 1px #ffffff;
border-radius:10px;
box-shadow: 1px 1px 5px 5px #ffffff;
position:absolute;
top:50%;
bottom:50%;
left:50%;
right:50%;
margin-left:-20vw;
margin-right:-20vw;
margin-top:-20vh;
margin-bottom:-20vh;
background:#404347;
}
</style>
</head> </head>
<body> <body>
<div id="login" > <div id="login" >
......
body {
background:#222528;
color:#ffffff;
margin:0;
padding:0;
min-width:1024px;
}
#login {
min-width:640px;
min-height:480px;
padding:2%;
font-size:1.5em;
border:solid 1px #ffffff;
border-radius:10px;
box-shadow: 1px 1px 5px 5px #ffffff;
position:absolute;
top:50%;
bottom:50%;
left:50%;
right:50%;
margin-left:-20vw;
margin-right:-20vw;
margin-top:-20vh;
margin-bottom:-20vh;
background:#404347;
}
#content {
background: #2F363B;
margin: 2vw 2vh;
padding: 2vw 2vh;
}
#header {
width:100vw;
height:4em;
background: #2F363B;
padding:0;
min-width:1024px;
}
#header .head {
padding:2vh;
margin:0;
font-size:2em;
padding:1em;
}
#maintable{
display: table;
min-width:700px;
min-height:100vh;
}
#navbar {
display: table-cell;
min-width:150px;
width:5vw;
background:#2F363B;
font-size:1em;
}
#navbar li {
list-style:none;
}
#navbar a {
color:#ffffff;
text-decoration:none;
}
#navbar a:visited {
color:#ffffff;
}
#maincell{
display: table-cell;
border:solid 10px #222528;
width:100%;
background:#2F363B;
}
a.button {
padding: 1px 6px;
border: 1px outset buttonborder;
border-radius: 3px;
color: buttontext;
background-color: buttonface;
text-decoration: none;
}
.usertoolbar li{
list-style:none;
display:inline-block;
margin:1em;
}
table.userlist {
margin:1em;
}
input.domaintext {
min-width:30vw;
}
...@@ -57,11 +57,17 @@ namespace authdb { ...@@ -57,11 +57,17 @@ namespace authdb {
HttpEvent(ssock), HttpEvent(ssock),
_AdminBackend(backend), _AdminBackend(backend),
_AdminInterface(backend,ssock){ _AdminInterface(backend,ssock){
std::ifstream authfs("../data/authdb.js", std::ios::ate); std::ifstream authfs("../data/authdb.js", std::ios::ate);
size_t asize = authfs.tellg(); size_t asize = authfs.tellg();
_AuthJs.resize(asize); _AuthJs.resize(asize);
authfs.seekg(0); authfs.seekg(0);
authfs.read(_AuthJs.data(),asize); authfs.read(_AuthJs.data(),asize);
std::ifstream cssfs("../data/style.css", std::ios::ate);
size_t csssize = cssfs.tellg();
_AuthCss.resize(csssize);
cssfs.seekg(0);
cssfs.read(_AuthCss.data(),csssize);
}; };
void RequestEvent(libhttppp::HttpRequest * curreq, const int tid, ULONG_PTR args){ void RequestEvent(libhttppp::HttpRequest * curreq, const int tid, ULONG_PTR args){
...@@ -92,6 +98,11 @@ namespace authdb { ...@@ -92,6 +98,11 @@ namespace authdb {
rep.setState(HTTP200); rep.setState(HTTP200);
rep.setContentType("text/javascript"); rep.setContentType("text/javascript");
rep.send(curreq,_AuthJs.data(),_AuthJs.size()); rep.send(curreq,_AuthJs.data(),_AuthJs.size());
}else if(strncmp("/style.css",curreq->getRequestURL(),9)==0){
libhttppp::HttpResponse rep;
rep.setState(HTTP200);
rep.setContentType("text/css");
rep.send(curreq,_AuthCss.data(),_AuthCss.size());
}else{ }else{
libhttppp::HttpResponse rep; libhttppp::HttpResponse rep;
rep.setState(HTTP404); rep.setState(HTTP404);
...@@ -155,6 +166,7 @@ namespace authdb { ...@@ -155,6 +166,7 @@ namespace authdb {
AuthBackend &_AdminBackend; AuthBackend &_AdminBackend;
AdminInterface _AdminInterface; AdminInterface _AdminInterface;
std::vector<char> _AuthJs; std::vector<char> _AuthJs;
std::vector<char> _AuthCss;
}; };
int searchValue(authdb::AuthBackend &backend,const char*fieldname,const char *value){ int searchValue(authdb::AuthBackend &backend,const char*fieldname,const char *value){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment