-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🚑 Don't make Request help page editable
- Loading branch information
1 parent
7024735
commit 2fb31ca
Showing
5 changed files
with
147 additions
and
6 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
apps/wizarr-frontend/src/modules/help/components/Request.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<div class="flex flex-col space-y-4"> | ||
<div> | ||
<h4 class="mb-3 text-xl font-bold dark:text-white">{{ __("Automatic Media Requests") }}</h4> | ||
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400"> | ||
{{ __("We are excited to offer you a wide selection of media to choose from. If you're having trouble finding something you like, don't worry! We have a user-friendly request system that can automatically search for the media you're looking for.") }} | ||
</p> | ||
</div> | ||
|
||
<ul class="space-y-2 text-left text-gray-500 dark:text-gray-400"> | ||
<li class="flex items-center space-x-3"> | ||
<i class="fas fa-check text-green-500 dark:text-green-400"></i> | ||
<span>{{ __("Request any available Movie or TV Show") }}</span> | ||
</li> | ||
<li class="flex items-center space-x-3"> | ||
<i class="fas fa-check text-green-500 dark:text-green-400"></i> | ||
<span>{{ __("Media will be automatically downloaded to your library") }}</span> | ||
</li> | ||
<li class="flex items-center space-x-3"> | ||
<i class="fas fa-check text-green-500 dark:text-green-400"></i> | ||
<span>{{ __("You can recieve notifications when your media is ready") }}</span> | ||
</li> | ||
</ul> | ||
|
||
<div class="flex justify-end pt-4"> | ||
<FormKit type="button" suffixIcon="fas fa-external-link-alt" @click="openURL"> | ||
{{ __("Check it Out") }} | ||
</FormKit> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { Requests } from "@/types/api/request"; | ||
import { defineComponent, defineAsyncComponent } from "vue"; | ||
export default defineComponent({ | ||
name: "Request", | ||
props: { | ||
requestURL: { | ||
type: Array as () => Requests, | ||
required: true, | ||
}, | ||
}, | ||
methods: { | ||
async selectURL() { | ||
const RequestsList = defineAsyncComponent(() => import("./RequestsList.vue")); | ||
this.$modal.openModal(RequestsList, { | ||
title: "Select Request Server", | ||
props: { | ||
requestURLS: this.requestURL, | ||
}, | ||
}); | ||
}, | ||
async openURL() { | ||
if (this.requestURL.length === 1) { | ||
window.open(this.requestURL[0].url, "_blank"); | ||
return; | ||
} | ||
this.selectURL(); | ||
}, | ||
}, | ||
}); | ||
</script> |
66 changes: 66 additions & 0 deletions
66
apps/wizarr-frontend/src/modules/help/components/RequestsList.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<div class="flex flex-col space-y-2"> | ||
<template v-for="request in requests"> | ||
<ListItem :svg-string="request.icon"> | ||
<template #title> | ||
<span class="text-lg">{{ request.name }}</span> | ||
</template> | ||
<template #buttons> | ||
<div class="flex flex-row space-x-2"> | ||
<FormKit type="button" data-theme="secondary" @click="openURL(request.url)" :classes="{ input: '!bg-secondary !px-3.5 h-[36px]' }"> | ||
<i class="fa-solid fa-external-link"></i> | ||
</FormKit> | ||
</div> | ||
</template> | ||
</ListItem> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { Requests, Request } from "@/types/api/request"; | ||
import { defineComponent } from "vue"; | ||
import ListItem from "@/components/ListItem.vue"; | ||
interface CustomRequest extends Request { | ||
icon: string; | ||
} | ||
export default defineComponent({ | ||
name: "RequestsList", | ||
components: { | ||
ListItem, | ||
}, | ||
props: { | ||
requestURLS: { | ||
type: Array as () => Requests, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
requests: [] as CustomRequest[], | ||
}; | ||
}, | ||
methods: { | ||
openURL(url: string) { | ||
window.open(url, "_blank"); | ||
}, | ||
async loadIcon(request: Request) { | ||
return await import(`../../../assets/img/logo/${request.service}.svg?raw`); | ||
}, | ||
}, | ||
async beforeMount() { | ||
const requests = this.requestURLS; | ||
requests.forEach(async (request) => { | ||
const icon = await this.loadIcon(request); | ||
this.requests.push({ | ||
...request, | ||
icon: icon.default ?? "", | ||
}); | ||
}); | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters