mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
95c5c1d8ae
commit
c8b05a6b96
5 changed files with 71 additions and 4 deletions
|
|
@ -304,6 +304,31 @@ progressLoading: 400
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__backgroundtask {
|
||||||
|
display: flex;
|
||||||
|
color: var(--b3-theme-on-surface);
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
height: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #fff;
|
||||||
|
width: 64px;
|
||||||
|
align-self: center;
|
||||||
|
margin: 0 8px 0 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
background-color: var(--b3-theme-primary-light);
|
||||||
|
height: 4px;
|
||||||
|
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
|
||||||
|
animation: stripMove 450ms linear infinite;
|
||||||
|
background-size: 50px 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#barDock .b3-menu__item:hover {
|
#barDock .b3-menu__item:hover {
|
||||||
background-color: var(--b3-list-hover);
|
background-color: var(--b3-list-hover);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,24 @@ export const progressLoading = (data: IWebSocketData) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const progressBackgroundTask = (tasks:{action:string}[]) => {
|
||||||
|
const backgroundTaskElement = document.querySelector(".status__backgroundtask");
|
||||||
|
if (!backgroundTaskElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tasks.length === 0) {
|
||||||
|
backgroundTaskElement.classList.add("fn__none");
|
||||||
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||||
|
window.siyuan.menus.menu.element.getAttribute("data-name") === "statusBackgroundTask") {
|
||||||
|
window.siyuan.menus.menu.remove();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
backgroundTaskElement.classList.remove("fn__none");
|
||||||
|
backgroundTaskElement.setAttribute("data-tasks", JSON.stringify(tasks));
|
||||||
|
backgroundTaskElement.innerHTML = tasks[0].action + "<div><div></div></div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const bootSync = () => {
|
export const bootSync = () => {
|
||||||
fetchPost("/api/sync/getBootSync", {}, response => {
|
fetchPost("/api/sync/getBootSync", {}, response => {
|
||||||
if (response.code === 1) {
|
if (response.code === 1) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {openFileById} from "./editor/util";
|
||||||
import {
|
import {
|
||||||
bootSync,
|
bootSync,
|
||||||
downloadProgress,
|
downloadProgress,
|
||||||
processSync,
|
processSync, progressBackgroundTask,
|
||||||
progressLoading,
|
progressLoading,
|
||||||
progressStatus,
|
progressStatus,
|
||||||
setTitle,
|
setTitle,
|
||||||
|
|
@ -100,7 +100,10 @@ class App {
|
||||||
transactionError(data);
|
transactionError(data);
|
||||||
break;
|
break;
|
||||||
case "syncing":
|
case "syncing":
|
||||||
processSync(data)
|
processSync(data);
|
||||||
|
break;
|
||||||
|
case "backgroundtask":
|
||||||
|
progressBackgroundTask(data.data.tasks);
|
||||||
break;
|
break;
|
||||||
case "refreshtheme":
|
case "refreshtheme":
|
||||||
if (!window.siyuan.config.appearance.customCSS && data.data.theme.indexOf("custom.css") > -1) {
|
if (!window.siyuan.config.appearance.customCSS && data.data.theme.indexOf("custom.css") > -1) {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import {getCurrentWindow} from "@electron/remote";
|
||||||
/// #endif
|
/// #endif
|
||||||
/// #endif
|
/// #endif
|
||||||
import {MenuItem} from "../menus/Menu";
|
import {MenuItem} from "../menus/Menu";
|
||||||
|
import {Constants} from "../constants";
|
||||||
|
|
||||||
export const initStatus = () => {
|
export const initStatus = () => {
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
|
|
@ -28,6 +29,7 @@ export const initStatus = () => {
|
||||||
</div>
|
</div>
|
||||||
<div class="status__msg"></div>
|
<div class="status__msg"></div>
|
||||||
<div class="fn__flex-1"></div>
|
<div class="fn__flex-1"></div>
|
||||||
|
<div class="status__backgroundtask fn__none"></div>
|
||||||
<div class="status__counter"></div>
|
<div class="status__counter"></div>
|
||||||
<div id="statusHelp" class="toolbar__item b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.help}">
|
<div id="statusHelp" class="toolbar__item b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.help}">
|
||||||
<svg><use xlink:href="#iconHelp"></use></svg>
|
<svg><use xlink:href="#iconHelp"></use></svg>
|
||||||
|
|
@ -67,6 +69,25 @@ export const initStatus = () => {
|
||||||
target.querySelector(".b3-menu").classList.add("fn__none");
|
target.querySelector(".b3-menu").classList.add("fn__none");
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
} else if (target.classList.contains("status__backgroundtask")) {
|
||||||
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||||
|
window.siyuan.menus.menu.element.getAttribute("data-name") === "statusBackgroundTask") {
|
||||||
|
window.siyuan.menus.menu.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.siyuan.menus.menu.remove();
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-name", "statusBackgroundTask");
|
||||||
|
JSON.parse(target.getAttribute("data-tasks")).forEach((item: { action: string }) => {
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
type: "readonly",
|
||||||
|
iconHTML: Constants.ZWSP,
|
||||||
|
label: item.action
|
||||||
|
}).element);
|
||||||
|
})
|
||||||
|
const rect = target.getBoundingClientRect();
|
||||||
|
window.siyuan.menus.menu.popup({x: rect.right, y: rect.top}, true);
|
||||||
|
event.stopPropagation();
|
||||||
|
break;
|
||||||
} else if (target.id === "statusHelp") {
|
} else if (target.id === "statusHelp") {
|
||||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||||
window.siyuan.menus.menu.element.getAttribute("data-name") === "statusHelp") {
|
window.siyuan.menus.menu.element.getAttribute("data-name") === "statusHelp") {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {addGA, initAssets, setInlineStyle, setMode} from "./assets";
|
||||||
import {renderSnippet} from "../config/util/snippets";
|
import {renderSnippet} from "../config/util/snippets";
|
||||||
import {openFileById} from "../editor/util";
|
import {openFileById} from "../editor/util";
|
||||||
import {focusByRange} from "../protyle/util/selection";
|
import {focusByRange} from "../protyle/util/selection";
|
||||||
import {exitSiYuan, processSync} from "../dialog/processSystem";
|
import {exitSiYuan, processSync, progressLoading} from "../dialog/processSystem";
|
||||||
import {openSetting} from "../config";
|
import {openSetting} from "../config";
|
||||||
import {getSearch} from "./functions";
|
import {getSearch} from "./functions";
|
||||||
import {initStatus} from "../layout/status";
|
import {initStatus} from "../layout/status";
|
||||||
|
|
@ -28,7 +28,7 @@ import {editor} from "../config/editor";
|
||||||
import {goBack, goForward} from "./backForward";
|
import {goBack, goForward} from "./backForward";
|
||||||
import {replaceLocalPath} from "../editor/rename";
|
import {replaceLocalPath} from "../editor/rename";
|
||||||
import {workspaceMenu} from "../menus/workspace";
|
import {workspaceMenu} from "../menus/workspace";
|
||||||
import { getWorkspaceName } from "./noRelyPCFunction";
|
import {getWorkspaceName} from "./noRelyPCFunction";
|
||||||
|
|
||||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||||
if (key1 === "general") {
|
if (key1 === "general") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue