|
import gradio as gr |
|
import os |
|
import runpodctl |
|
|
|
def run_command(command): |
|
|
|
if command: |
|
output = os.popen(command).read() |
|
return output |
|
else: |
|
return "Bitte geben Sie einen Befehl ein." |
|
|
|
|
|
command_input = gr.inputs.Textbox(label="Enter command") |
|
|
|
|
|
send_button = gr.inputs.Button(label="Send") |
|
|
|
|
|
output_text = gr.outputs.Text(label="Output") |
|
|
|
def run_app(command): |
|
output = run_command(command) |
|
return output |
|
|
|
|
|
iface = gr.Interface( |
|
fn=run_app, |
|
inputs=command_input + send_button, |
|
outputs=output_text, |
|
title="Terminal-Befehl ausführen", |
|
description="Geben Sie den gewünschten Befehl ein und drücken Sie 'Senden', um den Befehl im Terminal auszuführen.", |
|
theme="default" |
|
) |
|
iface.launch() |
|
|