Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,35 +1,28 @@
|
|
1 |
import streamlit as st
|
2 |
-
from diagrams import
|
3 |
-
from diagrams.azure.
|
4 |
-
from diagrams.azure.integration import APIManagement
|
5 |
-
from diagrams.onprem.container import Docker
|
6 |
-
#from diagrams.onprem.database import Snowflake
|
7 |
-
from diagrams.programming.framework import FastAPI
|
8 |
-
from diagrams.custom import Custom
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
with Diagram("Architecture Diagram", show=False):
|
13 |
-
with Cluster("Azure"):
|
14 |
-
container_registry = ContainerInstances("Azure Container Registry")
|
15 |
-
container_registry_api = APIManagement("ACR API")
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
slimbuster = Custom("Slim Buster", "./slimbuster.png")
|
20 |
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
container_registry_api >> docker
|
29 |
-
python >> snowflake
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
st.image(diagram, caption="Architecture Diagram", use_column_width=True)
|
|
|
1 |
import streamlit as st
|
2 |
+
from diagrams import Diagram, Cluster
|
3 |
+
from diagrams.azure.network import VirtualNetwork, LoadBalancer, TrafficManager
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
def main():
|
6 |
+
st.set_page_config(page_title="Azure Network Diagram Demo")
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
with st.sidebar:
|
9 |
+
st.title("Azure Network Diagram Demo")
|
|
|
10 |
|
11 |
+
with st.container():
|
12 |
+
st.header("Azure Network Diagram")
|
13 |
|
14 |
+
with Diagram("Azure Network Diagram", show=False):
|
15 |
+
with Cluster("Azure"):
|
16 |
+
vn = VirtualNetwork("Virtual Network")
|
17 |
+
lb = LoadBalancer("Load Balancer")
|
18 |
+
tm = TrafficManager("Traffic Manager")
|
19 |
|
20 |
+
vn >> lb >> tm
|
|
|
|
|
21 |
|
22 |
+
st.markdown("#### Legend")
|
23 |
+
st.markdown("- Virtual Network: A virtual network to isolate your Azure resources.")
|
24 |
+
st.markdown("- Load Balancer: A traffic distribution tool for Azure resources.")
|
25 |
+
st.markdown("- Traffic Manager: A DNS-based traffic routing service.")
|
26 |
|
27 |
+
if __name__ == '__main__':
|
28 |
+
main()
|
|