-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b49debd
commit b354f44
Showing
10 changed files
with
14,235 additions
and
17,184 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { ref, computed } from "vue"; | ||
import { defineStore } from "pinia"; | ||
|
||
import axios from "axios"; | ||
|
||
import type { Model } from "@/types"; | ||
|
||
export const useStore = defineStore("model", () => { | ||
const worst_models: { [key: string]: any } = ref<{}>({}); | ||
const model_instances = ref<Model[]>([]); | ||
|
||
const selectedOwners = ref<string[]>([]); | ||
|
||
const fetch_all_worst_models = async () => { | ||
const r = await axios.get<{}>(`${import.meta.env.VITE_APP_API_URL}/models`); | ||
console.info("modelStore: fetched all worst_models"); | ||
worst_models.value = r.data; | ||
}; | ||
|
||
const fetch_all_instances = async (model_name: string) => { | ||
const r = await axios.get<Model[]>( | ||
`${import.meta.env.VITE_APP_API_URL}/${model_name}` | ||
); | ||
console.info( | ||
`modelStore: fetched all model instances for model ${model_name}` | ||
); | ||
model_instances.value = r.data; | ||
}; | ||
|
||
const add_selected_owners = (owners: string[]) => { | ||
selectedOwners.value = owners; | ||
}; | ||
const get_unique_owners = computed(() => { | ||
const s = new Set<string>(); | ||
model_instances.value.forEach((instance) => s.add(instance.owned_by)); | ||
return Array.from(s).sort(); | ||
}); | ||
|
||
const clear_filters = () => { | ||
selectedOwners.value = []; | ||
}; | ||
|
||
const include_models_by_owners = (x: Model) => { | ||
if (selectedOwners.value.length === 0) return true; | ||
return selectedOwners.value.includes(x.owned_by); | ||
}; | ||
|
||
const get_filtered_models = () => { | ||
return model_instances.value.filter((x) => include_models_by_owners(x)); | ||
}; | ||
|
||
return { | ||
get_filtered_models, | ||
clear_filters, | ||
add_selected_owners, | ||
get_unique_owners, | ||
fetch_all_worst_models, | ||
worst_models, | ||
fetch_all_instances, | ||
model_instances, | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,20 @@ | ||
export interface AccountOverview { | ||
account_id: string; | ||
export interface WorstModel { | ||
name: string; | ||
owned_by: string; | ||
status: string; | ||
due_date: string; | ||
tags: string[]; | ||
created_at: string; | ||
created_by: string; | ||
updated_at: string; | ||
updaded_by: string; | ||
attachments: string[]; | ||
} | ||
|
||
export interface Model { | ||
field: string; | ||
header: string; | ||
visible: boolean; | ||
type: string; | ||
svg_path: string; | ||
} | ||
|
||
export interface Account { | ||
account_id: string; | ||
export interface Model { | ||
id: string; | ||
name: string; | ||
owned_by: string; | ||
status: string; | ||
due_date: string; | ||
tags: string[]; | ||
text: string; | ||
created_at: string; | ||
created_by: string; | ||
updated_at: string; | ||
updaded_by: string; | ||
attachments: string[]; | ||
} | ||
|
||
export interface OpportunityOverviewWithAccountName { | ||
account_id: string; | ||
opportunity_id: string; | ||
name: string; | ||
owned_by: string; | ||
} | ||
|
||
export interface ContactWithAccountName { | ||
account_id: string; | ||
account_name: string; | ||
contact_id: string; | ||
fname: string; | ||
lname: string; | ||
role_title: string; | ||
email: string; | ||
telephone_number: string; | ||
tags: string[]; | ||
business_card: string; | ||
created_at: string; | ||
created_by: string; | ||
updated_at: string; | ||
updaded_by: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<template> | ||
<div class="flex"> | ||
<ContextBarAdmin /> | ||
<ContentContainer /> | ||
</div> | ||
<div class="flex">------------ADMINVIEW</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ContextBarAdmin from "@/components/ContextBarAdmin.vue"; | ||
import ContentContainer from "@/components/ContentContainer.vue"; | ||
// import ContextBarAdmin from "@/components/ContextBarAdmin.vue"; | ||
// import ContentContainer from "@/components/ContentContainer.vue"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<template> | ||
<div class="flex"> | ||
<ContextBarHome /> | ||
===================HOMEVIEW | ||
<!-- <ContextBarHome /> --> | ||
<!-- <ContentContainer /> --> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ContextBarHome from "@/components/ContextBarHome.vue"; | ||
import ContentContainer from "@/components/ContentContainer.vue"; | ||
// import ContextBarHome from "@/components/ContextBarHome.vue"; | ||
// import ContentContainer from "@/components/ContentContainer.vue"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.