bluenevus commited on
Commit
1173a62
·
verified ·
1 Parent(s): 535f916

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -185,6 +185,10 @@ app.layout = dbc.Container([
185
  dbc.Row([
186
  dbc.Col([
187
  html.H1("Automated Guide Generator", className="text-center my-4"),
 
 
 
 
188
  html.P("Generate a user guide or administration guide based on the UI-related code in a Git repository using Gemini AI. Select a Git provider, enter repository details, choose the guide type, and let AI create a comprehensive guide.", className="text-center mb-4"),
189
 
190
  dbc.Card([
@@ -244,8 +248,8 @@ app.layout = dbc.Container([
244
 
245
  @app.callback(
246
  [Output("generated-guide", "children"),
247
- Output("download-docx", "n_clicks"),
248
- Output("download-md", "n_clicks")],
249
  [Input("generate-button", "n_clicks")],
250
  [State("git-provider", "value"),
251
  State("repo-url", "value"),
@@ -271,10 +275,12 @@ def update_output(n_clicks, git_provider, repo_url, guide_type, exclude_folders)
271
  # Convert the guide_text to a format that can be displayed in the Dash app
272
  if guide_text:
273
  preview_content = html.Pre(guide_text, style={"whiteSpace": "pre-wrap", "wordBreak": "break-word"})
 
274
  else:
275
  preview_content = "No content generated."
 
276
 
277
- return preview_content, 0, 0 # Return the preview content and reset n_clicks for download buttons
278
 
279
  @app.callback(
280
  Output("download-docx-file", "data"),
 
185
  dbc.Row([
186
  dbc.Col([
187
  html.H1("Automated Guide Generator", className="text-center my-4"),
188
+ ], width=12)
189
+ ]),
190
+ dbc.Row([
191
+ dbc.Col([
192
  html.P("Generate a user guide or administration guide based on the UI-related code in a Git repository using Gemini AI. Select a Git provider, enter repository details, choose the guide type, and let AI create a comprehensive guide.", className="text-center mb-4"),
193
 
194
  dbc.Card([
 
248
 
249
  @app.callback(
250
  [Output("generated-guide", "children"),
251
+ Output("download-docx", "disabled"),
252
+ Output("download-md", "disabled")],
253
  [Input("generate-button", "n_clicks")],
254
  [State("git-provider", "value"),
255
  State("repo-url", "value"),
 
275
  # Convert the guide_text to a format that can be displayed in the Dash app
276
  if guide_text:
277
  preview_content = html.Pre(guide_text, style={"whiteSpace": "pre-wrap", "wordBreak": "break-word"})
278
+ download_buttons_disabled = False
279
  else:
280
  preview_content = "No content generated."
281
+ download_buttons_disabled = True
282
 
283
+ return preview_content, download_buttons_disabled, download_buttons_disabled
284
 
285
  @app.callback(
286
  Output("download-docx-file", "data"),