Spaces:
Sleeping
Sleeping
Update BestYet2.app.py
Browse files- BestYet2.app.py +211 -53
BestYet2.app.py
CHANGED
|
@@ -11,6 +11,64 @@ CLIENT_SECRET_KEY = os.getenv('CLIENT_SECRET_KEY')
|
|
| 11 |
AUTHORITY_URL = 'https://login.microsoftonline.com/common'
|
| 12 |
REDIRECT_URI = 'https://huggingface.co/spaces/awacke1/MSGraphAPI'
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Define product to scope mapping, links, AI capabilities, and Graph solutions
|
| 15 |
PRODUCT_SCOPES = {
|
| 16 |
"π§ Outlook": {
|
|
@@ -29,7 +87,7 @@ PRODUCT_SCOPES = {
|
|
| 29 |
'scopes': ['Tasks.ReadWrite'],
|
| 30 |
'link': 'https://to-do.office.com/tasks/',
|
| 31 |
'ai_capabilities': "π€π Task prioritization",
|
| 32 |
-
'graph_solution': "β
Task management
|
| 33 |
},
|
| 34 |
"ποΈ OneDrive": {
|
| 35 |
'scopes': ['Files.ReadWrite.All'],
|
|
@@ -37,6 +95,48 @@ PRODUCT_SCOPES = {
|
|
| 37 |
'ai_capabilities': "π€π Smart file organization",
|
| 38 |
'graph_solution': "π File & folder API"
|
| 39 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
"π OneNote": {
|
| 41 |
'scopes': ['Notes.Read', 'Notes.Create'],
|
| 42 |
'link': 'https://www.onenote.com/notebooks',
|
|
@@ -55,18 +155,6 @@ PRODUCT_SCOPES = {
|
|
| 55 |
'ai_capabilities': "π€βοΈ Smart drafting & editing",
|
| 56 |
'graph_solution': "π Document content API"
|
| 57 |
},
|
| 58 |
-
"ποΈ SharePoint": {
|
| 59 |
-
'scopes': ['Sites.Read.All', 'Sites.ReadWrite.All'],
|
| 60 |
-
'link': 'https://www.microsoft.com/microsoft-365/sharepoint/collaboration',
|
| 61 |
-
'ai_capabilities': "π€π Smart search & tagging",
|
| 62 |
-
'graph_solution': "π Sites & lists API"
|
| 63 |
-
},
|
| 64 |
-
"π
Teams": {
|
| 65 |
-
'scopes': ['Team.ReadBasic.All', 'Channel.ReadBasic.All'],
|
| 66 |
-
'link': 'https://teams.microsoft.com/',
|
| 67 |
-
'ai_capabilities': "π€π¬ Meeting insights & summaries",
|
| 68 |
-
'graph_solution': "π₯ Teams & chats API"
|
| 69 |
-
},
|
| 70 |
"π¬ Viva": {
|
| 71 |
'scopes': ['Analytics.Read'],
|
| 72 |
'link': 'https://www.microsoft.com/microsoft-viva',
|
|
@@ -79,48 +167,12 @@ PRODUCT_SCOPES = {
|
|
| 79 |
'ai_capabilities': "π€βοΈ AI-powered automation",
|
| 80 |
'graph_solution': "π§ Workflow & app API"
|
| 81 |
},
|
| 82 |
-
"π§ Copilot": {
|
| 83 |
-
'scopes': ['Cognitive.Read'],
|
| 84 |
-
'link': 'https://www.microsoft.com/microsoft-365/copilot',
|
| 85 |
-
'ai_capabilities': "π€π Cross-app AI assistance",
|
| 86 |
-
'graph_solution': "π§ AI integration API"
|
| 87 |
-
},
|
| 88 |
"π‘ PowerPoint": {
|
| 89 |
'scopes': ['Files.ReadWrite.All'],
|
| 90 |
'link': 'https://www.office.com/launch/powerpoint',
|
| 91 |
'ai_capabilities': "π€π¨ Design & coaching AI",
|
| 92 |
'graph_solution': "π Presentation API"
|
| 93 |
},
|
| 94 |
-
"π Microsoft Bookings": {
|
| 95 |
-
'scopes': ['Bookings.Read.All', 'Bookings.ReadWrite.All'],
|
| 96 |
-
'link': 'https://outlook.office.com/bookings/',
|
| 97 |
-
'ai_capabilities': "π€π
Smart scheduling",
|
| 98 |
-
'graph_solution': "π Booking services API"
|
| 99 |
-
},
|
| 100 |
-
"π Loop": {
|
| 101 |
-
'scopes': ['Files.ReadWrite.All'],
|
| 102 |
-
'link': 'https://loop.microsoft.com/',
|
| 103 |
-
'ai_capabilities': "π€π Real-time collaboration AI",
|
| 104 |
-
'graph_solution': "π Workspace API"
|
| 105 |
-
},
|
| 106 |
-
"π£οΈ Translator": {
|
| 107 |
-
'scopes': ['Translation.Read'],
|
| 108 |
-
'link': 'https://www.microsoft.com/translator/',
|
| 109 |
-
'ai_capabilities': "π€π Real-time translation",
|
| 110 |
-
'graph_solution': "π¨οΈ Translation services API"
|
| 111 |
-
},
|
| 112 |
-
"π To Do & Planner": {
|
| 113 |
-
'scopes': ['Tasks.ReadWrite'],
|
| 114 |
-
'link': 'https://todo.microsoft.com/',
|
| 115 |
-
'ai_capabilities': "π€π Smart task management",
|
| 116 |
-
'graph_solution': "β
Task & plan API"
|
| 117 |
-
},
|
| 118 |
-
"π Azure OpenAI Service": {
|
| 119 |
-
'scopes': ['AzureAIServices.ReadWrite.All'],
|
| 120 |
-
'link': 'https://azure.microsoft.com/products/cognitive-services/openai-service/',
|
| 121 |
-
'ai_capabilities': "π€π§ Custom AI model access",
|
| 122 |
-
'graph_solution': "π AI model integration API"
|
| 123 |
-
}
|
| 124 |
}
|
| 125 |
|
| 126 |
BASE_SCOPES = ['User.Read']
|
|
@@ -264,13 +316,16 @@ def handle_calendar_integration(access_token):
|
|
| 264 |
day_placeholders[day].write(f"{start_date.strftime('%H:%M')} - {event['subject']}")
|
| 265 |
else:
|
| 266 |
st.write("No events found or unable to fetch events.")
|
|
|
|
|
|
|
|
|
|
| 267 |
|
| 268 |
-
# Create event
|
| 269 |
-
st.write("Add
|
| 270 |
event_subject = st.text_input("Event Subject")
|
| 271 |
event_date = st.date_input("Event Date")
|
| 272 |
event_time = st.time_input("Event Time")
|
| 273 |
-
if st.button("Add Event"):
|
| 274 |
event_start = datetime.combine(event_date, event_time)
|
| 275 |
event_end = event_start + timedelta(hours=1)
|
| 276 |
new_event = {
|
|
@@ -430,12 +485,79 @@ def handle_onedrive_integration(access_token):
|
|
| 430 |
else:
|
| 431 |
st.error("Failed to delete file.")
|
| 432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
def main():
|
| 437 |
st.title("π¦ MS Graph API with AI & Cloud Integration for M365")
|
| 438 |
|
|
|
|
|
|
|
|
|
|
| 439 |
st.sidebar.title("π M365 Products")
|
| 440 |
st.sidebar.write("Select products to integrate:")
|
| 441 |
|
|
@@ -475,6 +597,15 @@ def main():
|
|
| 475 |
except Exception as e:
|
| 476 |
st.error(f"Error acquiring access token: {str(e)}")
|
| 477 |
st.stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
else:
|
| 479 |
access_token = st.session_state['access_token']
|
| 480 |
|
|
@@ -492,9 +623,36 @@ def main():
|
|
| 492 |
handle_tasks_integration(access_token)
|
| 493 |
elif product == "ποΈ OneDrive":
|
| 494 |
handle_onedrive_integration(access_token)
|
| 495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
else:
|
| 497 |
st.write("No products selected. Please select products from the sidebar.")
|
|
|
|
| 498 |
|
| 499 |
if __name__ == "__main__":
|
| 500 |
main()
|
|
|
|
| 11 |
AUTHORITY_URL = 'https://login.microsoftonline.com/common'
|
| 12 |
REDIRECT_URI = 'https://huggingface.co/spaces/awacke1/MSGraphAPI'
|
| 13 |
|
| 14 |
+
# 1. Configuration
|
| 15 |
+
Site_Name = 'π Event π
Schedule and πAgenda πDashboard'
|
| 16 |
+
title="π Event π
Schedule and πAgenda πDashboard"
|
| 17 |
+
helpURL='https://huggingface.co/awacke1'
|
| 18 |
+
bugURL='https://huggingface.co/spaces/awacke1'
|
| 19 |
+
icons='π
'
|
| 20 |
+
#icons = Image.open("icons.ico")
|
| 21 |
+
st.set_page_config(
|
| 22 |
+
page_title=title,
|
| 23 |
+
page_icon=icons,
|
| 24 |
+
layout="wide",
|
| 25 |
+
#initial_sidebar_state="expanded",
|
| 26 |
+
initial_sidebar_state="auto",
|
| 27 |
+
menu_items={
|
| 28 |
+
'Get Help': helpURL,
|
| 29 |
+
'Report a bug': bugURL,
|
| 30 |
+
'About': title
|
| 31 |
+
}
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# Sticky navigation menu
|
| 35 |
+
def sticky_menu():
|
| 36 |
+
st.markdown(
|
| 37 |
+
"""
|
| 38 |
+
<style>
|
| 39 |
+
.menu-bar {
|
| 40 |
+
position: -webkit-sticky;
|
| 41 |
+
position: sticky;
|
| 42 |
+
top: 0;
|
| 43 |
+
background-color: white;
|
| 44 |
+
z-index: 999;
|
| 45 |
+
padding: 10px;
|
| 46 |
+
border-bottom: 1px solid #f0f0f0;
|
| 47 |
+
}
|
| 48 |
+
.menu-bar a {
|
| 49 |
+
margin: 0 10px;
|
| 50 |
+
padding: 5px;
|
| 51 |
+
text-decoration: none;
|
| 52 |
+
color: #000;
|
| 53 |
+
}
|
| 54 |
+
.menu-bar a:hover {
|
| 55 |
+
background-color: #f0f0f0;
|
| 56 |
+
}
|
| 57 |
+
</style>
|
| 58 |
+
<div class="menu-bar">
|
| 59 |
+
<a href="#dashboard">1οΈβ£ Dashboard</a>
|
| 60 |
+
<a href="#landing-page">π Landing Page</a>
|
| 61 |
+
<a href="#upcoming-events">π
Upcoming Events</a>
|
| 62 |
+
<a href="#schedule">π Schedule</a>
|
| 63 |
+
<a href="#agenda">π Agenda</a>
|
| 64 |
+
<a href="#event-details">π Event Details</a>
|
| 65 |
+
<a href="#add-event">β Add Event</a>
|
| 66 |
+
<a href="#filter-by">π Filter By</a>
|
| 67 |
+
</div>
|
| 68 |
+
""",
|
| 69 |
+
unsafe_allow_html=True
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
# Define product to scope mapping, links, AI capabilities, and Graph solutions
|
| 73 |
PRODUCT_SCOPES = {
|
| 74 |
"π§ Outlook": {
|
|
|
|
| 87 |
'scopes': ['Tasks.ReadWrite'],
|
| 88 |
'link': 'https://to-do.office.com/tasks/',
|
| 89 |
'ai_capabilities': "π€π Task prioritization",
|
| 90 |
+
'graph_solution': "β
Task & plan management"
|
| 91 |
},
|
| 92 |
"ποΈ OneDrive": {
|
| 93 |
'scopes': ['Files.ReadWrite.All'],
|
|
|
|
| 95 |
'ai_capabilities': "π€π Smart file organization",
|
| 96 |
'graph_solution': "π File & folder API"
|
| 97 |
},
|
| 98 |
+
"ποΈ SharePoint": {
|
| 99 |
+
'scopes': ['Sites.Read.All', 'Sites.ReadWrite.All'],
|
| 100 |
+
'link': 'https://www.microsoft.com/microsoft-365/sharepoint/collaboration',
|
| 101 |
+
'ai_capabilities': "π€π Smart search & tagging",
|
| 102 |
+
'graph_solution': "π Sites & lists API"
|
| 103 |
+
},
|
| 104 |
+
"π
Teams": {
|
| 105 |
+
'scopes': ['Team.ReadBasic.All', 'Channel.ReadBasic.All'],
|
| 106 |
+
'link': 'https://teams.microsoft.com/',
|
| 107 |
+
'ai_capabilities': "π€π¬ Meeting insights & summaries",
|
| 108 |
+
'graph_solution': "π₯ Teams & chats API"
|
| 109 |
+
},
|
| 110 |
+
"π Microsoft Bookings": {
|
| 111 |
+
'scopes': ['Bookings.Read.All', 'Bookings.ReadWrite.All'],
|
| 112 |
+
'link': 'https://outlook.office.com/bookings/',
|
| 113 |
+
'ai_capabilities': "π€π
Smart scheduling",
|
| 114 |
+
'graph_solution': "π Booking services API"
|
| 115 |
+
},
|
| 116 |
+
"π£οΈ Translator": {
|
| 117 |
+
'scopes': ['Translation.Read'],
|
| 118 |
+
'link': 'https://www.microsoft.com/translator/',
|
| 119 |
+
'ai_capabilities': "π€π Real-time translation",
|
| 120 |
+
'graph_solution': "π¨οΈ Translation services API"
|
| 121 |
+
},
|
| 122 |
+
"π Loop": {
|
| 123 |
+
'scopes': ['Files.ReadWrite.All'],
|
| 124 |
+
'link': 'https://loop.microsoft.com/',
|
| 125 |
+
'ai_capabilities': "π€π Real-time collaboration AI",
|
| 126 |
+
'graph_solution': "π Workspace API"
|
| 127 |
+
},
|
| 128 |
+
"π Azure OpenAI Service": {
|
| 129 |
+
'scopes': ['AzureAIServices.ReadWrite.All'],
|
| 130 |
+
'link': 'https://azure.microsoft.com/products/cognitive-services/openai-service/',
|
| 131 |
+
'ai_capabilities': "π€π§ Custom AI model access",
|
| 132 |
+
'graph_solution': "π AI model integration API"
|
| 133 |
+
},
|
| 134 |
+
"π§ Copilot": {
|
| 135 |
+
'scopes': ['Cognitive.Read'],
|
| 136 |
+
'link': 'https://www.microsoft.com/microsoft-365/copilot',
|
| 137 |
+
'ai_capabilities': "π€π Cross-app AI assistance",
|
| 138 |
+
'graph_solution': "π§ AI integration API"
|
| 139 |
+
},
|
| 140 |
"π OneNote": {
|
| 141 |
'scopes': ['Notes.Read', 'Notes.Create'],
|
| 142 |
'link': 'https://www.onenote.com/notebooks',
|
|
|
|
| 155 |
'ai_capabilities': "π€βοΈ Smart drafting & editing",
|
| 156 |
'graph_solution': "π Document content API"
|
| 157 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
"π¬ Viva": {
|
| 159 |
'scopes': ['Analytics.Read'],
|
| 160 |
'link': 'https://www.microsoft.com/microsoft-viva',
|
|
|
|
| 167 |
'ai_capabilities': "π€βοΈ AI-powered automation",
|
| 168 |
'graph_solution': "π§ Workflow & app API"
|
| 169 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
"π‘ PowerPoint": {
|
| 171 |
'scopes': ['Files.ReadWrite.All'],
|
| 172 |
'link': 'https://www.office.com/launch/powerpoint',
|
| 173 |
'ai_capabilities': "π€π¨ Design & coaching AI",
|
| 174 |
'graph_solution': "π Presentation API"
|
| 175 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
BASE_SCOPES = ['User.Read']
|
|
|
|
| 316 |
day_placeholders[day].write(f"{start_date.strftime('%H:%M')} - {event['subject']}")
|
| 317 |
else:
|
| 318 |
st.write("No events found or unable to fetch events.")
|
| 319 |
+
|
| 320 |
+
# Anchor for Add Event
|
| 321 |
+
st.markdown("<a id='add-event'></a>", unsafe_allow_html=True)
|
| 322 |
|
| 323 |
+
# Create event β Add Event
|
| 324 |
+
st.write("β Add New Event:")
|
| 325 |
event_subject = st.text_input("Event Subject")
|
| 326 |
event_date = st.date_input("Event Date")
|
| 327 |
event_time = st.time_input("Event Time")
|
| 328 |
+
if st.button("β Add Event"):
|
| 329 |
event_start = datetime.combine(event_date, event_time)
|
| 330 |
event_end = event_start + timedelta(hours=1)
|
| 331 |
new_event = {
|
|
|
|
| 485 |
else:
|
| 486 |
st.error("Failed to delete file.")
|
| 487 |
|
| 488 |
+
def handle_sharepoint_integration(access_token):
|
| 489 |
+
st.subheader("ποΈ SharePoint Integration")
|
| 490 |
+
st.markdown(f"[Open SharePoint]({PRODUCT_SCOPES['ποΈ SharePoint']['link']})")
|
| 491 |
+
st.write("Smart search & tagging features coming soon.")
|
| 492 |
+
|
| 493 |
+
def handle_teams_integration(access_token):
|
| 494 |
+
st.subheader("π
Teams Integration")
|
| 495 |
+
st.markdown(f"[Open Teams]({PRODUCT_SCOPES['π
Teams']['link']})")
|
| 496 |
+
st.write("Meeting insights & summaries features coming soon.")
|
| 497 |
+
|
| 498 |
+
def handle_bookings_integration(access_token):
|
| 499 |
+
st.subheader("π Microsoft Bookings Integration")
|
| 500 |
+
st.markdown(f"[Open Microsoft Bookings]({PRODUCT_SCOPES['π Microsoft Bookings']['link']})")
|
| 501 |
+
st.write("Smart scheduling features coming soon.")
|
| 502 |
+
|
| 503 |
+
def handle_translator_integration(access_token):
|
| 504 |
+
st.subheader("π£οΈ Translator Integration")
|
| 505 |
+
st.markdown(f"[Open Translator]({PRODUCT_SCOPES['π£οΈ Translator']['link']})")
|
| 506 |
+
st.write("Real-time translation features coming soon.")
|
| 507 |
+
|
| 508 |
+
def handle_loop_integration(access_token):
|
| 509 |
+
st.subheader("π Loop Integration")
|
| 510 |
+
st.markdown(f"[Open Loop]({PRODUCT_SCOPES['π Loop']['link']})")
|
| 511 |
+
st.write("Real-time collaboration AI features coming soon.")
|
| 512 |
+
|
| 513 |
+
def handle_openai_service_integration(access_token):
|
| 514 |
+
st.subheader("π Azure OpenAI Service Integration")
|
| 515 |
+
st.markdown(f"[Open Azure OpenAI Service]({PRODUCT_SCOPES['π Azure OpenAI Service']['link']})")
|
| 516 |
+
st.write("Custom AI model access features coming soon.")
|
| 517 |
+
|
| 518 |
+
def handle_copilot_integration(access_token):
|
| 519 |
+
st.subheader("π§ Copilot Integration")
|
| 520 |
+
st.markdown(f"[Open Copilot]({PRODUCT_SCOPES['π§ Copilot']['link']})")
|
| 521 |
+
st.write("Cross-app AI assistance features coming soon.")
|
| 522 |
+
|
| 523 |
+
def handle_onenote_integration(access_token):
|
| 524 |
+
st.subheader("π OneNote Integration")
|
| 525 |
+
st.markdown(f"[Open OneNote]({PRODUCT_SCOPES['π OneNote']['link']})")
|
| 526 |
+
st.write("Content suggestion & OCR features coming soon.")
|
| 527 |
+
|
| 528 |
+
def handle_excel_integration(access_token):
|
| 529 |
+
st.subheader("π Excel Integration")
|
| 530 |
+
st.markdown(f"[Open Excel]({PRODUCT_SCOPES['π Excel']['link']})")
|
| 531 |
+
st.write("Data analysis & insights features coming soon.")
|
| 532 |
+
|
| 533 |
+
def handle_word_integration(access_token):
|
| 534 |
+
st.subheader("π Word Integration")
|
| 535 |
+
st.markdown(f"[Open Word]({PRODUCT_SCOPES['π Word']['link']})")
|
| 536 |
+
st.write("Smart drafting & editing features coming soon.")
|
| 537 |
+
|
| 538 |
+
def handle_viva_integration(access_token):
|
| 539 |
+
st.subheader("π¬ Viva Integration")
|
| 540 |
+
st.markdown(f"[Open Viva]({PRODUCT_SCOPES['π¬ Viva']['link']})")
|
| 541 |
+
st.write("Personalized insights features coming soon.")
|
| 542 |
+
|
| 543 |
+
def handle_power_platform_integration(access_token):
|
| 544 |
+
st.subheader("π Power Platform Integration")
|
| 545 |
+
st.markdown(f"[Open Power Platform]({PRODUCT_SCOPES['π Power Platform']['link']})")
|
| 546 |
+
st.write("AI-powered automation features coming soon.")
|
| 547 |
+
|
| 548 |
+
def handle_powerpoint_integration(access_token):
|
| 549 |
+
st.subheader("π‘ PowerPoint Integration")
|
| 550 |
+
st.markdown(f"[Open PowerPoint]({PRODUCT_SCOPES['π‘ PowerPoint']['link']})")
|
| 551 |
+
st.write("Design & coaching AI features coming soon.")
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
def main():
|
| 556 |
st.title("π¦ MS Graph API with AI & Cloud Integration for M365")
|
| 557 |
|
| 558 |
+
# Sticky Menu
|
| 559 |
+
sticky_menu()
|
| 560 |
+
|
| 561 |
st.sidebar.title("π M365 Products")
|
| 562 |
st.sidebar.write("Select products to integrate:")
|
| 563 |
|
|
|
|
| 597 |
except Exception as e:
|
| 598 |
st.error(f"Error acquiring access token: {str(e)}")
|
| 599 |
st.stop()
|
| 600 |
+
|
| 601 |
+
fragment = query_params.get('code', [None])[0] # For example, 'add-event'
|
| 602 |
+
# Handle section jumping based on the URL fragment
|
| 603 |
+
if fragment:
|
| 604 |
+
st.write(f"Detected URL fragment: {fragment}")
|
| 605 |
+
# Simulate the scrolling or jump based on fragment
|
| 606 |
+
if fragment == 'add-event':
|
| 607 |
+
st.markdown("<script>document.getElementById('add-event').scrollIntoView();</script>", unsafe_allow_html=True)
|
| 608 |
+
|
| 609 |
else:
|
| 610 |
access_token = st.session_state['access_token']
|
| 611 |
|
|
|
|
| 623 |
handle_tasks_integration(access_token)
|
| 624 |
elif product == "ποΈ OneDrive":
|
| 625 |
handle_onedrive_integration(access_token)
|
| 626 |
+
elif product == "ποΈ SharePoint":
|
| 627 |
+
handle_sharepoint_integration(access_token)
|
| 628 |
+
elif product == "π
Teams":
|
| 629 |
+
handle_teams_integration(access_token)
|
| 630 |
+
elif product == "π Microsoft Bookings":
|
| 631 |
+
handle_bookings_integration(access_token)
|
| 632 |
+
elif product == "π£οΈ Translator":
|
| 633 |
+
handle_translator_integration(access_token)
|
| 634 |
+
elif product == "π Loop":
|
| 635 |
+
handle_loop_integration(access_token)
|
| 636 |
+
elif product == "π Azure OpenAI Service":
|
| 637 |
+
handle_openai_service_integration(access_token)
|
| 638 |
+
elif product == "π§ Copilot":
|
| 639 |
+
handle_copilot_integration(access_token)
|
| 640 |
+
elif product == "π OneNote":
|
| 641 |
+
handle_onenote_integration(access_token)
|
| 642 |
+
elif product == "π Excel":
|
| 643 |
+
handle_excel_integration(access_token)
|
| 644 |
+
elif product == "π Word":
|
| 645 |
+
handle_word_integration(access_token)
|
| 646 |
+
elif product == "π¬ Viva":
|
| 647 |
+
handle_viva_integration(access_token)
|
| 648 |
+
elif product == "π Power Platform":
|
| 649 |
+
handle_power_platform_integration(access_token)
|
| 650 |
+
elif product == "π‘ PowerPoint":
|
| 651 |
+
handle_powerpoint_integration(access_token)
|
| 652 |
+
|
| 653 |
else:
|
| 654 |
st.write("No products selected. Please select products from the sidebar.")
|
| 655 |
+
|
| 656 |
|
| 657 |
if __name__ == "__main__":
|
| 658 |
main()
|