mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-05 20:30:15 +01:00
🎨 记录操作系统平台
This commit is contained in:
parent
d316e4abc3
commit
235d940cad
7 changed files with 72 additions and 5 deletions
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -424,6 +424,7 @@ declare interface IConfig {
|
|||
container: "std" | "android" | "docker" | "ios"
|
||||
isMicrosoftStore: boolean
|
||||
os: "windows" | "linux" | "darwin"
|
||||
osPlatform: string
|
||||
homeDir: string
|
||||
xanadu: boolean
|
||||
udanax: boolean
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ const loadThirdIcon = (iconURL: string, data: IAppearance) => {
|
|||
|
||||
export const loadAssets = (data: IAppearance) => {
|
||||
const htmlElement = document.getElementsByTagName("html")[0];
|
||||
htmlElement.setAttribute("lang",window.siyuan.config.appearance.lang);
|
||||
htmlElement.setAttribute("data-theme-mode",getThemeMode());
|
||||
htmlElement.setAttribute("data-light-theme",window.siyuan.config.appearance.themeLight);
|
||||
htmlElement.setAttribute("data-dark-theme",window.siyuan.config.appearance.themeDark);
|
||||
htmlElement.setAttribute("lang", window.siyuan.config.appearance.lang);
|
||||
htmlElement.setAttribute("data-theme-mode", getThemeMode());
|
||||
htmlElement.setAttribute("data-light-theme", window.siyuan.config.appearance.themeLight);
|
||||
htmlElement.setAttribute("data-dark-theme", window.siyuan.config.appearance.themeDark);
|
||||
const OSTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
if (window.siyuan.config.appearance.modeOS && (
|
||||
(window.siyuan.config.appearance.mode === 1 && OSTheme === "light") ||
|
||||
|
|
@ -172,6 +172,7 @@ export const addGA = () => {
|
|||
version: Constants.SIYUAN_VERSION,
|
||||
container: window.siyuan.config.system.container,
|
||||
os: window.siyuan.config.system.os,
|
||||
osPlatform: window.siyuan.config.system.osPlatform,
|
||||
isLoggedIn: false,
|
||||
subscriptionStatus: -1,
|
||||
subscriptionPlan: -1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue