feat: always show Recreate Tunnel button for web instances
Show the Recreate Tunnel button on all active web-enabled session cards (instead of only when tunnel_status is unreachable) so users can manually trigger tunnel recreation at any time. Also adds it to the mobile action sheet. Quality gates: eslint clean, tsc clean
This commit is contained in:
@@ -1723,15 +1723,23 @@ async def start_instance(
|
|||||||
logger.debug("Container ID for instance %s: %s", instance.id, container_id)
|
logger.debug("Container ID for instance %s: %s", instance.id, container_id)
|
||||||
|
|
||||||
instance.container_name = expected_container_name
|
instance.container_name = expected_container_name
|
||||||
logger.debug("Container name for instance %s: %s", instance.id, expected_container_name)
|
logger.debug(
|
||||||
|
"Container name for instance %s: %s", instance.id, expected_container_name
|
||||||
|
)
|
||||||
|
|
||||||
# Connect container to backend network so API can reach it
|
# Connect container to backend network so API can reach it
|
||||||
logger.debug("Connecting container %s to backend network...", expected_container_name)
|
logger.debug(
|
||||||
|
"Connecting container %s to backend network...", expected_container_name
|
||||||
|
)
|
||||||
connected = connect_container_to_network(expected_container_name, "backend")
|
connected = connect_container_to_network(expected_container_name, "backend")
|
||||||
if connected:
|
if connected:
|
||||||
logger.debug("Successfully connected %s to backend network", expected_container_name)
|
logger.debug(
|
||||||
|
"Successfully connected %s to backend network", expected_container_name
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
logger.warning("Failed to connect %s to backend network", expected_container_name)
|
logger.warning(
|
||||||
|
"Failed to connect %s to backend network", expected_container_name
|
||||||
|
)
|
||||||
|
|
||||||
# Verify container reached running state
|
# Verify container reached running state
|
||||||
if instance.container_id:
|
if instance.container_id:
|
||||||
|
|||||||
@@ -229,12 +229,13 @@ export function SessionCard({
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{hasTunnelError && onRecreateTunnel && (
|
{!isTerminalOnly && onRecreateTunnel && (
|
||||||
<button
|
<button
|
||||||
className="secondary-button small"
|
className="ghost-button small"
|
||||||
onClick={() => onRecreateTunnel(session)}
|
onClick={() => onRecreateTunnel(session)}
|
||||||
type="button"
|
type="button"
|
||||||
disabled={isBusy}
|
disabled={isBusy}
|
||||||
|
title="Recreate Cloudflare tunnel"
|
||||||
>
|
>
|
||||||
<Icon name="refresh" size="sm" />
|
<Icon name="refresh" size="sm" />
|
||||||
<span className="action-label">Tunnel</span>
|
<span className="action-label">Tunnel</span>
|
||||||
@@ -323,7 +324,7 @@ export function SessionCard({
|
|||||||
onClose={() => setShowActionSheet(false)}
|
onClose={() => setShowActionSheet(false)}
|
||||||
title={session.display_name}
|
title={session.display_name}
|
||||||
actions={[
|
actions={[
|
||||||
...(isActive && hasTunnelError && onRecreateTunnel
|
...(isActive && !isTerminalOnly && onRecreateTunnel
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
id: "tunnel",
|
id: "tunnel",
|
||||||
@@ -332,7 +333,7 @@ export function SessionCard({
|
|||||||
onClick: () => onRecreateTunnel(session),
|
onClick: () => onRecreateTunnel(session),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
...(isActive && onStop
|
...(isActive && onStop
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user