* changes

* format
This commit is contained in:
aliabid94 2022-06-09 16:15:08 -07:00 committed by GitHub
parent 293a5916cf
commit f3e070541e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -9,4 +9,6 @@ def greet(name):
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(auth=lambda u, p: user_db.get(u) == p)
demo.launch(
auth=lambda u, p: user_db.get(u) == p,
auth_message="This is a welcome message")

View File

@ -1,5 +1,9 @@
<script lang="ts">
export let root: string;
export let id: number;
export let auth_message: string | null;
window.__gradio_loader__[id].$set({ status: "complete" });
</script>
<div class="login container mt-8">
@ -10,7 +14,9 @@
action={root + "login"}
>
<h2 class="text-2xl font-semibold my-2">login</h2>
{#if auth_message}
<p class="my-4">{auth_message}</p>
{/if}
<label class="block uppercase mt-4" for="username">username</label>
<input class="p-2 block" type="text" name="username" />
<label class="block uppercase mt-4" for="password">password</label>