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
98136096
Commit
98136096
authored
Mar 14, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish
parent
aa6254a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
publish.tsx
web/app/components/workflow/header/publish.tsx
+12
-0
workflow.ts
web/service/workflow.ts
+4
-0
No files found.
web/app/components/workflow/header/publish.tsx
View file @
98136096
...
...
@@ -7,12 +7,23 @@ import {
PortalToFollowElemContent
,
PortalToFollowElemTrigger
,
}
from
'@/app/components/base/portal-to-follow-elem'
import
{
publishWorkflow
}
from
'@/service/workflow'
import
{
useStore
as
useAppStore
}
from
'@/app/components/app/store'
const
Publish
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
runningStatus
=
useStore
(
s
=>
s
.
runningStatus
)
const
[
open
,
setOpen
]
=
useState
(
false
)
const
handlePublish
=
async
()
=>
{
const
appId
=
useAppStore
.
getState
().
appDetail
?.
id
try
{
await
publishWorkflow
(
`/apps/
${
appId
}
/workflows/publish`
)
}
catch
(
e
)
{
}
}
return
(
<
PortalToFollowElem
open=
{
open
}
...
...
@@ -51,6 +62,7 @@ const Publish = () => {
<
Button
type=
'primary'
className=
'mt-3 px-3 py-0 w-full h-8 border-[0.5px] border-primary-700 rounded-lg text-[13px] font-medium'
onClick=
{
handlePublish
}
>
{
t
(
'workflow.common.publish'
)
}
</
Button
>
...
...
web/service/workflow.ts
View file @
98136096
...
...
@@ -25,3 +25,7 @@ export const fetchWorkflowRunHistory: Fetcher<WorkflowRunHistoryResponse, string
export
const
singleNodeRun
=
(
appId
:
string
,
nodeId
:
string
,
params
:
object
)
=>
{
return
post
(
`apps/
${
appId
}
/workflows/draft/nodes/
${
nodeId
}
/run`
,
{
body
:
params
})
}
export
const
publishWorkflow
=
(
url
:
string
)
=>
{
return
post
<
CommonResponse
>
(
url
)
}
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