slakwik commited on
Commit
d2b9004
·
verified ·
1 Parent(s): 81818c0

Upload streamlit_app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. streamlit_app.py +4 -6
streamlit_app.py CHANGED
@@ -74,20 +74,18 @@ with st.sidebar:
74
  index=0
75
  )
76
 
77
- # Zabbix API Configuration
78
  with st.expander("Zabbix API Settings", expanded=True):
79
- zabbix_url = st.text_input("Zabbix API URL", value=ZABBIX_API_URL)
80
-
81
  if auth_method == "Username/Password":
82
  zabbix_user = st.text_input("Username", value="Admin")
83
  zabbix_password = st.text_input("Password", type="password")
84
  else:
85
  zabbix_token = st.text_input("API Token", type="password")
86
 
87
- if st.button("Connect to Zabbix"):
88
  with st.spinner("Connecting to Zabbix..."):
89
  try:
90
- zabbix = ZabbixAPI(zabbix_url)
91
 
92
  if auth_method == "Username/Password":
93
  auth_token = zabbix.authenticate(zabbix_user, zabbix_password)
@@ -112,7 +110,7 @@ with st.sidebar:
112
  with st.expander("Event Filters", expanded=True):
113
  if st.session_state.zabbix_auth_token:
114
  # Get host groups
115
- zabbix = ZabbixAPI(zabbix_url)
116
  host_groups = zabbix.get_host_groups(st.session_state.zabbix_auth_token)
117
  selected_group = st.selectbox("Host Group", [""] + [g['name'] for g in host_groups])
118
 
 
74
  index=0
75
  )
76
 
77
+ # Zabbix API Configuration - simplified to just connect button
78
  with st.expander("Zabbix API Settings", expanded=True):
 
 
79
  if auth_method == "Username/Password":
80
  zabbix_user = st.text_input("Username", value="Admin")
81
  zabbix_password = st.text_input("Password", type="password")
82
  else:
83
  zabbix_token = st.text_input("API Token", type="password")
84
 
85
+ if st.button("Подключиться"):
86
  with st.spinner("Connecting to Zabbix..."):
87
  try:
88
+ zabbix = ZabbixAPI(ZABBIX_API_URL)
89
 
90
  if auth_method == "Username/Password":
91
  auth_token = zabbix.authenticate(zabbix_user, zabbix_password)
 
110
  with st.expander("Event Filters", expanded=True):
111
  if st.session_state.zabbix_auth_token:
112
  # Get host groups
113
+ zabbix = ZabbixAPI(ZABBIX_API_URL)
114
  host_groups = zabbix.get_host_groups(st.session_state.zabbix_auth_token)
115
  selected_group = st.selectbox("Host Group", [""] + [g['name'] for g in host_groups])
116