Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions unraid-ui/src/components/layout/SettingsGrid.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script setup lang="ts">
import { cn } from '@/lib/utils';

const props = defineProps<{
class?: string;
}>();
</script>

<template>
<div
:class="cn('settings-grid grid gap-2 items-baseline md:pl-3 md:gap-x-10 md:gap-y-6', props.class)"
>
<slot />
</div>
</template>

<style>
.settings-grid {
grid-template-columns: 1fr;
}

@media (min-width: 768px) {
.settings-grid {
grid-template-columns: 35% 1fr;
}

.settings-grid > *:nth-child(odd) {
text-align: end;
}
}
</style>
3 changes: 2 additions & 1 deletion unraid-ui/src/components/layout/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import CardWrapper from '@/components/layout/CardWrapper.vue';
import PageContainer from '@/components/layout/PageContainer.vue';
import SettingsGrid from '@/components/layout/SettingsGrid.vue';

export { CardWrapper, PageContainer };
export { CardWrapper, PageContainer, SettingsGrid };
8 changes: 3 additions & 5 deletions unraid-ui/src/forms/UnraidSettingsLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @prop cells - Available cells
*/

import SettingsGrid from '@/components/layout/SettingsGrid.vue';
import { useJsonFormsVisibility } from '@/forms/composables/useJsonFormsVisibility';
import type { HorizontalLayout } from '@jsonforms/core';
import { DispatchRenderer, type RendererProps } from '@jsonforms/vue';
Expand All @@ -32,10 +33,7 @@ const elements = computed(() => {
</script>

<template>
<div
v-if="isVisible"
class="grid grid-cols-settings items-baseline pl-3 gap-y-6 [&>*:nth-child(odd)]:text-end [&>*:nth-child(even)]:ml-10"
>
<SettingsGrid v-if="isVisible">
<template v-for="(element, _i) in elements" :key="_i">
<DispatchRenderer
:schema="layout.layout.value.schema"
Expand All @@ -46,5 +44,5 @@ const elements = computed(() => {
:cells="layout.layout.value.cells"
/>
</template>
</div>
</SettingsGrid>
</template>
3 changes: 0 additions & 3 deletions unraid-ui/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@
--max-width-800px: 800px;
--max-width-1024px: 1024px;

/* Breakpoints */
--breakpoint-*: initial;

/* Animations */
--animate-mark-2: mark-2 1.5s ease infinite;
--animate-mark-3: mark-3 1.5s ease infinite;
Expand Down
8 changes: 3 additions & 5 deletions web/components/ConnectSettings/ConnectSettings.ce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { storeToRefs } from 'pinia';
import { watchDebounced } from '@vueuse/core';
import { useMutation, useQuery } from '@vue/apollo-composable';

import { BrandButton, jsonFormsRenderers, Label } from '@unraid/ui';
import { BrandButton, jsonFormsRenderers, Label, SettingsGrid } from '@unraid/ui';
import { JsonForms } from '@jsonforms/vue';

import { useServerStore } from '~/store/server';
Expand Down Expand Up @@ -102,9 +102,7 @@ const onChange = ({ data }: { data: Record<string, unknown> }) => {

<template>
<!-- common api-related actions -->
<div
class="grid grid-cols-settings items-baseline pl-3 gap-y-6 [&>*:nth-child(odd)]:text-end [&>*:nth-child(even)]:ml-10"
>
<SettingsGrid>
<template v-if="connectPluginInstalled">
<Label>Account Status:</Label>
<div v-html="'<unraid-auth></unraid-auth>'"/>
Expand All @@ -115,7 +113,7 @@ const onChange = ({ data }: { data: Record<string, unknown> }) => {
'<unraid-download-api-logs></unraid-download-api-logs>'
"
/>
</div>
</SettingsGrid>
<!-- auto-generated settings form -->
<div class="mt-6 pl-3 [&_.vertical-layout]:space-y-6">
<JsonForms
Expand Down