Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +663 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: key-manager
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,663 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>PGP Key Manager</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
.sidebar-item.active {
|
| 11 |
+
background-color: #f3f4f6;
|
| 12 |
+
border-left: 3px solid #3b82f6;
|
| 13 |
+
}
|
| 14 |
+
.key-card:hover {
|
| 15 |
+
transform: translateY(-2px);
|
| 16 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
| 17 |
+
}
|
| 18 |
+
.modal {
|
| 19 |
+
transition: opacity 0.3s ease;
|
| 20 |
+
}
|
| 21 |
+
</style>
|
| 22 |
+
</head>
|
| 23 |
+
<body class="bg-gray-50 font-sans">
|
| 24 |
+
<div class="flex h-screen overflow-hidden">
|
| 25 |
+
<!-- Sidebar -->
|
| 26 |
+
<div class="hidden md:flex md:flex-shrink-0">
|
| 27 |
+
<div class="flex flex-col w-64 border-r border-gray-200 bg-white">
|
| 28 |
+
<div class="h-16 flex items-center px-4 border-b border-gray-200">
|
| 29 |
+
<h1 class="text-xl font-bold text-blue-600">PGP Manager</h1>
|
| 30 |
+
</div>
|
| 31 |
+
<div class="flex flex-col flex-grow overflow-y-auto">
|
| 32 |
+
<div class="px-4 py-4">
|
| 33 |
+
<button id="newFolderBtn" class="w-full flex items-center justify-center px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition">
|
| 34 |
+
<i class="fas fa-folder-plus mr-2"></i> New Folder
|
| 35 |
+
</button>
|
| 36 |
+
</div>
|
| 37 |
+
<nav class="flex-1 px-2 space-y-1">
|
| 38 |
+
<a href="#" class="sidebar-item active flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 39 |
+
<i class="fas fa-key mr-3 text-gray-500"></i> All Keys
|
| 40 |
+
</a>
|
| 41 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 42 |
+
<i class="fas fa-user mr-3 text-gray-500"></i> Personal
|
| 43 |
+
</a>
|
| 44 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 45 |
+
<i class="fas fa-briefcase mr-3 text-gray-500"></i> Work
|
| 46 |
+
</a>
|
| 47 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 48 |
+
<i class="fas fa-server mr-3 text-gray-500"></i> Servers
|
| 49 |
+
</a>
|
| 50 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 51 |
+
<i class="fas fa-trash mr-3 text-gray-500"></i> Trash
|
| 52 |
+
</a>
|
| 53 |
+
</nav>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="p-4 border-t border-gray-200">
|
| 56 |
+
<div class="flex items-center">
|
| 57 |
+
<img class="h-9 w-9 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
|
| 58 |
+
<div class="ml-3">
|
| 59 |
+
<p class="text-sm font-medium text-gray-700">John Doe</p>
|
| 60 |
+
<p class="text-xs font-medium text-gray-500">john@example.com</p>
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<!-- Main content -->
|
| 68 |
+
<div class="flex flex-col flex-1 overflow-hidden">
|
| 69 |
+
<!-- Top navigation -->
|
| 70 |
+
<div class="border-b border-gray-200 bg-white">
|
| 71 |
+
<div class="flex items-center justify-between px-4 py-3 sm:px-6">
|
| 72 |
+
<div class="flex items-center">
|
| 73 |
+
<button id="mobileMenuBtn" class="md:hidden mr-2 text-gray-500 hover:text-gray-600">
|
| 74 |
+
<i class="fas fa-bars"></i>
|
| 75 |
+
</button>
|
| 76 |
+
<div class="relative w-64">
|
| 77 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 78 |
+
<i class="fas fa-search text-gray-400"></i>
|
| 79 |
+
</div>
|
| 80 |
+
<input type="text" class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm" placeholder="Search keys...">
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
<div class="flex items-center">
|
| 84 |
+
<div class="relative mr-4">
|
| 85 |
+
<input type="date" class="bg-gray-100 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5">
|
| 86 |
+
</div>
|
| 87 |
+
<button id="newKeyBtn" class="flex items-center px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition">
|
| 88 |
+
<i class="fas fa-plus mr-2"></i> New Key
|
| 89 |
+
</button>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
|
| 94 |
+
<!-- Content -->
|
| 95 |
+
<div class="flex-1 overflow-y-auto p-6 bg-gray-50">
|
| 96 |
+
<div class="mb-6 flex justify-between items-center">
|
| 97 |
+
<h2 class="text-2xl font-bold text-gray-800">All Keys</h2>
|
| 98 |
+
<div class="flex space-x-2">
|
| 99 |
+
<button class="px-3 py-1 bg-white border border-gray-300 rounded-md text-sm font-medium hover:bg-gray-50">All</button>
|
| 100 |
+
<button class="px-3 py-1 bg-white border border-gray-300 rounded-md text-sm font-medium hover:bg-gray-50">Personal</button>
|
| 101 |
+
<button class="px-3 py-1 bg-white border border-gray-300 rounded-md text-sm font-medium hover:bg-gray-50">Work</button>
|
| 102 |
+
<button class="px-3 py-1 bg-white border border-gray-300 rounded-md text-sm font-medium hover:bg-gray-50">Servers</button>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<!-- Key Cards Grid -->
|
| 107 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="keysContainer">
|
| 108 |
+
<!-- Key cards will be dynamically inserted here -->
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<!-- Mobile sidebar (hidden by default) -->
|
| 115 |
+
<div id="mobileSidebar" class="fixed inset-0 z-40 hidden">
|
| 116 |
+
<div class="fixed inset-0 bg-gray-600 bg-opacity-75" id="mobileSidebarBackdrop"></div>
|
| 117 |
+
<div class="relative flex flex-col flex-1 w-64 bg-white">
|
| 118 |
+
<div class="h-16 flex items-center px-4 border-b border-gray-200">
|
| 119 |
+
<h1 class="text-xl font-bold text-blue-600">PGP Manager</h1>
|
| 120 |
+
<button id="closeMobileMenuBtn" class="ml-auto text-gray-500 hover:text-gray-600">
|
| 121 |
+
<i class="fas fa-times"></i>
|
| 122 |
+
</button>
|
| 123 |
+
</div>
|
| 124 |
+
<div class="flex flex-col flex-grow overflow-y-auto">
|
| 125 |
+
<div class="px-4 py-4">
|
| 126 |
+
<button class="w-full flex items-center justify-center px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition">
|
| 127 |
+
<i class="fas fa-folder-plus mr-2"></i> New Folder
|
| 128 |
+
</button>
|
| 129 |
+
</div>
|
| 130 |
+
<nav class="flex-1 px-2 space-y-1">
|
| 131 |
+
<a href="#" class="sidebar-item active flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 132 |
+
<i class="fas fa-key mr-3 text-gray-500"></i> All Keys
|
| 133 |
+
</a>
|
| 134 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 135 |
+
<i class="fas fa-user mr-3 text-gray-500"></i> Personal
|
| 136 |
+
</a>
|
| 137 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 138 |
+
<i class="fas fa-briefcase mr-3 text-gray-500"></i> Work
|
| 139 |
+
</a>
|
| 140 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 141 |
+
<i class="fas fa-server mr-3 text-gray-500"></i> Servers
|
| 142 |
+
</a>
|
| 143 |
+
<a href="#" class="sidebar-item flex items-center px-4 py-2 text-sm font-medium text-gray-900 rounded-md">
|
| 144 |
+
<i class="fas fa-trash mr-3 text-gray-500"></i> Trash
|
| 145 |
+
</a>
|
| 146 |
+
</nav>
|
| 147 |
+
</div>
|
| 148 |
+
<div class="p-4 border-t border-gray-200">
|
| 149 |
+
<div class="flex items-center">
|
| 150 |
+
<img class="h-9 w-9 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
|
| 151 |
+
<div class="ml-3">
|
| 152 |
+
<p class="text-sm font-medium text-gray-700">John Doe</p>
|
| 153 |
+
<p class="text-xs font-medium text-gray-500">john@example.com</p>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<!-- New Key Modal -->
|
| 161 |
+
<div id="newKeyModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 162 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 163 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 164 |
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
| 165 |
+
</div>
|
| 166 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 167 |
+
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
|
| 168 |
+
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
| 169 |
+
<div class="sm:flex sm:items-start">
|
| 170 |
+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
| 171 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4">Add New PGP Key</h3>
|
| 172 |
+
<form id="newKeyForm">
|
| 173 |
+
<div class="grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
|
| 174 |
+
<div class="sm:col-span-6">
|
| 175 |
+
<label for="keyTitle" class="block text-sm font-medium text-gray-700">Title</label>
|
| 176 |
+
<input type="text" name="keyTitle" id="keyTitle" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
| 177 |
+
</div>
|
| 178 |
+
<div class="sm:col-span-3">
|
| 179 |
+
<label for="keyEmail" class="block text-sm font-medium text-gray-700">Email</label>
|
| 180 |
+
<input type="email" name="keyEmail" id="keyEmail" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
| 181 |
+
</div>
|
| 182 |
+
<div class="sm:col-span-3">
|
| 183 |
+
<label for="keyProfile" class="block text-sm font-medium text-gray-700">Site/Profile</label>
|
| 184 |
+
<input type="text" name="keyProfile" id="keyProfile" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
| 185 |
+
</div>
|
| 186 |
+
<div class="sm:col-span-6">
|
| 187 |
+
<label for="keyPassword" class="block text-sm font-medium text-gray-700">Password</label>
|
| 188 |
+
<input type="password" name="keyPassword" id="keyPassword" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
| 189 |
+
</div>
|
| 190 |
+
<div class="sm:col-span-6">
|
| 191 |
+
<label for="publicKey" class="block text-sm font-medium text-gray-700">Public Key</label>
|
| 192 |
+
<textarea id="publicKey" name="publicKey" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm font-mono text-sm"></textarea>
|
| 193 |
+
<div class="mt-1 flex justify-end">
|
| 194 |
+
<button type="button" id="generateKeyBtn" class="inline-flex items-center px-3 py-1 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
| 195 |
+
<i class="fas fa-key mr-1"></i> Generate New Key
|
| 196 |
+
</button>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="sm:col-span-6">
|
| 200 |
+
<label for="privateKey" class="block text-sm font-medium text-gray-700">Private Key</label>
|
| 201 |
+
<textarea id="privateKey" name="privateKey" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm font-mono text-sm"></textarea>
|
| 202 |
+
</div>
|
| 203 |
+
<div class="sm:col-span-6">
|
| 204 |
+
<label class="block text-sm font-medium text-gray-700">Folder</label>
|
| 205 |
+
<div class="mt-1 flex space-x-2">
|
| 206 |
+
<label class="inline-flex items-center">
|
| 207 |
+
<input type="radio" name="keyFolder" value="personal" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300" checked>
|
| 208 |
+
<span class="ml-2 text-sm text-gray-700">Personal</span>
|
| 209 |
+
</label>
|
| 210 |
+
<label class="inline-flex items-center">
|
| 211 |
+
<input type="radio" name="keyFolder" value="work" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300">
|
| 212 |
+
<span class="ml-2 text-sm text-gray-700">Work</span>
|
| 213 |
+
</label>
|
| 214 |
+
<label class="inline-flex items-center">
|
| 215 |
+
<input type="radio" name="keyFolder" value="servers" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300">
|
| 216 |
+
<span class="ml-2 text-sm text-gray-700">Servers</span>
|
| 217 |
+
</label>
|
| 218 |
+
</div>
|
| 219 |
+
</div>
|
| 220 |
+
</div>
|
| 221 |
+
</form>
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
</div>
|
| 225 |
+
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
| 226 |
+
<button type="button" id="saveKeyBtn" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
|
| 227 |
+
Save Key
|
| 228 |
+
</button>
|
| 229 |
+
<button type="button" id="cancelKeyBtn" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
| 230 |
+
Cancel
|
| 231 |
+
</button>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
</div>
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
<!-- Key Details Modal -->
|
| 238 |
+
<div id="keyDetailsModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 239 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 240 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 241 |
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
| 242 |
+
</div>
|
| 243 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 244 |
+
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
|
| 245 |
+
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
| 246 |
+
<div class="sm:flex sm:items-start">
|
| 247 |
+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
| 248 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4" id="detailsTitle">Key Details</h3>
|
| 249 |
+
<div class="grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
|
| 250 |
+
<div class="sm:col-span-6">
|
| 251 |
+
<label class="block text-sm font-medium text-gray-700">Title</label>
|
| 252 |
+
<p class="mt-1 text-sm text-gray-900" id="detailsKeyTitle">Personal Email Key</p>
|
| 253 |
+
</div>
|
| 254 |
+
<div class="sm:col-span-3">
|
| 255 |
+
<label class="block text-sm font-medium text-gray-700">Email</label>
|
| 256 |
+
<p class="mt-1 text-sm text-gray-900" id="detailsKeyEmail">john@example.com</p>
|
| 257 |
+
</div>
|
| 258 |
+
<div class="sm:col-span-3">
|
| 259 |
+
<label class="block text-sm font-medium text-gray-700">Site/Profile</label>
|
| 260 |
+
<p class="mt-1 text-sm text-gray-900" id="detailsKeyProfile">Gmail</p>
|
| 261 |
+
</div>
|
| 262 |
+
<div class="sm:col-span-6">
|
| 263 |
+
<label class="block text-sm font-medium text-gray-700">Public Key</label>
|
| 264 |
+
<div class="mt-1 p-2 bg-gray-100 rounded-md">
|
| 265 |
+
<pre class="text-xs text-gray-800 overflow-x-auto" id="detailsPublicKey">-----BEGIN PGP PUBLIC KEY BLOCK-----
|
| 266 |
+
mQINBF4wBvsBEADJvW...
|
| 267 |
+
</pre>
|
| 268 |
+
</div>
|
| 269 |
+
<div class="mt-2 flex justify-end">
|
| 270 |
+
<button type="button" id="exportPublicBtn" class="inline-flex items-center px-3 py-1 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
| 271 |
+
<i class="fas fa-download mr-1"></i> Export Public Key
|
| 272 |
+
</button>
|
| 273 |
+
</div>
|
| 274 |
+
</div>
|
| 275 |
+
<div class="sm:col-span-6">
|
| 276 |
+
<label class="block text-sm font-medium text-gray-700">Private Key</label>
|
| 277 |
+
<div class="mt-1 p-2 bg-gray-100 rounded-md">
|
| 278 |
+
<pre class="text-xs text-gray-800 overflow-x-auto" id="detailsPrivateKey">-----BEGIN PGP PRIVATE KEY BLOCK-----
|
| 279 |
+
mQINBF4wBvsBEADJvW...
|
| 280 |
+
</pre>
|
| 281 |
+
</div>
|
| 282 |
+
</div>
|
| 283 |
+
<div class="sm:col-span-6">
|
| 284 |
+
<label class="block text-sm font-medium text-gray-700">Created</label>
|
| 285 |
+
<p class="mt-1 text-sm text-gray-900" id="detailsCreatedAt">2023-05-15</p>
|
| 286 |
+
</div>
|
| 287 |
+
<div class="sm:col-span-6">
|
| 288 |
+
<label class="block text-sm font-medium text-gray-700">Last Used</label>
|
| 289 |
+
<p class="mt-1 text-sm text-gray-900" id="detailsLastUsed">2023-06-20</p>
|
| 290 |
+
</div>
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
</div>
|
| 295 |
+
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
| 296 |
+
<button type="button" id="encryptBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 mr-2">
|
| 297 |
+
<i class="fas fa-lock mr-1"></i> Encrypt
|
| 298 |
+
</button>
|
| 299 |
+
<button type="button" id="decryptBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 mr-2">
|
| 300 |
+
<i class="fas fa-unlock mr-1"></i> Decrypt
|
| 301 |
+
</button>
|
| 302 |
+
<button type="button" id="deleteKeyBtn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 mr-2">
|
| 303 |
+
<i class="fas fa-trash mr-1"></i> Delete
|
| 304 |
+
</button>
|
| 305 |
+
<button type="button" id="closeDetailsBtn" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
| 306 |
+
Close
|
| 307 |
+
</button>
|
| 308 |
+
</div>
|
| 309 |
+
</div>
|
| 310 |
+
</div>
|
| 311 |
+
</div>
|
| 312 |
+
|
| 313 |
+
<!-- Encrypt Modal -->
|
| 314 |
+
<div id="encryptModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 315 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 316 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 317 |
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
| 318 |
+
</div>
|
| 319 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 320 |
+
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
|
| 321 |
+
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
| 322 |
+
<div class="sm:flex sm:items-start">
|
| 323 |
+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
| 324 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4">Encrypt Message</h3>
|
| 325 |
+
<div class="grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
|
| 326 |
+
<div class="sm:col-span-6">
|
| 327 |
+
<label for="messageToEncrypt" class="block text-sm font-medium text-gray-700">Message to Encrypt</label>
|
| 328 |
+
<textarea id="messageToEncrypt" name="messageToEncrypt" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"></textarea>
|
| 329 |
+
</div>
|
| 330 |
+
<div class="sm:col-span-6">
|
| 331 |
+
<label for="recipientPublicKey" class="block text-sm font-medium text-gray-700">Recipient's Public Key</label>
|
| 332 |
+
<textarea id="recipientPublicKey" name="recipientPublicKey" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm font-mono text-sm"></textarea>
|
| 333 |
+
</div>
|
| 334 |
+
<div class="sm:col-span-6">
|
| 335 |
+
<label class="block text-sm font-medium text-gray-700">Encrypted Message</label>
|
| 336 |
+
<div class="mt-1 p-2 bg-gray-100 rounded-md">
|
| 337 |
+
<pre class="text-xs text-gray-800 overflow-x-auto" id="encryptedResult">Your encrypted message will appear here...</pre>
|
| 338 |
+
</div>
|
| 339 |
+
</div>
|
| 340 |
+
</div>
|
| 341 |
+
</div>
|
| 342 |
+
</div>
|
| 343 |
+
</div>
|
| 344 |
+
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
| 345 |
+
<button type="button" id="doEncryptBtn" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
|
| 346 |
+
Encrypt
|
| 347 |
+
</button>
|
| 348 |
+
<button type="button" id="cancelEncryptBtn" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
| 349 |
+
Cancel
|
| 350 |
+
</button>
|
| 351 |
+
</div>
|
| 352 |
+
</div>
|
| 353 |
+
</div>
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
+
<!-- Decrypt Modal -->
|
| 357 |
+
<div id="decryptModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 358 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 359 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 360 |
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
| 361 |
+
</div>
|
| 362 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 363 |
+
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
|
| 364 |
+
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
| 365 |
+
<div class="sm:flex sm:items-start">
|
| 366 |
+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
| 367 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4">Decrypt Message</h3>
|
| 368 |
+
<div class="grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
|
| 369 |
+
<div class="sm:col-span-6">
|
| 370 |
+
<label for="messageToDecrypt" class="block text-sm font-medium text-gray-700">Encrypted Message</label>
|
| 371 |
+
<textarea id="messageToDecrypt" name="messageToDecrypt" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm font-mono text-sm"></textarea>
|
| 372 |
+
</div>
|
| 373 |
+
<div class="sm:col-span-6">
|
| 374 |
+
<label for="decryptPrivateKey" class="block text-sm font-medium text-gray-700">Your Private Key</label>
|
| 375 |
+
<textarea id="decryptPrivateKey" name="decryptPrivateKey" rows="4" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm font-mono text-sm"></textarea>
|
| 376 |
+
</div>
|
| 377 |
+
<div class="sm:col-span-6">
|
| 378 |
+
<label for="decryptPassword" class="block text-sm font-medium text-gray-700">Password</label>
|
| 379 |
+
<input type="password" id="decryptPassword" name="decryptPassword" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
| 380 |
+
</div>
|
| 381 |
+
<div class="sm:col-span-6">
|
| 382 |
+
<label class="block text-sm font-medium text-gray-700">Decrypted Message</label>
|
| 383 |
+
<div class="mt-1 p-2 bg-gray-100 rounded-md">
|
| 384 |
+
<pre class="text-xs text-gray-800 overflow-x-auto" id="decryptedResult">Your decrypted message will appear here...</pre>
|
| 385 |
+
</div>
|
| 386 |
+
</div>
|
| 387 |
+
</div>
|
| 388 |
+
</div>
|
| 389 |
+
</div>
|
| 390 |
+
</div>
|
| 391 |
+
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
| 392 |
+
<button type="button" id="doDecryptBtn" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
|
| 393 |
+
Decrypt
|
| 394 |
+
</button>
|
| 395 |
+
<button type="button" id="cancelDecryptBtn" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
| 396 |
+
Cancel
|
| 397 |
+
</button>
|
| 398 |
+
</div>
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
</div>
|
| 402 |
+
|
| 403 |
+
<script>
|
| 404 |
+
// Sample data for keys
|
| 405 |
+
const sampleKeys = [
|
| 406 |
+
{
|
| 407 |
+
id: 1,
|
| 408 |
+
title: "Personal Email Key",
|
| 409 |
+
email: "john@example.com",
|
| 410 |
+
profile: "Gmail",
|
| 411 |
+
folder: "personal",
|
| 412 |
+
publicKey: "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nmQINBF4wBvsBEADJvW...",
|
| 413 |
+
privateKey: "-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nmQINBF4wBvsBEADJvW...",
|
| 414 |
+
createdAt: "2023-05-15",
|
| 415 |
+
lastUsed: "2023-06-20"
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
id: 2,
|
| 419 |
+
title: "Work SSH Key",
|
| 420 |
+
email: "john.doe@company.com",
|
| 421 |
+
profile: "Company Server",
|
| 422 |
+
folder: "work",
|
| 423 |
+
publicKey: "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nxQINBF4wBvsBEADJvW...",
|
| 424 |
+
privateKey: "-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nxQINBF4wBvsBEADJvW...",
|
| 425 |
+
createdAt: "2023-04-10",
|
| 426 |
+
lastUsed: "2023-06-18"
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
id: 3,
|
| 430 |
+
title: "GitHub Key",
|
| 431 |
+
email: "john@example.com",
|
| 432 |
+
profile: "GitHub",
|
| 433 |
+
folder: "personal",
|
| 434 |
+
publicKey: "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nyQINBF4wBvsBEADJvW...",
|
| 435 |
+
privateKey: "-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nyQINBF4wBvsBEADJvW...",
|
| 436 |
+
createdAt: "2023-03-22",
|
| 437 |
+
lastUsed: "2023-06-15"
|
| 438 |
+
}
|
| 439 |
+
];
|
| 440 |
+
|
| 441 |
+
// DOM elements
|
| 442 |
+
const keysContainer = document.getElementById('keysContainer');
|
| 443 |
+
const newKeyBtn = document.getElementById('newKeyBtn');
|
| 444 |
+
const newKeyModal = document.getElementById('newKeyModal');
|
| 445 |
+
const saveKeyBtn = document.getElementById('saveKeyBtn');
|
| 446 |
+
const cancelKeyBtn = document.getElementById('cancelKeyBtn');
|
| 447 |
+
const generateKeyBtn = document.getElementById('generateKeyBtn');
|
| 448 |
+
const keyDetailsModal = document.getElementById('keyDetailsModal');
|
| 449 |
+
const closeDetailsBtn = document.getElementById('closeDetailsBtn');
|
| 450 |
+
const exportPublicBtn = document.getElementById('exportPublicBtn');
|
| 451 |
+
const encryptBtn = document.getElementById('encryptBtn');
|
| 452 |
+
const decryptBtn = document.getElementById('decryptBtn');
|
| 453 |
+
const deleteKeyBtn = document.getElementById('deleteKeyBtn');
|
| 454 |
+
const encryptModal = document.getElementById('encryptModal');
|
| 455 |
+
const decryptModal = document.getElementById('decryptModal');
|
| 456 |
+
const doEncryptBtn = document.getElementById('doEncryptBtn');
|
| 457 |
+
const cancelEncryptBtn = document.getElementById('cancelEncryptBtn');
|
| 458 |
+
const doDecryptBtn = document.getElementById('doDecryptBtn');
|
| 459 |
+
const cancelDecryptBtn = document.getElementById('cancelDecryptBtn');
|
| 460 |
+
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
|
| 461 |
+
const mobileSidebar = document.getElementById('mobileSidebar');
|
| 462 |
+
const mobileSidebarBackdrop = document.getElementById('mobileSidebarBackdrop');
|
| 463 |
+
const closeMobileMenuBtn = document.getElementById('closeMobileMenuBtn');
|
| 464 |
+
|
| 465 |
+
// Current selected key
|
| 466 |
+
let currentKey = null;
|
| 467 |
+
|
| 468 |
+
// Initialize the app
|
| 469 |
+
function init() {
|
| 470 |
+
renderKeys();
|
| 471 |
+
setupEventListeners();
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
// Render all keys
|
| 475 |
+
function renderKeys() {
|
| 476 |
+
keysContainer.innerHTML = '';
|
| 477 |
+
|
| 478 |
+
sampleKeys.forEach(key => {
|
| 479 |
+
const keyCard = document.createElement('div');
|
| 480 |
+
keyCard.className = 'key-card bg-white rounded-lg shadow-md overflow-hidden transition cursor-pointer';
|
| 481 |
+
keyCard.dataset.id = key.id;
|
| 482 |
+
|
| 483 |
+
let folderColor = 'bg-blue-500';
|
| 484 |
+
if (key.folder === 'work') folderColor = 'bg-green-500';
|
| 485 |
+
if (key.folder === 'servers') folderColor = 'bg-purple-500';
|
| 486 |
+
|
| 487 |
+
keyCard.innerHTML = `
|
| 488 |
+
<div class="p-4">
|
| 489 |
+
<div class="flex items-start justify-between">
|
| 490 |
+
<div>
|
| 491 |
+
<h3 class="text-lg font-medium text-gray-900">${key.title}</h3>
|
| 492 |
+
<p class="text-sm text-gray-500 mt-1">${key.email}</p>
|
| 493 |
+
</div>
|
| 494 |
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${folderColor} text-white">
|
| 495 |
+
${key.folder.charAt(0).toUpperCase() + key.folder.slice(1)}
|
| 496 |
+
</span>
|
| 497 |
+
</div>
|
| 498 |
+
<div class="mt-4 flex items-center justify-between text-sm text-gray-500">
|
| 499 |
+
<div>
|
| 500 |
+
<p>Created: ${key.createdAt}</p>
|
| 501 |
+
<p class="mt-1">Last used: ${key.lastUsed}</p>
|
| 502 |
+
</div>
|
| 503 |
+
<i class="fas fa-chevron-right text-gray-400"></i>
|
| 504 |
+
</div>
|
| 505 |
+
</div>
|
| 506 |
+
`;
|
| 507 |
+
|
| 508 |
+
keyCard.addEventListener('click', () => showKeyDetails(key));
|
| 509 |
+
keysContainer.appendChild(keyCard);
|
| 510 |
+
});
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
// Show key details modal
|
| 514 |
+
function showKeyDetails(key) {
|
| 515 |
+
currentKey = key;
|
| 516 |
+
document.getElementById('detailsTitle').textContent = key.title;
|
| 517 |
+
document.getElementById('detailsKeyTitle').textContent = key.title;
|
| 518 |
+
document.getElementById('detailsKeyEmail').textContent = key.email;
|
| 519 |
+
document.getElementById('detailsKeyProfile').textContent = key.profile;
|
| 520 |
+
document.getElementById('detailsPublicKey').textContent = key.publicKey;
|
| 521 |
+
document.getElementById('detailsPrivateKey').textContent = key.privateKey;
|
| 522 |
+
document.getElementById('detailsCreatedAt').textContent = key.createdAt;
|
| 523 |
+
document.getElementById('detailsLastUsed').textContent = key.lastUsed;
|
| 524 |
+
|
| 525 |
+
keyDetailsModal.classList.remove('hidden');
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
// Show new key modal
|
| 529 |
+
function showNewKeyModal() {
|
| 530 |
+
document.getElementById('keyTitle').value = '';
|
| 531 |
+
document.getElementById('keyEmail').value = '';
|
| 532 |
+
document.getElementById('keyProfile').value = '';
|
| 533 |
+
document.getElementById('keyPassword').value = '';
|
| 534 |
+
document.getElementById('publicKey').value = '';
|
| 535 |
+
document.getElementById('privateKey').value = '';
|
| 536 |
+
|
| 537 |
+
newKeyModal.classList.remove('hidden');
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
// Show encrypt modal
|
| 541 |
+
function showEncryptModal() {
|
| 542 |
+
document.getElementById('messageToEncrypt').value = '';
|
| 543 |
+
document.getElementById('recipientPublicKey').value = '';
|
| 544 |
+
document.getElementById('encryptedResult').textContent = 'Your encrypted message will appear here...';
|
| 545 |
+
|
| 546 |
+
encryptModal.classList.remove('hidden');
|
| 547 |
+
keyDetailsModal.classList.add('hidden');
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
// Show decrypt modal
|
| 551 |
+
function showDecryptModal() {
|
| 552 |
+
document.getElementById('messageToDecrypt').value = '';
|
| 553 |
+
document.getElementById('decryptPrivateKey').value = currentKey.privateKey;
|
| 554 |
+
document.getElementById('decryptPassword').value = '';
|
| 555 |
+
document.getElementById('decryptedResult').textContent = 'Your decrypted message will appear here...';
|
| 556 |
+
|
| 557 |
+
decryptModal.classList.remove('hidden');
|
| 558 |
+
keyDetailsModal.classList.add('hidden');
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
// Setup event listeners
|
| 562 |
+
function setupEventListeners() {
|
| 563 |
+
// New key button
|
| 564 |
+
newKeyBtn.addEventListener('click', showNewKeyModal);
|
| 565 |
+
|
| 566 |
+
// Save key button
|
| 567 |
+
saveKeyBtn.addEventListener('click', () => {
|
| 568 |
+
// In a real app, this would save to the backend
|
| 569 |
+
alert('Key saved successfully!');
|
| 570 |
+
newKeyModal.classList.add('hidden');
|
| 571 |
+
renderKeys();
|
| 572 |
+
});
|
| 573 |
+
|
| 574 |
+
// Cancel key button
|
| 575 |
+
cancelKeyBtn.addEventListener('click', () => {
|
| 576 |
+
newKeyModal.classList.add('hidden');
|
| 577 |
+
});
|
| 578 |
+
|
| 579 |
+
// Generate key button
|
| 580 |
+
generateKeyBtn.addEventListener('click', () => {
|
| 581 |
+
// In a real app, this would generate a PGP key pair
|
| 582 |
+
document.getElementById('publicKey').value = "-----BEGIN PGP PUBLIC KEY BLOCK-----\nGenerated public key would appear here...";
|
| 583 |
+
document.getElementById('privateKey').value = "-----BEGIN PGP PRIVATE KEY BLOCK-----\nGenerated private key would appear here...";
|
| 584 |
+
});
|
| 585 |
+
|
| 586 |
+
// Close details button
|
| 587 |
+
closeDetailsBtn.addEventListener('click', () => {
|
| 588 |
+
keyDetailsModal.classList.add('hidden');
|
| 589 |
+
});
|
| 590 |
+
|
| 591 |
+
// Export public key button
|
| 592 |
+
exportPublicBtn.addEventListener('click', () => {
|
| 593 |
+
// In a real app, this would download the public key
|
| 594 |
+
alert('Public key exported successfully!');
|
| 595 |
+
});
|
| 596 |
+
|
| 597 |
+
// Encrypt button
|
| 598 |
+
encryptBtn.addEventListener('click', showEncryptModal);
|
| 599 |
+
|
| 600 |
+
// Decrypt button
|
| 601 |
+
decryptBtn.addEventListener('click', showDecryptModal);
|
| 602 |
+
|
| 603 |
+
// Delete key button
|
| 604 |
+
deleteKeyBtn.addEventListener('click', () => {
|
| 605 |
+
if (confirm('Are you sure you want to delete this key?')) {
|
| 606 |
+
// In a real app, this would delete from the backend
|
| 607 |
+
alert('Key deleted successfully!');
|
| 608 |
+
keyDetailsModal.classList.add('hidden');
|
| 609 |
+
renderKeys();
|
| 610 |
+
}
|
| 611 |
+
});
|
| 612 |
+
|
| 613 |
+
// Do encrypt button
|
| 614 |
+
doEncryptBtn.addEventListener('click', () => {
|
| 615 |
+
// In a real app, this would encrypt the message
|
| 616 |
+
const message = document.getElementById('messageToEncrypt').value;
|
| 617 |
+
if (message) {
|
| 618 |
+
document.getElementById('encryptedResult').textContent = `-----BEGIN PGP MESSAGE-----\nEncrypted version of: "${message}"\n-----END PGP MESSAGE-----`;
|
| 619 |
+
}
|
| 620 |
+
});
|
| 621 |
+
|
| 622 |
+
// Cancel encrypt button
|
| 623 |
+
cancelEncryptBtn.addEventListener('click', () => {
|
| 624 |
+
encryptModal.classList.add('hidden');
|
| 625 |
+
keyDetailsModal.classList.remove('hidden');
|
| 626 |
+
});
|
| 627 |
+
|
| 628 |
+
// Do decrypt button
|
| 629 |
+
doDecryptBtn.addEventListener('click', () => {
|
| 630 |
+
// In a real app, this would decrypt the message
|
| 631 |
+
const message = document.getElementById('messageToDecrypt').value;
|
| 632 |
+
if (message) {
|
| 633 |
+
document.getElementById('decryptedResult').textContent = `Decrypted message would appear here (original: "${message}")`;
|
| 634 |
+
}
|
| 635 |
+
});
|
| 636 |
+
|
| 637 |
+
// Cancel decrypt button
|
| 638 |
+
cancelDecryptBtn.addEventListener('click', () => {
|
| 639 |
+
decryptModal.classList.add('hidden');
|
| 640 |
+
keyDetailsModal.classList.remove('hidden');
|
| 641 |
+
});
|
| 642 |
+
|
| 643 |
+
// Mobile menu button
|
| 644 |
+
mobileMenuBtn.addEventListener('click', () => {
|
| 645 |
+
mobileSidebar.classList.remove('hidden');
|
| 646 |
+
});
|
| 647 |
+
|
| 648 |
+
// Close mobile menu button
|
| 649 |
+
closeMobileMenuBtn.addEventListener('click', () => {
|
| 650 |
+
mobileSidebar.classList.add('hidden');
|
| 651 |
+
});
|
| 652 |
+
|
| 653 |
+
// Mobile sidebar backdrop
|
| 654 |
+
mobileSidebarBackdrop.addEventListener('click', () => {
|
| 655 |
+
mobileSidebar.classList.add('hidden');
|
| 656 |
+
});
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
// Initialize the app when DOM is loaded
|
| 660 |
+
document.addEventListener('DOMContentLoaded', init);
|
| 661 |
+
</script>
|
| 662 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=hharris928/key-manager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 663 |
+
</html>
|