[FIX] update some web related design choices and improve messaging
This commit is contained in:
parent
058bf567d1
commit
357ca323e1
4 changed files with 22 additions and 62 deletions
|
|
@ -153,12 +153,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="help is-bold">
|
<span class="help ">
|
||||||
<span class="icon"><i class="fa-solid fa-info" /></span>
|
<div class="message is-info">
|
||||||
<span>
|
<div class="message-body content pl-0 is-small pt-1">
|
||||||
For advanced users only. This feature is meant to be expanded later. the only supported key right
|
<ul>
|
||||||
now. <code>ignore_download</code> with value of <code>true</code>. Keys must be lowercase with
|
<li>For advanced users only. This feature is meant to be expanded later.</li>
|
||||||
underscores (e.g., custom_field).</span>
|
<li>Keys must be lowercase with underscores (e.g., custom_field).</li>
|
||||||
|
<li>You must click on Add to actually add the option.</li>
|
||||||
|
<li>The key <code>ignore_download</code> with value of <code>true</code> will instruct
|
||||||
|
<b>YTPTube</b> to ignore the download and directly mark the item as archived. this is useful
|
||||||
|
to skip certain kind of downloads.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -268,7 +276,7 @@ import { useStorage } from '@vueuse/core'
|
||||||
import TextareaAutocomplete from '~/components/TextareaAutocomplete.vue'
|
import TextareaAutocomplete from '~/components/TextareaAutocomplete.vue'
|
||||||
import type { AutoCompleteOptions } from '~/types/autocomplete';
|
import type { AutoCompleteOptions } from '~/types/autocomplete';
|
||||||
import type { ConditionItem, ImportedConditionItem } from '~/types/conditions'
|
import type { ConditionItem, ImportedConditionItem } from '~/types/conditions'
|
||||||
import {useConfirm} from '~/composables/useConfirm'
|
import { useConfirm } from '~/composables/useConfirm'
|
||||||
|
|
||||||
const emitter = defineEmits<{
|
const emitter = defineEmits<{
|
||||||
(e: 'cancel'): void
|
(e: 'cancel'): void
|
||||||
|
|
@ -325,7 +333,7 @@ const checkInfo = async (): Promise<void> => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!form.cli || '' === form.cli.trim()) && Object.keys(form.extras).length < 1) {
|
if ((!form.cli || '' === form.cli.trim()) && Object.keys(form.extras).length < 1) {
|
||||||
toast.error('Either command options for yt-dlp or at least one extra option is required.')
|
toast.error('Command options for yt-dlp or at least one extra option is required.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -544,4 +552,5 @@ const updateExtraValue = (key: string, event: Event): void => {
|
||||||
const value = target.value.trim()
|
const value = target.value.trim()
|
||||||
form.extras[key] = value ? parseValue(value) : ''
|
form.extras[key] = value ? parseValue(value) : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,9 @@
|
||||||
<style scoped>
|
|
||||||
code {
|
|
||||||
color: var(--bulma-code) !important
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<ModalText :isLoading="isLoading" :data="data" :externalModel="externalModel"
|
||||||
<div class="modal is-active" v-if="false === externalModel">
|
@closeModel="() => emitter('closeModel')" :code_classes="code_classes" />
|
||||||
<div class="modal-background" @click="emitter('closeModel')"></div>
|
|
||||||
<div class="modal-content modal-content-max">
|
|
||||||
<div style="font-size:30vh; width: 99%" class="has-text-centered" v-if="isLoading">
|
|
||||||
<i class="fas fa-circle-notch fa-spin"></i>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<div class="content p-0 m-0" style="position: relative">
|
|
||||||
<pre><code class="p-4 is-block" v-text="data" />
|
|
||||||
<button class="button m-4" @click="() => copyText(JSON.stringify(data, null, 4))"
|
|
||||||
style="position: absolute; top:0; right:0;">
|
|
||||||
<span class="icon"><i class="fas fa-copy"></i></span>
|
|
||||||
</button>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button class="modal-close is-large" aria-label="close" @click="emitter('closeModel')"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-content-max" style="height: 80vh;" v-else>
|
|
||||||
<div class="content p-0 m-0" style="position: relative">
|
|
||||||
<pre><code class="p-4 is-block" v-text="data" /></pre>
|
|
||||||
<button class="button m-4" @click="() => copyText(JSON.stringify(data, null, 4))"
|
|
||||||
style="position: absolute; top:0; right:0;">
|
|
||||||
<span class="icon"><i class="fas fa-copy"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { disableOpacity, enableOpacity } from '~/utils';
|
|
||||||
|
|
||||||
const toast = useNotification()
|
const toast = useNotification()
|
||||||
const emitter = defineEmits<{ (e: 'closeModel'): void }>()
|
const emitter = defineEmits<{ (e: 'closeModel'): void }>()
|
||||||
|
|
||||||
|
|
@ -49,21 +13,13 @@ const props = defineProps<{
|
||||||
cli?: string
|
cli?: string
|
||||||
useUrl?: boolean
|
useUrl?: boolean
|
||||||
externalModel?: boolean
|
externalModel?: boolean
|
||||||
|
code_classes?: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const isLoading = ref<boolean>(false)
|
const isLoading = ref<boolean>(false)
|
||||||
const data = ref<any>({})
|
const data = ref<any>({})
|
||||||
|
|
||||||
const handle_event = (e: KeyboardEvent): void => {
|
|
||||||
if (e.key === 'Escape') {
|
|
||||||
emitter('closeModel')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async (): Promise<void> => {
|
onMounted(async (): Promise<void> => {
|
||||||
disableOpacity()
|
|
||||||
document.addEventListener('keydown', handle_event)
|
|
||||||
|
|
||||||
let url = props.useUrl ? props.link || '' : '/api/yt-dlp/url/info'
|
let url = props.useUrl ? props.link || '' : '/api/yt-dlp/url/info'
|
||||||
|
|
||||||
if (!props.useUrl) {
|
if (!props.useUrl) {
|
||||||
|
|
@ -95,9 +51,4 @@ onMounted(async (): Promise<void> => {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
|
||||||
enableOpacity()
|
|
||||||
document.removeEventListener('keydown', handle_event)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, computed, defineModel, defineProps, nextTick } from 'vue'
|
import { ref, watch, computed, nextTick } from 'vue'
|
||||||
import type { AutoCompleteOptions } from '~/types/autocomplete'
|
import type { AutoCompleteOptions } from '~/types/autocomplete'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, defineModel, defineProps, watch, nextTick } from 'vue'
|
import { ref, computed, watch, nextTick } from 'vue'
|
||||||
import type { AutoCompleteOptions } from '~/types/autocomplete'
|
import type { AutoCompleteOptions } from '~/types/autocomplete'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue