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
93c2cdf434
commit
8678e3474d
3 changed files with 8 additions and 21 deletions
|
|
@ -154,27 +154,13 @@ package "Backend" {
|
|||
}
|
||||
}
|
||||
|
||||
// PlantUML text encoder (deflate + base64 variant)
|
||||
// Uses the PlantUML encoding scheme: https://plantuml.com/text-encoding
|
||||
// PlantUML hex encoding — uses the ~h prefix supported by plantuml.com
|
||||
// See: https://plantuml.com/text-encoding
|
||||
function plantumlEncode(text: string): string {
|
||||
const data = 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)
|
||||
const bytes = unescape(encodeURIComponent(text));
|
||||
let hex = '~h';
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
hex += data.charCodeAt(i).toString(16).padStart(2, '0');
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
hex += bytes.charCodeAt(i).toString(16).padStart(2, '0');
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@
|
|||
class="action-btn"
|
||||
class:start={status === 'stopped'}
|
||||
class:stop={status !== 'stopped'}
|
||||
onclick={() => toggleAgent(agent)}
|
||||
onclick={(e: MouseEvent) => { e.stopPropagation(); toggleAgent(agent); }}
|
||||
title={status === 'stopped' ? 'Start agent' : 'Stop agent'}
|
||||
>
|
||||
{status === 'stopped' ? '▶' : '■'}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { convertFileSrc } from '@tauri-apps/api/core';
|
||||
import { listDirectoryChildren, readFileContent, type DirEntry } from '../../adapters/files-bridge';
|
||||
|
||||
interface Props {
|
||||
|
|
@ -150,7 +151,7 @@
|
|||
{#if selectedScreenshot}
|
||||
<div class="screenshot-preview">
|
||||
<img
|
||||
src="asset://localhost/{selectedScreenshot}"
|
||||
src={convertFileSrc(selectedScreenshot)}
|
||||
alt="Selenium screenshot"
|
||||
class="screenshot-img"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue