LoRaWAN is a connectionless technology. It’s also one that doesn’t necessarily guarantee that messages are transferred successfully. But if you knew that and meant to ask how you can get that online/offline status from Chirpstack, that is a good question.
You can get the “last seen” time from the DeviceService gRPC, but this specific status seems to be not exposed for devices. If that’s right, you could still make use of the “last seen” time to determine whether the device has been sending data, reasonably recently.
The dashboard status is simplistic and based on the expected payload interval that you have configured. You would probably be better off building your own logic based on your application to determine when a device has gone out of service.