forked from elk-zone/elk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add instance links on right bar
- Loading branch information
Showing
9 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export type FrontendConfiguration = { [x: string]: { [x: string]: unknown } }; | ||
|
||
export interface PleromaConfig { | ||
/** | ||
* Instance needs to be rebooted | ||
*/ | ||
need_reboot: boolean; | ||
/** | ||
* Pleroma settings | ||
*/ | ||
configs: { | ||
group: string; | ||
key: string; | ||
db: string[]; | ||
value: FrontendConfiguration[]; | ||
}[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
type FrontendConfiguration, | ||
type PleromaConfig, | ||
} from "../../entities/v1/pleroma-config"; | ||
|
||
export interface PleromaRepository { | ||
admin: { | ||
config: { | ||
/** Retrieves current pleroma configuration */ | ||
fetch(): Promise<PleromaConfig>; | ||
}; | ||
}; | ||
|
||
frontendConfigurations: { | ||
fetch(): Promise<FrontendConfiguration>; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ class?: string }>() | ||
const { config } = useFrontendConfig() | ||
</script> | ||
|
||
<template> | ||
<nav :class="props.class" flex flex-col gap-6> | ||
<NuxtLink v-for="link in config?.links" :key="link.url" target="_blank" flex gap-2 text-lg :href="link.url"> | ||
<div grayscale> | ||
{{ link.icon }} | ||
</div> | ||
{{ link.text }} | ||
</NuxtLink> | ||
</nav> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { akkoma } from '@bdxtown/akko' | ||
|
||
export interface FrontendConfiguration { | ||
links: { | ||
icon: string | ||
text: string | ||
url: string | ||
}[] | ||
} | ||
|
||
export function useFrontendConfig() { | ||
const { data: config } = useAsyncData<FrontendConfiguration | undefined>( | ||
'pleroma-config', | ||
() => fetchFrontendConfiguration(), | ||
{ watch: [isHydrated], immediate: isHydrated.value, default: () => shallowRef(undefined) }, | ||
) | ||
|
||
return { | ||
config, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters