Spaces:
Runtime error
Runtime error
elfsong
commited on
Commit
ยท
beb88e6
1
Parent(s):
3870cca
update
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def get_status(credentials):
|
|
| 16 |
status = False
|
| 17 |
client = googleapiclient.discovery.build('compute', 'v1', credentials=credentials)
|
| 18 |
|
| 19 |
-
result = client.instances().list(project='nus-cisco-corp-lab-wp1', zone='asia-southeast1-
|
| 20 |
for item in result['items']:
|
| 21 |
if item["name"] == "venus":
|
| 22 |
status = True if item["status"] == "RUNNING" else False
|
|
@@ -29,8 +29,7 @@ def activate_server():
|
|
| 29 |
st.title("Lucky Reactor")
|
| 30 |
|
| 31 |
credentials = auth()
|
| 32 |
-
status =
|
| 33 |
-
st.markdown("credentials: " + credentials)
|
| 34 |
|
| 35 |
st.image("cover.jpg", caption="Reactor is currently " + "running ๐" if status else "sleeping ๐ด" + ".")
|
| 36 |
|
|
|
|
| 16 |
status = False
|
| 17 |
client = googleapiclient.discovery.build('compute', 'v1', credentials=credentials)
|
| 18 |
|
| 19 |
+
result = client.instances().list(project='nus-cisco-corp-lab-wp1', zone='asia-southeast1-b').execute()
|
| 20 |
for item in result['items']:
|
| 21 |
if item["name"] == "venus":
|
| 22 |
status = True if item["status"] == "RUNNING" else False
|
|
|
|
| 29 |
st.title("Lucky Reactor")
|
| 30 |
|
| 31 |
credentials = auth()
|
| 32 |
+
status = get_status(credentials)
|
|
|
|
| 33 |
|
| 34 |
st.image("cover.jpg", caption="Reactor is currently " + "running ๐" if status else "sleeping ๐ด" + ".")
|
| 35 |
|