This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
CrunchyDL/components/Settings/Widevine.vue

109 lines
3.3 KiB
Vue
Raw Normal View History

<template>
2024-05-15 14:05:49 +02:00
<div class="flex flex-col gap-3 mt-3 font-dm" style="-webkit-app-region: no-drag">
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2">L3 Keys</div>
<input
@click="getFilePathL3Blob()"
v-model="pathL3Blob"
type="text"
name="text"
placeholder="Click to select device_client_id_blob"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer"
readonly
/>
<input
@click="getFilePathL3Key()"
v-model="pathL3Key"
type="text"
name="text"
placeholder="Click to select device_private_key"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer mt-2"
readonly
/>
</div>
2024-05-15 17:04:19 +02:00
<!-- <div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
2024-05-15 14:05:49 +02:00
<div class="text-sm mb-2">L1 Keys</div>
<input
@click="getFilePathL1Blob()"
v-model="pathL1Blob"
type="text"
name="text"
placeholder="Click to select device_client_id_blob"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer"
readonly
/>
<input
@click="getFilePathL1Key()"
v-model="pathL1Key"
type="text"
name="text"
placeholder="Click to select device_private_key"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer mt-2"
readonly
/>
2024-05-15 17:04:19 +02:00
</div> -->
2024-05-15 14:05:49 +02:00
</div>
</template>
<script lang="ts" setup>
2024-05-15 14:05:49 +02:00
const pathL3Blob = ref<string>();
const pathL3Key = ref<string>();
2024-05-15 14:05:49 +02:00
const pathL1Blob = ref<string>();
const pathL1Key = ref<string>();
const getFilePathL3Blob = () => {
if (process.client) {
;(window as any).myAPI.selectFile('l3blob').then((result: string) => {
pathL3Blob.value = result
})
}
}
const getFilePathL3Key = () => {
if (process.client) {
;(window as any).myAPI.selectFile('l3key').then((result: string) => {
pathL3Key.value = result
})
}
}
const getFilePathL1Blob = () => {
if (process.client) {
;(window as any).myAPI.selectFile('l1blob').then((result: string) => {
pathL1Blob.value = result
})
}
}
const getFilePathL1Key = () => {
if (process.client) {
;(window as any).myAPI.selectFile('l1key').then((result: string) => {
pathL1Key.value = result
})
}
}
onMounted(() => {
;(window as any).myAPI.getFile('l3blob').then((result: any) => {
pathL3Blob.value = result
})
2024-05-15 14:05:49 +02:00
;(window as any).myAPI.getFile('l3key').then((result: any) => {
pathL3Key.value = result
})
;(window as any).myAPI.getFile('l1blob').then((result: any) => {
pathL1Blob.value = result
})
;(window as any).myAPI.getFile('l1key').then((result: any) => {
pathL1Key.value = result
})
})
</script>
2024-05-15 14:05:49 +02:00
<style></style>