Fix manual Git webhook generation
This commit is contained in:
parent
0590ed7b2e
commit
e4b2195932
@ -511,6 +511,9 @@ function generateDeployWebhook($resource)
|
|||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
function generateGitManualWebhook($resource, $type) {
|
function generateGitManualWebhook($resource, $type) {
|
||||||
|
if ($resource->source_id !== 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if ($resource->getMorphClass() === 'App\Models\Application') {
|
if ($resource->getMorphClass() === 'App\Models\Application') {
|
||||||
$baseUrl = base_url();
|
$baseUrl = base_url();
|
||||||
$api = Url::fromString($baseUrl) . "/webhooks/source/$type/events/manual";
|
$api = Url::fromString($baseUrl) . "/webhooks/source/$type/events/manual";
|
||||||
|
@ -11,27 +11,31 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3>Manual Git Webhooks</h3>
|
<h3>Manual Git Webhooks</h3>
|
||||||
<form wire:submit.prevent='saveSecret' class="flex flex-col gap-2">
|
@if ($githubManualWebhook && $gitlabManualWebhook)
|
||||||
<div class="flex items-end gap-2">
|
<form wire:submit.prevent='saveSecret' class="flex flex-col gap-2">
|
||||||
<x-forms.input helper="Content Type in GitHub configuration could be json or form-urlencoded." readonly
|
<div class="flex items-end gap-2">
|
||||||
label="GitHub" id="githubManualWebhook"></x-forms.input>
|
<x-forms.input helper="Content Type in GitHub configuration could be json or form-urlencoded."
|
||||||
<x-forms.input type="password"
|
readonly label="GitHub" id="githubManualWebhook"></x-forms.input>
|
||||||
helper="Need to set a secret to be able to use this webhook. It should match with the secret in GitHub."
|
<x-forms.input type="password"
|
||||||
label="GitHub Webhook Secret" id="resource.manual_webhook_secret_github"></x-forms.input>
|
helper="Need to set a secret to be able to use this webhook. It should match with the secret in GitHub."
|
||||||
|
label="GitHub Webhook Secret" id="resource.manual_webhook_secret_github"></x-forms.input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a target="_blank" class="flex hover:no-underline" href="{{ $resource?->gitWebhook }}">
|
<a target="_blank" class="flex hover:no-underline" href="{{ $resource?->gitWebhook }}">
|
||||||
<x-forms.button>Webhook Configuration on GitHub
|
<x-forms.button>Webhook Configuration on GitHub
|
||||||
<x-external-link />
|
<x-external-link />
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</a>
|
</a>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<x-forms.input readonly label="GitLab" id="gitlabManualWebhook"></x-forms.input>
|
<x-forms.input readonly label="GitLab" id="gitlabManualWebhook"></x-forms.input>
|
||||||
<x-forms.input type="password"
|
<x-forms.input type="password"
|
||||||
helper="Need to set a secret to be able to use this webhook. It should match with the secret in GitLab."
|
helper="Need to set a secret to be able to use this webhook. It should match with the secret in GitLab."
|
||||||
label="GitLab Webhook Secret" id="resource.manual_webhook_secret_gitlab"></x-forms.input>
|
label="GitLab Webhook Secret" id="resource.manual_webhook_secret_gitlab"></x-forms.input>
|
||||||
</div>
|
</div>
|
||||||
<x-forms.button type="submit">Save</x-forms.button>
|
<x-forms.button type="submit">Save</x-forms.button>
|
||||||
</form>
|
</form>
|
||||||
|
@else
|
||||||
|
You are using an official Git App. You do not need manual webhooks.
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user