Skip to content

CNFeffery/dash-offline-detect-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dash-offline-detect-plugin

GitHub PyPI Ruff

English | 简体中文

Offline detect plugin for Dash applications using Dash Hooks.

Installation

pip install dash-offline-detect-plugin

Usage

from dash import Dash

# Import the offline detect plugin
from dash_offline_detect_plugin import setup_offline_detect_plugin

# Enable the offline detect plugin for the current app
setup_offline_detect_plugin()

app = Dash(__name__)

# Rest of your app code...

Example

Run the included example:

python example.py

API Reference

setup_offline_detect_plugin()

This function enables the offline detection feature for your Dash application.

Parameter Type Default Description
interval int 5000 Interval of detection in browser (milliseconds). Controls how frequently the browser checks if the backend service is available.
title str "Service Unavailable" Title of the overlay displayed when the service is unavailable.
description str "Unable to connect to the backend service, trying to reconnect..." Description text displayed in the overlay when the service is unavailable.

About

A plugin to offer offline detect for Dash applications using Dash Hooks.

Topics

Resources

License

Stars

Watchers

Forks

Languages