archive file - open in profiler

This commit is contained in:
Jan Prochazka
2022-12-17 20:07:26 +01:00
parent 123e00ecbc
commit 274fcd339b
3 changed files with 42 additions and 7 deletions

View File

@@ -8,7 +8,7 @@
category: 'Profiler',
name: 'Start profiling',
icon: 'icon play',
testEnabled: () => getCurrentEditor() && !getCurrentEditor()?.isProfiling(),
testEnabled: () => getCurrentEditor()?.startProfilingEnabled(),
onClick: () => getCurrentEditor().startProfiling(),
});
@@ -17,7 +17,7 @@
category: 'Profiler',
name: 'Stop profiling',
icon: 'icon play-stop',
testEnabled: () => getCurrentEditor()?.isProfiling(),
testEnabled: () => getCurrentEditor()?.stopProfilingEnabled(),
onClick: () => getCurrentEditor().stopProfiling(),
});
@@ -55,9 +55,10 @@
export let conid;
export let database;
export let jslid;
export let formatterFunction;
let profiling = false;
let jslid;
let sessionId;
let intervalId;
@@ -104,6 +105,10 @@
invalidateCommands();
}
export function startProfilingEnabled() {
return conid && database && !isProfiling;
}
export function stopProfiling() {
profiling = false;
apiCall('sessions/stop-profiler', { sesid: sessionId });
@@ -111,6 +116,10 @@
invalidateCommands();
}
export function stopProfilingEnabled() {
return conid && database && isProfiling;
}
export function saveEnabled() {
return !!jslid;
}
@@ -132,7 +141,11 @@
<ToolStripContainer>
{#if jslid}
<JslDataGrid {jslid} listenInitializeFile formatterFunction={engine?.profilerFormatterFunction} />
<JslDataGrid
{jslid}
listenInitializeFile
formatterFunction={formatterFunction || engine?.profilerFormatterFunction}
/>
{:else}
<ErrorInfo message="Profiler not yet started" alignTop />
{/if}