Spaces:
Sleeping
Sleeping
Moibe
commited on
Commit
·
c167925
1
Parent(s):
b953771
Work catalogue interface
Browse files- app.py +4 -2
- avaimet.py +1 -1
app.py
CHANGED
|
@@ -35,13 +35,15 @@ with gr.Blocks() as demo:
|
|
| 35 |
with gr.Row():
|
| 36 |
with gr.Column():
|
| 37 |
text_input = gr.Textbox()
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
access_btn = gr.Button(value="Submit")
|
| 40 |
debit_btn = gr.Button(value="Debit")
|
| 41 |
with gr.Column():
|
| 42 |
text_output = gr.Textbox()
|
| 43 |
|
| 44 |
access_btn.click(fn=getAccess, inputs=text_input, outputs=text_output, api_name="getTokens")
|
| 45 |
-
debit_btn.click(fn=debitTokens, inputs=[text_input,
|
| 46 |
|
| 47 |
demo.launch()
|
|
|
|
| 35 |
with gr.Row():
|
| 36 |
with gr.Column():
|
| 37 |
text_input = gr.Textbox()
|
| 38 |
+
work_catalogue = gr.Dropdown(
|
| 39 |
+
["picswap", "dog", "bird"], label="Catalogo", info="Will add more works later!"
|
| 40 |
+
),
|
| 41 |
access_btn = gr.Button(value="Submit")
|
| 42 |
debit_btn = gr.Button(value="Debit")
|
| 43 |
with gr.Column():
|
| 44 |
text_output = gr.Textbox()
|
| 45 |
|
| 46 |
access_btn.click(fn=getAccess, inputs=text_input, outputs=text_output, api_name="getTokens")
|
| 47 |
+
debit_btn.click(fn=debitTokens, inputs=[text_input, work_catalogue], outputs=text_output, api_name="debitTokens")
|
| 48 |
|
| 49 |
demo.launch()
|
avaimet.py
CHANGED
|
@@ -51,7 +51,7 @@ def obtenTokens(sftp, caja):
|
|
| 51 |
def restaToken(sftp, caja, tokens, work):
|
| 52 |
|
| 53 |
#Standard cost.
|
| 54 |
-
cuantos =
|
| 55 |
|
| 56 |
#Aplica reglas de cobro de tokens.
|
| 57 |
if work == 'picswap':
|
|
|
|
| 51 |
def restaToken(sftp, caja, tokens, work):
|
| 52 |
|
| 53 |
#Standard cost.
|
| 54 |
+
cuantos = 2
|
| 55 |
|
| 56 |
#Aplica reglas de cobro de tokens.
|
| 57 |
if work == 'picswap':
|