Improve the file saving/deletion menus

This commit is contained in:
oobabooga 2024-01-09 06:33:47 -08:00
parent 123f27a3c5
commit 953343cced
2 changed files with 6 additions and 6 deletions

View File

@ -193,11 +193,11 @@ button {
max-width: 500px;
background-color: var(--input-background-fill);
border: var(--input-border-width) solid var(--input-border-color) !important;
padding: 10px;
}
.file-saver > :first-child > :nth-child(2) {
.file-saver > :first-child > :last-child {
background: var(--block-background-fill);
justify-content: flex-end;
}
.checkboxgroup-table label {

View File

@ -13,23 +13,23 @@ def create_ui():
shared.gradio['save_root'] = gr.Textbox(lines=1, label='File folder', info='For reference. Unchangeable.', interactive=False)
shared.gradio['save_contents'] = gr.Textbox(lines=10, label='File contents')
with gr.Row():
shared.gradio['save_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
shared.gradio['save_cancel'] = gr.Button('Cancel', elem_classes="small-button")
shared.gradio['save_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
# Text file deleter
with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['file_deleter']:
shared.gradio['delete_filename'] = gr.Textbox(lines=1, label='File name')
shared.gradio['delete_root'] = gr.Textbox(lines=1, label='File folder', info='For reference. Unchangeable.', interactive=False)
with gr.Row():
shared.gradio['delete_confirm'] = gr.Button('Delete', elem_classes="small-button", variant='stop', interactive=not mu)
shared.gradio['delete_cancel'] = gr.Button('Cancel', elem_classes="small-button")
shared.gradio['delete_confirm'] = gr.Button('Delete', elem_classes="small-button", variant='stop', interactive=not mu)
# Character saver/deleter
with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['character_saver']:
shared.gradio['save_character_filename'] = gr.Textbox(lines=1, label='File name', info='The character will be saved to your characters/ folder with this base filename.')
with gr.Row():
shared.gradio['save_character_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
shared.gradio['save_character_cancel'] = gr.Button('Cancel', elem_classes="small-button")
shared.gradio['save_character_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['character_deleter']:
gr.Markdown('Confirm the character deletion?')
@ -42,8 +42,8 @@ def create_ui():
shared.gradio['save_preset_filename'] = gr.Textbox(lines=1, label='File name', info='The preset will be saved to your presets/ folder with this base filename.')
shared.gradio['save_preset_contents'] = gr.Textbox(lines=10, label='File contents')
with gr.Row():
shared.gradio['save_preset_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
shared.gradio['save_preset_cancel'] = gr.Button('Cancel', elem_classes="small-button")
shared.gradio['save_preset_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu)
def create_event_handlers():