This commit is contained in:
parent
515d11019d
commit
b2a85c66c6
2 changed files with 23 additions and 41 deletions
|
@ -129,6 +129,25 @@ class App {
|
|||
};
|
||||
fetchPost("/api/system/getConf", {}, response => {
|
||||
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(() => {
|
||||
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
|
||||
window.siyuan.languages = lauguages;
|
||||
|
|
|
@ -172,47 +172,10 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
|
|||
|
||||
const JSONToDock = (json: any) => {
|
||||
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[1].children[1] as Layout;
|
||||
// 历史数据兼容,202306后可删除
|
||||
let topData: { pin: boolean, data: IDockTab[][] }
|
||||
if (!json.top.data) {
|
||||
topData = {
|
||||
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});
|
||||
window.siyuan.layout.topDock = new Dock({position: "Top", data: json.top});
|
||||
window.siyuan.layout.leftDock = new Dock({position: "Left", data: json.left});
|
||||
window.siyuan.layout.rightDock = new Dock({position: "Right", data: json.right});
|
||||
window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: json.bottom});
|
||||
};
|
||||
|
||||
export const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model, isStart = false) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue