latest fixes and improvements

pull/317/head
ntmmfts 3 years ago
parent cf09767b48
commit b6bd57a85d

@ -30,7 +30,7 @@ import datetime
import pytz
from copy import deepcopy
__version__ = '0.39.4'
__version__ = '0.39.5'
datastore = None
@ -294,17 +294,16 @@ def changedetection_app(config=None, datastore_o=None):
if pause_uuid:
try:
validate = uuid.UUID(str(pause_uuid))
datastore.data['watching'][pause_uuid]['paused'] ^= True
except ValueError:
action = True if pause_uuid == 'pause-all' else False
for watch_uuid, watch in datastore.data['watching'].items():
if datastore.data['watching'][watch_uuid]['tag'] == limit_tag or limit_tag is None :
datastore.data['watching'][watch_uuid]['paused'] = action
datastore.needs_write = True
if pause_uuid == 'pause-all' or pause_uuid == 'resume-all':
action = True if pause_uuid == 'pause-all' else False
for watch_uuid, watch in datastore.data['watching'].items():
if datastore.data['watching'][watch_uuid]['tag'] == limit_tag or limit_tag is None :
datastore.data['watching'][watch_uuid]['paused'] = action
else :
datastore.data['watching'][pause_uuid]['paused'] ^= True
datastore.needs_write = True
except KeyError:
flash("No watch by that UUID found, or error setting paused state.", 'error');
return redirect(url_for('index', tag = limit_tag))
# Sort by last_changed and add the uuid which is usually the key..
@ -655,19 +654,13 @@ def changedetection_app(config=None, datastore_o=None):
pass
# process selected
@app.route("/api/process-selected", methods=['GET', "POST"])
@app.route("/api/process-selected", methods=["POST"])
@login_required
def process_selected():
if request.method == 'POST' :
func = request.form.get('func')
limit_tag = request.form.get('tag')
uuids = request.form.get('uuids')
if request.method == 'GET' :
func = request.args.get('func')
limit_tag = request.args.get('tag')
uuids = request.args.get('uuids')
func = request.form.get('func')
limit_tag = request.form.get('tag')
uuids = request.form.get('uuids')
if uuids == '' :
flash("No watches selected.")
@ -766,14 +759,9 @@ def changedetection_app(config=None, datastore_o=None):
else :
flash("Invalid parameter received.")
render_template('index') #ensure flash msgs are seen
if limit_tag == None or limit_tag == 'None' :
return redirect(url_for('index'))
else :
return redirect(url_for('index', tag = limit_tag))
render_template(url_for('index'), tag = limit_tag)
@app.route("/diff/<string:uuid>", methods=['GET'])
@login_required
def diff_history_page(uuid):

