fix : use MalioButton/MalioButtonIcon everywhere, fix env count and fixture URLs
- Replace all native HTML buttons with MalioButton and MalioButtonIcon components - Add app:read group on environments relation to fix 0 count in list - Fix fixture URLs (http for apps, https for gitea) - Maintenance icons: alert-outline (activate) / shield-check-outline (deactivate) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,12 +20,13 @@
|
||||
<h2 class="text-lg font-bold tracking-tight text-neutral-900">
|
||||
<slot name="title" />
|
||||
</h2>
|
||||
<button
|
||||
class="rounded-md p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600"
|
||||
<MalioButtonIcon
|
||||
icon="mdi:close"
|
||||
aria-label="Fermer"
|
||||
variant="ghost"
|
||||
icon-size="20"
|
||||
@click="close"
|
||||
>
|
||||
<Icon name="mdi:close" size="20" />
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,19 +39,16 @@
|
||||
<div class="border-t border-neutral-100 px-4 py-4 sm:px-8">
|
||||
<div class="flex justify-end gap-3">
|
||||
<slot name="footer">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg border border-neutral-300 px-4 py-2 text-sm font-semibold text-neutral-700 hover:bg-neutral-50"
|
||||
@click="close"
|
||||
>
|
||||
{{ cancelLabel }}
|
||||
</button>
|
||||
<MalioButton
|
||||
:label="cancelLabel"
|
||||
variant="tertiary"
|
||||
@click="close"
|
||||
/>
|
||||
<MalioButton
|
||||
:label="submitLabel"
|
||||
:loading="loading"
|
||||
@click="$emit('submit')"
|
||||
>
|
||||
{{ submitLabel }}
|
||||
</MalioButton>
|
||||
/>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -161,18 +161,20 @@ onMounted(loadApplication)
|
||||
<p v-if="application.description" class="text-neutral-500 mt-2">{{ application.description }}</p>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
class="rounded-lg border border-neutral-300 px-3 py-2 text-sm font-semibold text-neutral-700 hover:bg-neutral-50"
|
||||
<MalioButton
|
||||
:label="t('applications.detail.editButton')"
|
||||
variant="secondary"
|
||||
icon-name="mdi:pencil"
|
||||
icon-position="left"
|
||||
@click="openEditAppModal"
|
||||
>
|
||||
{{ t('applications.detail.editButton') }}
|
||||
</button>
|
||||
<button
|
||||
class="rounded-lg border border-red-300 px-3 py-2 text-sm font-semibold text-red-600 hover:bg-red-50"
|
||||
/>
|
||||
<MalioButton
|
||||
:label="t('applications.detail.deleteButton')"
|
||||
variant="danger"
|
||||
icon-name="mdi:trash-can-outline"
|
||||
icon-position="left"
|
||||
@click="handleDeleteApp"
|
||||
>
|
||||
{{ t('applications.detail.deleteButton') }}
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -196,12 +198,11 @@ onMounted(loadApplication)
|
||||
<div>
|
||||
<div class="flex items-center justify-between pb-4">
|
||||
<h2 class="text-xl font-bold text-primary-500 sm:text-2xl">{{ t('environments.title') }}</h2>
|
||||
<button
|
||||
class="rounded-lg bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-secondary-500"
|
||||
<MalioButtonIcon
|
||||
icon="mdi:plus"
|
||||
aria-label="Retour"
|
||||
@click="openCreateEnvModal"
|
||||
>
|
||||
+ {{ t('environments.addButton') }}
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Environments list -->
|
||||
@@ -235,31 +236,18 @@ onMounted(loadApplication)
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
class="rounded-lg px-3 py-2 text-xs font-semibold text-white hover:opacity-90"
|
||||
:class="env.maintenance ? 'bg-green-600 hover:bg-green-700' : 'bg-orange-500 hover:bg-orange-600'"
|
||||
:disabled="!!pendingMaintenanceByEnvId[env.id!]"
|
||||
@click="handleToggleMaintenance(env)"
|
||||
>
|
||||
{{ pendingMaintenanceByEnvId[env.id!]
|
||||
<MalioButton
|
||||
:label="pendingMaintenanceByEnvId[env.id!]
|
||||
? t('environments.maintenance.pending')
|
||||
: env.maintenance
|
||||
? t('environments.maintenance.deactivate')
|
||||
: t('environments.maintenance.activate')
|
||||
}}
|
||||
</button>
|
||||
<button
|
||||
class="rounded-lg border border-neutral-300 px-3 py-2 text-xs font-semibold text-neutral-600 hover:bg-white"
|
||||
@click="openEditEnvModal(env)"
|
||||
>
|
||||
{{ t('environments.editButton') }}
|
||||
</button>
|
||||
<button
|
||||
class="rounded-lg border border-red-300 px-3 py-2 text-xs font-semibold text-red-600 hover:bg-red-50"
|
||||
@click="handleDeleteEnv(env.id!)"
|
||||
>
|
||||
{{ t('environments.deleteButton') }}
|
||||
</button>
|
||||
: t('environments.maintenance.activate')"
|
||||
:variant="env.maintenance ? 'danger' : 'primary'"
|
||||
:icon-name="env.maintenance ? 'mdi:shield-check-outline' : 'mdi:alert-outline'"
|
||||
icon-position="left"
|
||||
:loading="!!pendingMaintenanceByEnvId[env.id!]"
|
||||
@click="handleToggleMaintenance(env)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -271,6 +259,22 @@ onMounted(loadApplication)
|
||||
<span class="font-mono text-neutral-400">{{ lf.path }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center gap-4 mt-4">
|
||||
<MalioButton
|
||||
:label="t('environments.editButton')"
|
||||
variant="secondary"
|
||||
icon-name="mdi:pencil"
|
||||
icon-position="left"
|
||||
@click="openEditEnvModal(env)"
|
||||
/>
|
||||
<MalioButton
|
||||
:label="t('environments.deleteButton')"
|
||||
variant="danger"
|
||||
icon-name="mdi:trash-can-outline"
|
||||
icon-position="left"
|
||||
@click="handleDeleteEnv(env.id!)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -364,15 +368,15 @@ onMounted(loadApplication)
|
||||
+ {{ t('environments.logFiles.addButton') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-for="(lf, index) in envForm.logFiles" :key="index" class="flex gap-2 mb-2 items-end">
|
||||
<MalioInputText v-model="lf.label" :label="t('environments.logFiles.label')" class="flex-1" required />
|
||||
<MalioInputText v-model="lf.path" :label="t('environments.logFiles.path')" class="flex-[2]" required />
|
||||
<div v-for="(lf, index) in envForm.logFiles" :key="index" class="flex gap-2 mb-2">
|
||||
<MalioInputText v-model="lf.label" :label="t('environments.logFiles.label')" groupClass="mt-0" inputClass="flex-1" required />
|
||||
<MalioInputText v-model="lf.path" :label="t('environments.logFiles.path')" groupClass="mt-0" inputClass="flex-[2]" required />
|
||||
<MalioButtonIcon
|
||||
icon="mdi:delete-outline"
|
||||
:aria-label="t('environments.logFiles.remove')"
|
||||
variant="ghost"
|
||||
icon-size="18"
|
||||
button-class="text-red-500 hover:bg-red-50 hover:text-red-700 mb-1"
|
||||
button-class="text-red-500 hover:bg-red-50 hover:text-red-700 my-1"
|
||||
@click="removeLogFile(index)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -53,12 +53,12 @@ onMounted(loadApplications)
|
||||
<div class="px-4 py-8 sm:px-8 lg:px-16">
|
||||
<div class="flex items-center justify-between pb-6">
|
||||
<h1 class="text-2xl font-bold text-primary-500 sm:text-4xl">{{ t('applications.title') }}</h1>
|
||||
<button
|
||||
class="rounded-lg bg-primary-500 px-4 py-2 text-sm font-semibold text-white hover:bg-secondary-500"
|
||||
<MalioButton
|
||||
:label="t('applications.addButton')"
|
||||
icon-name="mdi:plus"
|
||||
icon-position="left"
|
||||
@click="openCreateModal"
|
||||
>
|
||||
+ {{ t('applications.addButton') }}
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Loading -->
|
||||
|
||||
@@ -61,7 +61,7 @@ class AppFixtures extends Fixture
|
||||
$sirhProd->setContainerName('sirh-app');
|
||||
$sirhProd->setDeployScriptPath('/home/m-tristan/workspace/SIRH/deploy/docker/deploy.sh');
|
||||
$sirhProd->setMaintenanceFilePath('/home/m-tristan/workspace/SIRH/deploy/docker/maintenance.on');
|
||||
$sirhProd->setAppUrl('https://sirh.malio-dev.fr');
|
||||
$sirhProd->setAppUrl('http://sirh.malio-dev.fr');
|
||||
$sirh->addEnvironment($sirhProd);
|
||||
|
||||
$sirhProdLog = new LogFile();
|
||||
@@ -88,7 +88,7 @@ class AppFixtures extends Fixture
|
||||
$lesstimeProd->setContainerName('lesstime-app');
|
||||
$lesstimeProd->setDeployScriptPath('/home/m-tristan/workspace/lesstime/deploy/docker/deploy.sh');
|
||||
$lesstimeProd->setMaintenanceFilePath('/home/m-tristan/workspace/lesstime/deploy/docker/maintenance.on');
|
||||
$lesstimeProd->setAppUrl('https://lesstime.malio-dev.fr');
|
||||
$lesstimeProd->setAppUrl('http://lesstime.malio-dev.fr');
|
||||
$lesstime->addEnvironment($lesstimeProd);
|
||||
|
||||
$manager->persist($lesstime);
|
||||
@@ -105,7 +105,7 @@ class AppFixtures extends Fixture
|
||||
$inventoryProd->setContainerName('inventory-app');
|
||||
$inventoryProd->setDeployScriptPath('/home/m-tristan/workspace/inventory/deploy/docker/deploy.sh');
|
||||
$inventoryProd->setMaintenanceFilePath('/home/m-tristan/workspace/inventory/deploy/docker/maintenance.on');
|
||||
$inventoryProd->setAppUrl('https://inventory.malio-dev.fr');
|
||||
$inventoryProd->setAppUrl('http://inventory.malio-dev.fr');
|
||||
$inventory->addEnvironment($inventoryProd);
|
||||
|
||||
$inventoryRecette = new Environment();
|
||||
@@ -113,7 +113,7 @@ class AppFixtures extends Fixture
|
||||
$inventoryRecette->setContainerName('inventory-test-app');
|
||||
$inventoryRecette->setDeployScriptPath('/home/m-tristan/workspace/inventory/deploy/docker/deploy-test.sh');
|
||||
$inventoryRecette->setMaintenanceFilePath('/home/m-tristan/workspace/inventory/deploy/docker/maintenance-test.on');
|
||||
$inventoryRecette->setAppUrl('https://inventory-test.malio-dev.fr');
|
||||
$inventoryRecette->setAppUrl('http://inventory-test.malio-dev.fr');
|
||||
$inventory->addEnvironment($inventoryRecette);
|
||||
|
||||
$manager->persist($inventory);
|
||||
|
||||
@@ -81,7 +81,7 @@ class Application
|
||||
|
||||
/** @var Collection<int, Environment> */
|
||||
#[ORM\OneToMany(targetEntity: Environment::class, mappedBy: 'application', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[Groups(['app:detail'])]
|
||||
#[Groups(['app:read', 'app:detail'])]
|
||||
private Collection $environments;
|
||||
|
||||
public function __construct()
|
||||
|
||||
Reference in New Issue
Block a user