mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
front end trigger for backend jobs framework
This commit is contained in:
@@ -692,6 +692,13 @@ height: 50px;
|
||||
|
||||
}
|
||||
|
||||
.settings-expand-icon {
|
||||
font-size: medium;
|
||||
/* background-color: #272c30; */
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
|
||||
.settings_content input[type=checkbox]
|
||||
{
|
||||
width: auto
|
||||
@@ -711,4 +718,9 @@ height: 50px;
|
||||
z-index: 1;
|
||||
left: 0px;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.pointer
|
||||
{
|
||||
cursor:pointer;
|
||||
}
|
||||
@@ -500,7 +500,7 @@ the arp-scan will take hours to complete instead of seconds.
|
||||
'WEBHOOK_URL_name' => 'Target URL',
|
||||
'WEBHOOK_URL_description' => 'Target URL starting with <code>http://</code> or <code>https://</code>.',
|
||||
'WEBHOOK_PAYLOAD_name' => 'Payload type',
|
||||
'WEBHOOK_PAYLOAD_description' => 'The Webhook payload data format for the <code>body</code> > <code>attachments</code> > <code>text</code> attribute in the payload json. See an example of the payload <a target="_blank" href="https://github.com/jokob-sk/Pi.Alert/blob/main/docs/webhook_json_sample.json">here</a>. (e.g.: for discord use <code>html</code>)',
|
||||
'WEBHOOK_PAYLOAD_description' => 'The Webhook payload data format for the <code>body</code> > <code>attachments</code> > <code>text</code> attribute in the payload json. See an example of the payload <a target="_blank" href="https://github.com/jokob-sk/Pi.Alert/blob/main/back/webhook_json_sample.json">here</a>. (e.g.: for discord use <code>html</code>)',
|
||||
'WEBHOOK_REQUEST_METHOD_name' => 'Request method',
|
||||
'WEBHOOK_REQUEST_METHOD_description' => 'The HTTP request method to be used for the webhook call.',
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ CommitDB();
|
||||
<?php echo lang('Navigation_Settings');?>
|
||||
<a style="cursor:pointer">
|
||||
<span>
|
||||
<i id='toggleSettings' onclick="toggleAllSettings()" class="fa fa-angle-double-down"></i>
|
||||
<i id='toggleSettings' onclick="toggleAllSettings()" class="settings-expand-icon fa fa-angle-double-down"></i>
|
||||
</span>
|
||||
</a>
|
||||
</h1>
|
||||
@@ -239,10 +239,16 @@ CommitDB();
|
||||
|
||||
$eventsList = createArray($set['Events']);
|
||||
|
||||
$iconMap = [
|
||||
"test" => ["To test this configuration you have to save it at first.","fa-vial-circle-check"]
|
||||
];
|
||||
|
||||
if(count($eventsList) > 0)
|
||||
{
|
||||
foreach ($eventsList as $event) {
|
||||
$eventsHtml = $eventsHtml.'<span class="input-group-addon"><i class="fa fa-vial-circle-check" data-toggle="'.$event.'"></i></span>';
|
||||
$eventsHtml = $eventsHtml.'<span class="input-group-addon">
|
||||
<i title="'.$iconMap[$event][0].'" class="fa '.$iconMap[$event][1].' pointer" data-myparam="'.$set['Code_Name'].'" data-myevent="'.$event.'"></i>
|
||||
</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,11 +450,30 @@ CommitDB();
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script defer>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// handling events on the backend initiated by the front end START
|
||||
// -----------------------------------------------------------------------------
|
||||
$(window).on('load', function() {
|
||||
$('i[data-myevent]').each(function(index, element){
|
||||
$(element).attr('onclick',
|
||||
'handleEvent(\"' + $(element).attr('data-myevent') + '|'+ $(element).attr('data-myparam') + '\")'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
function handleEvent (value){
|
||||
|
||||
setParameter ('Front_Event', value)
|
||||
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
// handling events on the backend initiated by the front end END
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// Show last time settings have been imported
|
||||
getParam("lastImportedTime", "Back_Settings_Imported", skipCache = true);
|
||||
|
||||
Reference in New Issue
Block a user