Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -646,7 +646,7 @@ def main():
|
|
646 |
view_options = ['Show as Markdown', 'Show as Code Editor', 'Show as Edit, Save, Run AI', 'Clone Document', 'New Record']
|
647 |
selected_view = st.sidebar.selectbox("Select Viewer/Editor", view_options, index=2)
|
648 |
|
649 |
-
Label = '# π Markdown view -
|
650 |
if selected_view == 'Show as Markdown':
|
651 |
st.markdown(Label)
|
652 |
total_docs = len(documents)
|
@@ -691,7 +691,7 @@ def main():
|
|
691 |
|
692 |
|
693 |
|
694 |
-
Label = '# π» Code editor view -
|
695 |
elif selected_view == 'Show as Code Editor':
|
696 |
st.markdown(Label)
|
697 |
total_docs = len(documents)
|
@@ -735,7 +735,7 @@ def main():
|
|
735 |
|
736 |
|
737 |
|
738 |
-
Label = '# βοΈ Edit and save view -
|
739 |
elif selected_view == 'Show as Edit, Save, Run AI':
|
740 |
st.markdown(Label)
|
741 |
st.markdown("#### Edit the document fields below:")
|
@@ -792,7 +792,7 @@ def main():
|
|
792 |
|
793 |
|
794 |
|
795 |
-
Label = '# 𧬠Clone functionality -
|
796 |
elif selected_view == 'Clone Document':
|
797 |
st.markdown(Label)
|
798 |
st.markdown("#### Clone a document:")
|
@@ -830,7 +830,7 @@ def main():
|
|
830 |
|
831 |
|
832 |
|
833 |
-
Label = '# π New Record view -
|
834 |
elif selected_view == 'New Record':
|
835 |
st.markdown(Label)
|
836 |
st.markdown("#### Create a new document:")
|
@@ -867,10 +867,11 @@ def main():
|
|
867 |
|
868 |
|
869 |
|
870 |
-
# π Data display -
|
871 |
st.subheader(f"π Container: {st.session_state.selected_container}")
|
872 |
if st.session_state.selected_container:
|
873 |
if documents_to_display:
|
|
|
874 |
df = pd.DataFrame(documents_to_display)
|
875 |
st.dataframe(df)
|
876 |
else:
|
@@ -878,7 +879,7 @@ def main():
|
|
878 |
|
879 |
|
880 |
|
881 |
-
# π GitHub integration -
|
882 |
st.subheader("π GitHub Operations")
|
883 |
github_token = os.environ.get("GITHUB")
|
884 |
source_repo = st.text_input("Source GitHub Repository URL",
|
@@ -892,6 +893,8 @@ def main():
|
|
892 |
with col1:
|
893 |
if st.button("π₯ Clone Repository"):
|
894 |
if github_token and source_repo:
|
|
|
|
|
895 |
try:
|
896 |
local_path = f"./temp_repo_{datetime.now().strftime('%Y%m%d%H%M%S')}"
|
897 |
download_github_repo(source_repo, local_path)
|
@@ -914,6 +917,8 @@ def main():
|
|
914 |
with col2:
|
915 |
if st.button("π€ Push to New Repository"):
|
916 |
if github_token and source_repo:
|
|
|
|
|
917 |
try:
|
918 |
g = Github(github_token)
|
919 |
new_repo = create_repo(g, new_repo_name)
|
@@ -931,11 +936,12 @@ def main():
|
|
931 |
|
932 |
|
933 |
|
934 |
-
# π¬ Chat functionality -
|
935 |
st.subheader("π¬ Chat with Claude")
|
936 |
user_input = st.text_area("Message π¨:", height=100)
|
937 |
|
938 |
if st.button("Send π¨"):
|
|
|
939 |
if user_input:
|
940 |
response = client.messages.create(
|
941 |
model="claude-3-sonnet-20240229",
|
@@ -1018,8 +1024,9 @@ def main():
|
|
1018 |
|
1019 |
|
1020 |
|
1021 |
-
# πͺ Logout -
|
1022 |
if st.session_state.logged_in and st.sidebar.button("πͺ Logout"):
|
|
|
1023 |
st.session_state.logged_in = False
|
1024 |
st.session_state.selected_records.clear()
|
1025 |
st.session_state.client = None
|
|
|
646 |
view_options = ['Show as Markdown', 'Show as Code Editor', 'Show as Edit, Save, Run AI', 'Clone Document', 'New Record']
|
647 |
selected_view = st.sidebar.selectbox("Select Viewer/Editor", view_options, index=2)
|
648 |
|
649 |
+
Label = '# π Markdown view - Mark it down, mark it up'
|
650 |
if selected_view == 'Show as Markdown':
|
651 |
st.markdown(Label)
|
652 |
total_docs = len(documents)
|
|
|
691 |
|
692 |
|
693 |
|
694 |
+
Label = '# π» Code editor view - Code is poetry, bugs are typos'
|
695 |
elif selected_view == 'Show as Code Editor':
|
696 |
st.markdown(Label)
|
697 |
total_docs = len(documents)
|
|
|
735 |
|
736 |
|
737 |
|
738 |
+
Label = '# βοΈ Edit and save view - Edit with wisdom, save with precision'
|
739 |
elif selected_view == 'Show as Edit, Save, Run AI':
|
740 |
st.markdown(Label)
|
741 |
st.markdown("#### Edit the document fields below:")
|
|
|
792 |
|
793 |
|
794 |
|
795 |
+
Label = '# 𧬠Clone functionality - Copy wisely, paste precisely'
|
796 |
elif selected_view == 'Clone Document':
|
797 |
st.markdown(Label)
|
798 |
st.markdown("#### Clone a document:")
|
|
|
830 |
|
831 |
|
832 |
|
833 |
+
Label = '# π New Record view - Every new record is a new beginning'
|
834 |
elif selected_view == 'New Record':
|
835 |
st.markdown(Label)
|
836 |
st.markdown("#### Create a new document:")
|
|
|
867 |
|
868 |
|
869 |
|
870 |
+
Label = '# π Data display - Data tells tales that words cannot'
|
871 |
st.subheader(f"π Container: {st.session_state.selected_container}")
|
872 |
if st.session_state.selected_container:
|
873 |
if documents_to_display:
|
874 |
+
st.markdown(Label)
|
875 |
df = pd.DataFrame(documents_to_display)
|
876 |
st.dataframe(df)
|
877 |
else:
|
|
|
879 |
|
880 |
|
881 |
|
882 |
+
Label = '# π GitHub integration - Git happens'
|
883 |
st.subheader("π GitHub Operations")
|
884 |
github_token = os.environ.get("GITHUB")
|
885 |
source_repo = st.text_input("Source GitHub Repository URL",
|
|
|
893 |
with col1:
|
894 |
if st.button("π₯ Clone Repository"):
|
895 |
if github_token and source_repo:
|
896 |
+
|
897 |
+
st.markdown(Label)
|
898 |
try:
|
899 |
local_path = f"./temp_repo_{datetime.now().strftime('%Y%m%d%H%M%S')}"
|
900 |
download_github_repo(source_repo, local_path)
|
|
|
917 |
with col2:
|
918 |
if st.button("π€ Push to New Repository"):
|
919 |
if github_token and source_repo:
|
920 |
+
|
921 |
+
st.markdown(Label)
|
922 |
try:
|
923 |
g = Github(github_token)
|
924 |
new_repo = create_repo(g, new_repo_name)
|
|
|
936 |
|
937 |
|
938 |
|
939 |
+
Label = '# π¬ Chat functionality - Every chat is a chance to learn'
|
940 |
st.subheader("π¬ Chat with Claude")
|
941 |
user_input = st.text_area("Message π¨:", height=100)
|
942 |
|
943 |
if st.button("Send π¨"):
|
944 |
+
st.markdown(Label)
|
945 |
if user_input:
|
946 |
response = client.messages.create(
|
947 |
model="claude-3-sonnet-20240229",
|
|
|
1024 |
|
1025 |
|
1026 |
|
1027 |
+
Label = '# πͺ Logout - All good things must come to an end'
|
1028 |
if st.session_state.logged_in and st.sidebar.button("πͺ Logout"):
|
1029 |
+
st.markdown(Label)
|
1030 |
st.session_state.logged_in = False
|
1031 |
st.session_state.selected_records.clear()
|
1032 |
st.session_state.client = None
|