-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Hermes Broker by default & stub w/refer to installation instructions
- Loading branch information
1 parent
92b7b9b
commit 6b7cc77
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from crispy_forms.layout import Layout, HTML | ||
|
||
from tom_alerts.alerts import GenericBroker, GenericQueryForm, GenericAlert | ||
|
||
|
||
class HermesQueryForm(GenericQueryForm): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.helper.inputs.pop() | ||
self.helper.layout = Layout( | ||
HTML(''' | ||
<p> | ||
This plugin is a stub for the Hermes Broker plugin. In order to install the full plugin, please see the | ||
instructions <a href="https://github.com/TOMToolkit/tom_hermes">here</a>. | ||
</p> | ||
'''), | ||
HTML('''<a class="btn btn-outline-primary" href={% url 'tom_alerts:list' %}>Back</a>''') | ||
) | ||
|
||
|
||
class HermesBroker(GenericBroker): | ||
name = 'Hermes' | ||
form = HermesQueryForm | ||
|
||
def fetch_alerts(self, parameters): | ||
return iter([]), '' | ||
|
||
def process_reduced_data(self, target, alert=None): | ||
return | ||
|
||
def to_generic_alert(self, alert): | ||
return GenericAlert() |