@ -1,27 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1"
id="svg2" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:ns1="http://sozi.baierouge.fr" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="9.5px" height="15px"
viewBox="0 0 9.5 15" style="enable-background:new 0 0 9.5 15;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0078E7;}
.st1{fill:#0078E7;stroke:#0078E7;stroke-width:0.1;stroke-miterlimit:4.6604;}
.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="88.93244" inkscape:cy="-6.4524562" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="822" inkscape:window-maximized="0" inkscape:window-width="1274" inkscape:window-x="0" inkscape:window-y="25" inkscape:zoom="1" pagecolor="#ffffff" showgrid="false" showguides="true">
</sodipodi:namedview>
<path id="path3740" sodipodi:nodetypes="cccccc" class="st0" d="M2.2,0C1.8,0,0.7,0.1,0,1.5v1.3h2.2V0C2.3,0.1,2.2,0,2.2,0L2.2,0z"
/>
<path id="rect3728" sodipodi:nodetypes="ccccc" class="st0" d="M0.3,1.7l-0.2,1h2.1V0.2C1.1,0.4,0.6,1.2,0.3,1.7L0.3,1.7z"/>
<path id="path3655" class="st0" d="M9.5,2.6L9.5,2.6L2.3,0L2,0.2l7.2,2.6v0.1"/>
<path id="path3645" sodipodi:nodetypes="cccc" class="st0" d="M9.2,2.8v10.5L9.4,13V2.5"/>
<path id="rect3517" sodipodi:nodetypes="ccccc" class="st0" d="M2,0.2l7.2,2.6v10.6L2,10.8V0.2z"/>
<path id="path3657" sodipodi:nodetypes="cc" class="st1" d="M2.1,0.2l7.1,2.6"/>
<path id="path3684" sodipodi:nodetypes="cccccc" class="st2" d="M0.5,9.6l0.1-7.2L0.4,2.3c0,0,0.8-1.2,1.6-1.3l6.8,2.4v0.1"/>
<path id="path3679" class="st2" d="M8.9,3.4L8.7,13l-1.4,1.3l-6.8-2.4V9.5"/>
<path id="path3669" class="st0" d="M7.5,4.2L7.5,4.2L0.3,1.6L0,1.9l7.2,2.6v0.1"/>
<path id="path3671" sodipodi:nodetypes="cccc" class="st0" d="M7.2,4.5V15l0.2-0.3V4.2"/>
<path id="path3673" sodipodi:nodetypes="ccccc" class="st0" d="M0,1.9l7.2,2.6V15L0,12.4V1.9z"/>
<path id="path3675" sodipodi:nodetypes="cc" class="st1" d="M0.1,1.9l7.1,2.6"/>
</svg>
<svg id="svg2" xmlns="http://www.w3.org/2000/svg" width="9.5" height="15" viewBox="0 0 9.5 15"><path id="path3740" d="M2.2,0A2.41,2.41,0,0,0,0,1.5V2.8H2.2V0Z" transform="translate(0 0)" style="fill:#0078e7"/><path id="rect3728" d="M.3,1.7l-.2,1H2.2V.2A2.76,2.76,0,0,0,.3,1.7Z" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3655" d="M9.5,2.6h0L2.3,0,2,.2,9.2,2.8v.1" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3645" d="M9.2,2.8V13.3l.2-.3V2.5" transform="translate(0 0)" style="fill:#0078e7"/><path id="rect3517" d="M2,.2,9.2,2.8V13.4L2,10.8Z" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3657" d="M2.1.2,9.2,2.8" transform="translate(0 0)" style="fill:#0078e7;stroke:#0078e7;stroke-miterlimit:4.660399913787842;stroke-width:0.10000000149011612px"/><path id="path3684" d="M.5,9.6.6,2.4.4,2.3S1.2,1.1,2,1L8.8,3.4v.1" transform="translate(0 0)" style="fill:#fff;fill-rule:evenodd"/><path id="path3679" d="M8.9,3.4,8.7,13,7.3,14.3.5,11.9V9.5" transform="translate(0 0)" style="fill:#fff;fill-rule:evenodd"/><path id="path3669" d="M7.5,4.2h0L.3,1.6,0,1.9,7.2,4.5v.1" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3671" d="M7.2,4.5V15l.2-.3V4.2" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3673" d="M0,1.9,7.2,4.5V15L0,12.4Z" transform="translate(0 0)" style="fill:#0078e7"/><path id="path3675" d="M.1,1.9,7.2,4.5" transform="translate(0 0)" style="fill:#0078e7;stroke:#0078e7;stroke-miterlimit:4.660399913787842;stroke-width:0.10000000149011612px"/></svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -1,44 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1"
id="Capa_1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="15px"
viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0078E7;}
</style>
<path id="path2" class="st0" d="M7.5,0C4.5,0,1.7,1.9,0.6,4.6c-1.2,2.7-0.6,6,1.5,8.1c2,2.1,5.2,2.9,7.9,1.9c2.8-1,4.9-3.7,5-6.7
c0.2-2.9-1.5-5.8-4.1-7.1C9.9,0.3,8.7,0,7.5,0z M6.6,10.3c0,0.5-0.6,0.5-0.9,0.5c-0.3,0-0.8,0.1-0.9-0.4c0-1.9,0-3.8,0-5.7
c0.1-0.5,0.7-0.3,1.1-0.4c0.4-0.1,0.8,0.2,0.7,0.6C6.6,6.7,6.6,8.5,6.6,10.3z M10.3,10.3c0,0.5-0.6,0.5-0.9,0.5
c-0.3,0-0.8,0.1-0.9-0.4c0-1.9,0-3.8,0-5.7c0.1-0.5,0.7-0.3,1.1-0.4c0.4-0.1,0.8,0.2,0.7,0.6C10.3,6.7,10.3,8.5,10.3,10.3z"/>
<g id="g4" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g6" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g8" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g10" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g12" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g14" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g16" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g18" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g20" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g22" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g24" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g26" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g28" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g30" transform="translate(-0.01903604,0.02221043)">
</g>
<g id="g32" transform="translate(-0.01903604,0.02221043)">
</g>
</svg>
<svg id="Capa_1" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" width="15.03" height="15.03" viewBox="0 0 15.03 15.03"><path id="path2" d="M7.5,0A7.56,7.56,0,0,0,.6,4.6a7.37,7.37,0,0,0,1.5,8.1A7.52,7.52,0,0,0,10,14.6,7.53,7.53,0,0,0,10.9.8,7.73,7.73,0,0,0,7.5,0ZM6.6,10.3c0,.5-.6.5-.9.5s-.8.1-.9-.4V4.7c.1-.5.7-.3,1.1-.4a.53.53,0,0,1,.7.6Zm3.7,0c0,.5-.6.5-.9.5s-.8.1-.9-.4V4.7c.1-.5.7-.3,1.1-.4a.53.53,0,0,1,.7.6Z" transform="translate(0.01 0)" style="fill:#0078e7"/></svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 480 B

