Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -62,19 +62,19 @@ def search(q,rn,st):
|
|
62 |
return(json.dumps(cont,indent=4)),html
|
63 |
def next_show(cur):
|
64 |
new=int(cur)+10
|
65 |
-
return gr.update(
|
66 |
|
67 |
def prev_show(cur):
|
68 |
if int(cur)-10 <=0:
|
69 |
new=0
|
70 |
-
out_gr=gr.update(
|
71 |
else:
|
72 |
new=int(cur)-10
|
73 |
-
out_gr=gr.update(
|
74 |
return out_gr,new
|
75 |
def show_num(cur):
|
76 |
new=int(cur)+10
|
77 |
-
html_out=f"<div>Showing {cur} through {new}</div>"
|
78 |
return html_out
|
79 |
|
80 |
with gr.Blocks(css=style,head=head) as b:
|
@@ -84,7 +84,7 @@ with gr.Blocks(css=style,head=head) as b:
|
|
84 |
num=gr.Number(label="Count",step=1,value=10,interactive=False)
|
85 |
sub=gr.Button()
|
86 |
with gr.Row():
|
87 |
-
prev_btn=gr.Button("Previous",
|
88 |
show_html=gr.HTML()
|
89 |
next_btn=gr.Button("Next")
|
90 |
html_out=gr.HTML()
|
|
|
62 |
return(json.dumps(cont,indent=4)),html
|
63 |
def next_show(cur):
|
64 |
new=int(cur)+10
|
65 |
+
return gr.update(interactive=True),new
|
66 |
|
67 |
def prev_show(cur):
|
68 |
if int(cur)-10 <=0:
|
69 |
new=0
|
70 |
+
out_gr=gr.update(interactive=False)
|
71 |
else:
|
72 |
new=int(cur)-10
|
73 |
+
out_gr=gr.update(interactive=True)
|
74 |
return out_gr,new
|
75 |
def show_num(cur):
|
76 |
new=int(cur)+10
|
77 |
+
html_out=f"<div><center>Showing {cur} through {new}</center></div>"
|
78 |
return html_out
|
79 |
|
80 |
with gr.Blocks(css=style,head=head) as b:
|
|
|
84 |
num=gr.Number(label="Count",step=1,value=10,interactive=False)
|
85 |
sub=gr.Button()
|
86 |
with gr.Row():
|
87 |
+
prev_btn=gr.Button("Previous",interactive=False)
|
88 |
show_html=gr.HTML()
|
89 |
next_btn=gr.Button("Next")
|
90 |
html_out=gr.HTML()
|