85 lines
2.2 KiB
HTML
85 lines
2.2 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>Session Toolbox</title>
|
||
<style>
|
||
:root {
|
||
color-scheme: dark light;
|
||
}
|
||
body {
|
||
margin: 0;
|
||
padding: 16px;
|
||
font: 13px/1.5 var(--font-sans, system-ui, sans-serif);
|
||
background: var(--df-bg, #111827);
|
||
color: var(--df-fg, #e5e7eb);
|
||
}
|
||
h1 {
|
||
font-size: 17px;
|
||
margin: 0 0 12px;
|
||
}
|
||
label {
|
||
display: block;
|
||
margin: 16px 0 6px;
|
||
}
|
||
input,
|
||
button {
|
||
font: inherit;
|
||
border: 1px solid #64748b;
|
||
border-radius: 5px;
|
||
padding: 7px 9px;
|
||
}
|
||
input {
|
||
box-sizing: border-box;
|
||
width: 100%;
|
||
background: transparent;
|
||
color: inherit;
|
||
}
|
||
button {
|
||
margin-top: 8px;
|
||
cursor: pointer;
|
||
background: #2563eb;
|
||
color: white;
|
||
}
|
||
button:disabled {
|
||
opacity: 0.5;
|
||
cursor: wait;
|
||
}
|
||
pre {
|
||
white-space: pre-wrap;
|
||
overflow-wrap: anywhere;
|
||
padding: 10px;
|
||
background: #64748b22;
|
||
border-radius: 5px;
|
||
max-height: 400px;
|
||
overflow: auto;
|
||
}
|
||
#error {
|
||
color: #f87171;
|
||
}
|
||
.hint {
|
||
opacity: 0.7;
|
||
font-size: 12px;
|
||
}
|
||
</style>
|
||
<script src="nyaterm-sdk.js"></script>
|
||
<script src="toolbox.js" defer></script>
|
||
</head>
|
||
<body>
|
||
<h1>Session Toolbox</h1>
|
||
<p id="session">Waiting for NyaTerm…</p>
|
||
<p class="hint">Operations apply only to this view’s selected session.</p>
|
||
<button id="read">Read recent output</button>
|
||
<label for="command">Command</label>
|
||
<input id="command" placeholder="Enter a command" />
|
||
<button id="execute">Request execution</button>
|
||
<p class="hint">NyaTerm asks for approval before executing.</p>
|
||
<label for="path">Text file path</label>
|
||
<input id="path" placeholder="Path in the selected session" />
|
||
<button id="file">Request file read</button>
|
||
<p id="error" role="alert"></p>
|
||
<pre id="output" aria-live="polite"></pre>
|
||
</body>
|
||
</html>
|