Skip to content

A self-hosted media server and file management system

chore: code smells

aminnausind9c75e76d750
diff --git a/public/css/main.css b/public/css/main.css
index c1b66653..f63b3188 100755
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -1,33 +1,3 @@
-/* html[data-bs-theme="dark"] div.dtsp-panesContainer div.dtsp-searchPane div.dataTables_wrapper div.dataTables_scrollBody {
- background: var(--bs-table-bg) !important;
-} */
-
-/* .neu-card{
- border-radius: 15px;
- background: #f2f2f2;
- box-shadow: 20px 20px 60px #cecece, -20px -20px 60px #ffffff;
- margin: 2%;
- padding: 2%;
-}
-
-.neu-card.dark-mode{
- border-radius: 15px;
- background: #161618;
- box-shadow: 20px 20px 60px #131314, -20px -20px 60px #19191c;
- box-shadow: 0px 0px 0px #131314, -0px -0px 0px #19191c;
- margin: 2%;
- padding: 2%;
-}
-
-.neu-card.darker{
- border-radius: 15px;
- background: #121212;
- box-shadow: 20px 20px 60px #0f0f0f, -20px -20px 60px #151515;
- box-shadow: 0px 0px 0px #0f0f0f, -0px -0px 0px #151515;
- margin: 2%;
- padding: 2%;
-} */
-
.toggle-switch {
position: relative;
width: 60px;
@@ -90,13 +60,3 @@
-webkit-box-shadow: none;
box-shadow: none;
}
-
-/* .dark-mode{
- background-color: #121216;
- color:#e2e0e2;
-} */
-
-/* .light{
- background: #f2f2f2;
- background-color: #e2e0e2;"
-} */
diff --git a/public/index.php b/public/index.php
index 74a0960e..86bfe789 100755
--- a/public/index.php
+++ b/public/index.php
@@ -1,5 +1,6 @@
<?php
+use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
@@ -13,5 +14,7 @@ if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php'
require __DIR__ . '/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
-(require_once __DIR__ . '/../bootstrap/app.php')
- ->handleRequest(Request::capture());
+/** @var Application $app */
+$app = require_once __DIR__ . '/../bootstrap/app.php';
+
+$app->handleRequest(Request::capture());
diff --git a/resources/css/app.css b/resources/css/app.css
index 08a018af..7f017a71 100755
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -155,12 +155,6 @@
overflow: hidden;
}
- .slider::-webkit-slider-runnable-track {
- background: var(--track-color);
- border-radius: var(--track-rounded);
- overflow: hidden;
- }
-
/* Firefox */
.slider::-moz-range-thumb {
transition: all 200ms ease-in-out;
diff --git a/resources/js/components/cards/SubTaskCard.vue b/resources/js/components/cards/SubTaskCard.vue
index 97b3c2d4..5515c9c5 100644
--- a/resources/js/components/cards/SubTaskCard.vue
+++ b/resources/js/components/cards/SubTaskCard.vue
@@ -70,39 +70,6 @@ const emit = defineEmits(['clickAction']);
</div>
<div class="flex gap-1 items-center shrink-0 sm:flex-none">
- <!-- <PulseDoughnutChart
- v-if="isScreenLarge ?? false"
- v-cloak
- class="!h-6 !w-6 lg:!hidden"
- :chart-options="{
- borderWidth: 0,
- plugins: {
- legend: {
- display: false,
- },
- tooltip: {
- enabled: false,
- displayColors: false,
- },
- },
- }"
- :chart-data="{
- labels: ['Pending', 'Completed', 'Failed'],
- datasets: [
- {
- data: [
- Math.max(100 - data.progress, 0),
- data.status === 'processing' || data.status === 'completed' ? Math.max(data.progress, 0) : 0,
- data.status === 'failed' ? Math.max(data.progress, 0) : 0,
- ],
- backgroundColor: ['#f59e0b', '#9333ea', '#be123c'],
- hoverBackgroundColor: ['#f59e0b', '#9333ea', '#e11d48'],
- },
- ],
- }"
- />
- <p class="text-left lg:!hidden text-xs flex-1">{{ Math.max(data.progress, 0) }}%</p> -->
-
<ChipTag
:class="`h-6 shadow-sm`"
:colour="`${data.status === 'pending' ? 'bg-[#e4e4e4] dark:bg-white !text-gray-900' : '!text-white'} ${
diff --git a/resources/js/components/pinesUI/HoverCard.vue b/resources/js/components/pinesUI/HoverCard.vue
index 7da4a5ce..dd40a528 100644
--- a/resources/js/components/pinesUI/HoverCard.vue
+++ b/resources/js/components/pinesUI/HoverCard.vue
@@ -60,7 +60,7 @@ const updateTooltipPosition = (event: MouseEvent) => {
v-cloak
>
<slot name="content">
- <img src="https://cdn.devdojo.com/users/June2022/devdojo.jpg" alt="devdojo image" class="rounded-full w-14 h-14" />
+ <img src="https://cdn.devdojo.com/users/June2022/devdojo.jpg" alt="devdojo logo" class="rounded-full w-14 h-14" />
<div class="relative">
<p class="mb-1 font-bold">@thedevdojo</p>
<p class="mb-1 text-sm text-gray-600">The creative platform for developers. Community, tools, products, and more</p>
diff --git a/resources/js/components/pinesUI/ToastController.vue b/resources/js/components/pinesUI/ToastController.vue
index 648c0323..5eb6343b 100755
--- a/resources/js/components/pinesUI/ToastController.vue
+++ b/resources/js/components/pinesUI/ToastController.vue
@@ -212,9 +212,8 @@ watch(
watchEffect((onInvalidate) => {
const unsubscribe = ToastState.subscribe((newToast) => {
- // ? toast is deleted locally already why is there an extra step
if ((newToast as ToastToDismiss).dismiss) {
- // messages.value = messages.value.map((t) => (t.id === toast.id ? { ...t, delete: true } : t));
+ // ? toast is deleted locally already why is there an extra step -> messages.value = messages.value.map((t) => (t.id === toast.id ? { ...t, delete: true } : t));
return;
}
diff --git a/resources/js/components/pinesUI/ToastNotification.vue b/resources/js/components/pinesUI/ToastNotification.vue
index 60059e56..06b7f650 100755
--- a/resources/js/components/pinesUI/ToastNotification.vue
+++ b/resources/js/components/pinesUI/ToastNotification.vue
@@ -6,9 +6,7 @@ import { SWIPE_THRESHOLD, TOAST_LIFE } from '@/service/toaster/constants';
import { useSwipeHandler } from '@/composables/useSwipeHandler';
import { useToastTimer } from '@/composables/useToastTimer';
-const emit = defineEmits<{
- (e: 'close', id: string): void; // removeToast
-}>();
+const emit = defineEmits<(e: 'close', id: string) => void>(); // removeToast
const props = withDefaults(defineProps<ToastProps>(), {
type: 'default',
diff --git a/resources/js/components/pulse/PulseCardHeader.vue b/resources/js/components/pulse/PulseCardHeader.vue
index 465c99b5..67511850 100644
--- a/resources/js/components/pulse/PulseCardHeader.vue
+++ b/resources/js/components/pulse/PulseCardHeader.vue
@@ -1,9 +1,8 @@
<script setup lang="ts">
-const props = defineProps<{ name?: string; title?: string; details?: string }>();
+defineProps<{ name?: string; title?: string; details?: string }>();
</script>
<template>
- <!-- @props(['name' => '', 'title' => '', 'details' => null]) -->
<header class="flex flex-wrap justify-between items-center gap-4 mb-3 @md:mb-6">
<div class="flex-1 basis-0 flex-grow-[10000] max-w-full">
<div class="flex overflow-hidden gap-2 items-start">
@@ -11,24 +10,19 @@ const props = defineProps<{ name?: string; title?: string; details?: string }>()
<slot name="icon"></slot>
</div>
<hgroup class="flex flex-wrap items-baseline gap-x-2 overflow-hidden">
- <!-- <h2 class="text-base font-bold text-gray-600 dark:text-gray-300 truncate" @if($attributes->
- has('x-bind:title')) x-bind:title="{{ $attributes->get('x-bind:title') }}" @else :title="{{ title }}" @endif> -->
- <h2 class="text-base font-bold text-gray-600 dark:text-gray-300 truncate" :title="props.title">
- {{ props.name }}
+ <h2 class="text-base font-bold text-gray-600 dark:text-gray-300 truncate" :title="title">
+ {{ name }}
</h2>
- <p v-if="props.details" class="text-gray-400 dark:text-gray-600 font-medium truncate">
- <small class="text-xs">{{ props.details }}</small>
+ <p v-if="details" class="text-gray-400 dark:text-gray-600 font-medium truncate">
+ <small class="text-xs">{{ details }}</small>
</p>
</hgroup>
</div>
</div>
- <!-- @if ($actions ?? false) -->
- <div class="flex flex-grow">
+ <div v-if="$slots.actions" class="flex flex-grow">
<div class="w-full flex items-center gap-4">
- <!-- {{ $actions }} -->
<slot name="actions"></slot>
</div>
</div>
- <!-- @endif -->
</header>
</template>
diff --git a/resources/js/components/pulse/PulseThemeSwitcher.vue b/resources/js/components/pulse/PulseThemeSwitcher.vue
index 827baac3..c779ea68 100644
--- a/resources/js/components/pulse/PulseThemeSwitcher.vue
+++ b/resources/js/components/pulse/PulseThemeSwitcher.vue
@@ -1,4 +1,13 @@
-<script>
+<script setup lang="ts">
+import { ref } from 'vue';
+
+import IconComputerDesktop from '@/components/icons/IconComputerDesktop.vue';
+import IconMoon from '@/components/icons/IconMoon.vue';
+import IconSun from '@/components/icons/IconSun.vue';
+
+const theme = ref<'light' | 'dark' | undefined>(localStorage.theme);
+const menu = ref(false);
+
const setDarkClass = () => {
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
@@ -7,35 +16,29 @@ const setDarkClass = () => {
}
};
+function darkMode() {
+ theme.value = 'dark';
+ localStorage.theme = 'dark';
+ setDarkClass();
+}
+function lightMode() {
+ theme.value = 'light';
+ localStorage.theme = 'light';
+ setDarkClass();
+}
+function systemMode() {
+ theme.value = undefined;
+ localStorage.removeItem('theme');
+ setDarkClass();
+}
+
setDarkClass();
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setDarkClass);
</script>
<template>
- <div
- class="relative"
- x-data="{
- menu: false,
- theme: localStorage.theme,
- darkMode() {
- this.theme = 'dark'
- localStorage.theme = 'dark'
- setDarkClass()
- },
- lightMode() {
- this.theme = 'light'
- localStorage.theme = 'light'
- setDarkClass()
- },
- systemMode() {
- this.theme = undefined
- localStorage.removeItem('theme')
- setDarkClass()
- },
- }"
- @click.outside="menu = false"
- >
+ <div class="relative" @click.outside="menu = false">
<button
v-cloak
class="block p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800"
@@ -46,8 +49,8 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', set
"
@click="menu = !menu"
>
- <!-- <x-pulse::icons.sun class="block dark:hidden w-5 h-5" /> -->
- <!-- <x-pulse::icons.moon class="hidden dark:block w-5 h-5" /> -->
+ <IconSun class="block dark:hidden w-5 h-5" />
+ <IconMoon class="hidden dark:block w-5 h-5" />
</button>
<div
@@ -61,7 +64,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', set
:class="theme === 'light' ? 'text-gray-900 dark:text-gray-100' : 'text-gray-500 dark:text-gray-400'"
@click="lightMode()"
>
- <!-- <x-pulse::icons.sun class="w-5 h-5" /> -->
+ <IconSun class="w-5 h-5" />
Light
</button>
<button
@@ -69,7 +72,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', set
:class="theme === 'dark' ? 'text-gray-900 dark:text-gray-100' : 'text-gray-500 dark:text-gray-400'"
@click="darkMode()"
>
- <!-- <x-pulse::icons.moon class="w-5 h-5" /> -->
+ <IconMoon class="w-5 h-5" />
Dark
</button>
<button
@@ -77,7 +80,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', set
:class="theme === undefined ? 'text-gray-900 dark:text-gray-100' : 'text-gray-500 dark:text-gray-400'"
@click="systemMode()"
>
- <!-- <x-pulse::icons.computer-desktop class="w-5 h-5" /> -->
+ <IconComputerDesktop class="w-5 h-5" />
System
</button>
</div>
diff --git a/resources/js/components/pulseCards/PulseCache.vue b/resources/js/components/pulseCards/PulseCache.vue
index b117826d..60250dd2 100644
--- a/resources/js/components/pulseCards/PulseCache.vue
+++ b/resources/js/components/pulseCards/PulseCache.vue
@@ -106,10 +106,10 @@ const config = computed(() => {
<div>
<PulseTable>
<colgroup>
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>
diff --git a/resources/js/components/pulseCards/PulseExceptions.vue b/resources/js/components/pulseCards/PulseExceptions.vue
index a6e6659f..2fb69876 100644
--- a/resources/js/components/pulseCards/PulseExceptions.vue
+++ b/resources/js/components/pulseCards/PulseExceptions.vue
@@ -91,9 +91,9 @@ const exceptions = computed(() => {
<PulseNoResults v-if="exceptions.length === 0" />
<PulseTable v-else>
<colgroup>
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>
diff --git a/resources/js/components/pulseCards/PulseSlowJobs.vue b/resources/js/components/pulseCards/PulseSlowJobs.vue
index 2c7fda2e..011d8725 100644
--- a/resources/js/components/pulseCards/PulseSlowJobs.vue
+++ b/resources/js/components/pulseCards/PulseSlowJobs.vue
@@ -90,9 +90,9 @@ const config = computed(() => {
<PulseNoResults v-if="slowJobs.length === 0" />
<PulseTable v-else>
<colgroup>
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>
diff --git a/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue b/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
index ce51891b..d0af6fa1 100644
--- a/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
+++ b/resources/js/components/pulseCards/PulseSlowOutgoingRequests.vue
@@ -105,10 +105,10 @@ function getDomainFromUrl(input: string): string | null {
<PulseNoResults v-if="slowOutgoingRequests.length === 0" />
<PulseTable v-else>
<colgroup>
- <col width="0%" />
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-0" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>
diff --git a/resources/js/components/pulseCards/PulseSlowQueries.vue b/resources/js/components/pulseCards/PulseSlowQueries.vue
index 060ce7f5..fff50da8 100644
--- a/resources/js/components/pulseCards/PulseSlowQueries.vue
+++ b/resources/js/components/pulseCards/PulseSlowQueries.vue
@@ -91,9 +91,9 @@ const config = computed(() => {
<PulseNoResults v-if="slowQueries.length === 0" />
<PulseTable v-else>
<colgroup>
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>
diff --git a/resources/js/components/pulseCards/PulseSlowRequests.vue b/resources/js/components/pulseCards/PulseSlowRequests.vue
index 28d425ad..ea492d4e 100644
--- a/resources/js/components/pulseCards/PulseSlowRequests.vue
+++ b/resources/js/components/pulseCards/PulseSlowRequests.vue
@@ -91,10 +91,10 @@ const config = computed(() => {
<PulseNoResults v-if="requests.length === 0" />
<PulseTable v-else>
<colgroup>
- <col width="0%" />
- <col width="100%" />
- <col width="0%" />
- <col width="0%" />
+ <col class="w-0" />
+ <col class="w-full" />
+ <col class="w-0" />
+ <col class="w-0" />
</colgroup>
<PulseThead>
<tr>