mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
parent
293a5916cf
commit
f3e070541e
@ -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")
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user