clone functionality added
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div class="card">
|
||||
<Toast/>
|
||||
<ConfirmPopup></ConfirmPopup>
|
||||
<div v-if="loading" class="loading-container">
|
||||
<div class="spinner-container">
|
||||
<ProgressSpinner class="spinner" />
|
||||
@@ -32,6 +34,7 @@
|
||||
</IconField>
|
||||
</div>
|
||||
<Button icon="pi pi-plus" rounded raised @click="newCodeRepoForm()" v-tooltip="'Add New Git Repo'" class="mr-2" />
|
||||
<Button icon="pi pi-bolt" rounded raised @click="cloneRepoForm()" v-tooltip="'Clone New Git Repo'" class="mr-2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -95,8 +98,12 @@
|
||||
:class="{ 'p-button-danger': slotProps.data.ingestionStatus === 'INGESTED' }"
|
||||
/>
|
||||
|
||||
<Button type="button" icon="pi pi-forward" severity="danger" rounded @click="reIngestWithPullChanges(slotProps.data)" v-tooltip="'Ingest Repo with latest changes from master branch'"/>
|
||||
|
||||
<Button type="button" icon="pi pi-trash" rounded @click="showConfirmDialog(slotProps.data.id)"
|
||||
v-tooltip="'Delete the Records'" />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<Dialog header="Confirm Deletion" :visible="confirmDialogVisible" modal @hide="resetConfirmDialog"
|
||||
@@ -135,11 +142,13 @@ import Select from 'primevue/select';
|
||||
import Tag from 'primevue/tag';
|
||||
import Tooltip from 'primevue/tooltip';
|
||||
import ProgressSpinner from 'primevue/progressspinner';
|
||||
import { useConfirm } from "primevue/useconfirm";
|
||||
|
||||
const router = useRouter();
|
||||
const codeRepoInfo = ref(null);
|
||||
const loading = ref(true);
|
||||
const toast = useToast();
|
||||
const confirm = useConfirm();
|
||||
|
||||
const confirmDialogVisible = ref(false);
|
||||
const recordToDelete = ref(null);
|
||||
@@ -267,6 +276,11 @@ const newCodeRepoForm = () => {
|
||||
router.push({ name: 'ks-git-repo-new' });
|
||||
};
|
||||
|
||||
const cloneRepoForm = () =>{
|
||||
console.log("clone repo form");
|
||||
router.push({ name: 'ks-git-clone-repo' });
|
||||
}
|
||||
|
||||
function formatDate(dateString) {
|
||||
// Parse the date string using moment
|
||||
return moment(dateString).format('MM/DD/YYYY');
|
||||
@@ -328,6 +342,38 @@ const deleteRecordsFromVectorStore = (id) => {
|
||||
});
|
||||
}
|
||||
|
||||
const reIngestWithPullChanges = (data) =>{
|
||||
console.log("data",data);
|
||||
console.log("reponame",data.repoName);
|
||||
|
||||
confirm.require({
|
||||
target: event.currentTarget,
|
||||
message: 'Are you sure you want to proceed?',
|
||||
icon: 'pi pi-exclamation-triangle',
|
||||
rejectProps: {
|
||||
label: 'Cancel',
|
||||
severity: 'secondary',
|
||||
outlined: true
|
||||
},
|
||||
acceptProps: {
|
||||
label: 'Ingest Changes',
|
||||
severity: 'danger',
|
||||
},
|
||||
accept: () => {
|
||||
axios.get('/test/reingest_repo/'+data.repoName)
|
||||
.then(response => {
|
||||
console.log(response.data);
|
||||
toast.add({ severity: 'info', summary: 'Confirmed', detail: 'ReIngestion with latest pull from master started', life: 3000 });
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
toast.add({ severity: 'error', summary: 'Error', detail: 'Error in Reingestion', life: 3000 });
|
||||
})
|
||||
},
|
||||
reject: () => {
|
||||
toast.add({severity: 'error', summary: 'Rejected', detail: 'You have rejected', life: 3000})
|
||||
}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user