mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 16:41:07 +08:00
This commit is contained in:
parent
515d11019d
commit
b2a85c66c6
@ -129,6 +129,25 @@ class App {
|
|||||||
};
|
};
|
||||||
fetchPost("/api/system/getConf", {}, response => {
|
fetchPost("/api/system/getConf", {}, response => {
|
||||||
window.siyuan.config = response.data.conf;
|
window.siyuan.config = response.data.conf;
|
||||||
|
// 历史数据兼容,202306后可删除
|
||||||
|
if (!window.siyuan.config.uiLayout.left.data) {
|
||||||
|
window.siyuan.config.uiLayout.left = {
|
||||||
|
pin: true,
|
||||||
|
data: response.data.conf.uiLayout.left
|
||||||
|
}
|
||||||
|
window.siyuan.config.uiLayout.right = {
|
||||||
|
pin: true,
|
||||||
|
data: response.data.conf.uiLayout.right
|
||||||
|
}
|
||||||
|
window.siyuan.config.uiLayout.top = {
|
||||||
|
pin: true,
|
||||||
|
data: response.data.conf.uiLayout.top
|
||||||
|
}
|
||||||
|
window.siyuan.config.uiLayout.bottom = {
|
||||||
|
pin: true,
|
||||||
|
data: response.data.conf.uiLayout.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
getLocalStorage(() => {
|
getLocalStorage(() => {
|
||||||
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
|
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
|
||||||
window.siyuan.languages = lauguages;
|
window.siyuan.languages = lauguages;
|
||||||
|
@ -172,47 +172,10 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
|
|||||||
|
|
||||||
const JSONToDock = (json: any) => {
|
const JSONToDock = (json: any) => {
|
||||||
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[1].children[1] as Layout;
|
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[1].children[1] as Layout;
|
||||||
// 历史数据兼容,202306后可删除
|
window.siyuan.layout.topDock = new Dock({position: "Top", data: json.top});
|
||||||
let topData: { pin: boolean, data: IDockTab[][] }
|
window.siyuan.layout.leftDock = new Dock({position: "Left", data: json.left});
|
||||||
if (!json.top.data) {
|
window.siyuan.layout.rightDock = new Dock({position: "Right", data: json.right});
|
||||||
topData = {
|
window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: json.bottom});
|
||||||
pin: true,
|
|
||||||
data: json.top
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
topData = json.top;
|
|
||||||
}
|
|
||||||
let bottomData: { pin: boolean, data: IDockTab[][] }
|
|
||||||
if (!json.bottom.data) {
|
|
||||||
bottomData = {
|
|
||||||
pin: true,
|
|
||||||
data: json.bottom
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bottomData = json.bottom;
|
|
||||||
}
|
|
||||||
let rightData: { pin: boolean, data: IDockTab[][] }
|
|
||||||
if (!json.right.data) {
|
|
||||||
rightData = {
|
|
||||||
pin: true,
|
|
||||||
data: json.right
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rightData = json.right;
|
|
||||||
}
|
|
||||||
let leftData: { pin: boolean, data: IDockTab[][] }
|
|
||||||
if (!json.left.data) {
|
|
||||||
leftData = {
|
|
||||||
pin: true,
|
|
||||||
data: json.left
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
leftData = json.left;
|
|
||||||
}
|
|
||||||
window.siyuan.layout.topDock = new Dock({position: "Top", data: topData});
|
|
||||||
window.siyuan.layout.leftDock = new Dock({position: "Left", data: leftData});
|
|
||||||
window.siyuan.layout.rightDock = new Dock({position: "Right", data: rightData});
|
|
||||||
window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: bottomData});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model, isStart = false) => {
|
export const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model, isStart = false) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user