Huge change, removed Status class and all "alert" messages are now shown as BS toast() and are via the DB and handled async in the F/E in jscript via Ajax. Fixed BUG-113 where toasts() were repeating. Removed many of the explicit alert messages (other than errors) and hooked {New|Finish}Job to consistently send messages to the F/E. Other messages (F/E without a job, like save settings) now use this model as well

This commit is contained in:
2023-01-11 13:48:50 +11:00
parent 829f38f223
commit 2be2c504b2

View File

@@ -1,31 +0,0 @@
from shared import PA
### shared variables to show state of save/delete when we redirect to 'show all' view
# used mostly to note we have create a job for the job manager, or when a job finishes
# including when duplicates are found on import. These status messages are exposed into
# the html files, and they show once for success/green, and sticky for danger/red
class Status(PA):
level="success"
message=""
def GetAlert(self):
return self.level
def GetMessage(self):
return self.message
def SetMessage(self, msg, l="success"):
self.message=msg
self.level=l
return
def AppendMessage(self, msg):
self.message=self.message+msg
return
def ClearStatus(self):
self.level="success"
self.message=""
return ""
st=Status()