mirror of https://github.com/openspug/spug
A api update
parent
511ecd10b5
commit
612379e7e2
|
@ -25,7 +25,7 @@ class Alarm(models.Model, ModelMixin):
|
|||
|
||||
def to_dict(self, *args, **kwargs):
|
||||
tmp = super().to_dict(*args, **kwargs)
|
||||
tmp['notify_mode'] = json.loads(self.notify_mode)
|
||||
tmp['notify_mode'] = ','.join(dict(self.MODES)[x] for x in json.loads(self.notify_mode))
|
||||
tmp['notify_grp'] = json.loads(self.notify_grp)
|
||||
tmp['status_alias'] = self.get_status_display()
|
||||
return tmp
|
||||
|
|
|
@ -26,7 +26,7 @@ class Scheduler:
|
|||
duration = seconds_to_human(time.time() - obj.latest_fault_time)
|
||||
Alarm.objects.create(
|
||||
name=obj.name,
|
||||
type=obj.type,
|
||||
type=obj.get_type_display(),
|
||||
status=status,
|
||||
duration=duration,
|
||||
notify_grp=obj.notify_grp,
|
||||
|
|
Loading…
Reference in New Issue