mirror of
https://github.com/unraid/api.git
synced 2026-01-04 07:29:48 -06:00
38 lines
987 B
TypeScript
38 lines
987 B
TypeScript
import { useToggle } from '@vueuse/core';
|
|
import { defineStore, createPinia, setActivePinia } from "pinia";
|
|
import { useCallbackStore } from './callback';
|
|
import { useServerStore } from './server';
|
|
|
|
/**
|
|
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
|
|
* @see https://github.com/vuejs/pinia/discussions/1085
|
|
*/
|
|
setActivePinia(createPinia());
|
|
|
|
export const useTrialStore = defineStore('trial', () => {
|
|
const callbackStore = useCallbackStore();
|
|
const serverStore = useServerStore();
|
|
|
|
const extend = () => {
|
|
console.debug('[extend]');
|
|
callbackStore.send('https://account.unraid.net', {
|
|
...serverStore.serverAccountPayload,
|
|
type: 'trialExtend',
|
|
});
|
|
};
|
|
const start = () => {
|
|
console.debug('[start]');
|
|
callbackStore.send('https://account.unraid.net', {
|
|
...serverStore.serverAccountPayload,
|
|
type: 'trialStart',
|
|
});
|
|
};
|
|
|
|
return {
|
|
// State
|
|
// Actions
|
|
extend,
|
|
start,
|
|
};
|
|
});
|