Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
0f53fc86
Commit
0f53fc86
authored
Feb 28, 2024
by
crazywoola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: logo
parent
c4caa7c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
workspace_service.py
api/services/workspace_service.py
+13
-1
index.tsx
web/app/components/custom/custom-web-app-brand/index.tsx
+1
-3
No files found.
api/services/workspace_service.py
View file @
0f53fc86
from
flask
import
current_app
from
flask_login
import
current_user
from
flask_login
import
current_user
from
extensions.ext_database
import
db
from
extensions.ext_database
import
db
...
@@ -31,7 +33,17 @@ class WorkspaceService:
...
@@ -31,7 +33,17 @@ class WorkspaceService:
can_replace_logo
=
FeatureService
.
get_features
(
tenant_info
[
'id'
])
.
can_replace_logo
can_replace_logo
=
FeatureService
.
get_features
(
tenant_info
[
'id'
])
.
can_replace_logo
if
can_replace_logo
and
TenantService
.
has_roles
(
tenant
,
[
TenantAccountJoinRole
.
OWNER
,
TenantAccountJoinRole
.
ADMIN
]):
if
can_replace_logo
and
TenantService
.
has_roles
(
tenant
,
[
TenantAccountJoinRole
.
OWNER
,
TenantAccountJoinRole
.
ADMIN
]):
base_url
=
current_app
.
config
.
get
(
'FILES_URL'
)
replace_webapp_logo
=
f
'{base_url}/files/workspaces/{tenant.id}/webapp-logo'
if
tenant
.
custom_config_dict
.
get
(
'replace_webapp_logo'
)
else
None
remove_webapp_brand
=
tenant
.
custom_config_dict
.
get
(
'remove_webapp_brand'
,
False
)
# Make sure the custom_config_dict is updated with the new values
tenant
.
custom_config_dict
.
update
({
'remove_webapp_brand'
:
remove_webapp_brand
,
'replace_webapp_logo'
:
replace_webapp_logo
,
})
tenant_info
[
'custom_config'
]
=
tenant
.
custom_config_dict
tenant_info
[
'custom_config'
]
=
tenant
.
custom_config_dict
return
tenant_info
return
tenant_info
web/app/components/custom/custom-web-app-brand/index.tsx
View file @
0f53fc86
...
@@ -16,8 +16,6 @@ import {
...
@@ -16,8 +16,6 @@ import {
updateCurrentWorkspace
,
updateCurrentWorkspace
,
}
from
'@/service/common'
}
from
'@/service/common'
import
{
useAppContext
}
from
'@/context/app-context'
import
{
useAppContext
}
from
'@/context/app-context'
import
{
API_PREFIX
}
from
'@/config'
import
{
getPurifyHref
}
from
'@/utils'
const
ALLOW_FILE_EXTENSIONS
=
[
'svg'
,
'png'
]
const
ALLOW_FILE_EXTENSIONS
=
[
'svg'
,
'png'
]
...
@@ -123,7 +121,7 @@ const CustomWebAppBrand = () => {
...
@@ -123,7 +121,7 @@ const CustomWebAppBrand = () => {
POWERED BY
POWERED BY
{
{
webappLogo
webappLogo
?
<
img
key=
{
webappLogo
}
src=
{
`${getPurifyHref(API_PREFIX.slice(0, -12))}/files/workspaces/${currentWorkspace.id}/webapp-logo`
}
alt=
'logo'
className=
'ml-2 block w-auto h-5'
/>
?
<
img
key=
{
webappLogo
}
src=
{
webappLogo
}
alt=
'logo'
className=
'ml-2 block w-auto h-5'
/>
:
<
LogoSite
className=
'ml-2 !h-5'
/>
:
<
LogoSite
className=
'ml-2 !h-5'
/>
}
}
</
div
>
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment