This commit is contained in:
Andras Bacsai 2023-06-12 22:09:43 +02:00
parent bc79e142e5
commit 309ea0e4d2
5 changed files with 56 additions and 9 deletions

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Livewire\Source\Gitlab;
use Livewire\Component;
class Change extends Component
{
public function render()
{
return view('livewire.source.gitlab.change');
}
}

View File

@ -238,6 +238,7 @@ const possibleSequences = {
}, },
} }
const magicActions = [{ const magicActions = [{
id: 1,
name: 'Deploy: Public Repository', name: 'Deploy: Public Repository',
tags: 'git,github,public', tags: 'git,github,public',
icon: 'git', icon: 'git',
@ -245,6 +246,7 @@ const magicActions = [{
sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect'] sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect']
}, },
{ {
id: 2,
name: 'Deploy: Private Repository (with GitHub Apps)', name: 'Deploy: Private Repository (with GitHub Apps)',
tags: 'git,github,private', tags: 'git,github,private',
icon: 'git', icon: 'git',
@ -252,6 +254,7 @@ const magicActions = [{
sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect'] sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect']
}, },
{ {
id: 3,
name: 'Deploy: Private Repository (with Deploy Key)', name: 'Deploy: Private Repository (with Deploy Key)',
tags: 'git,github,private,deploy,key', tags: 'git,github,private,deploy,key',
icon: 'git', icon: 'git',
@ -259,6 +262,7 @@ const magicActions = [{
sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect'] sequence: ['main', 'server', 'destination', 'project', 'environment', 'redirect']
}, },
{ {
id: 4,
name: 'Create: Server', name: 'Create: Server',
tags: 'server,ssh,new,create', tags: 'server,ssh,new,create',
icon: 'server', icon: 'server',
@ -266,6 +270,7 @@ const magicActions = [{
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 5,
name: 'Create: Source', name: 'Create: Source',
tags: 'source,git,gitlab,github,bitbucket,gitea,new,create', tags: 'source,git,gitlab,github,bitbucket,gitea,new,create',
icon: 'git', icon: 'git',
@ -273,6 +278,7 @@ const magicActions = [{
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 6,
name: 'Create: Private Key', name: 'Create: Private Key',
tags: 'private,key,ssh,new,create', tags: 'private,key,ssh,new,create',
icon: 'key', icon: 'key',
@ -280,6 +286,7 @@ const magicActions = [{
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 7,
name: 'Create: Destination', name: 'Create: Destination',
tags: 'destination,docker,network,new,create', tags: 'destination,docker,network,new,create',
icon: 'destination', icon: 'destination',
@ -287,46 +294,61 @@ const magicActions = [{
sequence: ['main', 'server', 'redirect'] sequence: ['main', 'server', 'redirect']
}, },
{ {
id: 8,
name: 'Goto: Dashboard', name: 'Goto: Dashboard',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 9,
name: 'Goto: Servers', name: 'Goto: Servers',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 10,
name: 'Goto: Projects', name: 'Goto: Projects',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 11,
name: 'Goto: Sources',
icon: 'goto',
sequence: ['main', 'redirect']
},
{
id: 12,
name: 'Goto: Settings', name: 'Goto: Settings',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 13,
name: 'Goto: Command Center', name: 'Goto: Command Center',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 14,
name: 'Goto: Notifications', name: 'Goto: Notifications',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 15,
name: 'Goto: Profile', name: 'Goto: Profile',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 16,
name: 'Goto: Teams', name: 'Goto: Teams',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
}, },
{ {
id: 17,
name: 'Goto: Switch Teams', name: 'Goto: Switch Teams',
icon: 'goto', icon: 'goto',
sequence: ['main', 'redirect'] sequence: ['main', 'redirect']
@ -419,14 +441,12 @@ async function goThroughSequence(actionId) {
nextSequence = sequence[sequenceState.value.currentActionIndex + 1] nextSequence = sequence[sequenceState.value.currentActionIndex + 1]
sequenceState.value.sequence = sequence sequenceState.value.sequence = sequence
sequenceState.value.selected = { sequenceState.value.selected = {
// main: id main: id
main: actionId + 1
} }
} else { } else {
currentSequence = sequenceState.value.sequence[sequenceState.value.currentActionIndex] currentSequence = sequenceState.value.sequence[sequenceState.value.currentActionIndex]
nextSequence = sequenceState.value.sequence[sequenceState.value.currentActionIndex + 1] nextSequence = sequenceState.value.sequence[sequenceState.value.currentActionIndex + 1]
// let selectedId = sequenceState.value.magicActions[actionId].id let selectedId = sequenceState.value.magicActions[actionId].id
let selectedId = actionId + 1
if (uuidSelector.includes(currentSequence)) { if (uuidSelector.includes(currentSequence)) {
selectedId = sequenceState.value.magicActions[actionId].uuid selectedId = sequenceState.value.magicActions[actionId].uuid
} }
@ -483,6 +503,7 @@ async function redirect() {
let targetUrl = new URL(window.location.origin) let targetUrl = new URL(window.location.origin)
const selected = sequenceState.value.selected const selected = sequenceState.value.selected
const { main, destination = null, project = null, environment = null, server = null } = selected const { main, destination = null, project = null, environment = null, server = null } = selected
console.log({ main })
switch (main) { switch (main) {
case 1: case 1:
targetUrl.pathname = `/project/${project}/${environment}/new` targetUrl.pathname = `/project/${project}/${environment}/new`
@ -522,23 +543,26 @@ async function redirect() {
targetUrl.pathname = `/projects` targetUrl.pathname = `/projects`
break; break;
case 11: case 11:
targetUrl.pathname = `/settings` targetUrl.pathname = `/sources`
break; break;
case 12: case 12:
targetUrl.pathname = `/command-center` targetUrl.pathname = `/settings`
break; break;
case 13: case 13:
targetUrl.pathname = `/profile/team/notifications` targetUrl.pathname = `/command-center`
break; break;
case 14: case 14:
targetUrl.pathname = `/profile` targetUrl.pathname = `/profile/team/notifications`
break; break;
case 15: case 15:
targetUrl.pathname = `/profile/team` targetUrl.pathname = `/profile`
break; break;
case 16: case 16:
targetUrl.pathname = `/profile/team` targetUrl.pathname = `/profile/team`
break; break;
case 17:
targetUrl.pathname = `/profile/team`
break;
} }
window.location.href = targetUrl; window.location.href = targetUrl;
} }

View File

@ -0,0 +1,3 @@
<div>
{{-- In work, do what you enjoy. --}}
</div>

View File

@ -0,0 +1,4 @@
<x-layout>
<h1>New GitHub Source</h1>
</x-layout>

View File

@ -0,0 +1,3 @@
<x-layout>
GitLab WIP
</x-layout>