Compare commits
3 commits
dfdf13cf7e
...
66dc5f2111
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66dc5f2111 | ||
|
|
377639c04d | ||
|
|
7ef0b9d4ef |
3 changed files with 12 additions and 12 deletions
|
|
@ -190,7 +190,7 @@ export interface ProjectLink {
|
||||||
id: number
|
id: number
|
||||||
from_project: string
|
from_project: string
|
||||||
to_project: string
|
to_project: string
|
||||||
link_type: string
|
type: string
|
||||||
description: string | null
|
description: string | null
|
||||||
created_at: string
|
created_at: string
|
||||||
}
|
}
|
||||||
|
|
@ -415,7 +415,7 @@ export const api = {
|
||||||
get<PipelineLog[]>(`/pipelines/${pipelineId}/logs?since_id=${sinceId}`),
|
get<PipelineLog[]>(`/pipelines/${pipelineId}/logs?since_id=${sinceId}`),
|
||||||
projectLinks: (projectId: string) =>
|
projectLinks: (projectId: string) =>
|
||||||
get<ProjectLink[]>(`/projects/${projectId}/links`),
|
get<ProjectLink[]>(`/projects/${projectId}/links`),
|
||||||
createProjectLink: (data: { from_project: string; to_project: string; link_type: string; description?: string }) =>
|
createProjectLink: (data: { from_project: string; to_project: string; type: string; description?: string }) =>
|
||||||
post<ProjectLink>('/project-links', data),
|
post<ProjectLink>('/project-links', data),
|
||||||
deleteProjectLink: (id: number) =>
|
deleteProjectLink: (id: number) =>
|
||||||
del<void>(`/project-links/${id}`),
|
del<void>(`/project-links/${id}`),
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ const links = ref<ProjectLink[]>([])
|
||||||
const linksLoading = ref(false)
|
const linksLoading = ref(false)
|
||||||
const linksError = ref('')
|
const linksError = ref('')
|
||||||
const showAddLink = ref(false)
|
const showAddLink = ref(false)
|
||||||
const linkForm = ref({ to_project: '', link_type: 'depends_on', description: '' })
|
const linkForm = ref({ to_project: '', type: 'depends_on', description: '' })
|
||||||
const linkFormError = ref('')
|
const linkFormError = ref('')
|
||||||
const linkSaving = ref(false)
|
const linkSaving = ref(false)
|
||||||
|
|
||||||
|
|
@ -419,11 +419,11 @@ async function addLink() {
|
||||||
await api.createProjectLink({
|
await api.createProjectLink({
|
||||||
from_project: props.id,
|
from_project: props.id,
|
||||||
to_project: linkForm.value.to_project,
|
to_project: linkForm.value.to_project,
|
||||||
link_type: linkForm.value.link_type,
|
type: linkForm.value.type,
|
||||||
description: linkForm.value.description || undefined,
|
description: linkForm.value.description || undefined,
|
||||||
})
|
})
|
||||||
showAddLink.value = false
|
showAddLink.value = false
|
||||||
linkForm.value = { to_project: '', link_type: 'depends_on', description: '' }
|
linkForm.value = { to_project: '', type: 'depends_on', description: '' }
|
||||||
await loadLinks()
|
await loadLinks()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
linkFormError.value = e.message
|
linkFormError.value = e.message
|
||||||
|
|
@ -1368,7 +1368,7 @@ async function addDecision() {
|
||||||
<span class="text-gray-400 font-mono text-xs">{{ link.from_project }}</span>
|
<span class="text-gray-400 font-mono text-xs">{{ link.from_project }}</span>
|
||||||
<span class="text-gray-600">-></span>
|
<span class="text-gray-600">-></span>
|
||||||
<span class="text-gray-400 font-mono text-xs">{{ link.to_project }}</span>
|
<span class="text-gray-400 font-mono text-xs">{{ link.to_project }}</span>
|
||||||
<span class="px-1.5 py-0.5 text-[10px] bg-indigo-900/30 text-indigo-400 border border-indigo-800 rounded">{{ link.link_type }}</span>
|
<span class="px-1.5 py-0.5 text-[10px] bg-indigo-900/30 text-indigo-400 border border-indigo-800 rounded">{{ link.type }}</span>
|
||||||
<span v-if="link.description" class="text-gray-500 text-xs">{{ link.description }}</span>
|
<span v-if="link.description" class="text-gray-500 text-xs">{{ link.description }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button @click="deleteLink(link.id)"
|
<button @click="deleteLink(link.id)"
|
||||||
|
|
@ -1379,7 +1379,7 @@ async function addDecision() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Add Link Modal -->
|
<!-- Add Link Modal -->
|
||||||
<Modal v-if="showAddLink" title="Add Link" @close="showAddLink = false; linkForm = { to_project: '', link_type: 'depends_on', description: '' }; linkFormError = ''">
|
<Modal v-if="showAddLink" title="Add Link" @close="showAddLink = false; linkForm = { to_project: '', type: 'depends_on', description: '' }; linkFormError = ''">
|
||||||
<form @submit.prevent="addLink" class="space-y-3">
|
<form @submit.prevent="addLink" class="space-y-3">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-xs text-gray-500 mb-1">From (current project)</label>
|
<label class="block text-xs text-gray-500 mb-1">From (current project)</label>
|
||||||
|
|
@ -1396,7 +1396,7 @@ async function addDecision() {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-xs text-gray-500 mb-1">Link type</label>
|
<label class="block text-xs text-gray-500 mb-1">Link type</label>
|
||||||
<select v-model="linkForm.link_type"
|
<select v-model="linkForm.type"
|
||||||
class="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-sm text-gray-300">
|
class="w-full bg-gray-800 border border-gray-700 rounded px-3 py-2 text-sm text-gray-300">
|
||||||
<option value="depends_on">depends_on</option>
|
<option value="depends_on">depends_on</option>
|
||||||
<option value="triggers">triggers</option>
|
<option value="triggers">triggers</option>
|
||||||
|
|
|
||||||
|
|
@ -61,10 +61,10 @@ async function saveDeployConfig(projectId: string) {
|
||||||
saveDeployConfigStatus.value[projectId] = ''
|
saveDeployConfigStatus.value[projectId] = ''
|
||||||
try {
|
try {
|
||||||
await api.patchProject(projectId, {
|
await api.patchProject(projectId, {
|
||||||
deploy_host: deployHosts.value[projectId] || undefined,
|
deploy_host: deployHosts.value[projectId],
|
||||||
deploy_path: deployPaths.value[projectId] || undefined,
|
deploy_path: deployPaths.value[projectId],
|
||||||
deploy_runtime: deployRuntimes.value[projectId] || undefined,
|
deploy_runtime: deployRuntimes.value[projectId],
|
||||||
deploy_restart_cmd: deployRestartCmds.value[projectId] || undefined,
|
deploy_restart_cmd: deployRestartCmds.value[projectId],
|
||||||
deploy_command: deployCommands.value[projectId] || undefined,
|
deploy_command: deployCommands.value[projectId] || undefined,
|
||||||
})
|
})
|
||||||
saveDeployConfigStatus.value[projectId] = 'Saved'
|
saveDeployConfigStatus.value[projectId] = 'Saved'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue