Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
authdb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jan.koester
authdb
Commits
dd297c54
Commit
dd297c54
authored
3 weeks ago
by
jan.koester
Browse files
Options
Downloads
Patches
Plain Diff
added external stylesheet
parent
0b8fe1bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#34
canceled
3 weeks ago
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data/index.html
+1
-89
1 addition, 89 deletions
data/index.html
data/login.html
+1
-28
1 addition, 28 deletions
data/login.html
data/style.css
+106
-0
106 additions, 0 deletions
data/style.css
src/authdb.cpp
+17
-5
17 additions, 5 deletions
src/authdb.cpp
with
125 additions
and
122 deletions
data/index.html
+
1
−
89
View file @
dd297c54
<!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"
>
...
...
This diff is collapsed.
Click to expand it.
data/login.html
+
1
−
28
View file @
dd297c54
<!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"
>
...
...
This diff is collapsed.
Click to expand it.
data/style.css
0 → 100644
+
106
−
0
View file @
dd297c54
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
;
}
This diff is collapsed.
Click to expand it.
src/authdb.cpp
+
17
−
5
View file @
dd297c54
...
@@ -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
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment