🎨 改进数据仓库密钥初始化确认过程

This commit is contained in:
Liang Ding 2022-07-09 09:45:58 +08:00
parent 02c7182856
commit dd53d345a4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 49 additions and 32 deletions

View file

@ -289,7 +289,7 @@ ${accountHTML}
const importKeyElement = modelMainElement.querySelector("#importKey");
importKeyElement.addEventListener("click", () => {
const passwordDialog = new Dialog({
title: window.siyuan.languages.key,
title: "🔑 " + window.siyuan.languages.key,
content: `<div class="b3-dialog__content">
<textarea class="b3-text-field fn__block" placeholder="${window.siyuan.languages.keyPlaceholder}"></textarea>
</div>
@ -315,7 +315,7 @@ ${accountHTML}
});
});
modelMainElement.querySelector("#initKey").addEventListener("click", () => {
confirmDialog(window.siyuan.languages.genKey, "TODO", () => {
confirmDialog("🔑 " + window.siyuan.languages.genKey, window.siyuan.languages.initRepoKeyTip, () => {
fetchPost("/api/repo/initRepoKey", {}, (response) => {
window.siyuan.config.repo.key = response.data.key;
importKeyElement.parentElement.classList.add("fn__none");