Skip to content

Commit

Permalink
Refactor code and update comments
Browse files Browse the repository at this point in the history
- Removed unused ServerURLModal component
- Updated Server URL input field in DownloadView to dynamically bind the value and added copy functionality
- Disabled certain settings options in DefaultView
  • Loading branch information
realashleybailey committed Sep 14, 2023
1 parent 54c89e4 commit 6fe2d22
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
11 changes: 5 additions & 6 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<RouterView v-else />
<Offline />
<ReloadPrompt />
<ServerURLModal v-model:visible="serverURLModalVisible" />
<!-- <ServerURLModal v-model:visible="serverURLModalVisible" /> -->
</template>

<script lang="ts">
Expand All @@ -24,23 +24,22 @@ import BadBackend from "@/components/Toasts/BadBackend.vue";
import UpdateAvailable from "@/components/Toasts/UpdateAvailable.vue";
import DefaultToast from "@/components/Toasts/DefaultToast.vue";
import ReloadPrompt from "@/components/ReloadPrompt.vue";
import ServerURLModal from "./components/Modals/ServerURLModal.vue";
// import ServerURLModal from "@/components/Modals/ServerURLModal.vue";
export default defineComponent({
name: "App",
components: {
Offline,
FullPageLoading,
ReloadPrompt,
ServerURLModal,
// ServerURLModal,
},
data() {
return {
gettext: null as Language | null,
pageLoading: true,
connectionToast: null as ToastID | null,
serverURLModalVisible: false,
// serverURLModalVisible: false,
};
},
computed: {
Expand Down Expand Up @@ -69,7 +68,7 @@ export default defineComponent({
},
showServerURLModal() {
console.log("this", this);
this.serverURLModalVisible = true;
// this.serverURLModalVisible = true;
},
},
watch: {
Expand Down
17 changes: 14 additions & 3 deletions frontend/src/views/HelpViews/JellyfinViews/DownloadView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<!-- Server URL -->
<div class="flex flex-col justify-center items-center space-y-1 pt-3">
<span class="font-semibold text-sm">{{ __("Server URL") }}</span>
<div class="flex flex-row justify-center">
<input type="text" value="https://jellyfin.wizarr.app" class="p-2 bg-transparent border border-gray-200 rounded-l-lg rounded-r-none dark:border-gray-700 text-gray-700 dark:text-gray-400 px-5" readonly />
<button class="p-2 border border-gray-200 rounded-r-lg rounded-l-none dark:border-gray-700 dark:bg-gray-700 bg-primary text-gray-700 dark:text-gray-400 text-white px-5 cursor-pointer">
<div class="flex flex-row justify-center w-full">
<input type="text" :value="settings.server_url" class="text-center w-full p-2 bg-transparent border border-gray-200 rounded-l-lg rounded-r-none dark:border-gray-700 text-gray-700 dark:text-gray-400 px-5" readonly />
<button @click="copy()" class="p-2 border border-gray-200 rounded-r-lg rounded-l-none dark:border-gray-700 dark:bg-gray-700 bg-primary text-gray-700 dark:text-gray-400 text-white px-5 cursor-pointer">
{{ __("Copy") }}
</button>
</div>
Expand Down Expand Up @@ -61,6 +61,9 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useServerStore } from "@/stores/server";
import { mapState } from "pinia";
import { useClipboard } from "@vueuse/core";
import browserDetect from "browser-detect";
Expand All @@ -78,8 +81,15 @@ export default defineComponent({
data() {
return {
browser: browserDetect(),
clipboard: useClipboard(),
};
},
methods: {
copy() {
this.$toast.info("Copied to clipboard!");
this.clipboard.copy(this.settings.server_url);
},
},
computed: {
isIOS(): boolean {
return (this.browser.os?.toLowerCase().includes("os x") && this.browser.mobile) ?? false;
Expand All @@ -96,6 +106,7 @@ export default defineComponent({
isWindows(): boolean {
return this.browser.os?.toLowerCase().includes("windows") ?? false;
},
...mapState(useServerStore, ["settings"]),
},
});
</script>
6 changes: 6 additions & 0 deletions frontend/src/views/SettingsViews/DefaultView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default defineComponent({
roles: ["moderator"],
icon: "fas fa-link",
url: "/admin/settings/requests",
disabled: true,
},
{
title: this.__("API keys"),
Expand Down Expand Up @@ -134,12 +135,14 @@ export default defineComponent({
description: this.__("Configure your profile settings"),
icon: "fas fa-user-circle",
url: "/admin/settings/profile",
disabled: true,
},
{
title: this.__("Password"),
description: this.__("Change your password"),
icon: "fas fa-lock",
url: "/admin/settings/password",
disabled: true,
},
{
title: this.__("Sessions"),
Expand Down Expand Up @@ -178,12 +181,14 @@ export default defineComponent({
description: this.__("Enable Discord page and configure settings"),
icon: "fab fa-discord",
url: "/admin/settings/discord-ui",
disabled: true,
},
{
title: this.__("Custom HTML"),
description: this.__("Add Custom HTML page to help screen"),
icon: "fas fa-code",
url: "/admin/settings/html",
disabled: true,
},
],
},
Expand Down Expand Up @@ -222,6 +227,7 @@ export default defineComponent({
description: this.__("Create and restore backups"),
icon: "fas fa-hdd",
url: "/admin/settings/backup",
disabled: true,
},
{
title: this.__("About"),
Expand Down

0 comments on commit 6fe2d22

Please sign in to comment.