Compare commits

..

No commits in common. "91fd7c37c519c79247a317886477e0da7fa797b7" and "4faa5a4e068c8c45084a1c9d12d5e23ebcbecb9c" have entirely different histories.

9 changed files with 24 additions and 209 deletions

View file

@ -185,6 +185,9 @@ class Db(Queries):
digest.update(password.encode("utf-8"))
res = super().try_login(username=username, hash=digest.hexdigest())
if not res:
print("WARNING: Failed to log in!")
for it in self._cursor.execute("SELECT * FROM users").fetchall():
print("DEBUG", it)
return None
return self.create_key(uid=res.id, name="web session", ttl=ttl)

View file

@ -66,17 +66,7 @@ label {
flex-wrap: wrap;
}
.u-flex-break {
flex-basis: 100%;
}
.u-overflow-elipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 550px) {
@media (max-width: 760px) {
.file, .printer, .key, .job {
flex-direction: column;
margin-bottom: 10px;
@ -110,32 +100,3 @@ label {
input[type='text'], input[type='password'], select {
width: 100%;
}
input[type="image"] {
height: 38px;
padding: 0 30px;
color: #555;
text-align: center;
font-size: 11px;
font-weight: 600;
line-height: 38px;
letter-spacing: .1rem;
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
background-color: transparent;
border-radius: 4px;
// border: 1px solid #bbb;
cursor: pointer;
// box-sizing: border-box;
}
.row.bubble {
border-radius: 4px;
border: 1px solid $black;
}
.u-mv-auto {
margin-top: auto;
margin-bottom: auto;
}

View file

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 24 28"
x="0px"
y="0px"
version="1.1"
id="svg190"
sodipodi:docname="delete.svg"
width="24"
height="28"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs194" />
<sodipodi:namedview
id="namedview192"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="42.03125"
inkscape:cx="8.005948"
inkscape:cy="16"
inkscape:window-width="1918"
inkscape:window-height="2128"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg190" />
<title
id="title180">Basic_UI1_32px_2px_Solid</title>
<g
data-name="Layer 11"
id="g184"
transform="translate(-4,-2)">
<path
d="m 18,2 h -4 a 1,1 0 0 0 -1,1 v 1 h 6 V 3 A 1,1 0 0 0 18,2 Z M 6,10 v 16 a 4,4 0 0 0 4,4 h 12 a 4,4 0 0 0 4,-4 V 10 Z m 6,16 a 1,1 0 0 1 -2,0 V 14 a 1,1 0 0 1 2,0 z m 5,0 a 1,1 0 0 1 -2,0 V 14 a 1,1 0 0 1 2,0 z m 5,0 a 1,1 0 0 1 -2,0 V 14 a 1,1 0 0 1 2,0 z M 26,9 H 6 A 2,2 0 0 1 4,7 V 7 A 2,2 0 0 1 6,5 h 20 a 2,2 0 0 1 2,2 v 0 a 2,2 0 0 1 -2,2 z"
id="path182" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
data-name="Layer 1"
viewBox="0 0 22 27"
x="0px"
y="0px"
version="1.1"
id="svg978"
sodipodi:docname="download.svg"
width="22"
height="27"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs982" />
<sodipodi:namedview
id="namedview980"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="5.9"
inkscape:cx="10.932203"
inkscape:cy="18.050847"
inkscape:window-width="1918"
inkscape:window-height="2128"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg978" />
<g
id="g972"
transform="translate(-5,-2)">
<rect
x="5"
y="24"
width="22"
height="5"
rx="1"
id="rect968" />
<path
d="m 15.23,20.88086 a 1.00028,1.00028 0 0 0 1.54,0 l 6,-7.24268 A 1.00027,1.00027 0 0 0 22,12 H 19 V 3 A 1,1 0 0 0 18,2 h -4 a 1,1 0 0 0 -1,1 v 9 h -3 a 1.00027,1.00027 0 0 0 -0.77,1.63818 z"
id="path970" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 28 27"
version="1.1"
xml:space="preserve"
x="0px"
y="0px"
fill-rule="evenodd"
clip-rule="evenodd"
stroke-linejoin="round"
stroke-miterlimit="2"
id="svg1170"
sodipodi:docname="print.svg"
width="28"
height="27"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs1174" /><sodipodi:namedview
id="namedview1172"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="5.9"
inkscape:cx="13.983051"
inkscape:cy="18.050847"
inkscape:window-width="1918"
inkscape:window-height="2128"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1170" /><g
transform="translate(-290,-386)"
id="g1164"><path
d="m 296,403 c 0,0 16,0 16,0 0,0 0,9 0,9 0,0.552 -0.448,1 -1,1 h -14 c -0.552,0 -1,-0.448 -1,-1 z m 19,-11 h -22 c -1.657,0 -3,1.343 -3,3 v 8 c 0,1.657 1.343,3 3,3 h 1 v -3 c 0,-0.53 0.211,-1.039 0.586,-1.414 0.375,-0.375 0.884,-0.586 1.414,-0.586 3.151,0 12.849,0 16,0 0.53,0 1.039,0.211 1.414,0.586 0.375,0.375 0.586,0.884 0.586,1.414 v 8 c 0,0 0,-5 0,-5 h 1 c 1.657,0 3,-1.343 3,-3 v -8 c 0,-1.657 -1.343,-3 -3,-3 z m -16,18 h 10 c 0.552,0 1,-0.448 1,-1 0,-0.552 -0.448,-1 -1,-1 h -10 c -0.552,0 -1,0.448 -1,1 0,0.552 0.448,1 1,1 z m 0,-4 h 8 c 0.552,0 1,-0.448 1,-1 0,-0.552 -0.448,-1 -1,-1 h -8 c -0.552,0 -1,0.448 -1,1 0,0.552 0.448,1 1,1 z m 14,-10 c 0.552,0 1,0.448 1,1 0,0.552 -0.448,1 -1,1 -0.552,0 -1,-0.448 -1,-1 0,-0.552 0.448,-1 1,-1 z m -19,-6 h 20 v -1 c 0,-1.657 -1.343,-3 -3,-3 -3.463,0 -10.537,0 -14,0 -1.657,0 -3,1.343 -3,3 z"
id="path1162" /></g></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -4,21 +4,14 @@
{% if files %}
{% for file in files %}
<div class="file row u-flex">
<div class="details eight columns u-flex u-flex-wrap u-overflow-elipsis">
<div class="file-name u-flex u-flex-break">
<label for="filename">File</label>
<span name="filename">{{ file.filename }}</span>
<div class="details six columns u-flex u-flex-wrap">
<span class="file-name">{{ file.filename }}</span>
</div>
<div class="file-sucesses u-flex">
<label>Successes</label>
<span>{{ file.print_successes }}</span>
<div class="six columns u-flex u-flex-wrap">
<span class="file-sucesses"><label>Successes</label>{{ file.print_successes }}</span>
<span class="file-failures"><label>Failures</label>{{ file.print_failures }}</span>
</div>
<div class="file-failures u-flex">
<label>Failures</label>
<span>{{ file.print_failures }}</span>
</div>
</div>
<div class="controls u-flex u-ml-auto u-mv-auto">
<div class="controls u-flex u-ml-auto">
{{ macros.start_job(file.id) }}
{{ macros.download_file(file.id) }}
{{ macros.delete_file(file.id) }}

View file

@ -4,8 +4,8 @@
{% if jobs %}
{% for job in jobs %}
<div class="job row u-flex">
<div class="details eight columns u-flex u-flex-wrap u-overflow-elipsis">
<div class="job-filename u-flex u-flex-break">
<div class="details six columns u-flex u-flex-wrap">
<div class="job-filename u-flex mr-auto">
<label for="filename">File</label>
<span name="filename">{{ctx.db.fetch_file(ctx.uid, job.file_id).filename or "it's a secret"}}</span>
</div>
@ -28,7 +28,7 @@
<div class="dot {{ macros.job_state(job) }} {{ macros.job_active(job) }} tooltip bottom" data-text="{{ macros.job_state(job) }}" style="--dot-size: 1em;"> </div>
</div>
</div>
<div class="controls u-flex u-ml-auto u-mv-auto">
<div class="controls four columns u-flex u-ml-auto">
{% if ctx.uid %}
{{ macros.duplicate_job(job.id) }}
{{ macros.delete_job(job.id) }}

View file

@ -4,8 +4,8 @@
{% if jobs %}
{% for job in jobs %}
<div class="job row u-flex">
<div class="details eight columns u-flex u-flex-wrap u-overflow-elipsis">
<div class="job-filename u-flex u-flex-break">
<div class="details six columns u-flex u-flex-wrap">
<div class="job-filename u-flex">
<label for="filename">File</label>
<span name="filename">{{ctx.db.fetch_file(ctx.uid, job.file_id).filename or "it's a secret"}}</span>
</div>
@ -37,7 +37,7 @@
<div class="dot {{ macros.job_state(job) }} {{ macros.job_active(job) }} tooltip bottom" data-text="{{ macros.job_state(job) }}" style="--dot-size: 1em;"> </div>
</div>
</div>
<div class="controls u-flex u-ml-auto u-mv-auto">
<div class="controls u-flex u-ml-auto">
{% if ctx.uid %}
{{ macros.duplicate_job(job.id) }}
{{ macros.cancel_job(job.id) }}

View file

@ -4,7 +4,7 @@
<form class="inline" method="post" action="/jobs">
<input type="hidden" name="action" value="enqueue" />
<input type="hidden" name="file_id" value="{{ id }}" />
<input id="submit" type="image" src="/static/print.svg" height="24" width="24" />
<input id="submit" type="submit" value="Enqueue"/>
</form>
{% endmacro %}
@ -12,7 +12,7 @@
<form class="inline" method="post" action="/jobs">
<input type="hidden" name="action" value="duplicate" />
<input type="hidden" name="job_id" value="{{ id }}" />
<input id="submit" type="image" src="/static/print.svg" height="24" width="24" />
<input id="submit" type="submit" value="Duplicate"/>
</form>
{% endmacro %}
@ -28,7 +28,7 @@
<form class="inline" method="post" action="/jobs">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="job_id" value="{{ id }}" />
<input id="submit" type="image" src="/static/delete.svg" height="24" width="24" />
<input id="submit" type="submit" value="Delete"/>
</form>
{% endmacro %}
@ -54,7 +54,7 @@
<form class="inline" method="post" action="{{ endpoint }}">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="file_id" value="{{ id }}" />
<input id="submit" type="image" src="/static/delete.svg" height="24" width="24" />
<input id="submit" type="submit" value="Delete"/>
</form>
{% endmacro %}
@ -62,7 +62,7 @@
<form class="inline" method="post" action="{{ endpoint }}">
<input type="hidden" name="action" value="download" />
<input type="hidden" name="file_id" value="{{ id }}" />
<input id="submit" type="image" src="/static/download.svg" height="24" width="24" />
<input id="submit" type="submit" value="Download"/>
</form>
{% endmacro %}