Make application and logo configurable (#336)
* Adds settings for server name and logo * Implements ApplicationLogo and replaces site name based on settings * Refactors component for changing the company logo * Removes unused variable * Uses message instead of statusMessage * Replaces favicon with logo if set
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { ApplicationSettingsModel } from "~/prisma/client/models";
|
||||
import prisma from "../db/database";
|
||||
import type { Settings } from "../utils/types";
|
||||
|
||||
class ApplicationConfiguration {
|
||||
// Reference to the currently selected application configuration
|
||||
@@ -80,6 +81,20 @@ class ApplicationConfiguration {
|
||||
|
||||
return this.currentApplicationSettings[key];
|
||||
}
|
||||
|
||||
async getSettings(): Promise<Settings> {
|
||||
return {
|
||||
store: {
|
||||
showGamePanelTextDecoration: await applicationSettings.get(
|
||||
"showGamePanelTextDecoration",
|
||||
),
|
||||
},
|
||||
generalSettings: {
|
||||
serverName: await applicationSettings.get("serverName"),
|
||||
mLogoObjectId: await applicationSettings.get("mLogoObjectId"),
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const applicationSettings = new ApplicationConfiguration();
|
||||
|
||||
Vendored
+10
@@ -11,3 +11,13 @@ export type KeyOfType<T, V> = keyof {
|
||||
type EnumDictionary<T extends string | symbol | number, U> = {
|
||||
[K in T]: U;
|
||||
};
|
||||
|
||||
export type Settings = {
|
||||
store: {
|
||||
showGamePanelTextDecoration: boolean;
|
||||
};
|
||||
generalSettings: {
|
||||
serverName: string;
|
||||
mLogoObjectId: string | null;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user