Hide iFrame cards for http links when connecting to Home Assistant outside of local network

Hi. I’ve set up a webpage/iframe card that links to Grafana (Grafana is running on a different server on my local network). When connecting to Home Assistant outside the local network you get an error message saying that http links can’t be served over https connection. I only want the graphs to appear when connecting to the local network. Is there a way to hide the card so this error doesn’t show for my users when connecting externally?