mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 10:56:52 +08:00
feat: option to hide workflow steps (#5436)
This commit is contained in:
@@ -28,6 +28,7 @@ def parse_app_site_args():
|
||||
required=False,
|
||||
location='json')
|
||||
parser.add_argument('prompt_public', type=bool, required=False, location='json')
|
||||
parser.add_argument('show_workflow_steps', type=bool, required=False, location='json')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
@@ -59,7 +60,8 @@ class AppSite(Resource):
|
||||
'privacy_policy',
|
||||
'custom_disclaimer',
|
||||
'customize_token_strategy',
|
||||
'prompt_public'
|
||||
'prompt_public',
|
||||
'show_workflow_steps'
|
||||
]:
|
||||
value = args.get(attr_name)
|
||||
if value is not None:
|
||||
|
||||
@@ -33,7 +33,8 @@ class AppSiteApi(WebApiResource):
|
||||
'privacy_policy': fields.String,
|
||||
'custom_disclaimer': fields.String,
|
||||
'default_language': fields.String,
|
||||
'prompt_public': fields.Boolean
|
||||
'prompt_public': fields.Boolean,
|
||||
'show_workflow_steps': fields.Boolean,
|
||||
}
|
||||
|
||||
app_fields = {
|
||||
|
||||
@@ -117,6 +117,7 @@ site_fields = {
|
||||
'customize_token_strategy': fields.String,
|
||||
'prompt_public': fields.Boolean,
|
||||
'app_base_url': fields.String,
|
||||
'show_workflow_steps': fields.Boolean,
|
||||
}
|
||||
|
||||
app_detail_fields_with_site = {
|
||||
@@ -149,5 +150,6 @@ app_site_fields = {
|
||||
'privacy_policy': fields.String,
|
||||
'custom_disclaimer': fields.String,
|
||||
'customize_token_strategy': fields.String,
|
||||
'prompt_public': fields.Boolean
|
||||
'prompt_public': fields.Boolean,
|
||||
'show_workflow_steps': fields.Boolean,
|
||||
}
|
||||
|
||||
33
api/migrations/versions/4ff534e1eb11_add_workflow_to_site.py
Normal file
33
api/migrations/versions/4ff534e1eb11_add_workflow_to_site.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""add workflow to site
|
||||
|
||||
Revision ID: 4ff534e1eb11
|
||||
Revises: 7b45942e39bb
|
||||
Create Date: 2024-06-21 04:16:03.419634
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
import models as models
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4ff534e1eb11'
|
||||
down_revision = '7b45942e39bb'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('sites', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('show_workflow_steps', sa.Boolean(), server_default=sa.text('true'), nullable=False))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('sites', schema=None) as batch_op:
|
||||
batch_op.drop_column('show_workflow_steps')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
@@ -1043,6 +1043,7 @@ class Site(db.Model):
|
||||
default_language = db.Column(db.String(255), nullable=False)
|
||||
copyright = db.Column(db.String(255))
|
||||
privacy_policy = db.Column(db.String(255))
|
||||
show_workflow_steps = db.Column(db.Boolean, nullable=False, server_default=db.text('true'))
|
||||
custom_disclaimer = db.Column(db.String(255), nullable=True)
|
||||
customize_domain = db.Column(db.String(255))
|
||||
customize_token_strategy = db.Column(db.String(255), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user