@ -1,12 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="15px" height="15px" viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0078E7;}
.st1{fill:#FFFFFF;}
</style>
<path id="path2" class="st0" d="M7.5,0C3.4,0.1,0,3.4,0,7.5S3.4,15,7.5,15S15,11.6,15,7.5c0-2.8-1.6-5.4-4.1-6.7
C9.9,0.3,8.7,0.1,7.5,0z"/>
<polygon class="st1" points="11.4,8 5.8,4.8 5.8,11.3 "/>
</svg>
<svg id="Capa_1" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path id="path2" d="M7.5,0A7.62,7.62,0,0,0,0,7.5,7.55,7.55,0,0,0,7.5,15,7.55,7.55,0,0,0,15,7.5,7.6,7.6,0,0,0,10.9.8,9.42,9.42,0,0,0,7.5,0Z" transform="translate(0 0)" style="fill:#0078e7"/><polygon points="11.4 8 5.8 4.8 5.8 11.3 11.4 8" style="fill:#fff"/></svg>

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 377 B

@ -1,17 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1"
id="Layer_1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:ns1="http://sozi.baierouge.fr" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px"
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0078E7;}
.st1{fill:#FFFFFF;}
</style>
<circle class="st0" cx="16" cy="16" r="16"/>
<g transform="translate(-29.461,-26.738)">
<path class="st1" d="M51.7,51.2l-4-4c-1.1,0.7-2.4,1.1-3.8,1.1c-3.8,0-7-3.1-7-7c0-3.9,3.1-7,7-7c3.8,0,7,3.1,7,7
c0,1.4-0.4,2.6-1,3.7l4,4.1c0.2,0.2,0,0.7-0.4,1.2l-0.6,0.6C52.5,51.2,51.9,51.4,51.7,51.2z M48.6,41.3c0-2.6-2.1-4.7-4.6-4.7
c-2.6,0-4.7,2.1-4.7,4.7c0,2.6,2.1,4.7,4.7,4.7C46.5,45.9,48.6,43.8,48.6,41.3z"/>
</g>
</svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="16" style="fill:#0078e7"/><path d="M24,26.85l-4.93-5a8.53,8.53,0,0,1-4.71,1.41,8.63,8.63,0,1,1,7.32-4.12l5,5c.26.26,0,.9-.49,1.44l-.74.74C24.86,26.88,24.23,27.11,24,26.85Zm-3.9-12.23a5.75,5.75,0,1,0-5.74,5.79A5.76,5.76,0,0,0,20.07,14.62Z" style="fill:#fff"/></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 407 B

@ -1,9 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="10.8px" height="15px" viewBox="0 0 10.8 15" style="enable-background:new 0 0 10.8 15;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0078E7;stroke:#0078E7;stroke-width:1.25;stroke-miterlimit:10;}
</style>
<path class="st0" d="M5.5,1l4.1,5.1H1.3L5.5,1z M5.5,14L1.3,8.9h8.2L5.5,14z"/>
</svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="10.93" height="14.99" viewBox="0 0 10.93 14.99"><path d="M5.5,1,9.6,6.1H1.3Zm0,13L1.3,8.9H9.5Z" transform="translate(0.02 -0.01)" style="fill:#0078e7;stroke:#0078e7;stroke-miterlimit:10;stroke-width:1.25px"/></svg>

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 294 B

@ -1,30 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1"
id="svg2" inkscape:export-filename="/home/piotr/priv/zm_szablon/book.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.46" sodipodi:docname="book.svg" sodipodi:version="0.32" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:ns1="http://sozi.baierouge.fr" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16.3px" height="11.6px"
viewBox="0 0 16.3 11.6" style="enable-background:new 0 0 16.3 11.6;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#0078E7;stroke:#007EC0;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#1187C3;}
.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;stroke:#0078E7;stroke-width:0.5;}
.st3{fill-rule:evenodd;clip-rule:evenodd;fill:#1187C3;stroke:#007EC0;stroke-width:0.5;}
</style>
<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" gridtolerance="10000" guidetolerance="10" id="base" inkscape:current-layer="layer1" inkscape:cx="394.36154" inkscape:cy="818.28215" inkscape:document-units="px" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="725" inkscape:window-width="1279" inkscape:window-x="1" inkscape:window-y="49" inkscape:zoom="0.98994949" objecttolerance="10" pagecolor="#ffffff" showgrid="false">
</sodipodi:namedview>
<path id="path2416" sodipodi:nodetypes="cccsccccccccccccccc" class="st0" d="M14.2,6.5l1.4,3.1l-6.2,0.8c0,0,0,0.2-0.4,0.1
c-0.3,0-0.6-0.3-0.6-0.6l-6.6,1.2L0.6,4.2h0.3v0.1H0.8L2,10.9l6.4-1.1V10h0.4c0,0,0,0.4,0.5,0.4l0.1-0.1l6-0.8L14.2,6.5L14.2,6.5z"
/>
<path id="path2400" sodipodi:nodetypes="cccccc" class="st1" d="M1,4.3H0.9L2,10.9l6.4-1.1c0,0-1.7-0.9-6.1,1L1,4.3L1,4.3z"/>
<path id="path2402" sodipodi:nodetypes="ccccccccccccccc" class="st2" d="M1,4.1V3.6h0.1V3.2l0.2-0.3h0.1V2.6V2.5l1.4,6.4L2.7,9.2
v0.2L2.6,9.5L2.4,9.6l-0.1,1.1L1,4.1L1,4.1z"/>
<path id="path2388" sodipodi:nodetypes="cccccccc" class="st2" d="M2.3,10.8l0.1-1.2l0.3-0.3V9.2l0.2-0.3c0,0,5.5-0.2,5.9,0.8
L8.4,9.8C8.4,9.8,6.7,8.9,2.3,10.8L2.3,10.8z"/>
<path id="path2394" class="st2" d="M2.2,2.5H1.5l1.4,6.4c0,0,5.3-0.2,5.9,0.8c0,0-0.1-1.1-5.4-1.6L2.2,2.5L2.2,2.5z"/>
<path id="path2398" class="st2" d="M2,1.3L3.4,8c0,0,5,0.5,5.4,1.7l-2-6.3C6.8,3.3,6.8,2.3,2,1.3L2,1.3z"/>
<path id="path2403" sodipodi:nodetypes="ccccc" class="st2" d="M6.9,3.3l5-2.9l2.5,5.9L8.8,9.7L6.9,3.3L6.9,3.3z"/>
<path id="path2411" sodipodi:nodetypes="ccccccc" class="st3" d="M8.5,10V9.8l0.3-0.1c0,0,0.2,0.6,0.6,0.6v0.1c0,0-0.5,0-0.5-0.5
L8.5,10L8.5,10z"/>
<path id="path2415" class="st2" d="M8.8,9.7c0,0,0.2,0.6,0.6,0.5l6-0.8l-0.3-0.6h-0.3v0C14.9,8.8,9.8,9,8.8,9.7L8.8,9.7z"/>
<path id="path2404" sodipodi:nodetypes="ccccc" class="st2" d="M15.1,8.9l-1-2.3L8.8,9.7v0.1c0,0,0.5-0.6,6-0.9V9L15.1,8.9z"/>
</svg>
<svg id="svg2" xmlns="http://www.w3.org/2000/svg" width="16.33" height="11.64" viewBox="0 0 16.33 11.64"><path id="path2416" d="M14.2,6.5l1.4,3.1-6.2.8s0,.2-.4.1a.65.65,0,0,1-.6-.6L1.8,11.1.6,4.2H.9v.1H.8L2,10.9,8.4,9.8V10h.4s0,.4.5.4l.1-.1,6-.8-1.2-3Z" transform="translate(-0.01 -0.04)" style="fill:#0078e7;stroke:#007ec0;fill-rule:evenodd"/><path id="path2400" d="M1,4.3H.9L2,10.9,8.4,9.8s-1.7-.9-6.1,1L1,4.3Z" transform="translate(-0.01 -0.04)" style="fill:#1187c3;fill-rule:evenodd"/><path id="path2402" d="M1,4.1V3.6h.1V3.2l.2-.3h.1V2.5L2.8,8.9l-.1.3v.2l-.1.1-.2.1-.1,1.1L1,4.1Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2388" d="M2.3,10.8l.1-1.2.3-.3V9.2l.2-.3s5.5-.2,5.9.8l-.4.1s-1.7-.9-6.1,1Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2394" d="M2.2,2.5H1.5L2.9,8.9s5.3-.2,5.9.8c0,0-.1-1.1-5.4-1.6L2.2,2.5Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2398" d="M2,1.3,3.4,8s5,.5,5.4,1.7l-2-6.3c0-.1,0-1.1-4.8-2.1Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2403" d="M6.9,3.3l5-2.9,2.5,5.9L8.8,9.7,6.9,3.3Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2411" d="M8.5,10V9.8l.3-.1s.2.6.6.6v.1a.49.49,0,0,1-.5-.5l-.4.1Z" transform="translate(-0.01 -0.04)" style="fill:#1187c3;stroke:#007ec0;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2415" d="M8.8,9.7s.2.6.6.5l6-.8-.3-.6h-.3c.1,0-5,.2-6,.9Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/><path id="path2404" d="M15.1,8.9l-1-2.3L8.8,9.7v.1s.5-.6,6-.9V9Z" transform="translate(-0.01 -0.04)" style="fill:#fff;stroke:#0078e7;stroke-width:0.5px;fill-rule:evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -5,23 +5,25 @@ var CONSTANT_ESCAPE_KEY = 27;
var CONSTANT_S_KEY = 83;
var CONSTANT_s_KEY = 115;
// global sorting vars (new window is always last_changed, descending)
// globals
var loading;
var sort_column;
var sort_order;
var sort_column; // new window or tab is always last_changed
var sort_order; // new window or tab is always descending
var coordX;
var coordY;
// restore scroll position on submit/reload
document.addEventListener("DOMContentLoaded", function(event) {
document.addEventListener("DOMContentLoaded", function(event) {
var scrollpos = sessionStorage.getItem('scrollpos');
if (scrollpos) window.scrollTo(0, scrollpos);
});
// mobile scroll position retention
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
document.addEventListener("visibilitychange", function() {
storeScrollAndSearch();
});
}
else {
} else {
// non-mobile scroll position retention
window.onbeforeunload = function(e) {
storeScrollAndSearch();
@ -31,18 +33,26 @@ function storeScrollAndSearch() {
sessionStorage.setItem('scrollpos', window.pageYOffset);
sessionStorage.setItem('searchtxt', document.getElementById("txtInput").value);
}
// (ctl)-alt-s search hotkey
document.onkeyup=function(e){
var e = e || window.event; // for IE to cover IEs window event-object
if(e.altKey && (e.which == CONSTANT_S_KEY || e.which == CONSTANT_s_KEY)) {
document.getElementById("txtInput").focus();
return false;
}
document.onkeyup = function(e) {
var e = e || window.event; // for IE to cover IEs window event-object
if (e.altKey && (e.which == CONSTANT_S_KEY || e.which == CONSTANT_s_KEY)) {
document.getElementById("txtInput").focus();
return false;
}
}
// keep track of click position for placement of checkbox-functions grid display
document.addEventListener("click", clickPos);
function clickPos(event) {
coordX = event.clientX;
coordY = event.clientY;
}
// page load functions
window.addEventListener('DOMContentLoaded', (event) => {
load_functions();
load_functions();
});
function load_functions() {
@ -57,7 +67,7 @@ function load_functions() {
// search
if (isSessionStorageSupported()) {
// retrieve search
if ( sessionStorage.getItem("searchtxt") != null ) {
if (sessionStorage.getItem("searchtxt") != null) {
document.getElementById("txtInput").value = sessionStorage.getItem("searchtxt");
tblSearch(this);
}
@ -66,229 +76,223 @@ function load_functions() {
// sorting
function sortTable(n) {
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0, sortimgs, sortableimgs;
table = document.getElementById("watch-table");
switching = true;
//Set the sorting direction, either default 9, 1 or saved
if (loading) {
getSort();
dir = (sort_order == 0) ? "asc" : "desc";
loading = false;
}
else {
dir = "asc";
}
/*Make a loop that will continue until
no switching has been done:*/
while (switching) {
//start by saying: no switching is done:
switching = false;
rows = table.rows;
/*Loop through all table rows (except the
first, which contains table headers):*/
for (i = 1; i < (rows.length - 1); i++) {
//start by saying there should be no switching:
shouldSwitch = false;
/*Get the two elements you want to compare,
one from current row and one from the next:*/
x = rows[i].getElementsByTagName("TD")[n];
y = rows[i + 1].getElementsByTagName("TD")[n];
x = x.innerHTML.toLowerCase();
y = y.innerHTML.toLowerCase();
if (!isNaN(x)) { // handle numeric columns
x = parseFloat(x);
y = parseFloat(y);
}
if (n == 1) { // handle play/pause column
x = rows[i].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src;
y = rows[i + 1].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src;
}
/*check if the two rows should switch place,
based on the direction, asc or desc:*/
if (dir == "asc") {
if (x > y) {
//if so, mark as a switch and break the loop:
shouldSwitch= true;
break;
}
} else if (dir == "desc") {
if (x < y) {
//if so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
}
}
if (shouldSwitch) {
/*If a switch has been marked, make the switch
and mark that a switch has been done:*/
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
//Each time a switch is done, increase this count by 1:
switchcount ++;
} else {
/*If no switching has been done AND the direction is "asc",
set the direction to "desc" and run the while loop again.*/
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}
// hide all asc/desc sort arrows
sortimgs = document.querySelectorAll('[id^="sort-"]');
for (i = 0; i < sortimgs.length; i++) {
sortimgs[i].style.display = "none";
}
// show current asc/desc sort arrow and set sort_order var
if (dir == "asc") {
document.getElementById("sort-" + n + "a").style.display = "";
}
else {
document.getElementById("sort-" + n + "d").style.display = "";
}
// show all sortable indicators
sortableimgs = document.querySelectorAll('[id^="sortable-"]');
for (i = 0; i < sortableimgs.length; i++) {
sortableimgs[i].style.display = "";
}
// hide sortable indicator from current column
document.getElementById("sortable-" + n).style.display = "none";
// save sorting
sessionStorage.setItem("sort_column", n);
sessionStorage.setItem("sort_order", (dir == "asc") ? 0 : 1);
// restripe rows
restripe();
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0,
sortimgs, sortableimgs;
table = document.getElementById("watch-table");
switching = true;
//Set the sorting direction, either default 9, 1 or saved
if (loading) {
getSort();
dir = (sort_order == 0) ? "asc" : "desc";
loading = false;
} else {
dir = "asc";
}
/*Make a loop that will continue until
no switching has been done:*/
while (switching) {
//start by saying: no switching is done:
switching = false;
rows = table.rows;
/*Loop through all table rows (except the
first, which contains table headers):*/
for (i = 1; i < (rows.length - 1); i++) {
//start by saying there should be no switching:
shouldSwitch = false;
/*Get the two elements you want to compare,
one from current row and one from the next:*/
x = rows[i].getElementsByTagName("TD")[n];
y = rows[i + 1].getElementsByTagName("TD")[n];
x = x.innerHTML.toLowerCase();
y = y.innerHTML.toLowerCase();
if (!isNaN(x)) { // handle numeric columns
x = parseFloat(x);
y = parseFloat(y);
}
if (n == 1) { // handle play/pause column
x = rows[i].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src;
y = rows[i + 1].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src;
}
/*check if the two rows should switch place,
based on the direction, asc or desc:*/
if (dir == "asc") {
if (x > y) {
//if so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
} else if (dir == "desc") {
if (x < y) {
//if so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
}
}
if (shouldSwitch) {
/*If a switch has been marked, make the switch
and mark that a switch has been done:*/
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
//Each time a switch is done, increase this count by 1:
switchcount++;
} else {
/*If no switching has been done AND the direction is "asc",
set the direction to "desc" and run the while loop again.*/
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}
// hide all asc/desc sort arrows
sortimgs = document.querySelectorAll('[id^="sort-"]');
for (i = 0; i < sortimgs.length; i++) {
sortimgs[i].style.display = "none";
}
// show current asc/desc sort arrow and set sort_order var
if (dir == "asc") {
document.getElementById("sort-" + n + "a").style.display = "";
} else {
document.getElementById("sort-" + n + "d").style.display = "";
}
// show all sortable indicators
sortableimgs = document.querySelectorAll('[id^="sortable-"]');
for (i = 0; i < sortableimgs.length; i++) {
sortableimgs[i].style.display = "";
}
// hide sortable indicator from current column
document.getElementById("sortable-" + n).style.display = "none";
// save sorting
sessionStorage.setItem("sort_column", n);
sessionStorage.setItem("sort_order", (dir == "asc") ? 0 : 1);
// restripe rows
restripe();
}
// check/uncheck all checkboxes
function checkAll(e) {
var i;
var checkboxes = document.getElementsByName('check');
var checkboxFunctions = document.querySelectorAll('[id=checkbox-functions]');
var checkboxFunctions = document.getElementById('checkbox-functions');
if (e.checked) {
for (i = 0; i < checkboxes.length; i++) {
for (i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = true;
}
for (i = 0; i < checkboxFunctions.length; i++) {
checkboxFunctions[i].style.display = "";
}
}
else {
checkboxFunctions.style.left = coordX + 25 + "px";
checkboxFunctions.style.top = coordY + "px";
checkboxFunctions.style.display = "";
} else {
for (i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = false;
}
for (i = 0; i < checkboxFunctions.length; i++) {
checkboxFunctions[i].style.display = "none";
}
checkboxFunctions.style.display = "none";
}
}
// check/uncheck checkall checkbox if all other checkboxes are checked/unchecked
function checkChange(){
function checkChange() {
var i;
var totalCheckbox = document.querySelectorAll('input[name="check"]').length;
var totalChecked = document.querySelectorAll('input[name="check"]:checked').length;
var checkboxFunctions = document.querySelectorAll('[id=checkbox-functions]');
if(totalCheckbox == totalChecked) {
document.getElementsByName("showhide")[0].checked=true;
}
else {
document.getElementsByName("showhide")[0].checked=false;
var checkboxFunctions = document.getElementById('checkbox-functions'); //document.querySelectorAll('[id=checkbox-functions]');
if (totalCheckbox == totalChecked) {
document.getElementsByName("showhide")[0].checked = true;
} else {
document.getElementsByName("showhide")[0].checked = false;
}
if(totalChecked == 0) {
for (i = 0; i < checkboxFunctions.length; i++) {
checkboxFunctions[i].style.display = "none";
if (totalChecked > 0) {
checkboxFunctions.style.display = "";
checkboxFunctions.style.left = coordX + 25 + "px";
if ( coordY > ( window.innerHeight - checkboxFunctions.offsetHeight) ) {
checkboxFunctions.style.top = (window.innerHeight - checkboxFunctions.offsetHeight) + "px";
}
}
else {
for (i = 0; i < checkboxFunctions.length; i++) {
checkboxFunctions[i].style.display = "";
else {
checkboxFunctions.style.top = coordY + "px";
}
} else {
checkboxFunctions.style.display = "none";
}
}
// search watches in Title column
function tblSearch(evt) {
var code = evt.charCode || evt.keyCode;
if (code == CONSTANT_ESCAPE_KEY) {
document.getElementById("txtInput").value = '';
}
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("txtInput");
filter = input.value.toUpperCase();
table = document.getElementById("watch-table");
tr = table.getElementsByTagName("tr");
for (i = 1; i < tr.length; i++) { // skip header
td = tr[i].getElementsByTagName("td")[3]; // col 3 is the hidden title/url column
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
// restripe rows
restripe();
if (code == CONSTANT_ESCAPE_KEY) {
document.getElementById("watch-table-wrapper").focus();
}
var code = evt.charCode || evt.keyCode;
if (code == CONSTANT_ESCAPE_KEY) {
document.getElementById("txtInput").value = '';
}
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("txtInput");
filter = input.value.toUpperCase();
table = document.getElementById("watch-table");
tr = table.getElementsByTagName("tr");
for (i = 1; i < tr.length; i++) { // skip header
td = tr[i].getElementsByTagName("td")[3]; // col 3 is the hidden title/url column
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
// restripe rows
restripe();
if (code == CONSTANT_ESCAPE_KEY) {
document.getElementById("watch-table-wrapper").focus();
}
}
// restripe after searching or sorting
function restripe () {
function restripe() {
var i, visrows = [];
var table = document.getElementById("watch-table");
var rows = table.getElementsByTagName("tr");
for (i = 1; i < rows.length; i++) { // skip header
if (rows[i].style.display !== "none") {
if (rows[i].style.display !== "none") {
visrows.push(rows[i]);
}
}
for (i=0 ; i<visrows.length; i++) {
for (i = 0; i < visrows.length; i++) {
var row = visrows[i];
if( i%2==0 ) {
if (i % 2 == 0) {
row.classList.remove('pure-table-odd');
row.classList.add('pure-table-even');
}
else {
} else {
row.classList.remove('pure-table-even');
row.classList.add('pure-table-odd');
}
var cells = row.getElementsByTagName("td");
for(var j=0; j<cells.length; j++) {
if( i%2==0 ) {
for (var j = 0; j < cells.length; j++) {
if (i % 2 == 0) {
cells[j].style.background = "#f2f2f2";
} else {
cells[j].style.background = "#ffffff";
}
}
// uncomment to renumber rows ascending: var cells = row.getElementsByTagName("td");
// uncomment to renumber rows ascending: cells[0].innerText = i+1;
// uncomment to renumber rows ascending: var cells = row.getElementsByTagName("td");
// uncomment to renumber rows ascending: cells[0].innerText = i+1;
}
}
// get checked or all uuids
function getChecked(items) {
var i, checkedArr, uuids = '';
if ( items === undefined ) {
if (items === undefined) {
checkedArr = document.querySelectorAll('input[name="check"]:checked');
}
else {
} else {
checkedArr = document.querySelectorAll('input[name="check"]');
}
if ( checkedArr.length > 0 ) {
if (checkedArr.length > 0) {
let output = [];
for (i = 0; i < checkedArr.length; i++ ) {
output.push( checkedArr[i].parentNode.parentNode.getAttribute("id") );
for (i = 0; i < checkedArr.length; i++) {
output.push(checkedArr[i].parentNode.parentNode.getAttribute("id"));
}
for (i = 0; i < checkedArr.length; i++ ) {
if (i < checkedArr.length - 1 ) {
for (i = 0; i < checkedArr.length; i++) {
if (i < checkedArr.length - 1) {
uuids += output[i] + ",";
} else {
uuids += output[i];
@ -301,42 +305,41 @@ function getChecked(items) {
// process selected watches
function processChecked(func, tag) {
var uuids, result;
if ( func == 'mark_all_notviewed' ) {
if (func == 'mark_all_notviewed') {
uuids = getChecked('all');
}
else {
} else {
uuids = getChecked();
}
// confirm if deleting
if ( func == 'delete_selected' && uuids.length > 0 ) {
if (func == 'delete_selected' && uuids.length > 0) {
result = confirm('Deletions cannot be undone.\n\nAre you sure you want to continue?');
if ( result == false) {
if (result == false) {
return;
}
}
// href locations
var currenturl = window.location;
var posturl = location.protocol + '//' + location.host + '/api/process-selected';
var posturl = location.protocol + '//' + location.host + '/api/process-selected';
// posting vars
const XHR = new XMLHttpRequest(),
FD = new FormData();
FD = new FormData();
// fill form data
FD.append('func', func);
FD.append('tag', tag);
FD.append('uuids', uuids);
// success
XHR.addEventListener( 'load', function( event ) {
XHR.addEventListener('load', function(event) {
window.location = currenturl;
});
// error
XHR.addEventListener(' error', function( event ) {
alert( 'Error posting request.' );
XHR.addEventListener(' error', function(event) {
alert('Error posting request.');
});
// set up request
XHR.open( 'POST', posturl );
XHR.open('POST', posturl);
// send
XHR.send( FD );
XHR.send(FD);
}
function clearSearch() {
@ -345,27 +348,26 @@ function clearSearch() {
}
function isSessionStorageSupported() {
var storage = window.sessionStorage;
try {
storage.setItem('test', 'test');
storage.removeItem('test');
return true;
} catch (e) {
return false;
}
var storage = window.sessionStorage;
try {
storage.setItem('test', 'test');
storage.removeItem('test');
return true;
} catch (e) {
return false;
}
}
function getSort() {
if (isSessionStorageSupported()) {
// retrieve sort settings if set
if ( sessionStorage.getItem("sort_column") != null ) {
sort_column = sessionStorage.getItem("sort_column");
sort_order = sessionStorage.getItem("sort_order");
}
else {
if (sessionStorage.getItem("sort_column") != null) {
sort_column = sessionStorage.getItem("sort_column");
sort_order = sessionStorage.getItem("sort_order");
} else {
sort_column = 7; // last changed
sort_order = 1; // desc
sort_order = 1; // desc
//alert("Your web browser does not support retaining sorting and page position.");
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -34,9 +34,9 @@
<ul class="pure-menu-list" id="top-right-menu">
{% if current_user.is_authenticated or not has_password %}
{% if not current_diff_url %}
<li class="pure-menu-item">
<span class="search-box"><input type="text" id="txtInput" onkeyup="tblSearch(event)" onmouseup="clearSearch(event)" placeholder="Title..." /></span>
</li>
<li class="pure-menu-item">
<span class="search-box"><input type="text" id="txtInput" onkeyup="tblSearch(event)" onmouseup="clearSearch(event)" placeholder="Title..." /></span>
</li>
<li class="pure-menu-item">
<a href="{{ url_for('get_backup')}}" class="pure-menu-link">BACKUP</a>
</li>

Loading…
Cancel
Save