mirror of
https://github.com/unraid/api.git
synced 2026-01-05 16:09:49 -06:00
feat: init commit w/ callback prototype components
This commit is contained in:
15
components/Auth.ce.vue
Normal file
15
components/Auth.ce.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import 'tailwindcss/tailwind.css';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
Auth.ce
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
26
components/CallbackHandler.ce.vue
Normal file
26
components/CallbackHandler.ce.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { useCallbackStore } from '~/store/callback';
|
||||
import 'tailwindcss/tailwind.css';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const callbackStore = useCallbackStore();
|
||||
|
||||
const { decryptedData } = storeToRefs(callbackStore);
|
||||
|
||||
onBeforeMount(() => {
|
||||
callbackStore.watcher();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
<h2>CallbackHandler.ce</h2>
|
||||
<pre>{{ JSON.stringify(decryptedData, null, 2) }}</pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
15
components/KeyActions.ce.vue
Normal file
15
components/KeyActions.ce.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import 'tailwindcss/tailwind.css';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
KeyActions.ce
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
15
components/Launchpad.ce.vue
Normal file
15
components/Launchpad.ce.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import 'tailwindcss/tailwind.css';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
Launchpad.ce
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
15
components/PluginPromo.ce.vue
Normal file
15
components/PluginPromo.ce.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import 'tailwindcss/tailwind.css';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
PluginPromo.ce
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
49
components/UserProfile.ce.vue
Normal file
49
components/UserProfile.ce.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script lang="ts" setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useCallbackStore } from '~/store/callback';
|
||||
import { useServerStore } from '~/store/server';
|
||||
import type { Server } from '~/types/server';
|
||||
import 'tailwindcss/tailwind.css';
|
||||
|
||||
export interface Props {
|
||||
server?: Server;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const callbackStore = useCallbackStore();
|
||||
const serverStore = useServerStore();
|
||||
|
||||
const { name, description, guid } = storeToRefs(serverStore);
|
||||
|
||||
onBeforeMount(() => {
|
||||
console.debug('[onBeforeMount]', { props }, typeof props.server);
|
||||
if (!props.server) return console.error('Server data not present');
|
||||
// set props from web component in store so the data is available throughout other components
|
||||
if (typeof props.server === 'object') { // handle the testing dev Vue component
|
||||
serverStore.setServer(props.server);
|
||||
} else if (typeof props.server === 'string') { // handle web component
|
||||
try {
|
||||
const parsedServerProp = JSON.parse(props.server);
|
||||
serverStore.setServer(parsedServerProp);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white bg-blue-700 flex flex-col gap-y-2 p-4 rounded-lg">
|
||||
<h3 class="italic">{{ name }}</h3>
|
||||
<h4 class="text-gray-300">{{ description }}</h4>
|
||||
<h5>{{ guid }}</h5>
|
||||
<button class="p-2 text-blue-700 hover:text-white bg-white border border-white hover:bg-transparent rounded-sm" @click="callbackStore.send()" type="button">Test Purchase Callback</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
15
components/WanIpCheck.ce.vue
Normal file
15
components/WanIpCheck.ce.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import 'tailwindcss/tailwind.css';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="text-white font-semibold p-4 bg-orange-400 rounded-lg">
|
||||
WanIpCheck.ce
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
||||
Reference in New Issue
Block a user