Compare commits
4 Commits
ee1c9b5494
...
6419e20d7e
| Author | SHA1 | Date | |
|---|---|---|---|
| 6419e20d7e | |||
| b51d9e1776 | |||
| fa2197adbe | |||
| 66344e146e |
12
TODO
12
TODO
@@ -1,17 +1,5 @@
|
||||
###
|
||||
# 4 TEST everything (don't forget keybindings,e.g. delete)
|
||||
# -- go into viewer code from a files_rbp - had red bin, bot green on viewer.
|
||||
#
|
||||
# consider this:
|
||||
$('#viewer_bin use').attr('fill', 'var(--bs-success)'); $('#viewer_del').removeClass('btn-outline-danger').addClass('btn-outline-success')
|
||||
$('#viewer_bin').hover(
|
||||
function() {
|
||||
$('use', this).attr('fill', 'white');
|
||||
},
|
||||
function() {
|
||||
$('use', this).attr('fill', 'var(--bs-success)');
|
||||
}
|
||||
);
|
||||
#
|
||||
# 5 think I killed pa_job_manager without passing an eid to a transform job, shouldn't crash
|
||||
# SHOULD JUST get AI to help clean-up and write defensive code here...
|
||||
|
||||
@@ -177,7 +177,7 @@ function DelDBox(del_or_undel)
|
||||
div+=`
|
||||
'/delete_files',
|
||||
success: function(data){
|
||||
if( $(location).attr('pathname').match('search') !== null ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-danger col-2">Ok</button>
|
||||
if( $(location).attr('pathname').match('search') !== null || document.viewing ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-danger col-2">Ok</button>
|
||||
</div>
|
||||
`
|
||||
else
|
||||
@@ -186,7 +186,7 @@ function DelDBox(del_or_undel)
|
||||
div+=`
|
||||
'/restore_files',
|
||||
success: function(data){
|
||||
if( $(location).attr('pathname').match('search') !== null ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-success col-2">Ok</button>
|
||||
if( $(location).attr('pathname').match('search') !== null || document.viewing ) { window.location='/' }; CheckForJobs() } }); return false" class="btn btn-outline-success col-2">Ok</button>
|
||||
</div>
|
||||
`
|
||||
$('#dbox-content').html(div)
|
||||
@@ -585,12 +585,11 @@ function getPage(pageNumber, successCallback, viewingIdx=0)
|
||||
// if search, disable folders
|
||||
if( OPT.search_term )
|
||||
$('#folders').prop('disabled', 'disabled').removeClass('border-info').addClass('border-secondary').removeClass('text-info').addClass('text-secondary');
|
||||
else if( res == [] )
|
||||
else if( document.entries.length == 0 )
|
||||
{
|
||||
html=`<span class="alert alert-danger p-2 col-auto">No files in Path!'</span>`
|
||||
console.log(html)
|
||||
html=`<span class="alert alert-danger p-2 col-auto">No files in Path</span>`
|
||||
$('#file_list_div').append(html)
|
||||
$('#files_div').append(html)
|
||||
$('#figures').append(html)
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) { console.error("Error:", error); } });
|
||||
|
||||
4
main.py
4
main.py
@@ -246,6 +246,10 @@ def logout():
|
||||
logout_user()
|
||||
return redirect('/login')
|
||||
|
||||
# quick health route so traefik knows we are up
|
||||
@app.route('/health')
|
||||
def health():
|
||||
return {"status": "ok"}, 200
|
||||
|
||||
###############################################################################
|
||||
# main to be called via Flask/Gunicorn
|
||||
|
||||
@@ -209,14 +209,16 @@
|
||||
<button class="btn btn-outline-info p-1" title="View Original" onClick="window.location='/'+document.viewing.FullPathOnFS">
|
||||
<svg width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#download"/></svg>
|
||||
</button>
|
||||
<button id="viewer_del" class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)"
|
||||
onClick="$.ajax({ type: 'POST', data: '&eid-0='+document.viewing.id, url: '/delete_files', success: function(data){ window.location='/'; return false; } })">
|
||||
<button id="viewer_del" class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)" onClick="DelDBox('Delete')">
|
||||
<svg id="viewer_bin" width="32" height="32" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#trash"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div class="row">
|
||||
</div id="viewer">
|
||||
</div id="viewer_div">
|
||||
{#
|
||||
$.ajax({ type: 'POST', data: '&eid-0='+document.viewing.id, url: '/delete_files', success: function(data){ window.location='/'; return false; } })">
|
||||
#}
|
||||
{% endblock main_content %}
|
||||
|
||||
{% block script_content %}
|
||||
@@ -258,7 +260,7 @@
|
||||
if( fname.indexOf( "static/Import" ) == 0 )
|
||||
{
|
||||
s+='<svg width="20" height="20" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#import"/></svg>'
|
||||
tmp_path=fname.replace(imp_path,"" )
|
||||
tmp_path=fname.replace("statuc/Import","" )
|
||||
}
|
||||
if( fname.indexOf( "static/Storage" ) == 0 )
|
||||
{
|
||||
@@ -280,5 +282,25 @@
|
||||
window.addEventListener('resize', DrawImg, false);
|
||||
window.addEventListener('resize', ResizeVideo, false);
|
||||
|
||||
// when we are in recycle bin, change colours to green & func to restore
|
||||
if( window.location.href.includes('files_rbp') )
|
||||
{
|
||||
$('#viewer_bin').attr('fill', 'var(--bs-success)')
|
||||
// fill with bg-success colour
|
||||
$('#viewer_bin use').attr('fill', 'var(--bs-success)')
|
||||
$('#viewer_del').removeClass('btn-outline-danger').addClass('btn-outline-success')
|
||||
$('#viewer_del').on('mouseenter', function() {
|
||||
// Set the SVG fill to white
|
||||
$('#viewer_bin use').attr('fill', 'white');
|
||||
});
|
||||
|
||||
// When mouse leaves the button
|
||||
$('#viewer_del').on('mouseleave', function() {
|
||||
// Revert the SVG fill to the bg-success colour
|
||||
$('#viewer_bin use').attr('fill', 'var(--bs-success)');
|
||||
});
|
||||
$('#viewer_del').on('click', function() { DelDBox('Restore') } )
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock script_content %}
|
||||
|
||||
Reference in New Issue
Block a user