mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 21:33:02 +01:00
* feat: migrate tools page and label generator to shadcn * chore: lint issues * feat: also do profile page * feat: shadcn 404 page * feat: login page shadcn * fix: daisyui ironically breaks the z height for the login page * feat: componentise the language selector and add it to the login page * feat: use nuxtlink * feat: card and table made more shadcn * feat: shadcn statscard * chore: lint * feat: shadcn labelchip and locationcard * feat: shadcn locations page * refactor: remove unused new item page * chore: lint * feat: shadcn item card * fix: wrapping of location and lint * feat: ctrl enter in text area in form submits form * feat: begin shadcn locations page and remove pageqrcode comp in favour of integrating it into labelmaker * chore: lint + remove unused code * fix: remove uneeded margin * feat: shadcn labels page and fix some issues with location * feat: shadcn scanner * chore: lint * feat: begin shadcning item pages * feat: shadcn maintenance page * feat: begin shadcn search page * fix: quick switch blurry text and crashing page when switching + incorrect z height for create menu * feat: finish shadcn search page * chore: lint * feat: shadcn edit item page * fix: quickmenumodal bug * feat: shadcn item details page * feat: remove all non-color related daisyui classes * fix: type error * fix: quick menu modal again :(
92 lines
2.5 KiB
Vue
92 lines
2.5 KiB
Vue
<template>
|
|
<AlertDialog v-model:open="open">
|
|
<AlertDialogContent>
|
|
<AlertDialogHeader>
|
|
<AlertDialogTitle>🎉 {{ $t("components.app.outdated.new_version_available") }} 🎉</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
<p>{{ $t("components.app.outdated.current_version") }}: {{ current }}</p>
|
|
<p>{{ $t("components.app.outdated.latest_version") }}: {{ latest }}</p>
|
|
<p>
|
|
<a
|
|
href="https://github.com/sysadminsmedia/homebox/releases"
|
|
target="_blank"
|
|
rel="noopener"
|
|
class="underline hover:text-primary"
|
|
>
|
|
{{ $t("components.app.outdated.new_version_available_link") }}
|
|
</a>
|
|
</p>
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
<AlertDialogFooter>
|
|
<AlertDialogAction @click="hide">{{ $t("components.app.outdated.dismiss") }}</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { lt } from "semver";
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogContent,
|
|
AlertDialogHeader,
|
|
AlertDialogTitle,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogAction,
|
|
} from "@/components/ui/alert-dialog";
|
|
import { useDialog } from "@/components/ui/dialog-provider";
|
|
|
|
const props = defineProps<{
|
|
status: {
|
|
build: {
|
|
version: string;
|
|
};
|
|
latest: {
|
|
version: string;
|
|
};
|
|
};
|
|
}>();
|
|
|
|
const latest = computed(() => props.status.latest.version);
|
|
const current = computed(() => props.status.build.version);
|
|
|
|
const isDev = computed(() => import.meta.dev || !current.value?.includes("."));
|
|
const isOutdated = computed(() => current.value && latest.value && lt(current.value, latest.value));
|
|
const hasHiddenLatest = computed(() => localStorage.getItem("latestVersion") === latest.value);
|
|
|
|
const displayOutdatedWarning = computed(() => Boolean(!isDev.value && !hasHiddenLatest.value && isOutdated.value));
|
|
|
|
const open = ref(false);
|
|
|
|
watch(
|
|
displayOutdatedWarning,
|
|
displayOutdatedWarning => {
|
|
if (displayOutdatedWarning) {
|
|
open.value = true;
|
|
}
|
|
},
|
|
{ immediate: true }
|
|
);
|
|
|
|
const hide = () => {
|
|
open.value = false;
|
|
localStorage.setItem("latestVersion", latest.value);
|
|
};
|
|
|
|
const { addAlert, removeAlert } = useDialog();
|
|
|
|
watch(
|
|
open,
|
|
val => {
|
|
if (val) {
|
|
addAlert("new-version-modal");
|
|
} else {
|
|
removeAlert("new-version-modal");
|
|
}
|
|
},
|
|
{ immediate: true }
|
|
);
|
|
</script>
|