mirror of
https://github.com/unraid/api.git
synced 2026-04-21 23:00:31 -05:00
refactor: add & organize server store
This commit is contained in:
@@ -85,7 +85,6 @@ onBeforeMount(() => {
|
||||
<span>{{ description }}</span>
|
||||
<span class="text-grey-mid px-8px">•</span>
|
||||
</template>
|
||||
<!-- @todo click to copy ip -->
|
||||
<button @click="copyLanIp()" :title="`LAN IP ${lanIp}`">{{ name }}</button>
|
||||
<span v-if="copied" class="text-12px absolute right-0 bg-gradient-to-r from-red to-orange text-center block w-100px rounded">{{ 'LAN IP Copied' }}</span>
|
||||
<span v-if="showCopyNotSupported" class="text-12px font-semibold px-4px absolute right-0 bg-gradient-to-r from-red to-orange text-center block rounded">
|
||||
|
||||
@@ -11,7 +11,7 @@ const myServersEnv = ref<string>('Staging');
|
||||
const devEnv = ref<string>('development');
|
||||
|
||||
const serverStore = useServerStore();
|
||||
const { stateData } = storeToRefs(serverStore);
|
||||
const { registered, stateData } = storeToRefs(serverStore);
|
||||
|
||||
// Intended to hide sign in and sign out from actions v-for in UPC dropdown so we can display them separately
|
||||
const stateDataKeyActions = computed((): ServerStateDataAction[] | undefined => {
|
||||
@@ -20,6 +20,8 @@ const stateDataKeyActions = computed((): ServerStateDataAction[] | undefined =>
|
||||
return stateData.value.actions.filter(action => !notAllowed.includes(action.name));
|
||||
});
|
||||
|
||||
console.log('[registered]', registered.value);
|
||||
|
||||
const links = computed(():UserProfileLink[] => {
|
||||
return [
|
||||
{
|
||||
@@ -43,6 +45,15 @@ const links = computed(():UserProfileLink[] => {
|
||||
text: 'Settings',
|
||||
title: 'Go to Connect plugin settings',
|
||||
},
|
||||
...(registered.value
|
||||
? [{
|
||||
click: () => { console.debug('signOut') },
|
||||
icon: ArrowRightOnRectangleIcon,
|
||||
text: 'Sign Out',
|
||||
title: 'Sign Out to Unregister your server with Connect',
|
||||
}]
|
||||
: []
|
||||
),
|
||||
];
|
||||
})
|
||||
</script>
|
||||
@@ -64,7 +75,7 @@ const links = computed(():UserProfileLink[] => {
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<li class="my-8px mx-12px">
|
||||
<li class="m-8px">
|
||||
<upc-keyline />
|
||||
</li>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user