Commit fc19aae4 authored by Your Name's avatar Your Name

Add 'Create Persistent' button to TOR settings

- Add button to easily create persistent hidden service directory
- Automatically fills in default path (~/.aisbf/tor_hidden_service)
- Includes confirmation dialog if path already exists
- Visual feedback on button click
parent 6baea83b
......@@ -174,8 +174,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<div class="form-group">
<label for="tor_hidden_service_dir">Hidden Service Directory</label>
<input type="text" id="tor_hidden_service_dir" name="tor_hidden_service_dir" value="{{ config.tor.hidden_service_dir if config.tor and config.tor.hidden_service_dir else '' }}" placeholder="Leave blank for ephemeral service">
<small style="color: #666; display: block; margin-top: 5px;">Directory for persistent hidden service. Leave blank for ephemeral (temporary) service.</small>
<div style="display: flex; gap: 10px; align-items: flex-start;">
<input type="text" id="tor_hidden_service_dir" name="tor_hidden_service_dir" value="{{ config.tor.hidden_service_dir if config.tor and config.tor.hidden_service_dir else '' }}" placeholder="Leave blank for ephemeral service" style="flex: 1;">
<button type="button" onclick="createPersistentService()" class="btn btn-secondary" style="white-space: nowrap;">Create Persistent</button>
</div>
<small style="color: #666; display: block; margin-top: 5px;">Directory for persistent hidden service. Leave blank for ephemeral (temporary) service. Click "Create Persistent" to use default directory.</small>
</div>
<div class="form-group">
......@@ -226,6 +229,26 @@ function toggleTorFields() {
}
}
function createPersistentService() {
const dirInput = document.getElementById('tor_hidden_service_dir');
const defaultDir = '~/.aisbf/tor_hidden_service';
if (dirInput.value && dirInput.value.trim() !== '') {
if (!confirm('This will replace the current directory path. Continue?')) {
return;
}
}
dirInput.value = defaultDir;
dirInput.focus();
// Visual feedback
dirInput.style.backgroundColor = '#1a4d2e';
setTimeout(() => {
dirInput.style.backgroundColor = '';
}, 500);
}
async function checkTorStatus() {
try {
const response = await fetch('{{ url_for(request, "/dashboard/tor/status") }}');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment