mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-05 11:10:03 +08:00
can turn off flagging from interface
This commit is contained in:
parent
7c7d2f6abf
commit
c78126a55a
@ -41,7 +41,7 @@ class Interface:
|
||||
live=False, show_input=True, show_output=True,
|
||||
capture_session=False, title=None, description=None,
|
||||
thumbnail=None, server_port=None, server_name=networking.LOCALHOST_NAME,
|
||||
allow_screenshot=True):
|
||||
allow_screenshot=True, allow_flagging=True):
|
||||
"""
|
||||
Parameters:
|
||||
fn (Callable): the function to wrap an interface around.
|
||||
@ -101,6 +101,7 @@ class Interface:
|
||||
self.server_port = server_port
|
||||
self.simple_server = None
|
||||
self.allow_screenshot = allow_screenshot
|
||||
self.allow_flagging = allow_flagging
|
||||
Interface.instances.add(self)
|
||||
|
||||
data = {'fn': fn,
|
||||
|
@ -75,7 +75,9 @@ input.submit {
|
||||
input.submit:hover {
|
||||
background-color: #f39c12;
|
||||
}
|
||||
|
||||
.flag {
|
||||
visibility: hidden;
|
||||
}
|
||||
.flag.flagged {
|
||||
background-color: pink;
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ function gradio(config, fn, target) {
|
||||
if (config["allow_screenshot"]) {
|
||||
target.find(".screenshot").css("visibility", "visible");
|
||||
}
|
||||
if(config["allow_flagging"]){
|
||||
target.find(".flag").css("visibility", "visible");
|
||||
}
|
||||
target.find(".screenshot").click(function() {
|
||||
$(".screenshot").hide();
|
||||
$(".screenshot_logo").show();
|
||||
|
Loading…
Reference in New Issue
Block a user