|
|
@ -11,19 +11,16 @@ const { updateProjectTitle } = workspaceStore |
|
|
|
const { activePage } = storeToRefs(workspaceStore) |
|
|
|
const { activePage } = storeToRefs(workspaceStore) |
|
|
|
|
|
|
|
|
|
|
|
const basesStore = useBases() |
|
|
|
const basesStore = useBases() |
|
|
|
const { loadProjects } = basesStore |
|
|
|
|
|
|
|
const { basesList, isProjectsLoading } = storeToRefs(basesStore) |
|
|
|
const { basesList, isProjectsLoading } = storeToRefs(basesStore) |
|
|
|
|
|
|
|
|
|
|
|
const { navigateToProject } = useGlobal() |
|
|
|
const { navigateToProject } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
// const filteredProjects = computed(() => bases.value?.filter((p) => !p.deleted) || []) |
|
|
|
// const filteredProjects = computed(() => bases.value?.filter((p) => !p.deleted) || []) |
|
|
|
|
|
|
|
|
|
|
|
const { $e, $poller } = useNuxtApp() |
|
|
|
const { $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
|
|
|
|
|
|
|
const { refreshCommandPalette } = useCommandPalette() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showProjectDeleteModal = ref(false) |
|
|
|
const showProjectDeleteModal = ref(false) |
|
|
|
const toBeDeletedProjectId = ref<string | undefined>() |
|
|
|
const toBeDeletedProjectId = ref<string | undefined>() |
|
|
|
|
|
|
|
|
|
|
@ -142,37 +139,6 @@ const workspaceMoveProjectOnSuccess = async (workspaceId: string) => { |
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const selectedProjectToDuplicate = ref() |
|
|
|
const selectedProjectToDuplicate = ref() |
|
|
|
|
|
|
|
|
|
|
|
const DlgProjectDuplicateOnOk = async (jobData: { id: string }) => { |
|
|
|
|
|
|
|
await loadProjects('workspace') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$poller.subscribe( |
|
|
|
|
|
|
|
{ id: jobData.id }, |
|
|
|
|
|
|
|
async (data: { |
|
|
|
|
|
|
|
id: string |
|
|
|
|
|
|
|
status?: string |
|
|
|
|
|
|
|
data?: { |
|
|
|
|
|
|
|
error?: { |
|
|
|
|
|
|
|
message: string |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
message?: string |
|
|
|
|
|
|
|
result?: any |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) => { |
|
|
|
|
|
|
|
if (data.status !== 'close') { |
|
|
|
|
|
|
|
if (data.status === JobStatus.COMPLETED) { |
|
|
|
|
|
|
|
await loadProjects('workspace') |
|
|
|
|
|
|
|
refreshCommandPalette() |
|
|
|
|
|
|
|
} else if (data.status === JobStatus.FAILED) { |
|
|
|
|
|
|
|
message.error('Failed to duplicate base') |
|
|
|
|
|
|
|
await loadProjects('workspace') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$e('a:base:duplicate') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const duplicateProject = (base: BaseType) => { |
|
|
|
const duplicateProject = (base: BaseType) => { |
|
|
|
selectedProjectToDuplicate.value = base |
|
|
|
selectedProjectToDuplicate.value = base |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
@ -404,12 +370,7 @@ const setIcon = async (icon: string, base: BaseType) => { |
|
|
|
:base="selectedProjectToMove" |
|
|
|
:base="selectedProjectToMove" |
|
|
|
@success="workspaceMoveProjectOnSuccess" |
|
|
|
@success="workspaceMoveProjectOnSuccess" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<DlgProjectDuplicate |
|
|
|
<DlgProjectDuplicate v-if="selectedProjectToDuplicate" v-model="isDuplicateDlgOpen" :base="selectedProjectToDuplicate" /> |
|
|
|
v-if="selectedProjectToDuplicate" |
|
|
|
|
|
|
|
v-model="isDuplicateDlgOpen" |
|
|
|
|
|
|
|
:base="selectedProjectToDuplicate" |
|
|
|
|
|
|
|
:on-ok="DlgProjectDuplicateOnOk" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|