Merged PR 104: MSAL authetication
This commit is contained in:
1967
package-lock.json
generated
1967
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@
|
|||||||
"lint": "eslint --fix . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
"lint": "eslint --fix . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@azure/msal-browser": "^4.9.1",
|
||||||
"@heroicons/vue": "^2.2.0",
|
"@heroicons/vue": "^2.2.0",
|
||||||
"@matpool/vue-json-view": "^0.1.8",
|
"@matpool/vue-json-view": "^0.1.8",
|
||||||
"@primevue/themes": "^4.0.0",
|
"@primevue/themes": "^4.0.0",
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL;//'http://localhost:80
|
|||||||
console.log(import.meta.env.VITE_BACKEND_URL);
|
console.log(import.meta.env.VITE_BACKEND_URL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { createAuth } from '@websanova/vue-auth';
|
import { createAuth } from '@websanova/vue-auth';
|
||||||
import driverAuthBearer from '@websanova/vue-auth/dist/drivers/auth/bearer.esm.js';
|
import driverAuthBearer from '@websanova/vue-auth/dist/drivers/auth/bearer.esm.js';
|
||||||
import driverHttpAxios from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm.js';
|
import driverHttpAxios from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm.js';
|
||||||
|
|||||||
@@ -24,44 +24,49 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/ksdocuments',
|
path: '/ksdocuments',
|
||||||
children: [
|
children: [
|
||||||
{path: '', name: 'ks-document', component: () => import('@/views/pages/ksDocuments/KsDocuments.vue')},
|
{ path: '', name: 'ks-document', component: () => import('@/views/pages/ksDocuments/KsDocuments.vue') },
|
||||||
{path: 'new', name: 'ks-document-new', component: () => import('@/views/pages/ksDocuments/KsNewDocumentForm.vue')},
|
{ path: 'new', name: 'ks-document-new', component: () => import('@/views/pages/ksDocuments/KsNewDocumentForm.vue') }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/ks_git_repos',
|
path: '/ks_git_repos',
|
||||||
children: [
|
children: [
|
||||||
{path: '', name: 'ks-git-repos', component: () => import('@/views/pages/ksGitRepo/KsGitRepos.vue')},
|
{ path: '', name: 'ks-git-repos', component: () => import('@/views/pages/ksGitRepo/KsGitRepos.vue') },
|
||||||
//{path: 'new', name: 'ks-git-repo-new', component: () => import('@/views/pages/ksGitRepo/KsNewGitRepoForm.vue')},
|
//{path: 'new', name: 'ks-git-repo-new', component: () => import('@/views/pages/ksGitRepo/KsNewGitRepoForm.vue')},
|
||||||
//{path: '/clone', name: 'ks-git-clone-repo', component: () => import('@/views/pages/ksGitRepo/KsGitCloneRepoForm.vue')},
|
//{path: '/clone', name: 'ks-git-clone-repo', component: () => import('@/views/pages/ksGitRepo/KsGitCloneRepoForm.vue')},
|
||||||
{path: 'ks_code_parser', name: 'ks_code_parser', component: () => import('@/views/pages/ksGitRepo/ksCodeParser/KsGitCodeParser.vue')}
|
{ path: 'ks_code_parser', name: 'ks_code_parser', component: () => import('@/views/pages/ksGitRepo/ksCodeParser/KsGitCodeParser.vue') }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/ks_similarity_search',
|
path: '/ks_similarity_search',
|
||||||
children: [
|
children: [{ path: '', name: 'ks_similarity_search', component: () => import('@/views/pages/similaritySearch/KsSimilaritySearch.vue') }]
|
||||||
{path: '', name: 'ks_similarity_search', component: () => import('@/views/pages/similaritySearch/KsSimilaritySearch.vue')},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/ks_vector_data',
|
path: '/ks_vector_data',
|
||||||
children: [
|
children: [{ path: '', name: 'ks_vector_data', component: () => import('@/views/pages/vectorDBSearch/KsVectorData.vue') }]
|
||||||
{path: '', name: 'ks_vector_data', component: () => import('@/views/pages/vectorDBSearch/KsVectorData.vue')},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/kstexts',
|
path: '/kstexts',
|
||||||
children: [
|
children: [{ path: '', name: 'ks-texts', component: () => import('@/views/pages/KsTexts.vue') }]
|
||||||
{path: '', name: 'ks-texts', component: () => import('@/views/pages/KsTexts.vue')},
|
}
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/auth/login',
|
path: '/auth/login',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
|
meta: {
|
||||||
|
auth: false
|
||||||
|
},
|
||||||
component: () => import('@/views/pages/auth/Login.vue')
|
component: () => import('@/views/pages/auth/Login.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/auth/callback',
|
||||||
|
name: 'test',
|
||||||
|
meta: {
|
||||||
|
auth: false
|
||||||
|
},
|
||||||
|
component: () => import('@/views/pages/auth/Callback.vue')
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
66
src/views/pages/auth/Callback.vue
Normal file
66
src/views/pages/auth/Callback.vue
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<script setup>
|
||||||
|
import { useAuth } from '@websanova/vue-auth/src/v3.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { msalInstance } from './MsalConfig'; // wherever you created your MSAL instance
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const auth = useAuth();
|
||||||
|
const message = ref('')
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
console.log("Mounted on callback")
|
||||||
|
|
||||||
|
await msalInstance.initialize()
|
||||||
|
console.log("After initialize on callback")
|
||||||
|
|
||||||
|
const response = await msalInstance.handleRedirectPromise()
|
||||||
|
|
||||||
|
console.log("Response:",response)
|
||||||
|
|
||||||
|
if (response) {
|
||||||
|
message.value ="Logging in to the application..."
|
||||||
|
localStorage.setItem('msalUser', JSON.stringify(response.account))
|
||||||
|
axios.post("/msauth/exchange",{}, {
|
||||||
|
headers: { Authorization: `Bearer ${response.accessToken}` }
|
||||||
|
}).then(res=>{
|
||||||
|
if(res.data.token){
|
||||||
|
auth.token(null,res.data.token,false);
|
||||||
|
auth.fetch().then(response=>{
|
||||||
|
console.log("1 user :" , response.data.data);
|
||||||
|
|
||||||
|
if (!response.data.data.selectedProject) {
|
||||||
|
router.push({ name: 'projects-list' });
|
||||||
|
} else {
|
||||||
|
router.push({ name: 'ks-document' });
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(res=>{
|
||||||
|
console.log("Error on token exchange:",res)
|
||||||
|
message.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
visible.value = true;
|
||||||
|
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
message.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
console.error("No token exchange with backend")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch(res=>{
|
||||||
|
console.log(res.data)
|
||||||
|
message.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>{{message}}</div>
|
||||||
|
</template>
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useLayout } from '@/layout/composables/layout';
|
import { useLayout } from '@/layout/composables/layout';
|
||||||
import { useAuth } from '@websanova/vue-auth/src/v3.js';
|
import { useAuth } from '@websanova/vue-auth/src/v3.js';
|
||||||
import { computed, ref } from 'vue';
|
import axios from 'axios';
|
||||||
|
import Message from 'primevue/message';
|
||||||
|
import { onMounted,computed, ref } from 'vue';
|
||||||
|
import { msalInstance, msalrequest } from './MsalConfig';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
//import logo from '@/assets/Logo_Apollo_Transparent.png';
|
//import logo from '@/assets/Logo_Apollo_Transparent.png';
|
||||||
import logo from '@/assets/apollo.jpg';
|
import logo from '@/assets/apollo.jpg';
|
||||||
@@ -19,7 +22,80 @@ const logoUrl = computed(() => {
|
|||||||
return `/layout/images/${isDarkTheme ? 'logo-white' : 'logo-dark'}.svg`;
|
return `/layout/images/${isDarkTheme ? 'logo-white' : 'logo-dark'}.svg`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const login = async () => {
|
const msaccount = ref(null);
|
||||||
|
onMounted(async () => {
|
||||||
|
await msalInstance.initialize()
|
||||||
|
const accounts = msalInstance.getAllAccounts()
|
||||||
|
|
||||||
|
console.log("Accounts:",accounts)
|
||||||
|
if (accounts.length > 0) {
|
||||||
|
console.log(accounts)
|
||||||
|
msaccount.value= accounts[0]
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const loginAD = async () => {
|
||||||
|
|
||||||
|
var token = await msalInstance.acquireTokenSilent({
|
||||||
|
scopes: msalrequest.scopes,
|
||||||
|
account: msaccount.value
|
||||||
|
})
|
||||||
|
console.log("Token " ,token)
|
||||||
|
|
||||||
|
axios.post("/msauth/exchange",{}, {
|
||||||
|
headers: { Authorization: `Bearer ${token.accessToken}` }
|
||||||
|
}).then(res=>{
|
||||||
|
console.log("Token exhange done :",res.data.token)
|
||||||
|
if(res.data.token){
|
||||||
|
auth.token(null, res.data.token,false)
|
||||||
|
auth.fetch().then(response=>{
|
||||||
|
console.log("1 user :" , response.data.data);
|
||||||
|
|
||||||
|
if (!response.data.data.selectedProject) {
|
||||||
|
router.push({ name: 'projects-list' });
|
||||||
|
} else {
|
||||||
|
router.push({ name: 'ks-document' });
|
||||||
|
}
|
||||||
|
console.log("response", response);
|
||||||
|
|
||||||
|
}).catch(res=>{
|
||||||
|
console.log("Error on token exchange:",res)
|
||||||
|
error.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
visible.value = true;
|
||||||
|
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
error.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
visible.value = true;
|
||||||
|
|
||||||
|
console.error("No token exchange with backend")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch(res=>{
|
||||||
|
console.log("Error on token exchange:",res)
|
||||||
|
error.value = "Error authenticating on the application. Did you ask for authorization?"
|
||||||
|
visible.value = true;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const loginMsal = async () => {
|
||||||
|
await msalInstance.initialize()
|
||||||
|
msalInstance.loginRedirect(msalrequest)
|
||||||
|
}
|
||||||
|
|
||||||
|
const logoutAD = async () => {
|
||||||
|
const logoutRequest = {
|
||||||
|
account: msaccount.value,
|
||||||
|
mainWindowRedirectUri:window.location.href,
|
||||||
|
};
|
||||||
|
await msalInstance.logoutPopup(logoutRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
const login_old = async () => {
|
||||||
try {
|
try {
|
||||||
await auth.login({
|
await auth.login({
|
||||||
data:{
|
data:{
|
||||||
@@ -33,7 +109,7 @@ const login = async () => {
|
|||||||
if (!response.data.data.selectedProject) {
|
if (!response.data.data.selectedProject) {
|
||||||
router.push({ name: 'projects-list' });
|
router.push({ name: 'projects-list' });
|
||||||
} else {
|
} else {
|
||||||
router.push({ name: 'ksdocuments' });
|
router.push({ name: 'ks-document' });
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("response", response);
|
console.log("response", response);
|
||||||
@@ -79,8 +155,8 @@ const login = async () => {
|
|||||||
<h1>Welcome to</h1>
|
<h1>Welcome to</h1>
|
||||||
<h1>WizardAI - KNOWLEDGE</h1>
|
<h1>WizardAI - KNOWLEDGE</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Username & Password Section -->
|
||||||
<div>
|
<div class="mb-10 w-full max-w-xl">
|
||||||
<label for="email1" class="block text-surface-900 dark:text-surface-0 text-xl font-medium mb-2">Username</label>
|
<label for="email1" class="block text-surface-900 dark:text-surface-0 text-xl font-medium mb-2">Username</label>
|
||||||
<InputText id="email1" type="text" placeholder="Username" class="w-full md:w-[30rem] mb-8" style="padding: 1rem" v-model="username" />
|
<InputText id="email1" type="text" placeholder="Username" class="w-full md:w-[30rem] mb-8" style="padding: 1rem" v-model="username" />
|
||||||
|
|
||||||
@@ -95,11 +171,31 @@ const login = async () => {
|
|||||||
<a class="font-medium no-underline ml-2 text-right cursor-pointer"
|
<a class="font-medium no-underline ml-2 text-right cursor-pointer"
|
||||||
style="color: var(--primary-color)">Forgot password?</a>
|
style="color: var(--primary-color)">Forgot password?</a>
|
||||||
</div> -->
|
</div> -->
|
||||||
<Button label="Sign In" @click="login" class="w-full p-4 text-xl"></Button>
|
<Button @click="login_old" label="Sign In with Username and Password" class="w-full p-4 text-xl"></Button>
|
||||||
|
|
||||||
<Message v-if="visible" severity="error" :life="3000" class="mt-2 error-message">{{ error }}</Message>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Divider -->
|
||||||
|
<div class="my-6 w-full max-w-xl flex items-center justify-center">
|
||||||
|
<hr class="flex-grow border-t border-gray-300 dark:border-gray-700" />
|
||||||
|
<span class="mx-4 text-gray-500 dark:text-gray-400">Sign in with Microsoft Azure AD</span>
|
||||||
|
<hr class="flex-grow border-t border-gray-300 dark:border-gray-700" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Azure AD Section -->
|
||||||
|
<div class="w-full max-w-xl">
|
||||||
|
|
||||||
|
<Button @click="loginMsal" v-if="msaccount == null" label="Sign In with Microsoft AD"
|
||||||
|
class="w-full text-l mb-4" />
|
||||||
|
|
||||||
|
<Button @click="loginAD" v-if="msaccount" :label="'Login ' + msaccount.username"
|
||||||
|
class="w-full text-l mb-4" />
|
||||||
|
|
||||||
|
<Button @click="logoutAD" v-if="msaccount" label="Logout AD" severity="warn"
|
||||||
|
class="w-full text-l mb-4" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Error Message -->
|
||||||
|
<Message v-if="visible" severity="error" :life="5000" class="mt-4 error-message">{{ error }}</Message>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
32
src/views/pages/auth/MsalConfig.js
Normal file
32
src/views/pages/auth/MsalConfig.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { PublicClientApplication } from '@azure/msal-browser';
|
||||||
|
|
||||||
|
export const msalInstance = new PublicClientApplication({
|
||||||
|
auth: {
|
||||||
|
clientId: '1ddbd871-9544-4a31-97a4-2968ce08e49a', //'d3fee0e3-49e0-4910-b0b4-805bfbd5488a',
|
||||||
|
authority: 'https://login.microsoftonline.com/e0793d39-0939-496d-b129-198edd916feb/', //'https://login.microsoftonline.com/9dc4721e-4d54-4c40-a681-1dd740292901/', //
|
||||||
|
redirectUri: 'http://localhost:5173/auth/callback', // or your deployed URL
|
||||||
|
navigateToLoginRequestUrl: false
|
||||||
|
},
|
||||||
|
cache: {
|
||||||
|
cacheLocation: 'localStorage',
|
||||||
|
storeAuthStateInCookie: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
export const msalInstance = new PublicClientApplication({
|
||||||
|
auth: {
|
||||||
|
clientId: 'd3fee0e3-49e0-4910-b0b4-805bfbd5488a',
|
||||||
|
authority: "https://login.microsoftonline.com/9dc4721e-4d54-4c40-a681-1dd740292901",
|
||||||
|
redirectUri: "http://localhost:5173/auth/callback", // or your deployed URL
|
||||||
|
navigateToLoginRequestUrl: false,
|
||||||
|
},
|
||||||
|
cache: {
|
||||||
|
cacheLocation: "localStorage",
|
||||||
|
storeAuthStateInCookie: false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
export const msalrequest = {
|
||||||
|
scopes: ['1ddbd871-9544-4a31-97a4-2968ce08e49a/.default'] //['api://d3fee0e3-49e0-4910-b0b4-805bfbd5488a/access_as_user']
|
||||||
|
};
|
||||||
@@ -147,7 +147,7 @@ const filters = ref();
|
|||||||
const userPrefStore = UserPrefStore();
|
const userPrefStore = UserPrefStore();
|
||||||
const ksDocumentStore = KsDocumentStore();
|
const ksDocumentStore = KsDocumentStore();
|
||||||
const loadingStore = LoadingStore();
|
const loadingStore = LoadingStore();
|
||||||
const fe_status = ref("");
|
const fe_status = ref('');
|
||||||
|
|
||||||
const initFilters = () => {
|
const initFilters = () => {
|
||||||
filters.value = {
|
filters.value = {
|
||||||
|
|||||||
@@ -1,39 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="content-section introduction big-title">
|
<!-- <div class="card"> -->
|
||||||
<div class="feature-intro">
|
|
||||||
<h1>Repository <span>DataTable</span></h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<Toast />
|
<Toast />
|
||||||
<ConfirmPopup></ConfirmPopup>
|
<ConfirmPopup></ConfirmPopup>
|
||||||
<Toolbar class="mb-6">
|
|
||||||
<template #start>
|
|
||||||
<Button label="Refresh" icon="pi pi-refresh" class="mr-2"
|
|
||||||
@click="refreshPage" v-tooltip.top="'Refresh all records'" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #end>
|
|
||||||
<Button label="Expand All" icon="pi pi-plus" class="mr-3"
|
|
||||||
@click="expandAll" v-tooltip.top="'Expand all records'" />
|
|
||||||
<Button label="Collapse All" icon="pi pi-minus" class="mr-3"
|
|
||||||
@click="collapseAll" v-tooltip.top="'Collapse all records'" />
|
|
||||||
<!--Button label="Add New Git Repo" icon="pi pi-plus" severity="secondary" rounded class="mr-3" @click="newCodeRepoForm()" v-tooltip.top="'Add New Git Repo'" class="mr-2" /-->
|
|
||||||
<!--Button label="Add Git Repo" icon="pi pi-bolt" severity="secondary" rounded @click="cloneRepoForm()" v-tooltip.top="'Add New Git Repo'" /-->
|
|
||||||
<Button label="New Git Repository" icon="pi pi-bolt"
|
|
||||||
@click="showDialog = true" v-tooltip.top="'Add New Git Repository'" />
|
|
||||||
|
|
||||||
<Dialog v-model:visible="showDialog" :style="{ width: '50rem' }" header="Repository Details"
|
|
||||||
:modal="true">
|
|
||||||
<div>
|
|
||||||
<cloneForm @submitForm="cloneRepo" @cancel="showDialog = false" />
|
|
||||||
</div>
|
|
||||||
</Dialog>
|
|
||||||
</template>
|
|
||||||
</Toolbar>
|
|
||||||
|
|
||||||
<DataTable v-model:filters="filters" v-model:expandedRows="expandedRows" @rowExpand="onRowExpand"
|
<DataTable v-model:filters="filters" v-model:expandedRows="expandedRows" @rowExpand="onRowExpand"
|
||||||
@rowCollapse="onRowCollapse" :value="codeRepoInfo" :paginator="true" :rows="10"
|
@rowCollapse="onRowCollapse" :value="codeRepoInfo" :paginator="true" :rows="10"
|
||||||
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown"
|
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown"
|
||||||
@@ -44,8 +13,9 @@
|
|||||||
:globalFilterFields="['branch', 'cloneStatus', 'ingestionStatus', 'ingestionDateFormat']"
|
:globalFilterFields="['branch', 'cloneStatus', 'ingestionStatus', 'ingestionDateFormat']"
|
||||||
tableStyle="min-width: 70rem" removableSort>
|
tableStyle="min-width: 70rem" removableSort>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex flex-wrap gap-2 items-center justify-between">
|
<div class="flex items-center justify-between gap-4 p-4 ">
|
||||||
<h4 class="m-0">Manage Repositories</h4>
|
<span class="text-xl font-bold">Repository DataTable</span>
|
||||||
|
<div class="flex items-center gap-2 flex-grow">
|
||||||
<IconField>
|
<IconField>
|
||||||
<InputIcon>
|
<InputIcon>
|
||||||
<i class="pi pi-search" />
|
<i class="pi pi-search" />
|
||||||
@@ -53,9 +23,26 @@
|
|||||||
<InputText v-model="filters['global'].value" placeholder="Search..." />
|
<InputText v-model="filters['global'].value" placeholder="Search..." />
|
||||||
</IconField>
|
</IconField>
|
||||||
</div>
|
</div>
|
||||||
|
<Button icon="pi pi-refresh" rounded raised class="mr-1 p-button-sm"
|
||||||
|
@click="refreshPage" v-tooltip.top="'Refresh all records'" />
|
||||||
|
<Button icon="pi pi-plus" rounded raised class="mr-1 p-button-sm"
|
||||||
|
@click="expandAll" v-tooltip.top="'Expand all records'" />
|
||||||
|
<Button icon="pi pi-minus" rounded raised class="mr-1 p-button-sm"
|
||||||
|
@click="collapseAll" v-tooltip.top="'Collapse all records'" />
|
||||||
|
<!--Button label="Add New Git Repo" icon="pi pi-plus" severity="secondary" rounded class="mr-3" @click="newCodeRepoForm()" v-tooltip.top="'Add New Git Repo'" class="mr-1" /-->
|
||||||
|
<!--Button label="Add Git Repo" icon="pi pi-bolt" severity="secondary" rounded @click="cloneRepoForm()" v-tooltip.top="'Add New Git Repo'" /-->
|
||||||
|
<Button icon="pi pi-bolt" rounded raised class="p-button-sm"
|
||||||
|
@click="showDialog = true" v-tooltip.top="'Add New Git Repository'" />
|
||||||
|
<Dialog v-model:visible="showDialog" :style="{ width: '50rem' }" header="Repository Details"
|
||||||
|
:modal="true">
|
||||||
|
<div>
|
||||||
|
<cloneForm @submitForm="cloneRepo" @cancel="showDialog = false" />
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #groupheader="slotProps">
|
<template #groupheader="slotProps">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2" style="background: '#f3f3f3'">
|
||||||
<img :alt="slotProps.data.repoName" :src="logoSrc" width="32" style="vertical-align: middle" />
|
<img :alt="slotProps.data.repoName" :src="logoSrc" width="32" style="vertical-align: middle" />
|
||||||
<span>{{ slotProps.data.repoName }}</span>
|
<span>{{ slotProps.data.repoName }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -176,25 +163,25 @@
|
|||||||
</Column>
|
</Column>
|
||||||
|
|
||||||
<!--Column header="Actions" headerStyle="width: 5rem; text-align: center" bodyStyle="text-align: center; overflow: visible"-->
|
<!--Column header="Actions" headerStyle="width: 5rem; text-align: center" bodyStyle="text-align: center; overflow: visible"-->
|
||||||
<Column :exportable="false" style="min-width: 12rem">
|
<Column field="id" header="A" :style="{minWidth: '12rem', position: 'sticky', right: '0', zIndex: '1', background: '#f3f3f3'}" :showFilterMatchModes="false">
|
||||||
<template #body="slotProps">
|
<div class="flex justify-center items-center space-x-3">
|
||||||
|
<template #body="slotProps" class="flex justify-center items-center space-x-3">
|
||||||
<Button text raised rounded severity="info" type="button" class="mr-2" icon="pi pi-play"
|
<Button raised rounded type="button" class="mr-2" icon="pi pi-play"
|
||||||
@click="parseGitRepo(slotProps.data)" v-tooltip.top="'Start Parsing of Repo'"
|
@click="parseGitRepo(slotProps.data)" v-tooltip.top="'Start Parsing of Repo'"
|
||||||
:disabled="isButtonDisabled(slotProps.data)" />
|
:disabled="isButtonDisabled(slotProps.data)" />
|
||||||
|
|
||||||
<Button text raised rounded severity="warn" type="button" class="mr-2" icon="pi pi-play"
|
<Button raised rounded type="button" class="mr-2" icon="pi pi-play"
|
||||||
@click="reverserEnginneringGitRepo(slotProps.data)" v-tooltip.top="'Start RE of Repo'"
|
@click="reverserEnginneringGitRepo(slotProps.data)" v-tooltip.top="'Start RE of Repo'"
|
||||||
:disabled="isButtonDisabled(slotProps.data)" />
|
:disabled="isButtonDisabled(slotProps.data)" />
|
||||||
|
|
||||||
<!--Button text raised rounded severity="warn" type="button" class="mr-2" icon="pi pi-forward"
|
<!--Button raised rounded severity="warn" type="button" class="mr-2" icon="pi pi-forward"
|
||||||
@click="reIngestWithPullChanges(slotProps.data)"
|
@click="reIngestWithPullChanges(slotProps.data)"
|
||||||
v-tooltip.top="'Ingest Latest changes From Git'" /-->
|
v-tooltip.top="'Ingest Latest changes From Git'" /-->
|
||||||
|
|
||||||
<Button text raised rounded severity="danger" type="button" icon="pi pi-trash"
|
<Button raised rounded type="button" icon="pi pi-trash"
|
||||||
@click="deleteRecordsFromVectorStore(slotProps.data)" v-tooltip.top="'Delete Records'" />
|
@click="deleteRecordsFromVectorStore(slotProps.data)" v-tooltip.top="'Delete Records'" />
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
</div>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
||||||
|
|
||||||
@@ -207,13 +194,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #groupfooter="slotProps">
|
<template #groupfooter="slotProps">
|
||||||
<div class="flex justify-end font-bold w-full">
|
<div class="flex justify-end font-bold w-full" style="background-color: #f3f3f3;">
|
||||||
Total Count: {{ calculateCustomerTotal(slotProps.data.repoName) }}
|
Total Count: {{ calculateCustomerTotal(slotProps.data.repoName) }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
Reference in New Issue
Block a user