Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -11,17 +11,25 @@ use Livewire\Component;
|
||||
class Change extends Component
|
||||
{
|
||||
public string $webhook_endpoint;
|
||||
|
||||
public ?string $ipv4 = null;
|
||||
|
||||
public ?string $ipv6 = null;
|
||||
|
||||
public ?string $fqdn = null;
|
||||
|
||||
public ?bool $default_permissions = true;
|
||||
|
||||
public ?bool $preview_deployment_permissions = true;
|
||||
|
||||
public ?bool $administration = false;
|
||||
|
||||
public $parameters;
|
||||
|
||||
public ?GithubApp $github_app = null;
|
||||
|
||||
public string $name;
|
||||
|
||||
public bool $is_system_wide;
|
||||
|
||||
public $applications;
|
||||
@@ -57,7 +65,6 @@ class Change extends Component
|
||||
// Need administration:read:write permission
|
||||
// https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
|
||||
|
||||
|
||||
// $github_access_token = generate_github_installation_token($this->github_app);
|
||||
// $repositories = Http::withToken($github_access_token)->get("{$this->github_app->api_url}/installation/repositories?per_page=100");
|
||||
// $runners_by_repository = collect([]);
|
||||
@@ -89,7 +96,7 @@ class Change extends Component
|
||||
{
|
||||
$github_app_uuid = request()->github_app_uuid;
|
||||
$this->github_app = GithubApp::where('uuid', $github_app_uuid)->first();
|
||||
if (!$this->github_app) {
|
||||
if (! $this->github_app) {
|
||||
return redirect()->route('source.all');
|
||||
}
|
||||
$this->applications = $this->github_app->applications;
|
||||
@@ -100,14 +107,14 @@ class Change extends Component
|
||||
$this->fqdn = $settings->fqdn;
|
||||
|
||||
if ($settings->public_ipv4) {
|
||||
$this->ipv4 = 'http://' . $settings->public_ipv4 . ':' . config('app.port');
|
||||
$this->ipv4 = 'http://'.$settings->public_ipv4.':'.config('app.port');
|
||||
}
|
||||
if ($settings->public_ipv6) {
|
||||
$this->ipv6 = 'http://' . $settings->public_ipv6 . ':' . config('app.port');
|
||||
$this->ipv6 = 'http://'.$settings->public_ipv6.':'.config('app.port');
|
||||
}
|
||||
if ($this->github_app->installation_id && session('from')) {
|
||||
$source_id = data_get(session('from'), 'source_id');
|
||||
if (!$source_id || $this->github_app->id !== $source_id) {
|
||||
if (! $source_id || $this->github_app->id !== $source_id) {
|
||||
session()->forget('from');
|
||||
} else {
|
||||
$parameters = data_get(session('from'), 'parameters');
|
||||
@@ -117,6 +124,7 @@ class Change extends Component
|
||||
$type = data_get($parameters, 'type');
|
||||
$destination = data_get($parameters, 'destination');
|
||||
session()->forget('from');
|
||||
|
||||
return redirect()->route($back, [
|
||||
'environment_name' => $environment_name,
|
||||
'project_uuid' => $project_uuid,
|
||||
@@ -126,7 +134,7 @@ class Change extends Component
|
||||
}
|
||||
}
|
||||
$this->parameters = get_route_parameters();
|
||||
if (isCloud() && !isDev()) {
|
||||
if (isCloud() && ! isDev()) {
|
||||
$this->webhook_endpoint = config('app.url');
|
||||
} else {
|
||||
$this->webhook_endpoint = $this->ipv4;
|
||||
@@ -176,9 +184,11 @@ class Change extends Component
|
||||
if ($this->github_app->applications->isNotEmpty()) {
|
||||
$this->dispatch('error', 'This source is being used by an application. Please delete all applications first.');
|
||||
$this->github_app->makeVisible('client_secret')->makeVisible('webhook_secret');
|
||||
|
||||
return;
|
||||
}
|
||||
$this->github_app->delete();
|
||||
|
||||
return redirect()->route('source.all');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
|
||||
@@ -8,11 +8,17 @@ use Livewire\Component;
|
||||
class Create extends Component
|
||||
{
|
||||
public string $name;
|
||||
public string|null $organization = null;
|
||||
|
||||
public ?string $organization = null;
|
||||
|
||||
public string $api_url = 'https://api.github.com';
|
||||
|
||||
public string $html_url = 'https://github.com';
|
||||
|
||||
public string $custom_user = 'git';
|
||||
|
||||
public int $custom_port = 22;
|
||||
|
||||
public bool $is_system_wide = false;
|
||||
|
||||
public function mount()
|
||||
@@ -24,13 +30,13 @@ class Create extends Component
|
||||
{
|
||||
try {
|
||||
$this->validate([
|
||||
"name" => 'required|string',
|
||||
"organization" => 'nullable|string',
|
||||
"api_url" => 'required|string',
|
||||
"html_url" => 'required|string',
|
||||
"custom_user" => 'required|string',
|
||||
"custom_port" => 'required|int',
|
||||
"is_system_wide" => 'required|bool',
|
||||
'name' => 'required|string',
|
||||
'organization' => 'nullable|string',
|
||||
'api_url' => 'required|string',
|
||||
'html_url' => 'required|string',
|
||||
'custom_user' => 'required|string',
|
||||
'custom_port' => 'required|int',
|
||||
'is_system_wide' => 'required|bool',
|
||||
]);
|
||||
$payload = [
|
||||
'name' => $this->name,
|
||||
@@ -48,6 +54,7 @@ class Create extends Component
|
||||
if (session('from')) {
|
||||
session(['from' => session('from') + ['source_id' => $github_app->id]]);
|
||||
}
|
||||
|
||||
return redirect()->route('source.github.show', ['github_app_uuid' => $github_app->uuid]);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
|
||||
Reference in New Issue
Block a user