Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{% block _config_webhookconfig_widget %}
<h4 class="fw-sb mt-48 mb-xs">{{ 'mautic.config.tab.webhookconfig'|trans }}</h4>
<div class="text-muted small pb-md">{{ 'mautic.core.config.header.webhookconfig.description'|trans }}</div>
<div class="row">
<div class="panel panel-default mb-md">
<div class="panel-body">
<div class="row">
{% for f in form.children %}
<div class="col-xs-12">
{{ form_row(f) }}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,17 @@
{% if code >= 200 and code < 300 %}
<span class="label label-success">
{{ code }}
</span>
{% elseif code >= 300 and code < 500 %}
<span class="label label-warning">
{{ code }}
</span>
{% elseif code >= 500 %}
<span class="label label-warning">
{{ code }}
</span>
{% else %}
<span size="sm" class="label label-gray">
{{ code }}
</span>
{% endif %}

View File

@@ -0,0 +1,16 @@
<div class="col-lg-12">
<h3 class="mt-80 mb-md">{{ 'mautic.webhook.card.interesting'|trans }}</h3>
{% include '@MauticCore/Components/card.html.twig' with {
'type': 'feature--large',
'aspectRatio': '2:1',
'ctaType': 'local',
'image': {'src': 'app/bundles/WebhookBundle/Assets/images/google-deepmind-erunoELfh50-unsplash.jpg', 'alt': 'mautic.webhook.card.image.alt'|trans},
'eyebrow': 'mautic.webhook.webhooks'|trans,
'heading': 'mautic.webhook.card.heading'|trans,
'copy': 'mautic.webhook.card.copy'|trans,
'href': path('mautic_webhook_index'),
'attributes': {
'data-toggle': 'ajax',
}
} %}
</div>

View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<p>Dear User,</p>
<p>We wanted to bring to your attention that we've detected a failure in one of your configured webhooks. This issue has been ongoing for a significant period and requires your immediate attention to prevent potential disruptions.</p>
<h2>Details of the Issue:</h2>
<div class="content">
<p><strong>Webhook Name/ID:</strong>
<a href="{{ path('mautic_webhook_action', {'objectAction': 'view', 'objectId': webhook.id}) }}">
{{ webhook.name }}
</a>
</p>
<p><strong>Failure Started At:</strong> {{ failing_since }} (UTC)</p>
<p><strong>Current Status:</strong> Failing</p>
</div>
<h2>Recommended Action:</h2>
<div class="content">
<ul>
<li>Review the webhook configuration and ensure that the endpoint URL is correct and reachable.</li>
<li>Check any related server logs for error messages that might indicate the cause of the failure.</li>
<li>Please verify the authentication credentials, if required by the webhook endpoint.</li>
<li>Consider temporarily disabling the webhook to prevent further alerts while you resolve the issue.</li>
</ul>
<p>Our technical support team is available to assist you if necessary.</p>
<p>By resolving this promptly, you can prevent further complications from arising.</p>
</div>
<p class="footer">Thank you for your attention to this matter.</p>
<p>Best Regards,</p>
<p>{{ signature_from_name }}</p>
</body>
</html>

View File

