feat: add Tor rotate button to all services, not just archipelago
Every enabled Tor service now shows a Rotate button that instantly creates a new .onion address and decommissions the old one. Previously only the main 'archipelago' service had this button. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
01f81a1912
commit
2e753c8d70
@ -354,12 +354,12 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-2 shrink-0">
|
||||
<button
|
||||
v-if="svc.name === 'archipelago'"
|
||||
@click="rotateNodeAddress"
|
||||
:disabled="torRotating"
|
||||
v-if="svc.onion_address && svc.enabled"
|
||||
@click="rotateService(svc.name)"
|
||||
:disabled="torRotating === svc.name"
|
||||
class="glass-button px-3 py-1.5 rounded-lg text-xs"
|
||||
>
|
||||
{{ torRotating ? 'Rotating...' : 'Rotate' }}
|
||||
{{ torRotating === svc.name ? 'Rotating...' : 'Rotate' }}
|
||||
</button>
|
||||
<label class="tor-toggle-label">
|
||||
<input
|
||||
@ -809,7 +809,7 @@ async function loadTorServices() {
|
||||
}
|
||||
}
|
||||
|
||||
const torRotating = ref(false)
|
||||
const torRotating = ref<string | false>(false)
|
||||
|
||||
function copyTorAddress(address: string) {
|
||||
navigator.clipboard.writeText(address)
|
||||
@ -826,10 +826,10 @@ async function toggleTorApp(appId: string, enabled: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
async function rotateNodeAddress() {
|
||||
torRotating.value = true
|
||||
async function rotateService(name: string) {
|
||||
torRotating.value = name
|
||||
try {
|
||||
await rpcClient.call({ method: 'tor.rotate-service', params: { name: 'archipelago' } })
|
||||
await rpcClient.call({ method: 'tor.rotate-service', params: { name } })
|
||||
await loadTorServices()
|
||||
} catch (e) {
|
||||
if (import.meta.env.DEV) console.warn('Failed to rotate Tor address:', e)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user