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:
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user