diff options
author | Simon Rettberg | 2021-06-25 16:21:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-06-25 16:21:17 +0200 |
commit | 32f0677dbca9e3347b931c1d0105eb37aa57e90d (patch) | |
tree | ddad4562e7ee8439a24e2462d44614692bb71d14 /modules-available/eventlog/templates | |
parent | Update .idea (diff) | |
download | slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.tar.gz slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.tar.xz slx-admin-32f0677dbca9e3347b931c1d0105eb37aa57e90d.zip |
[eventlog] Add event filtering and notification system
Diffstat (limited to 'modules-available/eventlog/templates')
9 files changed, 494 insertions, 1 deletions
diff --git a/modules-available/eventlog/templates/_page.html b/modules-available/eventlog/templates/_page.html index 6be0bbb8..facdd205 100644 --- a/modules-available/eventlog/templates/_page.html +++ b/modules-available/eventlog/templates/_page.html @@ -1,3 +1,4 @@ +<h2>{{lang_eventLog}}</h2> {{{pagenav}}} <table class="table table-striped table-condensed"> <thead> diff --git a/modules-available/eventlog/templates/heading.html b/modules-available/eventlog/templates/heading.html index 37612a77..e69de29b 100644 --- a/modules-available/eventlog/templates/heading.html +++ b/modules-available/eventlog/templates/heading.html @@ -1 +0,0 @@ -<h1>{{lang_eventLog}}</h1>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-edit-mailconfig.html b/modules-available/eventlog/templates/page-filters-edit-mailconfig.html new file mode 100644 index 00000000..07d6e9c0 --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-edit-mailconfig.html @@ -0,0 +1,54 @@ +<h2>{{title}}</h2> + + +<form method="post" action="?do=eventlog&show=mailconfigs"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="id" value="{{configid}}"> + <div class="form-group row"> + <div class="col-md-4"> + <label for="i-host">{{lang_host}}</label> + <input id="i-host" class="form-control" name="host" value="{{host}}" required> + </div> + <div class="col-md-4"> + <label for="i-ssl">{{lang_ssl}}</label> + <select name="ssl" id="i-ssl" class="form-control"> + <option value="IMPLICIT" {{IMPLICIT_selected}}>{{lang_sslImplicit}}</option> + <option value="NONE" {{NONE_selected}}>{{lang_sslNone}}</option> + <option value="EXPLICIT" {{EXPLICIT_selected}}>{{lang_sslExplicit}}</option> + </select> + </div> + <div class="col-md-4"> + <label for="i-port">{{lang_port}}</label> + <input id="i-port" type="number" min="1" max="65535" class="form-control" name="port" value="{{port}}" required> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-6"> + <label for="i-username">{{lang_username}}</label> + <input id="i-username" class="form-control" name="username" value="{{username}}"> + </div> + <div class="col-sm-6"> + <label for="i-password">{{lang_password}}</label> + <input id="i-password" type="{{password_type}}" class="form-control" name="password" value="{{password}}"> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-6"> + <label for="i-senderaddress">{{lang_senderAddress}}</label> + <input id="i-senderaddress" class="form-control" name="senderaddress" value="{{senderaddress}}" required> + </div> + <div class="col-sm-6"> + <label for="i-replyto">{{lang_replyTo}}</label> + <input id="i-replyto" class="form-control" name="replyto" value="{{replyto}}"> + </div> + </div> + <div class="buttonbar text-right"> + <a class="btn btn-default" href="?do=eventlog&show=mailconfigs"> + {{lang_cancel}} + </a> + <button class="btn btn-primary" type="submit" name="action" value="save-mailconfig"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_save}} + </button> + </div> +</form>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-edit-rule.html b/modules-available/eventlog/templates/page-filters-edit-rule.html new file mode 100644 index 00000000..72a53e9a --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-edit-rule.html @@ -0,0 +1,102 @@ +<h2>{{title}}</h2> + + +<form method="post" action="?do=eventlog&show=rules"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="id" value="{{ruleid}}"> + <div class="form-group row"> + <div class="col-md-4"> + <label for="i-type">{{lang_type}}</label> + <input autocomplete="off" id="i-type" list="i-types" class="form-control" name="type" value="{{type}}" required> + <datalist id="i-types"> + {{#types}} + <option value="{{.}}">{{lang_typeExample}}: {{.}}</option> + {{/types}} + </datalist> + </div> + <div class="col-md-8"> + <label for="i-title">{{lang_title}}</label> + <input id="i-title" class="form-control" name="title" value="{{title}}" required> + </div> + </div> + <div class="form-group row"> + <div class="col-md-12"> + <label for="i-transports">{{lang_transports}}</label> + <select multiple name="transports[]" id="i-transports" class="form-control multilist"> + {{#transports}} + <option value="{{transportid}}" {{selected}}>{{title}}</option> + {{/transports}} + </select> + </div> + </div> + {{#filter}} + <div class="form-group"> + <label> + <span class="form-control">{{index}}</span> + </label> + <label> + {{lang_filterPath}} + <input class="form-control" name="filter[{{index}}][path]" value="{{path}}"> + </label> + <label> + {{lang_filterOp}} + <select class="form-control op-select" name="filter[{{index}}][op]" data-index="{{index}}"> + {{#operators}} + <option {{selected}}>{{name}}</option> + {{/operators}} + </select> + </label> + <label> + {{lang_filterArg}} + <input class="form-control op-arg" name="filter[{{index}}][arg]" value="{{arg}}" data-index="{{index}}"> + </label> + <!--label> + {{lang_filterResult}} + <input class="form-control" name="filter[{{index}}][result]" value="{{result}}"> + </label--> + </div> + {{/filter}} + <div> + <p>{{lang_hintRegex}}</p> + </div> + <div class="form-group"> + <label for="i-subject">{{lang_subject}}</label> + <input id="i-subject" class="form-control" name="subject" value="{{subject}}"> + </div> + <div class="form-group"> + <label for="msg-txt"> + {{lang_messageTemplate}} + </label> + <textarea required id="msg-txt" name="message" class="form-control" rows="10" cols="80">{{message}}</textarea> + <p> + {{lang_messageTemplateHelp}} Platzhalter %zeile.n%, blabla.... + </p> + </div> + <div class="buttonbar text-right"> + <a class="btn btn-default" href="?do=eventlog&show=rules"> + {{lang_cancel}} + </a> + <button class="btn btn-primary" type="submit" name="action" value="save-filter"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_save}} + </button> + </div> +</form> + +<script> + document.addEventListener('DOMContentLoaded', function () { + var $multilists = $("select.multilist"); + if ($multilists.multiselect) { + $multilists.multiselect({ + includeSelectAllOption: true, + buttonWidth: '100%', + buttonClass: 'form-control' + }); + } + $('.op-select').change(function() { + var $t = $(this); + var disabled = $t.val() === '*'; + $('.op-arg[data-index=' + $t.data('index') + ']').prop('disabled', disabled); + }).change(); + }); +</script>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-edit-transport.html b/modules-available/eventlog/templates/page-filters-edit-transport.html new file mode 100644 index 00000000..77213b28 --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-edit-transport.html @@ -0,0 +1,190 @@ +<h2>{{lang_editFilter}} {{#title}}–{{/title}} {{title}}</h2> + +<form method="post" action="?do=eventlog&show=transports"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="id" value="{{transportid}}"> + + <div class="form-group row"> + <div class="col-sm-6"> + <label for="title">{{lang_title}}</label> + <input id="title" name="title" class="form-control" value="{{title}}" required> + </div> + <div class="col-sm-6"> + <label for="transport-select"> + {{lang_type}} + </label> + <select id="transport-select" class="form-control" name="type"> + <option value="mail" {{mail_selected}}>{{lang_mail}}</option> + <option value="irc" {{irc_selected}}>{{lang_irc}}</option> + <option value="http" {{http_selected}}>{{lang_http}}</option> + <option value="group" {{group_selected}}>{{lang_transportGroup}}</option> + </select> + </div> + </div> + <hr> + + <div class="transport-list"> + <div id="transport-mail"> + <div class="form-group row"> + <div class="col-md-6"> + <label for="mail-config">{{lang_mailConfig}}</label> + <select class="form-control" name="mail-config-id" id="mail-config"> + {{^mailconfigs}} + <option value="0" disabled>{{lang_noMailConfig}}</option> + {{/mailconfigs}} + {{#mailconfigs}} + <option value="{{configid}}" {{selected}}>{{senderaddress}} @ {{host}}:{{port}}</option> + {{/mailconfigs}} + </select> + </div> + <div class="col-md-6"> + <label for="mail-users">{{lang_mailUsers}}</label> + <select class="form-control multilist" name="mail-users[]" multiple id="mail-users"> + {{#users}} + <option value="{{userid}}" {{selected}} {{disabled}}>{{login}} - {{fullname}} - {{email}}</option> + {{/users}} + </select> + </div> + </div> + <div class="form-group row"> + <div class="col-md-12"> + <label for="mail-extra-mails">{{lang_additionalMailAddresses}}</label> + <textarea class="form-control" name="mail-extra-mails" id="mail-extra-mails">{{data.mail-extra-mails}}</textarea> + </div> + </div> + </div> + + <div id="transport-irc"> + <div class="form-group row"> + <div class="col-md-4 col-sm-6"> + <label for="irc-server">{{lang_ircServer}}</label> + <input id="irc-server" name="irc-server" class="form-control" value="{{data.irc-server}}" + placeholder="irc.example.com"> + </div> + <div class="col-md-4 col-sm-6"> + <label for="irc-target">{{lang_ircTarget}}</label> + <input id="irc-target" name="irc-target" class="form-control" value="{{data.irc-target}}" placeholder="#foo"> + </div> + <div class="col-md-4 col-sm-6"> + <label for="irc-server-passwd">{{lang_ircServerPassword}}</label> + <input id="irc-server-passwd" name="irc-server-passwd" class="form-control" + value="{{data.irc-server-passwd}}"> + </div> + </div> + <div class="form-group row"> + <div class="col-md-4 col-sm-6"> + <label for="irc-nickname">{{lang_ircNickname}}</label> + <input id="irc-nickname" name="irc-nickname" class="form-control" value="{{data.irc-nickname}}" + placeholder="Brunhilde"> + </div> + </div> + </div> + + <div id="transport-http"> + <div class="form-group row"> + <div class="col-md-10"> + <label for="http-uri">{{lang_httpUri}}</label> + <input id="http-uri" name="http-uri" class="form-control" value="{{data.http-uri}}" + placeholder="https://example.com/bwlp"> + <p>{{lang_uriUseSUBJECTandTEXThint}}</p> + </div> + <div class="col-md-2"> + <label for="http-method">{{lang_httpMethod}}</label> + <select id="http-method" name="http-method" class="form-control"> + <option {{POST_selected}}>POST</option> + <option {{GET_selected}}>GET</option> + </select> + </div> + </div> + <div id="post-options" class="form-group row"> + <div class="col-md-7"> + <label for="http-post-field">{{lang_httpPostField}}</label> + <input id="http-post-field" name="http-post-field" class="form-control" value="{{data.http-post-field}}" + placeholder="key=1234&message=%TEXT%"> + <p>{{lang_postUseSUBJECTandTEXThint}}</p> + </div> + <div class="col-md-5"> + <label for="http-post-format">{{lang_httpPostFormat}}</label> + <select id="http-post-format" name="http-post-format" class="form-control"> + <option value="FORM" {{FORM_selected}} aria-describedby="d-fd">FORM-data (urlencode)</option> + <option value="JSON" {{JSON_selected}} aria-describedby="d-js">json string</option> + <option value="JSON_AUTO" {{JSON_AUTO_selected}} aria-describedby="d-aj">{{lang_autoJson}}</option> + </select> + <div id="d-fd"><b>FORM-data</b>: {{lang_formDataHelp}}</div> + <div id="d-js"><b>json string</b>: {{lang_jsonStringHelp}}</div> + <div id="d-aj"><b>{{lang_autoJson}}</b>: {{lang_autoJsonHelp}}</div> + </div>templates + </div> + <div class="form-group"> + <label for="http-method"></label> + </div> + </div> + + <div id="transport-group"> + <div class="form-group"> + <label for="group-list">{{lang_selectTransports}}</label> + <select class="form-control multilist" name="group-list[]" multiple id="group-list"> + {{#backends}} + <option value="{{transportid}}" {{selected}}>{{title}}</option> + {{/backends}} + </select> + </div> + </div> + </div> + <hr> + + <div class="form-group"> + <label for="i-rules">{{lang_rules}}</label> + <select multiple name="rules[]" id="i-rules" class="form-control multilist"> + {{#rules}} + <option value="{{ruleid}}" {{selected}}>{{title}}</option> + {{/rules}} + </select> + </div> + + <div class="form-group"> + <label for="description-box">{{lang_optionalDescription}}</label> + <textarea id="description-box" name="description" class="form-control" rows="10">{{description}}</textarea> + </div> + + <div class="buttonbar text-right"> + <a class="btn btn-default" href="?do=eventlog&show=transports"> + {{lang_cancel}} + </a> + <button class="btn btn-primary" type="submit" name="action" value="save-transport"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_save}} + </button> + </div> +</form> + +<script> + document.addEventListener('DOMContentLoaded', function () { + // Show proper transport options + $('#transport-select').change(function () { + $('.transport-list > div').hide(); + $('#transport-' + $('#transport-select').val()).show(); + }).change(); + // Init multilist of available + var $multilists = $("select.multilist"); + if ($multilists.multiselect) { + $multilists.multiselect({ + includeSelectAllOption: true, + buttonWidth: '100%', + buttonClass: 'form-control' + }); + } + // Hide POST options for GET + $('#http-method').change(function () { + if ($(this).val() === 'POST') { + $('#post-options').show(); + } else { + $('#post-options').hide(); + } + }).change(); + // Disable POST input for JSON_AUTO + $('#http-post-format').change(function () { + $('#http-post-field').prop('disabled', $(this).val() === 'JSON_AUTO'); + }).change(); + }); +</script>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-mailconfigs.html b/modules-available/eventlog/templates/page-filters-mailconfigs.html new file mode 100644 index 00000000..08901f87 --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-mailconfigs.html @@ -0,0 +1,42 @@ +<form method="post" action="?do=eventlog&show=mailconfigs"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="delete-mailconfig"> + <table class="table"> + <thead> + <tr> + <th class="slx-smallcol">{{lang_id}}</th> + <th class="slx-smallcol">{{lang_host}}</th> + <th class="slx-smallcol">{{lang_ssl}}</th> + <th>{{lang_senderAddress}}</th> + <th class="slx-smallcol">{{lang_edit}}</th> + </tr> + </thead> + <tbody> + {{#configs}} + <tr> + <td>{{configid}}</td> + <td class="text-nowrap">{{host}}:{{port}}</td> + <td class="text-nowrap">{{ssl}}</td> + <td>{{senderaddress}}{{^senderaddress}}{{replyto}}{{/senderaddress}}</td> + <td class="text-nowrap"> + <a class="btn btn-xs btn-default" href="?do=eventlog&show=mailconfigs&id={{configid}}"> + <span class="glyphicon glyphicon-edit" aria-label="{{lang_edit}}"></span> + </a> + <button class="btn btn-xs btn-danger" type="submit" name="id" value="{{configid}}" + data-confirm="{{lang_reallyDelete}}"> + <span class="glyphicon glyphicon-trash"></span> + </button> + </td> + </tr> + {{/configs}} + </tbody> + </table> + +</form> + +<div class="buttonbar text-right"> + <a class="btn btn-success" href="?do=eventlog&show=mailconfigs&id=0"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_add}} + </a> +</div>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-rules.html b/modules-available/eventlog/templates/page-filters-rules.html new file mode 100644 index 00000000..524e71b2 --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-rules.html @@ -0,0 +1,44 @@ +<form method="post" action="?do=eventlog&show=rules"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="delete-filter"> + <table class="table"> + <thead> + <tr> + <th class="slx-smallcol">{{lang_id}}</th> + <th class="slx-smallcol">{{lang_type}}</th> + <th>{{lang_title}}</th> + <!--th>{{lang_details}}</th--> + <th class="slx-smallcol"></th> + <th class="slx-smallcol">{{lang_edit}}</th> + </tr> + </thead> + <tbody> + {{#filters}} + <tr> + <td>{{ruleid}}</td> + <td>{{type}}</td> + <td class="text-nowrap">{{title}}</td> + <!--td class="small">{.{datafilter}.}</td--> + <td><span class="badge">{{useCount}}</span></td> + <td class="slx-smallcol"> + <a class="btn btn-xs btn-default" href="?do=eventlog&show=rules&id={{ruleid}}"> + <span class="glyphicon glyphicon-edit" aria-label="{{lang_edit}}"></span> + </a> + <button class="btn btn-xs btn-danger" type="submit" name="id" value="{{ruleid}}" + data-confirm="{{lang_reallyDelete}}"> + <span class="glyphicon glyphicon-trash"></span> + </button> + </td> + </tr> + {{/filters}} + </tbody> + </table> + +</form> + +<div class="buttonbar text-right"> + <a class="btn btn-success" href="?do=eventlog&show=rules&id=0"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_add}} + </a> +</div>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-filters-transports.html b/modules-available/eventlog/templates/page-filters-transports.html new file mode 100644 index 00000000..34015f2f --- /dev/null +++ b/modules-available/eventlog/templates/page-filters-transports.html @@ -0,0 +1,45 @@ +<form method="post" action="?do=eventlog&show=transports"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="delete-transport"> + <table class="table"> + <thead> + <tr> + <th class="slx-smallcol">{{lang_id}}</th> + <th class="slx-smallcol">{{lang_type}}</th> + <th>{{lang_title}}</th> + <th>{{lang_details}}</th> + <th class="slx-smallcol"></th> + <th class="slx-smallcol">{{lang_edit}}</th> + </tr> + </thead> + <tbody> + {{#transports}} + <tr> + <td>{{transportid}}</td> + <td>{{type}}</td> + <td>{{title}}</td> + <td class="small">{{details.toString}}</td> + <td><span class="badge">{{useCount}}</span></td> + <td class="slx-smallcol"> + <a class="btn btn-xs btn-default" + href="?do=eventlog&show=transports&id={{transportid}}"> + <span class="glyphicon glyphicon-edit" aria-label="{{lang_edit}}"></span> + </a> + <button class="btn btn-xs btn-danger" type="submit" name="id" value="{{ruleid}}" + data-confirm="{{lang_reallyDelete}}"> + <span class="glyphicon glyphicon-trash"></span> + </button> + </td> + </tr> + {{/transports}} + </tbody> + </table> + +</form> + +<div class="buttonbar text-right"> + <a class="btn btn-success" href="?do=eventlog&show=transports&id=0"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_add}} + </a> +</div>
\ No newline at end of file diff --git a/modules-available/eventlog/templates/page-header.html b/modules-available/eventlog/templates/page-header.html new file mode 100644 index 00000000..c3595350 --- /dev/null +++ b/modules-available/eventlog/templates/page-header.html @@ -0,0 +1,16 @@ +<h1>{{lang_logAndEvents}}</h1> + +<ul class="nav nav-tabs"> + <li class="{{active_log}}"> + <a href="?do=eventlog&show=log">{{lang_log}}</a> + </li> + <li class="{{active_rules}}"> + <a href="?do=eventlog&show=rules">{{lang_rules}}</a> + </li> + <li class="{{active_transports}}"> + <a href="?do=eventlog&show=transports">{{lang_transports}}</a> + </li> + <li class="{{active_mailconfigs}}"> + <a href="?do=eventlog&show=mailconfigs">{{lang_mailconfigs}}</a> + </li> +</ul>
\ No newline at end of file |