Files
OliveTin/webui.dev/index.html
T

226 lines
6.5 KiB
HTML

<!DOCTYPE html>
<html lang = "en">
<head>
<meta name = "viewport" content = "width=device-width, initial-scale=1.0">
<meta name = "description" content = "Give safe and simple access to predefined shell commands from a web interface." />
<title>OliveTin</title>
<link rel = "stylesheet" type = "text/css" href = "style.css" />
<link rel = "shortcut icon" type = "image/png" href = "OliveTinLogo.png" />
<link rel = "apple-touch-icon" sizes="57x57" href="OliveTinLogo-57px.png" />
<link rel = "apple-touch-icon" sizes="120x120" href="OliveTinLogo-120px.png" />
<link rel = "apple-touch-icon" sizes="180x180" href="OliveTinLogo-180px.png" />
</head>
<body>
<main title = "main content">
<div id = "perma-widget">
<div id = "sidebar-toggle-wrapper">
<label for = "hide-sidebar-checkbox" id = "sidebar-toggler-button" title = "Toggle sidebar" tabindex = "0">&#9776;</label>
</div>
<h1 id = "page-title">OliveTin</h1>
</div>
<input type = "checkbox" id = "hide-sidebar-checkbox" hidden checked />
<nav hidden>
<ul id = "navigation-links">
<li title = "Actions"><a id = "showActions">Actions</a></li>
</ul>
<ul id = "supplemental-links">
<li title = "Logs"><a id = "showLogs">Logs</a></li>
</ul>
</nav>
<section id = "contentLogs" title = "Logs" hidden>
<div class = "toolbar">
<input placeholder = "Search for action name" id = "logSearchBox" />
<button id = "searchLogsClear" title = "Clear search filter" disabled>X</button>
</div>
<table title = "Logs">
<thead>
<tr title = "untitled">
<th>Timestamp</th>
<th>Log</th>
<th>Exit Code</th>
</tr>
</thead>
<tbody id = "logTableBody" />
</table>
</section>
<section id = "contentActions" title = "Actions" hidden >
<fieldset id = "root-group" title = "Actions">
<legend hidden>Actions</legend>
</fieldset>
</section>
<noscript>
<div class = "error">Sorry, JavaScript is required to use OliveTin.</div>
</noscript>
</main>
<footer title = "footer">
<p><img title = "application icon" src = "OliveTinLogo.png" alt = "OliveTin logo" height = "1em" class = "logo" /> OliveTin</p>
<p>
<a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
<a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
<span>Version: <span id = "currentVersion">?</span></span> |
<span>Server connection:
<span id = "serverConnectionRest">REST</span>,
<span id = "serverConnectionWebSocket">WebSocket</span>
</span>
</p>
<p>
<a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
</p>
</footer>
<dialog title = "Execution Results" id = "execution-results-popup">
<div class = "action-header">
<span id = "execution-dialog-icon" class = "icon" role = "img"></span>
<h2>
<span id = "execution-dialog-title">?</span>
</h2>
<button id = "execution-dialog-toggle-size" title = "Toggle dialog size">&#128470;</button>
</div>
<div id = "execution-dialog-basics">
<strong>Started: </strong><span id = "execution-dialog-datetime-started">unknown</span>
</div>
<div id = "execution-dialog-details">
<p>
<strong>Finished: </strong><span id = "execution-dialog-datetime-finished">unknown</span>
</p>
<p>
<strong>Exit Code: </strong><span id = "execution-dialog-exit-code">unknown</span>
</p>
<p>
<strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
</p>
</div>
<div id = "execution-dialog-output">
<details>
<summary>Standard Output</summary>
<pre id = "execution-dialog-stdout">
?
</pre>
</details>
<details>
<summary>Standard Error</summary>
<pre id = "execution-dialog-stderr">
?
</pre>
</details>
</div>
<form method = "dialog">
<div class = "buttons">
<button name = "Cancel" title = "Close">Close</button>
</div>
</form>
</dialog>
<template id = "tplArgumentForm">
<dialog title = "Arguments" id = "argument-popup">
<form class = "action-arguments">
<div class = "wrapper">
<div class = "action-header">
<span class = "icon" role = "img"></span>
<h2>Argument form</h2>
</div>
<div class = "arguments"></div>
<div class = "buttons">
<input name = "start" type = "submit" value = "Start">
<button name = "cancel" title = "Cancel">Cancel</button>
</div>
</div>
</form>
</dialog>
</template>
<template id = "tplActionButton">
<button>
<span title = "action button icon" class = "icon">&#x1f4a9;</span>
<span class = "title">Untitled Button</span>
</button>
<div class = "action-button-footer">
</div>
</template>
<template id = "tplLogRow">
<tr class = "log-row">
<td class = "timestamp">?</td>
<td>
<span role = "img" class = "icon"></span>
<span class = "content">?</span>
<details>
<summary>stdout</summary>
<pre class = "stdout">
?
</pre>
</details>
<details>
<summary>stderr</summary>
<pre class = "stderr">
?
</pre>
</details>
<div class = "tags"></div>
</td>
<td class = "exit-code">?</td>
</tr>
</template>
<script type = "text/javascript">
/**
This is the bootstrap code, which relies on very simple, old javascript
to at least display a helpful error message if we can't use OliveTin.
*/
window.showBigError = function (type, friendlyType, message) {
clearBigErrors(type)
console.error('Error ' + type + ': ', message)
const domErr = document.createElement('div')
domErr.classList.add('error')
domErr.classList.add(type)
domErr.innerHTML = '<h1>Error ' + friendlyType + '</h1><p>' + message + "</p><p><a href = 'http://docs.olivetin.app/err-" + type + ".html' target = 'blank'/>" + type + " error in OliveTin Documentation</a></p>"
document.body.prepend(domErr)
}
window.clearBigErrors = function (additionalClass) {
let selector = 'div.error'
if (additionalClass != null) {
selector += '.' + additionalClass
}
for (const oldError of document.querySelectorAll(selector).values()) {
window.old = oldError;
oldError.remove();
}
}
</script>
<script type = "text/javascript" nomodule>
showBigError("js-modules-not-supported", "Sorry, your browser does not support JavaScript modules.", null)
</script>
<script type = "module" src = "main.js"></script>
</body>
</html>