Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

toaster

Andras Bacsai8b6598ea6be3
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 38cc106c58..abefe136b4 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -59,7 +59,7 @@ class General extends Component
$this->application->settings->is_force_https_enabled = $this->is_force_https_enabled;
$this->application->settings->save();
$this->application->refresh();
- $this->emit('saved', 'Application settings updated!');
+ $this->emit('success', 'Application settings updated!');
$this->checkWildCardDomain();
}
protected function checkWildCardDomain()
diff --git a/app/Http/Livewire/Project/Application/Source.php b/app/Http/Livewire/Project/Application/Source.php
index 4d7274cdb8..0a39b03f64 100644
--- a/app/Http/Livewire/Project/Application/Source.php
+++ b/app/Http/Livewire/Project/Application/Source.php
@@ -40,6 +40,6 @@ class Source extends Component
$this->application->git_commit_sha = 'HEAD';
}
$this->application->save();
- $this->emit('saved', 'Application source updated!');
+ $this->emit('success', 'Application source updated!');
}
}
diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepository.php b/app/Http/Livewire/Project/New/GithubPrivateRepository.php
index 6159b81977..89dab6b725 100644
--- a/app/Http/Livewire/Project/New/GithubPrivateRepository.php
+++ b/app/Http/Livewire/Project/New/GithubPrivateRepository.php
@@ -157,6 +157,6 @@ class GithubPrivateRepository extends Component
$this->port = 3000;
$this->publish_directory = null;
}
- $this->emit('saved', 'Application settings updated!');
+ $this->emit('success', 'Application settings updated!');
}
}
diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php
index 52e63bb706..6f97bc10f8 100644
--- a/app/Http/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php
@@ -56,7 +56,7 @@ class PublicGitRepository extends Component
$this->port = 3000;
$this->publish_directory = null;
}
- $this->emit('saved', 'Application settings updated!');
+ $this->emit('success', 'Application settings updated!');
}
public function load_branches()
{
diff --git a/app/Http/Livewire/Server/New/ByIp.php b/app/Http/Livewire/Server/New/ByIp.php
index 23a76f5f91..c2cc1cd06d 100644
--- a/app/Http/Livewire/Server/New/ByIp.php
+++ b/app/Http/Livewire/Server/New/ByIp.php
@@ -39,7 +39,7 @@ class ByIp extends Component
}
public function instantSave()
{
- $this->emit('saved', 'Application settings updated!');
+ $this->emit('success', 'Application settings updated!');
}
public function submit()
{
diff --git a/app/Http/Livewire/Settings/Configuration.php b/app/Http/Livewire/Settings/Configuration.php
index 04e12980b7..57de5e1657 100644
--- a/app/Http/Livewire/Settings/Configuration.php
+++ b/app/Http/Livewire/Settings/Configuration.php
@@ -37,7 +37,7 @@ class Configuration extends Component
$this->settings->is_auto_update_enabled = $this->is_auto_update_enabled;
$this->settings->is_registration_enabled = $this->is_registration_enabled;
$this->settings->save();
- $this->emit('saved', 'Settings updated!');
+ $this->emit('success', 'Settings updated!');
}
private function setup_instance_fqdn()
{
diff --git a/app/Http/Livewire/Team/InviteLink.php b/app/Http/Livewire/Team/InviteLink.php
index 60fb30a0f8..c57ed4b81d 100644
--- a/app/Http/Livewire/Team/InviteLink.php
+++ b/app/Http/Livewire/Team/InviteLink.php
@@ -59,9 +59,9 @@ class InviteLink extends Component
]);
if ($isEmail) {
$user->first()->notify(new InvitationLinkEmail());
- $this->emit('message', 'Invitation sent via email successfully.');
+ $this->emit('success', 'Invitation sent via email successfully.');
} else {
- $this->emit('message', 'Invitation link generated.');
+ $this->emit('success', 'Invitation link generated.');
}
$this->emit('refreshInvitations');
} catch (\Throwable $e) {
diff --git a/app/Http/Livewire/ForceUpgrade.php b/app/Http/Livewire/Upgrade.php
similarity index 63%
rename from app/Http/Livewire/ForceUpgrade.php
rename to app/Http/Livewire/Upgrade.php
index a41651bf0b..0ac47576ba 100644
--- a/app/Http/Livewire/ForceUpgrade.php
+++ b/app/Http/Livewire/Upgrade.php
@@ -2,17 +2,19 @@
namespace App\Http\Livewire;
+use Masmerise\Toaster\Toaster;
use App\Jobs\InstanceAutoUpdateJob;
use Livewire\Component;
-class ForceUpgrade extends Component
+class Upgrade extends Component
{
- public bool $visible = false;
+ public bool $showProgress = false;
public function upgrade()
{
try {
- $this->visible = true;
+ $this->showProgress = true;
dispatch(new InstanceAutoUpdateJob(force: true));
+ Toaster::success('Update started.');
} catch (\Exception $e) {
return general_error_handler(err: $e, that: $this);
}
diff --git a/app/Http/Livewire/Upgrading.php b/app/Http/Livewire/Upgrading.php
deleted file mode 100644
index b9de9bb03f..0000000000
--- a/app/Http/Livewire/Upgrading.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-namespace App\Http\Livewire;
-
-use Livewire\Component;
-
-class Upgrading extends Component
-{
- public bool $visible = false;
- protected $listeners = ['updateInitiated'];
- public function updateInitiated()
- {
- $this->visible = true;
- }
-}
diff --git a/app/Jobs/InstanceAutoUpdateJob.php b/app/Jobs/InstanceAutoUpdateJob.php
index 6076647391..a08caf23f2 100644
--- a/app/Jobs/InstanceAutoUpdateJob.php
+++ b/app/Jobs/InstanceAutoUpdateJob.php
@@ -27,24 +27,6 @@ class InstanceAutoUpdateJob implements ShouldQueue, ShouldBeUnique
public function __construct(private bool $force = false)
{
}
- private function update()
- {
- if (config('app.env') === 'local') {
- ray('Running update on local docker container');
- instant_remote_process([
- "sleep 10"
- ], $this->server);
- ray('Update done');
- return;
- } else {
- ray('Running update on production server');
- instant_remote_process([
- "curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh",
- "bash /data/coolify/source/upgrade.sh $this->latest_version"
- ], $this->server);
- return;
- }
- }
public function handle(): void
{
try {
@@ -81,6 +63,25 @@ class InstanceAutoUpdateJob implements ShouldQueue, ShouldBeUnique
return;
}
}
+ private function update()
+ {
+ if (config('app.env') === 'local') {
+ ray('Running update on local docker container');
+ instant_remote_process([
+ "sleep 10"
+ ], $this->server);
+ ray('Update done');
+ return;
+ } else {
+ ray('Running update on production server');
+ instant_remote_process([
+ "curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh",
+ "bash /data/coolify/source/upgrade.sh $this->latest_version"
+ ], $this->server);
+ return;
+ }
+ }
+
public function failed(Exception $exception)
{
return;
diff --git a/composer.json b/composer.json
index 06470793d1..8fe9ce5dcc 100644
--- a/composer.json
+++ b/composer.json
@@ -19,6 +19,7 @@
"laravel/ui": "^4.2",
"lcobucci/jwt": "^5.0.0",
"livewire/livewire": "^v2.12.3",
+ "masmerise/livewire-toaster": "^1.2",
"nubs/random-name-generator": "^2.2",
"sentry/sentry-laravel": "^3.4",
"spatie/laravel-activitylog": "^4.7.3",
@@ -91,4 +92,4 @@
},
"minimum-stability": "stable",
"prefer-stable": true
-}
\ No newline at end of file
+}
diff --git a/composer.lock b/composer.lock
index 11410a4905..f4d2b9c408 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "77b718b33a7ba99083fd327821f968a2",
+ "content-hash": "d9173515bca399807784102128591e1e",
"packages": [
{
"name": "bacon/bacon-qr-code",
@@ -2738,6 +2738,74 @@
],
"time": "2023-03-03T20:12:38+00:00"
},
+ {
+ "name": "masmerise/livewire-toaster",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/masmerise/livewire-toaster.git",
+ "reference": "2706d3822e111af8272ebc117cb2c69228d14faf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/masmerise/livewire-toaster/zipball/2706d3822e111af8272ebc117cb2c69228d14faf",
+ "reference": "2706d3822e111af8272ebc117cb2c69228d14faf",
+ "shasum": ""
+ },
+ "require": {
+ "laravel/framework": "^10.0",
+ "livewire/livewire": "^2.0",
+ "php": "~8.2"
+ },
+ "require-dev": {
+ "dive-be/php-crowbar": "^1.1",
+ "laravel/pint": "^1.0",
+ "nunomaduro/larastan": "^2.0",
+ "orchestra/testbench": "^8.0",
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "aliases": {
+ "Toaster": "Masmerise\\Toaster\\Toaster"
+ },
+ "providers": [
+ "Masmerise\\Toaster\\ToasterServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Masmerise\\Toaster\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Muhammed Sari",
+ "email": "[email protected]",
+ "role": "Developer"
+ }
+ ],
+ "description": "Beautiful toast notifications for Laravel / Livewire.",
+ "homepage": "https://github.com/masmerise/livewire-toaster",
+ "keywords": [
+ "alert",
+ "laravel",
+ "livewire",
+ "toast",
+ "toaster"
+ ],
+ "support": {
+ "issues": "https://github.com/masmerise/livewire-toaster/issues",
+ "source": "https://github.com/masmerise/livewire-toaster/tree/1.2.0"
+ },
+ "time": "2023-06-13T11:44:44+00:00"
+ },
{
"name": "monolog/monolog",
"version": "3.3.1",
diff --git a/config/toaster.php b/config/toaster.php
new file mode 100644
index 0000000000..8059272105
--- /dev/null
+++ b/config/toaster.php
@@ -0,0 +1,48 @@
+<?php
+
+declare(strict_types=1);
+
+return [
+
+ /**
+ * Add an additional second for every 100th word of the toast messages.
+ *
+ * Supported: true | false
+ */
+ 'accessibility' => true,
+
+ /**
+ * The vertical alignment of the toast container.
+ *
+ * Supported: "bottom", "middle" or "top"
+ */
+ 'alignment' => 'top',
+
+ /**
+ * Allow users to close toast messages prematurely.
+ *
+ * Supported: true | false
+ */
+ 'closeable' => true,
+
+ /**
+ * The on-screen duration of each toast.
+ *
+ * Minimum: 3000 (in milliseconds)
+ */
+ 'duration' => 3000,
+
+ /**
+ * The horizontal position of each toast.
+ *
+ * Supported: "center", "left" or "right"
+ */
+ 'position' => 'right',
+
+ /**
+ * Whether messages passed as translation keys should be translated automatically.
+ *
+ * Supported: true | false
+ */
+ 'translate' => true,
+];
diff --git a/resources/js/app.js b/resources/js/app.js
index 2dc18bf8c0..ccfeee5c26 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -2,6 +2,10 @@ import Alpine from "alpinejs";
import { createApp } from "vue";
import MagicBar from "./components/MagicBar.vue";
+import Toaster from "../../vendor/masmerise/livewire-toaster/resources/js";
+
+Alpine.plugin(Toaster);
+
window.Alpine = Alpine;
Alpine.start();
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php
index 7a949b8c8d..773c08a048 100644
--- a/resources/views/components/layout.blade.php
+++ b/resources/views/components/layout.blade.php
@@ -26,6 +26,7 @@
<body>
@livewireScripts
+ <x-toaster-hub />
@auth
<x-navbar />
@endauth
@@ -54,17 +55,17 @@
Livewire.on('reloadWindow', () => {
window.location.reload();
})
+ Livewire.on('info', (message) => {
+ if (message) Toaster.info(message)
+ })
Livewire.on('error', (message) => {
- console.log(message);
- alert(message);
+ if (message) Toaster.error(message)
})
- Livewire.on('message', (message) => {
- console.log(message);
- alert(message);
+ Livewire.on('warning', (message) => {
+ if (message) Toaster.warning(message)
})
- Livewire.on('saved', (message) => {
- if (message) console.log(message);
- else console.log('saved');
+ Livewire.on('success', (message) => {
+ if (message) Toaster.success(message)
})
</script>
@else
diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php
index c159d7cb79..07b4d9adbf 100644
--- a/resources/views/components/navbar.blade.php
+++ b/resources/views/components/navbar.blade.php
@@ -67,6 +67,9 @@
</svg>
</a>
</li>
+ <li title="New version available">
+ <livewire:upgrade />
+ </li>
@endif
</ul>
</nav>
diff --git a/resources/views/livewire/force-upgrade.blade.php b/resources/views/livewire/force-upgrade.blade.php
deleted file mode 100644
index dd9818a8c7..0000000000
--- a/resources/views/livewire/force-upgrade.blade.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<div class="flex gap-10 text-xs text-white" x-data="{ visible: @entangle('visible') }">
- <x-forms.button x-cloak x-show="!visible" wire:click='upgrade'>
- Force Upgrade Your Instance
- </x-forms.button>
- <template x-if="visible">
- <div class="bg-coollabs-gradient">
- <svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10 mx-auto text-pink-500 lds-heart" viewBox="0 0 24 24"
- stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
- </svg> Upgrading, please wait...
- <script>
- function checkHealth() {
- console.log('Checking server\'s health...')
- checkHealthInterval = setInterval(async () => {
- try {
- const res = await fetch('/api/health');
- if (res.ok) {
- console.log('Server is back online. Reloading...')
- if (checkHealthInterval) clearInterval(checkHealthInterval);
- window.location.reload();
- }
- } catch (error) {
- console.log('Waiting for server to come back from dead...');
- }
-
- return;
- }, 2000);
- }
-
- function checkIfIamDead() {
- console.log('Checking server\'s pulse...')
- checkIfIamDeadInterval = setInterval(async () => {
- try {
- const res = await fetch('/api/health');
- if (res.ok) {
- console.log('I\'m alive. Waiting for server to be dead...');
- }
- } catch (error) {
- console.log('I\'m dead. Charging... Standby... Bzz... Bzz...')
- checkHealth();
- if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
- }
-
- return;
- }, 2000);
- }
- let checkHealthInterval = null;
- let checkIfIamDeadInterval = null;
- console.log('Update initiated. Waiting for server to be dead...')
- checkIfIamDead();
- </script>
- </div>
- <svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 mx-auto lds-heart" viewBox="0 0 24 24" stroke-width="1.5"
- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
- <path d="M12 6l-2 4l4 3l-2 4v3" />
- </svg>
- </template>
-
- {{-- <livewire:upgrading /> --}}
-</div>
diff --git a/resources/views/livewire/upgrade.blade.php b/resources/views/livewire/upgrade.blade.php
new file mode 100644
index 0000000000..cda492bcd1
--- /dev/null
+++ b/resources/views/livewire/upgrade.blade.php
@@ -0,0 +1,67 @@
+<div x-data wire:click='upgrade' x-on:click="upgrade" @class([
+ 'bg-gradient-to-r from-purple-500 via-pink-500 to-red-500' => !$showProgress,
+ 'hover:bg-transparent focus:bg-transparent' => $showProgress,
+])>
+ <button>
+ @if ($showProgress)
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-pink-500 lds-heart" viewBox="0 0 24 24"
+ stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
+ </svg>
+ @else
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-white " viewBox="0 0 24 24" stroke-width="1.5"
+ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v3h-6v-3z" />
+ <path d="M9 21h6" />
+ <path d="M9 18h6" />
+ </svg>
+ @endif
+ </button>
+ <script>
+ let checkHealthInterval = null;
+ let checkIfIamDeadInterval = null;
+
+ function revive() {
+ console.log('Checking server\'s health...')
+ checkHealthInterval = setInterval(() => {
+ fetch('/api/health')
+ .then(response => {
+ if (response.ok) {
+ console.log('Server is back online. Reloading...')
+ setTimeout(() => {
+ Toaster.success('Coolify started. Reloading!')
+ if (checkHealthInterval) clearInterval(checkHealthInterval);
+ window.location.reload();
+ }, 2000)
+ }
+ })
+ .catch(error => {
+ console.log('Waiting for server to come back from dead...');
+ });
+ return;
+ }, 5000);
+ }
+
+ function upgrade() {
+ console.log('Update initiated.')
+ checkIfIamDeadInterval = setInterval(() => {
+ fetch('/api/health')
+ .then(response => {
+ if (response.ok) {
+ console.log('It\'s alive. Waiting for server to be dead...');
+ }
+ })
+ .catch(error => {
+ Toaster.success('Update done, restart Coolify!')
+ console.log('It\'s dead. Reviving... Standby... Bzz... Bzz...')
+ revive();
+ if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
+ });
+ return;
+ }, 5000);
+ }
+ </script>
+</div>
diff --git a/resources/views/livewire/upgrading.blade.php b/resources/views/livewire/upgrading.blade.php
deleted file mode 100644
index 48d8e2981a..0000000000
--- a/resources/views/livewire/upgrading.blade.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<div x-data="{ visible: @entangle('visible') }" class="flex text-xs text-white">
- <template x-if="visible">
- <div class="bg-coollabs-gradient">
- <svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10 mx-auto text-pink-500 lds-heart" viewBox="0 0 24 24"
- stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
- </svg> Upgrading, please wait...
- <script>
- function checkHealth() {
- console.log('Checking server\'s health...')
- checkHealthInterval = setInterval(async () => {
- try {
- const res = await fetch('/api/health');
- if (res.ok) {
- console.log('Server is back online. Reloading...')
- if (checkHealthInterval) clearInterval(checkHealthInterval);
- window.location.reload();
- }
- } catch (error) {
- console.log('Waiting for server to come back from dead...');
- }
-
- return;
- }, 2000);
- }
-
- function checkIfIamDead() {
- console.log('Checking server\'s pulse...')
- checkIfIamDeadInterval = setInterval(async () => {
- try {
- const res = await fetch('/api/health');
- if (res.ok) {
- console.log('I\'m alive. Waiting for server to be dead...');
- }
- } catch (error) {
- console.log('I\'m dead. Charging... Standby... Bzz... Bzz...')
- checkHealth();
- if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
- }
-
- return;
- }, 2000);
- }
- let checkHealthInterval = null;
- let checkIfIamDeadInterval = null;
- console.log('Update initiated. Waiting for server to be dead...')
- checkIfIamDead();
- </script>
- </div>
- <svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 mx-auto lds-heart" viewBox="0 0 24 24" stroke-width="1.5"
- stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
- <path d="M12 6l-2 4l4 3l-2 4v3" />
- </svg>
- </template>
-</div>
diff --git a/resources/views/settings/configuration.blade.php b/resources/views/settings/configuration.blade.php
index fe805d4617..f4ca677a72 100644
--- a/resources/views/settings/configuration.blade.php
+++ b/resources/views/settings/configuration.blade.php
@@ -1,8 +1,4 @@
<x-layout>
<x-settings.navbar />
<livewire:settings.configuration :settings="$settings" />
-
- @if (auth()->user()->isInstanceAdmin())
- <livewire:force-upgrade />
- @endif
</x-layout>
diff --git a/resources/views/vendor/toaster/hub.blade.php b/resources/views/vendor/toaster/hub.blade.php
new file mode 100644
index 0000000000..5c6dfa19de
--- /dev/null
+++ b/resources/views/vendor/toaster/hub.blade.php
@@ -0,0 +1,90 @@
+<div role="status" id="toaster" x-data="toasterHub(@js($toasts), @js($config))" @class([
+ 'fixed z-50 p-4 w-full flex flex-col pointer-events-none sm:p-6',
+ 'bottom-0' => $alignment->is('bottom'),
+ 'top-1/2 -translate-y-1/2' => $alignment->is('middle'),
+ 'top-0' => $alignment->is('top'),
+ 'items-start' => $position->is('left'),
+ 'items-center' => $position->is('center'),
+ 'items-end' => $position->is('right'),
+])>
+ <template x-for="toast in toasts" :key="toast.id">
+ <div x-show="toast.isVisible" x-init="$nextTick(() => toast.show($el))" @if ($alignment->is('bottom'))
+ x-transition:enter-start="translate-y-12 opacity-0"
+ x-transition:enter-end="translate-y-0 opacity-100"
+ @elseif($alignment->is('top'))
+ x-transition:enter-start="-translate-y-12 opacity-0"
+ x-transition:enter-end="translate-y-0 opacity-100"
+ @else
+ x-transition:enter-start="opacity-0 scale-90"
+ x-transition:enter-end="opacity-100 scale-100"
+ @endif
+ x-transition:leave-end="opacity-0 scale-90"
+ class="relative flex duration-300 transform transition ease-in-out max-w-md w-full pointer-events-auto {{ $position->is('center') ? 'text-center' : 'text-left' }}"
+ :class="toast.select({ error: 'text-white', info: 'text-white', success: 'text-white', warning: 'text-white' })"
+ >
+ <i class=" flex items-center gap-2 select-none not-italic pr-6 pl-4 py-3 rounded shadow-lg text-sm w-full {{ $alignment->is('bottom') ? 'mt-3' : 'mb-3' }}"
+ :class="toast.select({
+ error: 'bg-coolgray-300',
+ info: 'bg-coolgray-300',
+ success: 'bg-coolgray-300',
+ warning: 'bg-coolgray-300'
+ })">
+ <template x-if="toast.type === 'success'">
+ <div class="rounded text-success">
+ <svg aria-hidden="true" class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd"
+ d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
+ clip-rule="evenodd"></path>
+ </svg>
+ </div>
+ </template>
+ <template x-if="toast.type === 'error'">
+ <div class="rounded text-error">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
+ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
+ <path d="M12 9v4" />
+ <path d="M12 16v.01" />
+ </svg>
+ </div>
+ </template>
+ <template x-if="toast.type === 'info'">
+ <div class="rounded text-info">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
+ stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
+ <path d="M12 9h.01" />
+ <path d="M11 12h1v4h1" />
+ </svg>
+ </div>
+ </template>
+ <template x-if="toast.type === 'warning'">
+ <div class="rounded text-warning">
+ <svg aria-hidden="true" class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd"
+ d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
+ clip-rule="evenodd"></path>
+ </svg>
+ </div>
+ </template>
+ <span x-text="toast.message" />
+ </i>
+
+ @if ($closeable)
+ <button @click="toast.dispose()" aria-label="@lang('close')"
+ class="absolute right-0 p-4 focus:outline-none hover:bg-transparent/10 rounded {{ $alignment->is('bottom') ? 'top-3' : 'top-0' }}">
+ <svg aria-hidden="true" class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd"
+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
+ clip-rule="evenodd"></path>
+ </svg>
+ </button>
+ @endif
+ </div>
+ </template>
+</div>
diff --git a/tailwind.config.js b/tailwind.config.js
index 1d29f994a8..154269aecd 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,55 +1,59 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: [
- "./resources/**/*.blade.php",
- "./resources/**/*.js",
- "./resources/**/*.vue",
- ],
- theme: {
- extend: {
- fontFamily: {
- sans: ['Inter', 'sans-serif'],
- },
- colors: {
- "applications": "#16A34A",
- "databases": "#9333EA",
- "databases-100": "#9b46ea",
- "destinations": "#0284C7",
- "sources": "#EA580C",
- "services": "#DB2777",
- "settings": "#FEE440",
- "iam": "#C026D3",
- 'coollabs': '#6B16ED',
- 'coollabs-100': '#7317FF',
- 'coolblack': '#141414',
- 'coolgray-100': '#181818',
- 'coolgray-200': '#202020',
- 'coolgray-300': '#242424',
- 'coolgray-400': '#282828',
- 'coolgray-500': '#323232'
- }
+ content: [
+ "./resources/**/*.blade.php",
+ "./resources/**/*.js",
+ "./resources/**/*.vue",
+ ],
+ theme: {
+ extend: {
+ fontFamily: {
+ sans: ["Inter", "sans-serif"],
+ },
+ colors: {
+ applications: "#16A34A",
+ databases: "#9333EA",
+ "databases-100": "#9b46ea",
+ destinations: "#0284C7",
+ sources: "#EA580C",
+ services: "#DB2777",
+ settings: "#FEE440",
+ iam: "#C026D3",
+ coollabs: "#6B16ED",
+ "coollabs-100": "#7317FF",
+ coolblack: "#141414",
+ "coolgray-100": "#181818",
+ "coolgray-200": "#202020",
+ "coolgray-300": "#242424",
+ "coolgray-400": "#282828",
+ "coolgray-500": "#323232",
+ },
+ },
+ },
+ variants: {
+ scrollbar: ["dark"],
+ extend: {},
+ },
+ daisyui: {
+ themes: [
+ {
+ coollabs: {
+ primary: "#6B16ED",
+ secondary: "#4338ca",
+ accent: "#4338ca",
+ neutral: "#1B1D1D",
+ "base-100": "#212121",
+ info: "#2563EB",
+ success: "#16A34A",
+ warning: "#FCD34D",
+ error: "#DC2626",
+ },
+ },
+ ],
},
- },
- variants: {
- scrollbar: ['dark'],
- extend: {}
- },
- daisyui: {
- themes: [
- {
- "coollabs": {
- "primary": "#6B16ED",
- "secondary": "#4338ca",
- "accent": "#4338ca",
- "neutral": "#1B1D1D",
- "base-100": "#212121",
- "info": "#2563EB",
- "success": "#16A34A",
- "warning": "#FCD34D",
- "error": "#DC2626",
- }
- }
+ plugins: [
+ require("tailwindcss-scrollbar"),
+ require("@tailwindcss/typography"),
+ require("daisyui"),
],
- },
- plugins: [require('tailwindcss-scrollbar'),require("@tailwindcss/typography"),require("daisyui")],
-}
+};