This commit is contained in:
Saeed Vaziry
2024-03-24 09:56:34 +01:00
committed by GitHub
parent 884f18db63
commit 4d051330d6
1055 changed files with 14493 additions and 20278 deletions

View File

@ -0,0 +1,134 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'connect-source-control')">
{{ __("Connect") }}
</x-primary-button>
<x-modal name="connect-source-control" :show="request()->has('provider')">
@php
$oldProvider = old("provider", request()->input("provider") ?? "");
@endphp
<form
id="connect-source-control-form"
hx-post="{{ route("source-controls.connect") }}"
hx-swap="outerHTML"
hx-select="#connect-source-control-form"
hx-ext="disable-element"
hx-disable-element="#btn-connect-source-control"
class="p-6"
x-data="{ provider: '{{ $oldProvider }}' }"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Connect to a Source Control") }}
</h2>
<div class="mt-6">
<x-input-label for="provider" value="Provider" />
<x-select-input x-model="provider" id="provider" name="provider" class="mt-1 w-full">
<option value="" selected disabled>
{{ __("Select") }}
</option>
@foreach (config("core.source_control_providers") as $p)
@if ($p !== "custom")
<option value="{{ $p }}" @if($oldProvider === $p) selected @endif>
{{ $p }}
</option>
@endif
@endforeach
</x-select-input>
@error("provider")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="name" value="Name" />
<x-text-input value="{{ old('name') }}" id="name" name="name" type="text" class="mt-1 w-full" />
@error("name")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'gitlab'" class="mt-6">
<x-input-label for="url" value="Url (optional)" />
<x-text-input
value="{{ old('url') }}"
id="url"
name="url"
type="text"
class="mt-1 w-full"
placeholder="e.g. https://gitlab.example.com/"
/>
<x-input-help>
If you run a self-managed gitlab enter the url here, leave empty to use gitlab.com
</x-input-help>
@error("url")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="['gitlab', 'github'].includes(provider)" class="mt-6">
<x-input-label for="token" value="API Key" />
<x-text-input value="{{ old('token') }}" id="token" name="token" type="text" class="mt-1 w-full" />
@error("token")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'bitbucket'">
<div class="mt-6">
<x-input-label for="username" value="Username" />
<x-text-input
value="{{ old('username') }}"
id="username"
name="username"
type="text"
class="mt-1 w-full"
/>
<x-input-help>Your Bitbucket username</x-input-help>
@error("username")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="password" value="Password" />
<x-text-input
value="{{ old('password') }}"
id="password"
name="password"
type="text"
class="mt-1 w-full"
/>
<x-input-help>
Create a new
<a
class="text-primary-500"
href="https://bitbucket.org/account/settings/app-passwords/new"
target="_blank"
>
App Password
</a>
in your Bitbucket account with write and admin access to Workspaces, Projects, Repositories and
Webhooks
</x-input-help>
@error("password")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</div>
<div class="mt-6 flex justify-end">
<x-secondary-button type="button" x-on:click="$dispatch('close')">
{{ __("Cancel") }}
</x-secondary-button>
<x-primary-button id="btn-connect-source-control" class="ml-3">
{{ __("Connect") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-source-control" :show="$errors->isNotEmpty()">
<form id="delete-source-control-form" method="post" x-bind:action="deleteAction" class="p-6">
@csrf
@method("delete")
<h2 class="text-lg font-medium">Are you sure that you want to delete this source control?</h2>
<div class="mt-6 flex justify-end">
<x-secondary-button type="button" x-on:click="$dispatch('close')">
{{ __("Cancel") }}
</x-secondary-button>
<x-danger-button class="ml-3">
{{ __("Delete") }}
</x-danger-button>
</div>
</form>
</x-modal>

View File

@ -0,0 +1,25 @@
<svg class="h-10 w-10" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M2.9087 3.00008C2.64368 2.99655 2.3907 3.11422 2.21764 3.32152C2.04458 3.52883 1.96915 3.80455 2.01158 4.07472L5.81987 27.9484C5.91782 28.5515 6.42093 28.9949 7.01305 28.9999H25.283C25.7274 29.0058 26.109 28.6748 26.1801 28.2217L29.9884 4.07935C30.0309 3.80918 29.9554 3.53346 29.7824 3.32615C29.6093 3.11885 29.3563 3.00118 29.0913 3.00471L2.9087 3.00008ZM18.9448 20.2546H13.1135L11.5346 11.7362H20.3578L18.9448 20.2546Z"
fill="#2684FF"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M28.7778 11.7363H20.3582L18.9453 20.2547H13.114L6.22852 28.6944C6.44675 28.8892 6.725 28.9976 7.0135 29.0001H25.2879C25.7324 29.006 26.114 28.675 26.1851 28.2219L28.7778 11.7363Z"
fill="url(#paint0_linear_87_7932)"
/>
<defs>
<linearGradient
id="paint0_linear_87_7932"
x1="30.7245"
y1="14.1218"
x2="20.5764"
y2="28.0753"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.18" stop-color="#0052CC" />
<stop offset="1" stop-color="#2684FF" />
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,19 @@
<svg
class="h-10 w-10"
viewBox="0 -0.5 48 48"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<title>Github-color</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Color-" transform="translate(-700.000000, -560.000000)" fill="#3E75C3">
<path
d="M723.9985,560 C710.746,560 700,570.787092 700,584.096644 C700,594.740671 706.876,603.77183 716.4145,606.958412 C717.6145,607.179786 718.0525,606.435849 718.0525,605.797328 C718.0525,605.225068 718.0315,603.710086 718.0195,601.699648 C711.343,603.155898 709.9345,598.469394 709.9345,598.469394 C708.844,595.686405 707.2705,594.94548 707.2705,594.94548 C705.091,593.450075 707.4355,593.480194 707.4355,593.480194 C709.843,593.650366 711.1105,595.963499 711.1105,595.963499 C713.2525,599.645538 716.728,598.58234 718.096,597.964902 C718.3135,596.407754 718.9345,595.346062 719.62,594.743683 C714.2905,594.135281 708.688,592.069123 708.688,582.836167 C708.688,580.205279 709.6225,578.054788 711.1585,576.369634 C710.911,575.759726 710.0875,573.311058 711.3925,569.993458 C711.3925,569.993458 713.4085,569.345902 717.9925,572.46321 C719.908,571.928599 721.96,571.662047 724.0015,571.651505 C726.04,571.662047 728.0935,571.928599 730.0105,572.46321 C734.5915,569.345902 736.603,569.993458 736.603,569.993458 C737.9125,573.311058 737.089,575.759726 736.8415,576.369634 C738.3805,578.054788 739.309,580.205279 739.309,582.836167 C739.309,592.091712 733.6975,594.129257 728.3515,594.725612 C729.2125,595.469549 729.9805,596.939353 729.9805,599.18773 C729.9805,602.408949 729.9505,605.006706 729.9505,605.797328 C729.9505,606.441873 730.3825,607.191834 731.6005,606.9554 C741.13,603.762794 748,594.737659 748,584.096644 C748,570.787092 737.254,560 723.9985,560"
id="Github"
></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,13 @@
<svg class="h-10 w-10" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none">
<path
fill="#FC6D26"
d="M14.975 8.904L14.19 6.55l-1.552-4.67a.268.268 0 00-.255-.18.268.268 0 00-.254.18l-1.552 4.667H5.422L3.87 1.879a.267.267 0 00-.254-.179.267.267 0 00-.254.18l-1.55 4.667-.784 2.357a.515.515 0 00.193.583l6.78 4.812 6.778-4.812a.516.516 0 00.196-.583z"
/>
<path fill="#E24329" d="M8 14.296l2.578-7.75H5.423L8 14.296z" />
<path fill="#FC6D26" d="M8 14.296l-2.579-7.75H1.813L8 14.296z" />
<path fill="#FCA326" d="M1.81 6.549l-.784 2.354a.515.515 0 00.193.583L8 14.3 1.81 6.55z" />
<path fill="#E24329" d="M1.812 6.549h3.612L3.87 1.882a.268.268 0 00-.254-.18.268.268 0 00-.255.18L1.812 6.549z" />
<path fill="#FC6D26" d="M8 14.296l2.578-7.75h3.614L8 14.296z" />
<path fill="#FCA326" d="M14.19 6.549l.783 2.354a.514.514 0 01-.193.583L8 14.296l6.188-7.747h.001z" />
<path fill="#E24329" d="M14.19 6.549H10.58l1.551-4.667a.267.267 0 01.255-.18c.115 0 .217.073.254.18l1.552 4.667z" />
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,43 @@
<div>
<x-card-header>
<x-slot name="title">Source Controls</x-slot>
<x-slot name="description">You can connect your source controls via API Tokens</x-slot>
<x-slot name="aside">
@include("settings.source-controls.partials.connect")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($sourceControls) > 0)
@foreach ($sourceControls as $sourceControl)
<x-item-card>
<div class="flex-none text-gray-600 dark:text-gray-300">
@include("settings.source-controls.partials.icons." . $sourceControl->provider . "-icon")
</div>
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
<span class="mb-1">{{ $sourceControl->profile }}</span>
<span class="text-sm text-gray-400">
<x-datetime :value="$sourceControl->created_at" />
</span>
</div>
<div class="flex items-center">
<div class="inline">
<x-icon-button
x-on:click="deleteAction = '{{ route('source-controls.delete', $sourceControl->id) }}'; $dispatch('open-modal', 'delete-source-control')"
>
<x-heroicon name="o-trash" class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.source-controls.partials.delete-source-control")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any server source controls yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>