Compare commits
3 Commits
022046cd3f
...
a7d56bae10
Author | SHA1 | Date |
---|---|---|
itdominator | a7d56bae10 | |
maximstewart | 4dafc328a5 | |
maximstewart | 86b652e8d7 |
|
@ -17,7 +17,10 @@ window_controllers = {}
|
||||||
|
|
||||||
|
|
||||||
def get_window_controller():
|
def get_window_controller():
|
||||||
if session.get('win_controller_id') is None:
|
controller = None
|
||||||
|
try:
|
||||||
|
controller = window_controllers[ session["win_controller_id"] ]
|
||||||
|
except Exception as e:
|
||||||
id = secrets.token_hex(16)
|
id = secrets.token_hex(16)
|
||||||
controller = WindowController()
|
controller = WindowController()
|
||||||
view = controller.get_window(1).get_view(0)
|
view = controller.get_window(1).get_view(0)
|
||||||
|
@ -28,8 +31,9 @@ def get_window_controller():
|
||||||
|
|
||||||
session['win_controller_id'] = id
|
session['win_controller_id'] = id
|
||||||
window_controllers.update( {id: controller } )
|
window_controllers.update( {id: controller } )
|
||||||
|
controller = window_controllers[ session["win_controller_id"] ]
|
||||||
|
|
||||||
return window_controllers[ session["win_controller_id"] ]
|
return controller
|
||||||
|
|
||||||
|
|
||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
|
@ -68,6 +72,12 @@ def listFiles(_hash = None):
|
||||||
path = view.get_path_part_from_hash(_hash)
|
path = view.get_path_part_from_hash(_hash)
|
||||||
view.push_to_path(path)
|
view.push_to_path(path)
|
||||||
|
|
||||||
|
error_msg = view.get_error_message()
|
||||||
|
if error_msg != None:
|
||||||
|
view.unset_error_message()
|
||||||
|
return msgHandler.createMessageJSON("danger", error_msg)
|
||||||
|
|
||||||
|
|
||||||
sub_path = view.get_current_sub_path()
|
sub_path = view.get_current_sub_path()
|
||||||
files = view.get_files_formatted()
|
files = view.get_files_formatted()
|
||||||
fave = db.session.query(Favorites).filter_by(link = sub_path).first()
|
fave = db.session.query(Favorites).filter_by(link = sub_path).first()
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#video-controls {
|
#video-controls {
|
||||||
position: relative;
|
position: relative;
|
||||||
bottom: 2em;
|
bottom: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,6 +38,19 @@
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noselect {
|
||||||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||||||
|
-webkit-user-select: none; /* Safari */
|
||||||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||||||
|
-moz-user-select: none; /* Old versions of Firefox */
|
||||||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||||
|
user-select: none; /* Non-prefixed version, currently
|
||||||
|
supported by Chrome, Edge, Opera and Firefox */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.volume-control-positioner {
|
.volume-control-positioner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 2em;
|
bottom: 2em;
|
||||||
|
|
|
@ -29,7 +29,10 @@ const loadFavePath = (e) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const openFile = (eve) => {
|
const openFile = (eve) => {
|
||||||
const target = eve.target;
|
let target = eve.target;
|
||||||
|
if (!target.getAttribute("title"))
|
||||||
|
target = target.parentElement
|
||||||
|
|
||||||
const ftype = target.getAttribute("ftype");
|
const ftype = target.getAttribute("ftype");
|
||||||
const title = target.getAttribute("title");
|
const title = target.getAttribute("title");
|
||||||
const hash = target.getAttribute("hash");
|
const hash = target.getAttribute("hash");
|
||||||
|
|
|
@ -78,13 +78,14 @@ class FilesList extends React.Component {
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
{card_header}
|
{card_header}
|
||||||
<input hash={hash} onClick={this.openThis} ftype={filetype} class="btn btn-secondary btn-sm float-right" title={name} type="button" value="Open"/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body text-center">
|
<div class="card-body text-center noselect" title={name} hash={hash} ftype={filetype} onDoubleClick={this.openThis}>
|
||||||
{card_body}
|
{card_body}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<input hash={hash} onClick={this.openThisLocally} ftype={filetype} class="btn btn-secondary btn-sm float-right" type="button" value="Open Locally"/>
|
<a href={"api/file-manager-action/files/" + hash} download class="btn btn-secondary btn-sm float-left">Download</a>
|
||||||
|
<input hash={hash} onClick={this.openThisLocally} ftype={filetype} class="btn btn-secondary btn-sm float-left" type="button" value="Open Locally"/>
|
||||||
|
<input hash={hash} onClick={this.openThis} ftype={filetype} class="btn btn-secondary btn-sm float-right" title={name} type="button" value="Open"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -9,8 +9,8 @@ from os.path import isdir, isfile, join
|
||||||
|
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from . import Path, Settings, Launcher
|
from .utils import Settings, Launcher
|
||||||
|
from . import Path
|
||||||
|
|
||||||
class View(Settings, Launcher, Path):
|
class View(Settings, Launcher, Path):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -20,6 +20,7 @@ class View(Settings, Launcher, Path):
|
||||||
self.images = []
|
self.images = []
|
||||||
self.desktop = []
|
self.desktop = []
|
||||||
self.ungrouped = []
|
self.ungrouped = []
|
||||||
|
self.error_message = None
|
||||||
|
|
||||||
self.set_to_home()
|
self.set_to_home()
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ class View(Settings, Launcher, Path):
|
||||||
self.files = []
|
self.files = []
|
||||||
|
|
||||||
if not isdir(path):
|
if not isdir(path):
|
||||||
self.set_to_home()
|
self._set_error_message("Path can not be accessed.")
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
for f in listdir(path):
|
for f in listdir(path):
|
||||||
|
@ -120,6 +121,15 @@ class View(Settings, Launcher, Path):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _set_error_message(self, text):
|
||||||
|
self.error_message = text
|
||||||
|
|
||||||
|
def unset_error_message(self):
|
||||||
|
self.error_message = None
|
||||||
|
|
||||||
|
def get_error_message(self):
|
||||||
|
return self.error_message
|
||||||
|
|
||||||
def get_current_directory(self):
|
def get_current_directory(self):
|
||||||
return self.get_path()
|
return self.get_path()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue