huohguohbo commited on
Commit
c97a399
·
1 Parent(s): 4d9085f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -50,10 +50,10 @@ input_password = gr.inputs.Textbox(label='Password')
50
  input_encrypted_password = gr.inputs.Textbox(label='Encrypted Password')
51
  input_key = gr.inputs.Textbox(label='Key')
52
 
53
- output_password_strength = gr.outputs.ProgressBar(label='Password Strength')
54
  output_generated_password = gr.outputs.Textbox(label='Generated Password')
55
  output_generated_key = gr.outputs.Textbox(label='Generated Key')
56
  output_encrypted_password = gr.outputs.Textbox(label='Encrypted Password')
 
57
  output_decrypted_password = gr.outputs.Textbox(label='Decrypted Password')
58
 
59
  interface = gr.Interface(
@@ -82,7 +82,7 @@ def generate_password_callback(password_length):
82
 
83
  def password_strength_callback(password):
84
  result = password_strength(password)
85
- return [None, None, None, result['password_strength'], None]
86
 
87
  def password_decrypt_callback(encrypted_password, key):
88
  result = password_decrypt(encrypted_password, key)
 
50
  input_encrypted_password = gr.inputs.Textbox(label='Encrypted Password')
51
  input_key = gr.inputs.Textbox(label='Key')
52
 
 
53
  output_generated_password = gr.outputs.Textbox(label='Generated Password')
54
  output_generated_key = gr.outputs.Textbox(label='Generated Key')
55
  output_encrypted_password = gr.outputs.Textbox(label='Encrypted Password')
56
+ output_password_strength = gr.outputs.Label(label='Password Strength')
57
  output_decrypted_password = gr.outputs.Textbox(label='Decrypted Password')
58
 
59
  interface = gr.Interface(
 
82
 
83
  def password_strength_callback(password):
84
  result = password_strength(password)
85
+ return [None, None, None, f'{result["password_strength"]}%', None]
86
 
87
  def password_decrypt_callback(encrypted_password, key):
88
  result = password_decrypt(encrypted_password, key)