mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-04-29 20:38:35 +00:00
- Now we are ready for i18n. - The setting dialogue has been refined. Very controllable, clearly displayed disabled items, and ready to i18n. Fixed: - Many memory leaks have been rescued. - Chunk caches now work well. - Many trivial but potential bugs are fixed. - No longer error messages will be shown on retrieving checkpoint or server information. - Now we can check and correct tweak mismatch during the setup Improved: - Customisation synchronisation has got more smoother. Tidied - Practically unused functions have been removed or are being prepared for removal. - Many of the type-errors and lint errors have been corrected. - Unused files have been removed. Note: - From this version, some test files have been included. However, they are not enabled and released in the release build.
51 lines
1.3 KiB
Svelte
51 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import { onDestroy, onMount } from "svelte";
|
|
import type ObsidianLiveSyncPlugin from "../main";
|
|
import { perf_trench } from "./tests";
|
|
import { MarkdownRenderer } from "../deps";
|
|
export let plugin: ObsidianLiveSyncPlugin;
|
|
let performanceTestResult = "";
|
|
let functionCheckResult = "";
|
|
let testRunning = false;
|
|
let prefTestResultEl: HTMLDivElement;
|
|
let isReady = false;
|
|
$: {
|
|
if (performanceTestResult != "" && isReady) {
|
|
MarkdownRenderer.render(plugin.app, performanceTestResult, prefTestResultEl, "/", plugin);
|
|
}
|
|
}
|
|
|
|
async function performTest() {
|
|
try {
|
|
testRunning = true;
|
|
performanceTestResult = await perf_trench(plugin);
|
|
} finally {
|
|
testRunning = false;
|
|
}
|
|
}
|
|
function clearPerfTestResult() {
|
|
prefTestResultEl.empty();
|
|
}
|
|
onMount(() => {
|
|
isReady = true;
|
|
// performTest();
|
|
});
|
|
</script>
|
|
|
|
<h2>TESTBENCH: Self-hosted LiveSync</h2>
|
|
|
|
<h3>Function check</h3>
|
|
<pre>{functionCheckResult}</pre>
|
|
|
|
<h3>Performance test</h3>
|
|
<button on:click={() => performTest()} disabled={testRunning}>Test!</button>
|
|
<button on:click={() => clearPerfTestResult()}>Clear</button>
|
|
|
|
<div bind:this={prefTestResultEl}></div>
|
|
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|