Fleet targets revisit CSS

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2025-06-18 16:48:00 +02:00
parent 952be9a79c
commit c44681ab8c
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
5 changed files with 32 additions and 23 deletions

View File

@ -2579,15 +2579,18 @@ fleet:
notReady: Not Ready notReady: Not Ready
waitApplied: Wait Applied waitApplied: Wait Applied
clusterTargets: clusterTargets:
title: Select by name
label: Clusters label: Clusters
advancedConfigs: Advanced target configurations are defined, check the YAML file for further details. advancedConfigs: Advanced target configurations are defined, check the YAML file for further details.
placeholders: placeholders:
selectMultiple: Select Multiple Clusters selectMultiple: Select Multiple Clusters
rules: rules:
title: Labels matching rules title: Select by labels
description: Add rules to select clusters with matching labels
addSelector: Add cluster selector addSelector: Add cluster selector
matching: Target Clusters matching:
title: Selected clusters
placeholder: Select clusters by name or labels
empty: No clusters in the workspace
application: application:
pageTitle: App Bundles pageTitle: App Bundles
menuLabel: App Bundles menuLabel: App Bundles
@ -2719,7 +2722,7 @@ fleet:
clusterGroup: Cluster Group clusterGroup: Cluster Group
label: Deploy To label: Deploy To
labelLocal: Deploy With labelLocal: Deploy With
additionalOptions: Additional Options additionalOptions: Additional settings
targetDisplay: targetDisplay:
advanced: Advanced advanced: Advanced
clusters: "Clusters" clusters: "Clusters"

View File

@ -9,6 +9,11 @@ export default {
type: Array as PropType<{ name: string }[]>, type: Array as PropType<{ name: string }[]>,
default: () => [], default: () => [],
}, },
emptyLabel: {
type: String,
default: ''
}
}, },
computed: { computed: {
@ -33,22 +38,25 @@ export default {
<template> <template>
<div class="targets-list"> <div class="targets-list">
<h3>{{ t('fleet.clusterTargets.rules.matching') }}</h3> <h3>{{ t('fleet.clusterTargets.rules.matching.title') }}</h3>
<span <span
v-for="(name, i) in names" v-for="(name, i) in names"
:key="i" :key="i"
class="row" class="row mt-5"
> >
{{ name }} {{ name }}
</span> </span>
<span
v-if="!names.length"
class="text-muted"
>
{{ emptyLabel || t('fleet.clusterTargets.rules.matching.empty') }}
</span>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.targets-list { .targets-list {
border: 1px solid var(--border);
padding: 15px;
border-radius: 5px;
height: 100%; height: 100%;
} }
</style> </style>

View File

@ -111,18 +111,18 @@ export default {
const out: { label: string, value: TargetMode }[] = [ const out: { label: string, value: TargetMode }[] = [
{ {
label: 'All Clusters in the Workspace', label: 'All Clusters in the workspace',
value: 'all', value: 'all',
}, },
{ {
label: 'No Clusters', label: 'No clusters',
value: 'none' value: 'none'
}, },
]; ];
if (this.clustersOptions.length) { if (this.clustersOptions.length) {
out.push({ out.push({
label: 'Manually select clusters', label: 'Manually selected clusters',
value: 'clusters' value: 'clusters'
}); });
} }
@ -326,7 +326,9 @@ export default {
class="row mt-20" class="row mt-20"
> >
<div class="col span-8"> <div class="col span-8">
<h3> {{ t('fleet.clusterTargets.title') }} </h3>
<LabeledSelect <LabeledSelect
class="mt-20"
:value="selectedClusters" :value="selectedClusters"
:label="t('fleet.clusterTargets.label')" :label="t('fleet.clusterTargets.label')"
:options="clustersOptions" :options="clustersOptions"
@ -337,15 +339,12 @@ export default {
:placeholder="t('fleet.clusterTargets.placeholders.selectMultiple')" :placeholder="t('fleet.clusterTargets.placeholders.selectMultiple')"
@update:value="selectClusters" @update:value="selectClusters"
/> />
<div class="mt-20"> <div class="mt-30">
<h3> {{ t('fleet.clusterTargets.rules.title') }} </h3> <h3> {{ t('fleet.clusterTargets.rules.title') }} </h3>
<p class="text-muted">
{{ t('fleet.clusterTargets.rules.description') }}
</p>
<div <div
v-for="(selector, i) in clusterSelectors" v-for="(selector, i) in clusterSelectors"
:key="selector.key" :key="selector.key"
class="match-expressions-container mt-10" class="match-expressions-container mt-20"
> >
<MatchExpressions <MatchExpressions
class="body" class="body"
@ -382,6 +381,7 @@ export default {
<TargetsList <TargetsList
class="target-list" class="target-list"
:clusters="matching" :clusters="matching"
:empty-label="t('fleet.clusterTargets.rules.matching.placeholder')"
/> />
</div> </div>
</div> </div>

View File

@ -127,7 +127,7 @@ export default {
label: this.t('fleet.gitRepo.add.steps.metadata.label'), label: this.t('fleet.gitRepo.add.steps.metadata.label'),
subtext: this.t('fleet.gitRepo.add.steps.metadata.subtext'), subtext: this.t('fleet.gitRepo.add.steps.metadata.subtext'),
descriptionKey: 'fleet.gitRepo.add.steps.metadata.description', descriptionKey: 'fleet.gitRepo.add.steps.metadata.description',
ready: this.isView || !!this.value.metadata.name, ready: true,
weight: 1 weight: 1
}, },
{ {
@ -136,7 +136,7 @@ export default {
label: this.t('fleet.gitRepo.add.steps.repo.label'), label: this.t('fleet.gitRepo.add.steps.repo.label'),
subtext: this.t('fleet.gitRepo.add.steps.repo.subtext'), subtext: this.t('fleet.gitRepo.add.steps.repo.subtext'),
descriptionKey: 'fleet.gitRepo.add.steps.repo.description', descriptionKey: 'fleet.gitRepo.add.steps.repo.description',
ready: this.isView || (!!this.refValue && !!this.fvFormIsValid), ready: true,
weight: 1 weight: 1
}, },
{ {
@ -657,7 +657,6 @@ export default {
<template #stepTarget> <template #stepTarget>
<h2 v-t="'fleet.gitRepo.target.label'" /> <h2 v-t="'fleet.gitRepo.target.label'" />
<FleetClusterTargets <FleetClusterTargets
:targets="value.spec.targets" :targets="value.spec.targets"
:matching="value.targetClusters" :matching="value.targetClusters"
@ -666,7 +665,7 @@ export default {
@update:value="updateTargets" @update:value="updateTargets"
/> />
<h3 class="mt-30"> <h3 class="mt-40">
{{ t('fleet.gitRepo.target.additionalOptions') }} {{ t('fleet.gitRepo.target.additionalOptions') }}
</h3> </h3>
<div class="row mt-20"> <div class="row mt-20">

View File

@ -673,7 +673,6 @@ export default {
<template #target> <template #target>
<h2 v-t="'fleet.helmOp.target.label'" /> <h2 v-t="'fleet.helmOp.target.label'" />
<FleetClusterTargets <FleetClusterTargets
:targets="value.spec.targets" :targets="value.spec.targets"
:matching="value.targetClusters" :matching="value.targetClusters"
@ -682,7 +681,7 @@ export default {
@update:value="updateTargets" @update:value="updateTargets"
/> />
<h3 class="mt-30"> <h3 class="mt-40">
{{ t('fleet.helmOp.target.additionalOptions') }} {{ t('fleet.helmOp.target.additionalOptions') }}
</h3> </h3>
<div class="row mt-20"> <div class="row mt-20">