@@ -0,0 +1,39 @@
{# Twig template for webhook killed notification #}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<p>Dear User,</p>
<p>We wanted to bring to your attention that we've detected a failure in one of your configured webhook so we unpublished it automatically. This issue has been ongoing for a significant period and requires your immediate attention to prevent potential disruptions.</p>
<h2>Details of the Issue:</h2>
<div class="content">
<p><strong>Webhook Name/ID:</strong>
<a href="{{ path('mautic_webhook_action', {'objectAction': 'view', 'objectId': webhook.id}) }}">
{{ webhook.name }}
</a>
</p>
<p><strong>Failure Started At:</strong> {{ failing_since }} (UTC)</p>
<p><strong>Current Status:</strong> Failing</p>
</div>
<h2>Recommended Action:</h2>
<div class="content">
<ul>
<li>Review the webhook configuration and ensure that the endpoint URL is correct and reachable.</li>
<li>Check any related server logs for error messages that might indicate the cause of the failure.</li>
<li>Please verify the authentication credentials, if required by the webhook endpoint.</li>
</ul>
<p>Our technical support team is available to assist you if necessary.</p>
<p>By resolving this promptly, you can prevent further complications from arising.</p>
</div>
<p class="footer">Thank you for your attention to this matter.</p>
<p>Best Regards,</p>
<p>{{ signature_from_name }}</p>
</body>
</html>

View File

@@ -0,0 +1,153 @@
{% extends '@MauticCore/Default/content.html.twig' %}
{% block preHeader %}
{{- include(
'@MauticCore/Helper/page_actions.html.twig', {
item: item,
templateButtons: {
'close': securityHasEntityAccess(
permissions['webhook:webhooks:viewown'],
permissions['webhook:webhooks:viewother'],
item.getCreatedBy()
),
},
routeBase: 'webhook',
'targetLabel': 'mautic.webhook.webhooks'|trans
}) -}}
{{ include('@MauticCore/Modules/category--inline.html.twig', {'category': item.category}) }}
{% endblock %}
{% block headerTitle %}{{ item.getName() }}{% endblock %}
{% block mauticContent %}mauticWebhook{% endblock %}
{% block actions %}
{{- include(
'@MauticCore/Helper/page_actions.html.twig', {
item: item,
templateButtons: {
'edit': securityHasEntityAccess(
permissions['webhook:webhooks:editown'],
permissions['webhook:webhooks:editother'],
item.getCreatedBy()
),
'clone': permissions['webhook:webhooks:create'],
'delete': securityHasEntityAccess(
permissions['webhook:webhooks:deleteown'],
permissions['webhook:webhooks:deleteother'],
item.getCreatedBy()
)
},
routeBase: 'webhook'
}) -}}
{% endblock %}
{% block content %}
<!-- start: box layout -->
<div class="box-layout">
<!-- left section -->
<div class="col-md-9 height-auto">
{% include '@MauticCore/Helper/description--expanded.html.twig' with {'description': item.description} %}
<div class="pa-md">
<div class="row">
<div class="col-md-12">
{% set hookLog = item.getLimitedLogs() %}
{% if hookLog is empty %}
<div class="alert alert-warning col-md-6 col-md-offset-3 mt-md" style="white-space: normal;">
<h4>
{% trans %}mautic.webhook.no.logs{% endtrans %}
</h4>
<p>
{% trans %}mautic.webhook.no.logs_desc{% endtrans %}
</p>
</div>
{% else %}
<table class="table table-responsive">
<thead>
<tr>
<th>
{% trans %}mautic.core.id{% endtrans %}
</th>
<th>
{% trans %}mautic.webhook.status{% endtrans %}
</th>
<th>
{% trans %}mautic.webhook.note{% endtrans %}
</th>
<th>
{% trans %}mautic.webhook.runtime{% endtrans %}
</th>
<th>
{% trans %}mautic.core.date.added{% endtrans %}
</th>
</tr>
</thead>
<tbody>
{% for log in hookLog %}
<tr>
<td>{{ log.getId() }}</td>
<td>{{- include(
'@MauticWebhook/Helper/labelcode.html.twig', {
code: log.getStatusCode()
}
) }}</td>
<td>{{ log.getNote() is not empty ? log.getNote() : 'mautic.webhook.webhook.logs.empty.response'|trans }}</td>
<td>{{ log.getRuntime() }} s</td>
<td>{{ dateToFull(log.getDateAdded()) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="alert alert-info col-md-6 col-md-offset-3 mt-md">
<h4>
{% trans %}mautic.webhook.webhook.logs.title{% endtrans %}
</h4>
<p>
{% trans %}mautic.webhook.webhook.logs.desc{% endtrans %}
</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- right section -->
<div class="col-md-3 bdr-l height-auto">
<!-- preview URL -->
<div class="panel shd-none bdr-rds-0 bdr-w-0 mt-sm mb-0">
<div class="panel-heading">
<div class="panel-title">{% trans %}mautic.webhook.webhook_url{% endtrans %}</div>
</div>
<div class="panel-body pt-xs">
<div class="input-group">
<input onclick="this.setSelectionRange(0, this.value.length);" type="text" class="form-control" readonly
value="{{ item.getWebhookUrl()|escape('html_attr') }}" />
<span class="input-group-btn">
{% include '@MauticCore/Helper/button.html.twig' with {
buttons: [
{
label: 'mautic.core.open_link',
variant: 'ghost',
icon_only: true,
icon: 'ri-external-link-line',
onclick: 'window.open("' ~ item.getWebhookUrl()|escape('html_attr') ~ '", "_blank");',
}
]
} %}
</span>
</div>
</div>
<hr class="hr-w-2" style="width:50%">
<!-- recent activity -->
{{- include(
'@MauticCore/Helper/recentactivity.html.twig', {
logs: logs
}
) }}
</div>
</div>
<!--/ right section -->
</div>
{% endblock %}

View File

@@ -0,0 +1,50 @@
{% extends '@MauticCore/Default/content.html.twig' %}
{% block headerTitle %}{{ entity.getId() ?
'mautic.webhook.webhook.header.edit'|trans({'%name%': entity.getName()|trans}) :
'mautic.webhook.webhook.header.new'|trans }}{% endblock %}
{% block mauticContent %}mauticWebhook{% endblock %}
{% block content %}
{{ form_start(form) }}
<!-- start: box layout -->
<div class="box-layout">
<!-- container -->
<div class="col-md-9 height-auto">
<div class="pa-md">
<div class="row">
<div class="col-md-6">
{{ form_row(form.name) }}
{{ form_row(form.description) }}
{{ form_row(form.secret) }}
{{ form_row(form.webhookUrl) }}
<div class="row">
<div class="col-md-5">
{{ form_row(form.sendTest) }}
</div>
<div class="col-md-2">
<span id="spinner" class="ri-loader-3-line ri-spin hide"></span>
</div>
<div class="col-md-5">
<div id="tester" class="text-right"></div>
</div>
</div>
</div>
<div class="col-md-6" id="event-types">
{{ form_row(form.events) }}
</div>
</div>
</div>
</div>
<div class="col-md-3 height-auto bdr-l">
<div class="pr-lg pl-lg pt-md pb-md">
{{ form_row(form.category) }}
{{ form_row(form.eventsOrderbyDir) }}
{{ form_row(form.isPublished) }}
</div>
</div>
</div>
{{ form_end(form) }}
{% endblock %}

View File

@@ -0,0 +1,192 @@
{# Override tmpl to "list" because otherwise AJAX calls render the whole content instead of just the raw output #}
{% set isIndex = tmpl == 'index' ? true : false %}
{% set tmpl = 'list' %}
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
{% block headerTitle %}{% trans %}mautic.webhook.webhooks{% endtrans %}{% endblock %}
{% block mauticContent %}mauticWebhook{% endblock %}
{% block actions %}
{{- include(
'@MauticCore/Helper/page_actions.html.twig', {
templateButtons: {
'new': permissions['webhook:webhooks:create']
},
routeBase: 'webhook'
}) -}}
{% endblock %}
{% block content %}
{% if isIndex %}
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
{{ include('@MauticCore/Helper/list_toolbar.html.twig', {
'searchValue': searchValue,
'action': currentRoute,
'bulk_actions': {
'routeBase': 'webhook',
'templateButtons': {
'delete': (permissions['webhook:webhooks:deleteown'] or permissions['webhook:webhooks:deleteother'])
}
},
'quickFilters': [
{
'search': 'mautic.core.searchcommand.ispublished',
'label': 'mautic.core.form.active',
'tooltip': 'mautic.core.searchcommand.ispublished.description',
'icon': 'ri-check-line'
},
{
'search': 'mautic.core.searchcommand.isunpublished',
'label': 'mautic.core.form.inactive',
'tooltip': 'mautic.core.searchcommand.isunpublished.description',
'icon': 'ri-close-line'
},
{
'search': 'mautic.core.searchcommand.ismine',
'label': 'mautic.core.searchcommand.ismine.label',
'tooltip': 'mautic.core.searchcommand.ismine.description',
'icon': 'ri-user-line'
}
]
}) }}
<div class="page-list">
{{ block('listResults') }}
</div>
</div>
{% else %}
{{ block('listResults') }}
{% endif %}
{% endblock %}
{% block listResults %}
{% if items is defined and items is not empty %}
<div class="table-responsive panel-collapse pull out webhook-list">
<table class="table table-hover webhook-list" id="webhookTable">
<thead>
<tr>
{{- include(
'@MauticCore/Helper/tableheader.html.twig', {
checkall: 'true',
target: '#webhookTable'
}) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig', {
sessionVar: 'mautic_webhook',
orderBy: 'e.name',
text: 'mautic.core.name',
class: 'col-webhook-name',
default: true
}) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig', {
sessionVar: 'mautic_webhook',
orderBy: 'c.title',
text: 'mautic.core.category',
class: 'visible-md visible-lg col-webhook-category',
}) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig', {
sessionVar: 'mautic_webhook',
orderBy: 'e.webhookUrl',
text: 'mautic.webhook.webhook_url',
class: 'col-webhook-id visible-md visible-lg'
}) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig', {
sessionVar: 'mautic_webhook',
orderBy: 'e.id',
text: 'mautic.core.id',
class: 'col-webhook-id visible-md visible-lg'
}) -}}
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>
{{- include(
'@MauticCore/Helper/list_actions.html.twig', {
item: item,
templateButtons: {
edit: securityHasEntityAccess(
permissions['webhook:webhooks:editown'],
permissions['webhook:webhooks:editother'],
item.getCreatedBy()
),
clone: permissions['webhook:webhooks:create'],
delete: securityHasEntityAccess(
permissions['webhook:webhooks:deleteown'],
permissions['webhook:webhooks:deleteother'],
item.getCreatedBy()
)
},
routeBase: 'webhook'
}) -}}
</td>
<td>
<div>
{{- include(
'@MauticCore/Helper/publishstatus_icon.html.twig', {
item: item,
model: 'webhook'
}
) }}
<a data-toggle="ajax" href="{{ path(
'mautic_webhook_action',
{ objectId: item.getId(), objectAction: 'view' }
) }}">
{{ item.getName() }}
</a>
{{ include('@MauticCore/Helper/description--inline.html.twig', {
'description': item.getDescription()
}) }}
</div>
</td>
<td class="visible-md visible-lg">
{{ include('@MauticCore/Modules/category--expanded.html.twig', {'category': item.getCategory()}) }}
</td>
<td class="visible-md visible-lg">{{ item.getWebhookUrl() }}</td>
<td class="visible-md visible-lg">{{ item.getId() }} </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="panel-footer">
{{- include(
'@MauticCore/Helper/pagination.html.twig', {
totalItems: items|length,
page: page,
limit: limit,
menuLinkId: 'mautic_webhook_index',
baseUrl: path('mautic_webhook_index'),
sessionVar: 'mautic_webhook'
}
) }}
</div>
{% else %}
{% if searchValue is not empty %}
{{- include('@MauticCore/Helper/noresults.html.twig') -}}
{% else %}
<div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
{% set childContainer %}
<div class="mt-32 mb-md">
{% include '@MauticCore/Components/pictogram.html.twig' with {
'pictogram': 'event--streams',
'size': '80'
} %}
</div>
{% endset %}
{{ include('@MauticCore/Components/content-block.html.twig', {
heading: 'mautic.webhook.contentblock.heading',
subheading: 'mautic.webhook.contentblock.subheading',
copy: 'mautic.webhook.contentblock.copy',
childContainer: childContainer,
}) }}
</div>
{% endif %}
{% endif %}
{% endblock %}