feat(lite): CR feedback (#6341)
This commit is contained in:
parent
005d3b5976
commit
971cdaa44f
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="collection-filter-row">
|
<div class="collection-filter-row">
|
||||||
<span class="or">OR</span>
|
<span class="or">OR</span>
|
||||||
<FormWidget v-if="newFilter.isAdvanced" style="flex: 1">
|
<FormWidget v-if="newFilter.isAdvanced" class="form-widget-advanced">
|
||||||
<input v-model="newFilter.content" />
|
<input v-model="newFilter.content" />
|
||||||
</FormWidget>
|
</FormWidget>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@ -257,4 +257,8 @@ const valueInputAfter = computed(() => {
|
|||||||
.remove-icon {
|
.remove-icon {
|
||||||
color: var(--color-red-vates-base);
|
color: var(--color-red-vates-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-widget-advanced {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
@edit="emit('toggleSortDirection', property)"
|
@edit="emit('toggleSortDirection', property)"
|
||||||
@remove="emit('removeSort', property)"
|
@remove="emit('removeSort', property)"
|
||||||
>
|
>
|
||||||
<span style="display: inline-flex; align-items: center; gap: 0.7rem">
|
<span class="property">
|
||||||
<FontAwesomeIcon :icon="isAscending ? faCaretUp : faCaretDown" />
|
<FontAwesomeIcon :icon="isAscending ? faCaretUp : faCaretDown" />
|
||||||
{{ property }}
|
{{ property }}
|
||||||
</span>
|
</span>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<UiModal v-if="isOpen">
|
<UiModal v-if="isOpen">
|
||||||
<form @submit.prevent="handleSubmit">
|
<form @submit.prevent="handleSubmit">
|
||||||
<div style="display: flex; gap: 1rem">
|
<div class="form-widgets">
|
||||||
<FormWidget label="Sort by">
|
<FormWidget label="Sort by">
|
||||||
<select v-model="newSortProperty">
|
<select v-model="newSortProperty">
|
||||||
<option v-if="!newSortProperty"></option>
|
<option v-if="!newSortProperty"></option>
|
||||||
@ -80,9 +80,8 @@ const newSortProperty = ref();
|
|||||||
const newSortIsAscending = ref<boolean>(true);
|
const newSortIsAscending = ref<boolean>(true);
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
// editedFilter.value = "";
|
newSortProperty.value = undefined;
|
||||||
// newFilters.value = [];
|
newSortIsAscending.value = true;
|
||||||
// addNewFilter();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
@ -101,4 +100,15 @@ const handleCancel = () => {
|
|||||||
.add-sort {
|
.add-sort {
|
||||||
height: 3.4rem;
|
height: 3.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-widgets {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.property {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.7rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -11,24 +11,20 @@ import {
|
|||||||
faQuestion,
|
faQuestion,
|
||||||
faStop,
|
faStop,
|
||||||
} from "@fortawesome/pro-solid-svg-icons";
|
} from "@fortawesome/pro-solid-svg-icons";
|
||||||
import FormWidget from "@/components/FormWidget.vue";
|
|
||||||
import type { PowerState } from "@/libs/xen-api";
|
import type { PowerState } from "@/libs/xen-api";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
state: PowerState | "Unknown";
|
state: PowerState;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const icon = computed(() => {
|
|
||||||
const icons = {
|
const icons = {
|
||||||
Running: faPlay,
|
Running: faPlay,
|
||||||
Paused: faPause,
|
Paused: faPause,
|
||||||
Suspended: faMoon,
|
Suspended: faMoon,
|
||||||
Unknown: faQuestion,
|
|
||||||
Halted: faStop,
|
Halted: faStop,
|
||||||
};
|
};
|
||||||
|
|
||||||
return icons[props.state];
|
const icon = computed(() => icons[props.state] ?? faQuestion);
|
||||||
});
|
|
||||||
|
|
||||||
const className = computed(() => `state-${props.state.toLocaleLowerCase()}`);
|
const className = computed(() => `state-${props.state.toLocaleLowerCase()}`);
|
||||||
</script>
|
</script>
|
||||||
|
@ -24,6 +24,13 @@ export function escapeRegExp(string: string) {
|
|||||||
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iconsByType = {
|
||||||
|
string: faFont,
|
||||||
|
number: faHashtag,
|
||||||
|
boolean: faSquareCheck,
|
||||||
|
enum: faList,
|
||||||
|
};
|
||||||
|
|
||||||
export function getFilterIcon(filter: Filter | undefined) {
|
export function getFilterIcon(filter: Filter | undefined) {
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
return;
|
return;
|
||||||
@ -33,13 +40,6 @@ export function getFilterIcon(filter: Filter | undefined) {
|
|||||||
return filter.icon;
|
return filter.icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconsByType = {
|
|
||||||
string: faFont,
|
|
||||||
number: faHashtag,
|
|
||||||
boolean: faSquareCheck,
|
|
||||||
enum: faList,
|
|
||||||
};
|
|
||||||
|
|
||||||
return iconsByType[filter.type];
|
return iconsByType[filter.type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user