add color theme
This commit is contained in:
parent
c33ab48225
commit
ddb07a651e
6 changed files with 40 additions and 22 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { RiHome2Line } from 'svelte-remixicon';
|
||||
import { RiHome2Line, RiSettings2Line, RiSettingsLine } from 'svelte-remixicon';
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -7,4 +7,7 @@
|
|||
<li>
|
||||
<a href="/"><RiHome2Line /> Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/settings"><RiSettings2Line /> Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ export type ServerHealth = {
|
|||
post_count: number,
|
||||
user_count: number,
|
||||
me: string | null,
|
||||
csrf_token?: string
|
||||
csrf_token?: string,
|
||||
color_theme?: number
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,21 +3,23 @@ import type { ServerHealth, UserEntry } from "$lib/backend";
|
|||
|
||||
let health : {
|
||||
app_name: string, version: string, post_count: number,
|
||||
user_count: number, me: null | UserEntry
|
||||
user_count: number, me: null | UserEntry, color_theme: number
|
||||
} = $state({
|
||||
app_name: 'app_name',
|
||||
version: "?.?",
|
||||
post_count: NaN,
|
||||
user_count: NaN,
|
||||
me: null
|
||||
me: null,
|
||||
color_theme: 0
|
||||
});
|
||||
|
||||
|
||||
export function setHealth ({ name, version, post_count, user_count }: ServerHealth) {
|
||||
export function setHealth ({ name, version, post_count, user_count, color_theme = 0 }: ServerHealth) {
|
||||
health.app_name = name;
|
||||
health.version = version;
|
||||
health.post_count = post_count;
|
||||
health.user_count = user_count;
|
||||
health.color_theme = color_theme;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -49,4 +51,8 @@ export function activeUserCount (): number{
|
|||
|
||||
export async function sleep (ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function getColorThemeCode (): number {
|
||||
return health.color_theme;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue