This commit is contained in:
parent
4226b66fd2
commit
26dbe801a1
10 changed files with 13 additions and 60 deletions
|
@ -749,7 +749,6 @@
|
|||
"about5": "Access Authorization Code",
|
||||
"about6": "After configuration, it will be used as the access authentication password, leave it blank to close the authentication",
|
||||
"about7": "Workspace dir",
|
||||
"about8": "After the workspace is switched, the data in the current workspace will not be copied to the target workspace",
|
||||
"about9": "Automatically upload error messages and diagnostic data",
|
||||
"about10": "After enabling, it will automatically upload error information and diagnostic data through the <a href=\"https://sentry.io\" target=\"_blank\">Sentry</a> SDK, which does not involve personal privacy data so that developers can fix bugs. The application will be closed automatically after modification, please restart manually",
|
||||
"about11": "Network serving",
|
||||
|
|
|
@ -749,7 +749,6 @@
|
|||
"about5": "Código de autorización de acceso",
|
||||
"about6": "Después de la configuración, se utilizará como contraseña de autenticación de acceso, déjelo en blanco para cerrar la autenticación",
|
||||
"about7": "Directorio del espacio de trabajo",
|
||||
"about8": "Después de cambiar el espacio de trabajo, los datos del espacio de trabajo actual no se copiarán en el espacio de trabajo de destino",
|
||||
"about9": "Carga automática de mensajes de error y datos de diagnóstico",
|
||||
"about10": "Después de habilitarlo, cargará automáticamente información de error y datos de diagnóstico a través del <a href=\"https://sentry.io\" target=\"_blank\">Sentry</a> SDK, que no involucra datos de privacidad personal para que los desarrolladores puede corregir errores. La aplicación se cerrará automáticamente después de la modificación, por favor, reinicie manualmente",
|
||||
"about11": "Red de servicio",
|
||||
|
|
|
@ -749,7 +749,6 @@
|
|||
"about5": "Accès Code d'autorisation",
|
||||
"about6": "Configuré comme mot de passe d'authentification d'accès, laisser vide pour désactiver l'authentification.",
|
||||
"about7": "Répertoire de l'espace de travail",
|
||||
"about8": "Une fois l'espace de travail basculé, les données de l'espace de travail actuel ne seront pas copiées dans l'espace de travail cible",
|
||||
"about9": "Télécharger automatiquement les messages d'erreur et les données de diagnostic",
|
||||
"about10": "Après l'activation, il télécharge automatiquement les informations d'erreur et les données de diagnostic via le SDK <a href=\"https://sentry.io\" target=\"_blank\">Sentry</a>, qui n'implique pas de données de confidentialité personnelles afin que les développeurs peut corriger des bogues. L'application sera fermée automatiquement après modification, veuillez la redémarrer manuellement.",
|
||||
"about11": "Service de réseau",
|
||||
|
|
|
@ -749,7 +749,6 @@
|
|||
"about5": "存取授權碼",
|
||||
"about6": "配置後作為存取鑒權密碼,留空則關閉鑒權",
|
||||
"about7": "工作空間目錄",
|
||||
"about8": "切換工作空間後不會將當前工作空間的數據複製到目標工作空間中",
|
||||
"about9": "自動上傳報錯信息和診斷數據",
|
||||
"about10": "啟用後會通過 <a href=\"https://sentry.io\" target=\"_blank\">Sentry</a> SDK 自動上傳報錯信息和診斷數據等不涉及個人隱私的數據,以便開發者修復缺陷。修改後會自動關閉應用,請手動重啟",
|
||||
"about11": "網路伺服",
|
||||
|
|
|
@ -749,7 +749,6 @@
|
|||
"about5": "访问授权码",
|
||||
"about6": "配置后作为访问鉴权密码,留空则关闭鉴权",
|
||||
"about7": "工作空间目录",
|
||||
"about8": "切换工作空间后不会将当前工作空间的数据复制到目标工作空间中",
|
||||
"about9": "自动上传报错信息和诊断数据",
|
||||
"about10": "启用后会通过 <a href=\"https://sentry.io\" target=\"_blank\">Sentry</a> SDK 自动上传报错信息和诊断数据等不涉及个人隐私的数据,以便开发者修复缺陷。修改后会自动关闭应用,请手动重启",
|
||||
"about11": "网络伺服",
|
||||
|
|
|
@ -135,18 +135,6 @@ export const about = {
|
|||
</button>
|
||||
</div>
|
||||
</label>
|
||||
<label class="fn__flex config__item b3-label${isBrowser() ? " fn__none" : ""}">
|
||||
<div class="fn__flex-1">
|
||||
<div class="fn__flex">
|
||||
${window.siyuan.languages.about7}
|
||||
<span class="fn__space"></span>
|
||||
<a href="javascript:void(0)" data-type="open" data-url="${window.siyuan.config.system.workspaceDir}">${window.siyuan.config.system.workspaceDir}</a>
|
||||
</div>
|
||||
<div class="b3-label__text">${window.siyuan.languages.about8}</div>
|
||||
</div>
|
||||
<div class="fn__space"></div>
|
||||
<select id="workspaceDir" class="fn__flex-center b3-select fn__size200"></select>
|
||||
</label>
|
||||
<label class="fn__flex config__item b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.about13}
|
||||
|
@ -224,39 +212,6 @@ export const about = {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
const workspaceDirElement = about.element.querySelector("#workspaceDir") as HTMLInputElement;
|
||||
workspaceDirElement.addEventListener("change", async () => {
|
||||
let workspace = workspaceDirElement.value;
|
||||
if (workspaceDirElement.value === "0") {
|
||||
const localPath = await dialog.showOpenDialog({
|
||||
defaultPath: window.siyuan.config.system.homeDir,
|
||||
properties: ["openDirectory", "createDirectory"],
|
||||
});
|
||||
if (localPath.filePaths.length === 0) {
|
||||
workspaceDirElement.value = window.siyuan.config.system.workspaceDir;
|
||||
return;
|
||||
}
|
||||
workspace = localPath.filePaths[0];
|
||||
}
|
||||
fetchPost("/api/system/setWorkspaceDir", {
|
||||
path: workspace
|
||||
}, () => {
|
||||
ipcRenderer.send(Constants.SIYUAN_OPEN_WORKSPACE, {
|
||||
workspace,
|
||||
lang: window.siyuan.config.appearance.lang
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
fetchPost("/api/system/listWorkspaceDirs", {}, (response) => {
|
||||
let optionsHTML = "";
|
||||
response.data.forEach((item: string) => {
|
||||
optionsHTML += `<option value="${item}">${item}</option>`;
|
||||
});
|
||||
workspaceDirElement.innerHTML = optionsHTML + `<option value="0">${window.siyuan.languages.updatePath}</option>`;
|
||||
workspaceDirElement.value = window.siyuan.config.system.workspaceDir;
|
||||
});
|
||||
/// #endif
|
||||
about.element.querySelector("#authCode").addEventListener("click", () => {
|
||||
setAccessAuthCode();
|
||||
|
|
|
@ -69,7 +69,7 @@ export const initConfigSearch = (element: HTMLElement) => {
|
|||
"twoFactorCaptcha", "account1", "account2", "account5"]),
|
||||
|
||||
// 关于
|
||||
getLang(["about", "about1", "about2", "about3", "about4", "about5", "about6", "about7", "about8",
|
||||
getLang(["about", "about1", "about2", "about3", "about4", "about5", "about6",
|
||||
"about9", "about10", "about11", "about12", "about13", "about14", "about17", "config", "dataRepoKey",
|
||||
"dataRepoKeyTip1", "dataRepoKeyTip2", "slogan", "currentVer", "checkUpdate", "updatePath", "systemLog",
|
||||
"importKey", "genKey", "genKeyByPW", "copyKey", "resetRepo", "systemLogTip", "export", "visitAnnouncements",
|
||||
|
|
|
@ -92,7 +92,7 @@ export const workspaceMenu = (rect: DOMRect) => {
|
|||
label: window.siyuan.languages.opendWorkspace,
|
||||
type: "readonly"
|
||||
}).element);
|
||||
response.data.forEach((item: { path: string, closed: boolean }) => {
|
||||
response.data.forEach((item: IWorkspace) => {
|
||||
if (item.closed) {
|
||||
return;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ export const workspaceMenu = (rect: DOMRect) => {
|
|||
label: window.siyuan.languages.about7,
|
||||
type: "readonly"
|
||||
}).element);
|
||||
response.data.forEach((item: { path: string, closed: boolean }) => {
|
||||
response.data.forEach((item: IWorkspace) => {
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: pathPosix().basename(item.path),
|
||||
click: () => {
|
||||
|
|
|
@ -97,11 +97,11 @@ const showAccountInfo = (modelElement: HTMLElement, modelMainElement: Element) =
|
|||
};
|
||||
|
||||
const genWorkspace = (workspaceDirElement: Element) => {
|
||||
fetchPost("/api/system/listWorkspaceDirs", {}, (response) => {
|
||||
fetchPost("/api/system/getWorkspaces", {}, (response) => {
|
||||
let html = "";
|
||||
response.data.forEach((item: string) => {
|
||||
html += `<li data-path="${item}" class="b3-list-item b3-list-item--narrow${window.siyuan.config.system.workspaceDir === item ? " b3-list-item--focus" : ""}">
|
||||
<span class="b3-list-item__text">${pathPosix().basename(item)}</span>
|
||||
response.data.forEach((item: IWorkspace) => {
|
||||
html += `<li data-path="${item.path}" class="b3-list-item b3-list-item--narrow${window.siyuan.config.system.workspaceDir === item.path ? " b3-list-item--focus" : ""}">
|
||||
<span class="b3-list-item__text">${pathPosix().basename(item.path)}</span>
|
||||
<span data-type="remove" class="b3-list-item__action">
|
||||
<svg><use xlink:href="#iconTrashcan"></use></svg>
|
||||
</span>
|
||||
|
@ -296,8 +296,6 @@ ${accountHTML}
|
|||
<ul id="workspaceDir" class="b3-list b3-list--background"></ul>
|
||||
<div class="fn__hr"></div>
|
||||
<button id="creatWorkspace" class="b3-button fn__block">${window.siyuan.languages.new}</button>
|
||||
<div class="fn__hr"></div>
|
||||
<div class="b3-label__text">${window.siyuan.languages.about8}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
<div class="config-about__logo">
|
||||
|
@ -487,7 +485,7 @@ ${accountHTML}
|
|||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.classList.contains("b3-list-item") && !target.classList.contains("b3-list-item--focus")) {
|
||||
confirmDialog(`${pathPosix().basename(window.siyuan.config.system.workspaceDir)} -> ${pathPosix().basename(target.getAttribute("data-path"))}?`, window.siyuan.languages.about8, () => {
|
||||
confirmDialog(window.siyuan.languages.confirm,`${pathPosix().basename(window.siyuan.config.system.workspaceDir)} -> ${pathPosix().basename(target.getAttribute("data-path"))}?`, () => {
|
||||
fetchPost("/api/system/setWorkspaceDir", {
|
||||
path: target.getAttribute("data-path")
|
||||
}, () => {
|
||||
|
|
5
app/src/types/index.d.ts
vendored
5
app/src/types/index.d.ts
vendored
|
@ -51,6 +51,11 @@ interface Window {
|
|||
hideKeyboardToolbar(): void
|
||||
}
|
||||
|
||||
interface IWorkspace {
|
||||
path:string
|
||||
closed:boolean
|
||||
}
|
||||
|
||||
interface ICard {
|
||||
id: string
|
||||
updated: string
|
||||
|
|
Loading…
Add table
Reference in a new issue