olivetin/frontend/index.html

158 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html lang = "en">
<head>
<meta charset = "UTF-8" />
<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 = "stylesheet" type = "text/css" href = "/theme.css" />
<link rel = "stylesheet" href = "node_modules/@xterm/xterm/css/xterm.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" />
<base href = "/" />
</head>
<body>
<slot id = "app" />
<main title = "main content">
<section id = "contentActions" title = "Actions" class = "transparent" 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>
<dialog title = "Big Error Message" id = "big-error" class = "error padded-content">
</dialog>
<dialog title = "Execution Results" id = "execution-results-popup">
<div class = "action-header padded-content">
<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">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M3 3h6v2H6.462l4.843 4.843l-1.415 1.414L5 6.367V9H3zm0 18h6v-2H6.376l4.929-4.928l-1.415-1.414L5 17.548V15H3zm12 0h6v-6h-2v2.524l-4.867-4.866l-1.414 1.414L17.647 19H15zm6-18h-6v2h2.562l-4.843 4.843l1.414 1.414L19 6.39V9h2z"/></svg>
</button>
</div>
<div id = "execution-dialog-basics" class = "padded-content-sides">
<strong>Duration: </strong><span id = "execution-dialog-duration">unknown</span>
</div>
<div id = "execution-dialog-details" class = "padded-content-sides">
<p>
<strong>Status: </strong><span id = "execution-dialog-status">unknown</span>
</p>
</div>
<div id = "execution-dialog-xterm"></div>
<div id = "execution-dialog-output-html" class = "padded-content"></div>
<div class = "buttons padded-content">
<button name = "rerun" title = "Rerun" id = "execution-dialog-rerun-action">Rerun</button>
<button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
<form method = "dialog">
<button name = "Cancel" title = "Close">Close</button>
</form>
</div>
</dialog>
<template id = "tplArgumentForm">
<dialog title = "Arguments" id = "argument-popup">
<form class = "action-arguments padded-content">
<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">
<button name = "start" type = "submit">Start</button>
<button name = "cancel" title = "Cancel" type = "button">Cancel</button>
</div>
</div>
</form>
</dialog>
</template>
<template id = "tplActionButton">
<button>
<span title = "action button icon" class = "icon">&#x1f4a9;</span>
<span class = "title" aria-live = "polite">Untitled Button</span>
</button>
<div class = "action-button-footer" hidden></div>
</template>
<template id = "tplLogRow">
<tr class = "log-row">
<td class = "timestamp">?</td>
<td>
<span role = "img" class = "icon"></span>
<a href = "javascript:void(0)" class = "content">?</a>
</td>
<td class = "tags"></td>
<td class = "exit-code">?</td>
</tr>
</template>
<script type = "text/javascript">
const bigErrorDialog = document.getElementById('big-error')
/**
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, isFatal) {
console.error('Error ' + type + ': ', message)
return;
bigErrorDialog.innerHTML = '<h1>Error ' + friendlyType + '</h1><p>' + message + "</p><p><a href = 'http://docs.olivetin.app/troubleshooting/err-" + type + ".html' target = 'blank'/>" + type + " error in OliveTin Documentation</a></p>"
if (isFatal) {
bigErrorDialog.innerHTML += '<p>You will need to refresh your browser to clear this message.</p>'
} else {
bigErrorDialog.innerHTML += '<p>This error message will go away automatically if the problem is solved.</p>'
}
bigErrorDialog.showModal()
console.error('Error ' + type + ': ', message)
}
window.clearBigErrors = function () {
bigErrorDialog.close()
}
</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>
<script src = "lib/iconify-icon-2.0.0.min.js"></script>
</body>
</html>