test: extend trial

This commit is contained in:
Zack Spear
2023-06-26 15:05:55 -07:00
committed by Zack Spear
parent 97d64bb89b
commit 1ffc4ef03d
4 changed files with 23 additions and 11 deletions
+2
View File
@@ -4,6 +4,7 @@
const ACCOUNT = 'https://localhost:8008';
const CONNECT_DOCS = 'https://docs.unraid.net/category/unraid-connect';
const CONNECT_DASHBOARD = 'https://connect.myunraid.net';
const CONNECT_FORUMS = 'https://forums.unraid.net/forum/94-connect-plugin-support/';
const DEV_GRAPH_URL = '';
const PURCHASE = 'https://unraid.net/preflight';
const PLUGIN_SETTINGS = '/Settings/ManagementAccess#UnraidNetSettings';
@@ -12,6 +13,7 @@ export {
ACCOUNT,
CONNECT_DASHBOARD,
CONNECT_DOCS,
CONNECT_FORUMS,
DEV_GRAPH_URL,
PURCHASE,
PLUGIN_SETTINGS,
+15 -5
View File
@@ -2,7 +2,7 @@ import { defineStore, createPinia, setActivePinia } from 'pinia';
import { useCallbackStore } from './callbackActions';
import { useServerStore } from './server';
import { WebguiUpdate } from '~/composables/services/webgui';
import { ACCOUNT_CALLBACK } from '~/helpers/urls';
import { ACCOUNT } from '~/helpers/urls';
import type { CallbackAction } from '~/types/callback';
/**
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
@@ -21,7 +21,7 @@ export const useAccountStore = defineStore('account', () => {
// Actions
const recover = () => {
console.debug('[accountStore.recover]');
callbackStore.send('https://localhost:8008/connect', [{
callbackStore.send(`${ACCOUNT}/connect`, [{
server: {
...serverStore.serverAccountPayload,
},
@@ -30,7 +30,7 @@ export const useAccountStore = defineStore('account', () => {
};
const replace = () => {
console.debug('[accountStore.replace]');
callbackStore.send('https://localhost:8008/connect', [{
callbackStore.send(`${ACCOUNT}/connect`, [{
server: {
...serverStore.serverAccountPayload,
},
@@ -39,7 +39,7 @@ export const useAccountStore = defineStore('account', () => {
};
const signIn = () => {
console.debug('[accountStore.signIn]');
callbackStore.send('https://localhost:8008/connect', [{
callbackStore.send(`${ACCOUNT}/connect`, [{
server: {
...serverStore.serverAccountPayload,
},
@@ -48,13 +48,22 @@ export const useAccountStore = defineStore('account', () => {
};
const signOut = () => {
console.debug('[accountStore.accountStore.signOut]');
callbackStore.send('https://localhost:8008/connect', [{
callbackStore.send(`${ACCOUNT}/connect`, [{
server: {
...serverStore.serverAccountPayload,
},
type: 'signOut',
}]);
};
const troubleshoot = () => {
console.debug('[accountStore.accountStore.troubleshoot]');
callbackStore.send(`${ACCOUNT}/connect`, [{
server: {
...serverStore.serverAccountPayload,
},
type: 'troubleshoot',
}]);
};
/**
* @description Update myservers.cfg for both Sign In & Sign Out
* @note unraid-api requires apikey & token realted keys to be lowercase
@@ -117,6 +126,7 @@ export const useAccountStore = defineStore('account', () => {
replace,
signIn,
signOut,
troubleshoot,
updatePluginConfig,
};
});
+2 -2
View File
@@ -173,14 +173,14 @@ export const useServerStore = defineStore('server', () => {
const trialExtendAction: ServerStateDataAction = {
click: () => { trialStore.extend() },
external: true,
icon: ArrowRightOnRectangleIcon,
icon: KeyIcon,
name: 'trialExtend',
text: 'Extend Trial',
};
const trialStartAction: ServerStateDataAction = {
click: () => { trialStore.start() },
external: true,
icon: ArrowRightOnRectangleIcon,
icon: KeyIcon,
name: 'trialStart',
text: 'Start Free 30 Day Trial',
};
+4 -4
View File
@@ -14,21 +14,21 @@ export const useTrialStore = defineStore('trial', () => {
const extend = () => {
console.debug('[extend]');
callbackStore.send('https://localhost:8008/connect', {
callbackStore.send('https://localhost:8008/connect', [{
server: {
...serverStore.serverAccountPayload,
},
type: 'trialExtend',
});
}]);
};
const start = () => {
console.debug('[start]');
callbackStore.send('https://localhost:8008/connect', {
callbackStore.send('https://localhost:8008/connect', [{
server: {
...serverStore.serverAccountPayload,
},
type: 'trialStart',
});
}]);
};
return {