fix(components): stopPropagation, PlantUML encoding, Tauri 2.x asset URL
GroupAgentsPanel: added e.stopPropagation() on toggleAgent button. ArchitectureTab: collapsed rawDeflate no-op into single plantumlEncode(). TestingTab: replaced asset://localhost/ with convertFileSrc().
This commit is contained in:
parent
bd904de151
commit
cba9b298eb
3 changed files with 8 additions and 21 deletions
|
|
@ -154,27 +154,13 @@ package "Backend" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlantUML text encoder (deflate + base64 variant)
|
// PlantUML hex encoding — uses the ~h prefix supported by plantuml.com
|
||||||
// Uses the PlantUML encoding scheme: https://plantuml.com/text-encoding
|
// See: https://plantuml.com/text-encoding
|
||||||
function plantumlEncode(text: string): string {
|
function plantumlEncode(text: string): string {
|
||||||
const data = unescape(encodeURIComponent(text));
|
const bytes = unescape(encodeURIComponent(text));
|
||||||
const compressed = rawDeflate(data);
|
|
||||||
return encode64(compressed);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Minimal raw deflate (store-only for simplicity — works with plantuml.com)
|
|
||||||
function rawDeflate(data: string): string {
|
|
||||||
// For PlantUML server compatibility, we use the ~h hex encoding as fallback
|
|
||||||
// which is simpler and doesn't require deflate
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PlantUML base64 encoding (6-bit alphabet: 0-9A-Za-z-_)
|
|
||||||
function encode64(data: string): string {
|
|
||||||
// Use hex encoding prefix for simplicity (supported by PlantUML server)
|
|
||||||
let hex = '~h';
|
let hex = '~h';
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < bytes.length; i++) {
|
||||||
hex += data.charCodeAt(i).toString(16).padStart(2, '0');
|
hex += bytes.charCodeAt(i).toString(16).padStart(2, '0');
|
||||||
}
|
}
|
||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
class="action-btn"
|
class="action-btn"
|
||||||
class:start={status === 'stopped'}
|
class:start={status === 'stopped'}
|
||||||
class:stop={status !== 'stopped'}
|
class:stop={status !== 'stopped'}
|
||||||
onclick={() => toggleAgent(agent)}
|
onclick={(e: MouseEvent) => { e.stopPropagation(); toggleAgent(agent); }}
|
||||||
title={status === 'stopped' ? 'Start agent' : 'Stop agent'}
|
title={status === 'stopped' ? 'Start agent' : 'Stop agent'}
|
||||||
>
|
>
|
||||||
{status === 'stopped' ? '▶' : '■'}
|
{status === 'stopped' ? '▶' : '■'}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
|
import { convertFileSrc } from '@tauri-apps/api/core';
|
||||||
import { listDirectoryChildren, readFileContent, type DirEntry } from '../../adapters/files-bridge';
|
import { listDirectoryChildren, readFileContent, type DirEntry } from '../../adapters/files-bridge';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -150,7 +151,7 @@
|
||||||
{#if selectedScreenshot}
|
{#if selectedScreenshot}
|
||||||
<div class="screenshot-preview">
|
<div class="screenshot-preview">
|
||||||
<img
|
<img
|
||||||
src="asset://localhost/{selectedScreenshot}"
|
src={convertFileSrc(selectedScreenshot)}
|
||||||
alt="Selenium screenshot"
|
alt="Selenium screenshot"
|
||||||
class="screenshot-img"
|
class="screenshot-img"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue