196 lines
5.3 KiB
HTML
196 lines
5.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Your FB1 overleaf git ssh keys</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
max-width: 650px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
}
|
|
.user-info {
|
|
margin-bottom: 20px;
|
|
text-align: right;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 15px;
|
|
}
|
|
label {
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
}
|
|
input[type="text"] {
|
|
width: 100%;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
}
|
|
input[type="email"] {
|
|
width: 100%;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
}
|
|
textarea {
|
|
height: 150px;
|
|
width: 100%;
|
|
resize: vertical;
|
|
}
|
|
.status-marker {
|
|
display: inline-block;
|
|
width: 20px;
|
|
height: 20px;
|
|
border-radius: 50%;
|
|
margin-left: 10px;
|
|
}
|
|
.submit-btn {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
margin-top: 15px;
|
|
}
|
|
.submit-btn:hover {
|
|
background-color: #45a049;
|
|
}
|
|
.key-container {
|
|
position: relative;
|
|
margin-bottom: 30px;
|
|
}
|
|
.key-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-bottom: 10px;
|
|
padding: 15px 60px 15px 15px;
|
|
}
|
|
.key-table td {
|
|
border: 2px solid #0056b3;
|
|
padding: 15px;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.key-box {
|
|
width: 100%;
|
|
min-height: 40px;
|
|
font-family: monospace;
|
|
white-space: pre-wrap;
|
|
word-break: break-all;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
.private-key {
|
|
height: auto;
|
|
min-height: 120px;
|
|
}
|
|
.copy-btn {
|
|
padding: 5px 10px;
|
|
background-color: #0056b3;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 12px;
|
|
}
|
|
.copy-btn:hover {
|
|
background-color: #003d82;
|
|
}
|
|
.success-message {
|
|
position: absolute;
|
|
top: 10px;
|
|
right: 80px;
|
|
color: #28a745;
|
|
font-size: 12px;
|
|
display: none; /* Hidden by default */
|
|
}
|
|
.error-msg {
|
|
color: #dc3545;
|
|
padding: 10px;
|
|
background-color: #f8d7da;
|
|
border-radius: 4px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.button-container {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
margin-top: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<img src="/keys/static/UNI_Logo.svg" alt="University of Bremen Logo" style="max-width: 200px;">
|
|
</header>
|
|
|
|
<div class="user-info">
|
|
Welcome, {{ username }} | <a href="{{ url_for('keys.logout') }}">Logout</a>
|
|
</div>
|
|
|
|
<p>
|
|
|
|
{{ added_email|safe }}
|
|
<h1>Your FB1 overleaf git ssh keys</h1>
|
|
|
|
{{ error_msg|safe }}
|
|
|
|
<h2>Public key</h2>
|
|
<div class="key-container">
|
|
<table class="key-table">
|
|
<tr>
|
|
<td>
|
|
<div class="key-box" id="public-key">{{ public_key|safe }}</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="button-container">
|
|
<span class="success-message" id="public-key-copied">Copied!</span>
|
|
<button class="copy-btn" onclick="copyToClipboard('public-key')">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<h2>Private key</h2>
|
|
<div class="key-container">
|
|
<table class="key-table">
|
|
<tr>
|
|
<td>
|
|
<div class="key-box private-key" id="private-key">{{ private_key|safe }}</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="button-container">
|
|
<span class="success-message" id="private-key-copied">Copied!</span>
|
|
<button class="copy-btn" onclick="copyToClipboard('private-key')">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
function copyToClipboard(elementId) {
|
|
const element = document.getElementById(elementId);
|
|
const textToCopy = element.textContent;
|
|
|
|
navigator.clipboard.writeText(textToCopy)
|
|
.then(() => {
|
|
// Show success message
|
|
const successMessage = document.getElementById(elementId + '-copied');
|
|
successMessage.style.display = 'inline';
|
|
|
|
// Hide after 2 seconds
|
|
setTimeout(() => {
|
|
successMessage.style.display = 'none';
|
|
}, 2000);
|
|
})
|
|
.catch(err => {
|
|
console.error('Failed to copy text: ', err);
|
|
alert('Failed to copy text. Please try again.');
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|
|
|