added icons for paths into a dict ICON, and func to retrieve the icon based on objects type of path

This commit is contained in:
2021-06-06 17:21:45 +10:00
parent 3cf27e9366
commit ecefb59458

View File

@@ -4,6 +4,12 @@ import os
hostname = socket.gethostname() hostname = socket.gethostname()
PROD_HOST="pa_web" PROD_HOST="pa_web"
ICON={}
ICON["Import"]="fa-file-upload"
ICON["Storage"]="fa-database"
ICON["Bin"]="fa-trash-alt"
if hostname == PROD_HOST: if hostname == PROD_HOST:
PA_JOB_MANAGER_HOST="192.168.0.2" PA_JOB_MANAGER_HOST="192.168.0.2"
DB_URL = 'postgresql+psycopg2://pa:for_now_pa@192.168.0.2:55432/pa' DB_URL = 'postgresql+psycopg2://pa:for_now_pa@192.168.0.2:55432/pa'
@@ -42,6 +48,11 @@ def CreateFoldersSelect(selected):
str += '</select>' str += '</select>'
return str return str
def LocationIcon(obj):
print( f"LocationIcon( {obj.in_dir.in_path.type.name} ) == {ICON[obj.in_dir.in_path.type.name]}" )
return ICON[obj.in_dir.in_path.type.name]
def SymlinkName(ptype, path, file): def SymlinkName(ptype, path, file):
sig_bit=file.replace(path, "") sig_bit=file.replace(path, "")