Skip to content

A self-hosted media server and file management system

fix: padding for sidebar cards are duplicated on all instances vs centralised on layout

aminnausin1e4a42d4674c
diff --git a/resources/js/components/panels/VideoSidebar.vue b/resources/js/components/panels/VideoSidebar.vue
index 48beaa16..4ea8ebb6 100755
--- a/resources/js/components/panels/VideoSidebar.vue
+++ b/resources/js/components/panels/VideoSidebar.vue
@@ -61,53 +61,51 @@ watch(
</script>
<template>
- <div class="p-3 px-6 lg:px-3 flex flex-col gap-3">
- <div class="flex py-1 flex-col gap-2">
- <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white truncate">{{ selectedSideBar }}</h2>
- <hr class="" />
- </div>
-
- <section v-if="selectedSideBar === 'folders'" id="list-content-folders" class="flex gap-2 flex-wrap">
- <TableBase
- :data="stateDirectory.folders"
- :row="FolderCard"
- :clickAction="handleFolderAction"
- :useToolbar="false"
- :startAscending="true"
- :row-attributes="{
- categoryName: stateDirectory.name,
- stateFolderName: stateFolder?.name,
- }"
- :items-per-page="10"
- :max-visible-pages="3"
- :pagination-class="'!justify-center !flex-col-reverse'"
- :use-pagination-icons="true"
- />
- </section>
- <section v-if="selectedSideBar === 'history'" id="list-content-history" class="flex gap-2 flex-wrap">
- <RecordCard v-for="(record, index) in stateRecords.slice(0, 10)" :key="record.id" :record="record" :index="index" @clickAction="handleShare" />
- <ButtonText
- v-if="stateRecords.length > 0"
- to="/history"
- :title="'View All Watch History'"
- :class="'text-sm h-8 mx-auto mt-2 mb-2 hover:!bg-white dark:!bg-primary-dark-800/70 !bg-primary-800 dark:hover:!bg-primary-dark-600 line-clamp-1 truncate !rounded-full hover:!ring-violet-400 hover:dark:!ring-violet-700 hover:ring-[0.125rem]'"
- :variant="'form'"
- target=""
- >
- <template #text>View More</template>
- </ButtonText>
- <h3 v-show="stateRecords.length < 1" class="text-gray-500 dark:text-gray-400 tracking-wider w-full py-2">Nothing Yet...</h3>
- </section>
- <ModalBase :modalData="shareModal">
- <template #description> Copy link to clipboard to share it.</template>
- <template #controls>
- <ButtonClipboard :text="shareLink" />
- </template>
- </ModalBase>
- <ModalBase :modalData="editFolderModal" :useControls="false">
- <template #content>
- <EditFolder v-if="cachedFolder" :folder="cachedFolder" @handleFinish="handleSeriesUpdate" />
- </template>
- </ModalBase>
+ <div class="flex py-1 flex-col gap-2">
+ <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white truncate">{{ selectedSideBar }}</h2>
+ <hr class="" />
</div>
+
+ <section v-if="selectedSideBar === 'folders'" id="list-content-folders" class="flex gap-2 flex-wrap">
+ <TableBase
+ :data="stateDirectory.folders"
+ :row="FolderCard"
+ :clickAction="handleFolderAction"
+ :useToolbar="false"
+ :startAscending="true"
+ :row-attributes="{
+ categoryName: stateDirectory.name,
+ stateFolderName: stateFolder?.name,
+ }"
+ :items-per-page="10"
+ :max-visible-pages="3"
+ :pagination-class="'!justify-center !flex-col-reverse'"
+ :use-pagination-icons="true"
+ />
+ </section>
+ <section v-if="selectedSideBar === 'history'" id="list-content-history" class="flex gap-2 flex-wrap">
+ <RecordCard v-for="(record, index) in stateRecords.slice(0, 10)" :key="record.id" :record="record" :index="index" @clickAction="handleShare" />
+ <ButtonText
+ v-if="stateRecords.length > 0"
+ to="/history"
+ :title="'View All Watch History'"
+ :class="'text-sm h-8 mx-auto mt-2 mb-2 hover:!bg-white dark:!bg-primary-dark-800/70 !bg-primary-800 dark:hover:!bg-primary-dark-600 line-clamp-1 truncate !rounded-full hover:!ring-violet-400 hover:dark:!ring-violet-700 hover:ring-[0.125rem]'"
+ :variant="'form'"
+ target=""
+ >
+ <template #text>View More</template>
+ </ButtonText>
+ <h3 v-show="stateRecords.length < 1" class="text-gray-500 dark:text-gray-400 tracking-wider w-full py-2">Nothing Yet...</h3>
+ </section>
+ <ModalBase :modalData="shareModal">
+ <template #description> Copy link to clipboard to share it.</template>
+ <template #controls>
+ <ButtonClipboard :text="shareLink" />
+ </template>
+ </ModalBase>
+ <ModalBase :modalData="editFolderModal" :useControls="false">
+ <template #content>
+ <EditFolder v-if="cachedFolder" :folder="cachedFolder" @handleFinish="handleSeriesUpdate" />
+ </template>
+ </ModalBase>
</template>
diff --git a/resources/js/layouts/LayoutBase.vue b/resources/js/layouts/LayoutBase.vue
index 4c9b2fff..3efd2d7f 100755
--- a/resources/js/layouts/LayoutBase.vue
+++ b/resources/js/layouts/LayoutBase.vue
@@ -9,24 +9,35 @@ const { selectedSideBar, sideBarTarget } = storeToRefs(useAppStore());
<template>
<main
- class="md:h-auto grid grid-cols-1 lg:grid-cols-10 2xl:grid-cols-6 sm:p-6 lg:gap-6 snap-y bg-primary-900 dark:bg-primary-dark-900 sm:bg-primary-950 sm:dark:bg-primary-dark-950 dark:text-white text-gray-900 antialiased overflow-x-clip"
+ class="px-6 p-3 sm:p-6 md:h-auto grid grid-cols-1 lg:grid-cols-10 2xl:grid-cols-6 sm:gap-6 snap-y bg-primary-900 dark:bg-primary-dark-900 sm:bg-primary-950 sm:dark:bg-primary-dark-950 dark:text-white text-gray-900 antialiased overflow-x-clip"
>
<section
id="left-card"
- :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:block lg:invisible'}`"
+ :class="[
+ `col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-2 lg:order-1 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5`,
+ `${selectedSideBar && sideBarTarget === 'left-card' ? 'sm:ring-1' : 'hidden lg:block lg:invisible'}`,
+ 'sm:p-3 flex flex-col gap-3',
+ ]"
>
<slot name="leftSidebar"></slot>
</section>
<section
id="content-card"
- class="col-span-full lg:col-span-6 2xl:col-span-4 flex-grow order-1 lg:order-2 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl p-6 pt-3 sm:rounded-2xl w-full h-fit flex flex-col gap-3 sm:ring-1 ring-gray-900/5"
+ :class="[
+ 'col-span-full lg:col-span-6 2xl:col-span-4 flex-grow order-1 lg:order-2 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl w-full h-fit sm:ring-1 ring-gray-900/5',
+ 'flex flex-col gap-3 sm:p-3 sm:px-6',
+ ]"
>
<NavBar />
<slot name="content" class="relative z-0"></slot>
</section>
<section
id="list-card"
- :class="`col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5 ${selectedSideBar && sideBarTarget === 'list-card' ? 'sm:ring-1' : 'hidden'}`"
+ :class="[
+ `col-span-1 lg:col-span-2 2xl:col-span-1 h-fit order-3 bg-primary-900 dark:bg-primary-dark-900 sm:shadow-xl sm:rounded-2xl space-y-2 sm:scroll-mt-6 ring-gray-900/5`,
+ `${selectedSideBar && sideBarTarget === 'list-card' ? 'sm:ring-1' : 'hidden'}`,
+ 'sm:p-3 flex flex-col gap-3',
+ ]"
>
<slot name="sidebar"></slot>
</section>
diff --git a/resources/js/views/DashboardView.vue b/resources/js/views/DashboardView.vue
index 3ccf43e4..9c47f152 100644
--- a/resources/js/views/DashboardView.vue
+++ b/resources/js/views/DashboardView.vue
@@ -112,84 +112,82 @@ watch(
</section>
</template>
<template v-slot:leftSidebar>
- <div class="p-3 px-6 lg:px-3 flex flex-col gap-3">
- <div class="flex py-1 flex-col gap-2">
- <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white">{{ selectedSideBar }}</h2>
- <hr class="" />
- </div>
- <section class="flex flex-col gap-2 flex-1">
- <SidebarCard
- v-for="(tab, index) in dashboardTabs.filter((tab) => !tab.disabled)"
- :key="index"
- :link="tab.disabled ? '' : `/dashboard/${tab.name}`"
- :class="`
+ <div class="flex py-1 flex-col gap-2">
+ <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white">{{ selectedSideBar }}</h2>
+ <hr class="" />
+ </div>
+ <section class="flex flex-col gap-2 flex-1">
+ <SidebarCard
+ v-for="(tab, index) in dashboardTabs.filter((tab) => !tab.disabled)"
+ :key="index"
+ :link="tab.disabled ? '' : `/dashboard/${tab.name}`"
+ :class="`
items-center justify-between !gap-2
capitalize overflow-hidden bg-white hover:bg-primary-800
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem] ${dashboardTab?.name == tab.name && 'ring-[0.125rem]'}
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- @click="
- () => {
- if (tab.disabled) return;
- dashboardTab = tab;
- }
- "
- :aria-disabled="tab.disabled"
- >
- <template #header>
- <h3 class="w-full flex-1 text-gray-900 dark:text-white line-clamp-1" :title="tab.title ?? tab.name">{{ tab.title ?? tab.name }}</h3>
- <component v-if="tab.icon" :is="tab.icon" class="ml-auto w-6 h-6" />
- </template>
- <template #body>
- <h4 v-if="tab.description" title="Description" class="w-full text-wrap truncate sm:text-nowrap flex-1">
- {{ tab.description }}
- </h4>
- <h4 v-if="tab.info" title="Information" class="truncate text-nowrap sm:text-right w-fit">
- {{ tab.info.value }}
- </h4>
- </template>
- </SidebarCard>
+ @click="
+ () => {
+ if (tab.disabled) return;
+ dashboardTab = tab;
+ }
+ "
+ :aria-disabled="tab.disabled"
+ >
+ <template #header>
+ <h3 class="w-full flex-1 text-gray-900 dark:text-white line-clamp-1" :title="tab.title ?? tab.name">{{ tab.title ?? tab.name }}</h3>
+ <component v-if="tab.icon" :is="tab.icon" class="ml-auto w-6 h-6" />
+ </template>
+ <template #body>
+ <h4 v-if="tab.description" title="Description" class="w-full text-wrap truncate sm:text-nowrap flex-1">
+ {{ tab.description }}
+ </h4>
+ <h4 v-if="tab.info" title="Information" class="truncate text-nowrap sm:text-right w-fit">
+ {{ tab.info.value }}
+ </h4>
+ </template>
+ </SidebarCard>
- <SidebarCard
- :link="`/settings`"
- :class="`
+ <SidebarCard
+ :link="`/settings`"
+ :class="`
items-center justify-between
capitalize overflow-hidden bg-white hover:bg-primary-800
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem]
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- :aria-disabled="false"
- >
- <template #header>
- <h3 class="text-gray-900 dark:text-white" :title="'Settings'">Settings</h3>
- <ProiconsSettings class="ml-auto w-6 h-6" />
- </template>
- <template #body>
- <h4 title="App Version" class="w-full text-wrap truncate sm:text-nowrap flex-1">Configurable Options</h4>
- </template>
- </SidebarCard>
- <SidebarCard
- :to="`${appManifest?.commit ? `https://github.com/aminnausin/mediaServer/commit/${appManifest?.commit}` : ''}`"
- target="_blank"
- :class="`
+ :aria-disabled="false"
+ >
+ <template #header>
+ <h3 class="text-gray-900 dark:text-white" :title="'Settings'">Settings</h3>
+ <ProiconsSettings class="ml-auto w-6 h-6" />
+ </template>
+ <template #body>
+ <h4 title="App Version" class="w-full text-wrap truncate sm:text-nowrap flex-1">Configurable Options</h4>
+ </template>
+ </SidebarCard>
+ <SidebarCard
+ :to="`${appManifest?.commit ? `https://github.com/aminnausin/mediaServer/commit/${appManifest?.commit}` : ''}`"
+ target="_blank"
+ :class="`
items-center justify-between
capitalize overflow-hidden bg-white hover:bg-primary-800
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem]
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- :aria-disabled="false"
- >
- <template #header>
- <h3 class="text-gray-900 dark:text-white" :title="'Source Code'">MediaServer</h3>
- <ProiconsGithub class="ml-auto w-6 h-6" />
- </template>
- <template #body>
- <h4 title="App Version" class="w-full text-wrap truncate sm:text-nowrap flex-1">V{{ appManifest.version ?? '0.1.15b' }}</h4>
- <h4 v-if="appManifest.commit" title="Information" class="truncate text-nowrap sm:text-right w-fit">#{{ appManifest.commit }}</h4>
- </template>
- </SidebarCard>
- </section>
- </div>
+ :aria-disabled="false"
+ >
+ <template #header>
+ <h3 class="text-gray-900 dark:text-white" :title="'Source Code'">MediaServer</h3>
+ <ProiconsGithub class="ml-auto w-6 h-6" />
+ </template>
+ <template #body>
+ <h4 title="App Version" class="w-full text-wrap truncate sm:text-nowrap flex-1">V{{ appManifest.version ?? '0.1.15b' }}</h4>
+ <h4 v-if="appManifest.commit" title="Information" class="truncate text-nowrap sm:text-right w-fit">#{{ appManifest.commit }}</h4>
+ </template>
+ </SidebarCard>
+ </section>
</template>
</LayoutBase>
</template>
diff --git a/resources/js/views/SettingsView.vue b/resources/js/views/SettingsView.vue
index 7c489010..89c66aca 100755
--- a/resources/js/views/SettingsView.vue
+++ b/resources/js/views/SettingsView.vue
@@ -90,58 +90,56 @@ watch(
</section>
</template>
<template v-slot:leftSidebar>
- <div class="p-3 px-6 lg:px-3 flex flex-col gap-3">
- <div class="flex py-1 flex-col gap-2">
- <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white">{{ selectedSideBar }}</h2>
- <hr class="" />
- </div>
- <section class="flex flex-col gap-2 flex-1">
- <SidebarCard
- v-for="(tab, index) in settingsTabs.filter((tab) => !tab.disabled)"
- :key="index"
- :link="tab.disabled ? '' : `/settings/${tab.name}`"
- :class="`
+ <div class="flex py-1 flex-col gap-2">
+ <h2 id="sidebar-title" class="text-2xl h-8 w-full capitalize dark:text-white">{{ selectedSideBar }}</h2>
+ <hr class="" />
+ </div>
+ <section class="flex flex-col gap-2 flex-1">
+ <SidebarCard
+ v-for="(tab, index) in settingsTabs.filter((tab) => !tab.disabled)"
+ :key="index"
+ :link="tab.disabled ? '' : `/settings/${tab.name}`"
+ :class="`
items-center justify-between !gap-2
capitalize overflow-hidden bg-white hover:bg-primary-800
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem] ${settingsTab?.name == tab.name && 'ring-[0.125rem]'}
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- @click="settingsTab = tab"
- :aria-disabled="tab.disabled"
- >
- <template #header>
- <h3 class="w-full flex-1 text-gray-900 dark:text-white line-clamp-1" :title="tab.title ?? tab.name">{{ tab.title ?? tab.name }}</h3>
- <component v-if="tab.icon" :is="tab.icon" class="ml-auto w-6 h-6" />
- </template>
- <template #body>
- <h4 v-if="tab.description" title="Description" class="w-full text-wrap truncate sm:text-nowrap flex-1">
- {{ tab.description }}
- </h4>
- <h4 v-if="tab.info" title="Information" class="truncate text-nowrap sm:text-right w-fit">
- {{ tab.info.value }}
- </h4>
- </template>
- </SidebarCard>
- <SidebarCard
- :link="`/dashboard`"
- :class="`
+ @click="settingsTab = tab"
+ :aria-disabled="tab.disabled"
+ >
+ <template #header>
+ <h3 class="w-full flex-1 text-gray-900 dark:text-white line-clamp-1" :title="tab.title ?? tab.name">{{ tab.title ?? tab.name }}</h3>
+ <component v-if="tab.icon" :is="tab.icon" class="ml-auto w-6 h-6" />
+ </template>
+ <template #body>
+ <h4 v-if="tab.description" title="Description" class="w-full text-wrap truncate sm:text-nowrap flex-1">
+ {{ tab.description }}
+ </h4>
+ <h4 v-if="tab.info" title="Information" class="truncate text-nowrap sm:text-right w-fit">
+ {{ tab.info.value }}
+ </h4>
+ </template>
+ </SidebarCard>
+ <SidebarCard
+ :link="`/dashboard`"
+ :class="`
items-center justify-between
capitalize overflow-hidden bg-white hover:bg-primary-800
ring-inset ring-purple-600 hover:ring-purple-600/50 hover:ring-[0.125rem]
aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60
`"
- :aria-disabled="false"
- >
- <template #header>
- <h3 class="text-gray-900 dark:text-white" :title="'Dashboard'">Dashboard</h3>
- <CircumGrid31 class="ml-auto w-6 h-6" />
- </template>
- <template #body>
- <h4 title="App Dashboard" class="w-full text-wrap truncate sm:text-nowrap flex-1">Server Analytics</h4>
- </template>
- </SidebarCard>
- </section>
- </div>
+ :aria-disabled="false"
+ >
+ <template #header>
+ <h3 class="text-gray-900 dark:text-white" :title="'Dashboard'">Dashboard</h3>
+ <CircumGrid31 class="ml-auto w-6 h-6" />
+ </template>
+ <template #body>
+ <h4 title="App Dashboard" class="w-full text-wrap truncate sm:text-nowrap flex-1">Server Analytics</h4>
+ </template>
+ </SidebarCard>
+ </section>
</template>
</LayoutBase>
</template>