Skip to content

UI tweaks & bugfixes #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/components/ACLEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,13 @@ export default {
});
});
},
generateAclTable(group) {
generateAclTable(obj) {
let memberList = [];
for (let key in group.acls) {
if (group.acls[key].role != 0) {
let id = group.acls[key].source.replace("users/", "");
memberList.push({ name: key, id, ...group.acls[key] });
console.log(obj);
for (let key in obj.acls) {
if (obj.acls[key].role != 0) {
let id = obj.acls[key].source.replace("users/", "");
memberList.push({ name: key, id, ...obj.acls[key] });
}
}
return memberList;
Expand Down Expand Up @@ -303,7 +304,7 @@ export default {
},
mounted() {
this.listUsers();
this.getMembershipData();
this.ACLTableData = this.generateAclTable(this.object);
},
watch: {
group: {
Expand Down
12 changes: 10 additions & 2 deletions src/components/DFIQ/EditDFIQObject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
density="compact"
></v-text-field>
<v-text-field
label="DFIQ ID"
label="DFIQ ID (optional)"
placeholder="e.g. S0001, F0001, Q0001"
persistent-placeholder
v-model="parsedYaml.id"
Expand Down Expand Up @@ -55,6 +55,14 @@
density="compact"
:delimiters="[',', ' ', ';']"
></v-combobox>
<v-combobox
label="Contributors"
v-model="parsedYaml.contributors"
chips
multiple
density="compact"
:delimiters="[',', ' ', ';']"
></v-combobox>
<v-textarea
label="Description (optional)"
:placeholder="placeholders['description']"
Expand Down Expand Up @@ -454,7 +462,7 @@ export default {
},
validatingYaml: false,
yamlValidationError: { valid: true },
updateApproachIndicators: true,
updateApproachIndicators: false,
dialogDelete: false,
activeTab: "user-form",
parsedYaml: {},
Expand Down
38 changes: 15 additions & 23 deletions src/components/GraphObjects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
name: "GraphObjects",

props: {
id: { type: String, required: true },
object: { type: Object, required: true },
sourceType: { type: String, default: "observable" }
},

Expand Down Expand Up @@ -361,7 +361,7 @@ export default {
this.selected_dfiq
);
let graphSearchRequest = {
source: `${this.sourceType}/${this.id}`,
source: `${this.sourceType}/${this.object.id}`,
target_types: target_types,
graph: "links",
hops: 1,
Expand Down Expand Up @@ -495,27 +495,19 @@ export default {
},

getObjectDetails() {
axios
.get(`/api/v2/${this.sourceType}/${this.id}`)
.then(response => {
var data = response.data;
if (data.root_type == "observable") {
var label = data.value;
delete data.value;
} else {
var label = data.name;
delete data.name;
}
data.label = label;
data.object_type = data.type;
delete data.type;
data.yeti_object_id = `${this.sourceType}/${this.id}`;
this.selected_node = { ...data };
})
.catch(error => {
console.log(error);
})
.finally();
var data = { ...this.object };
if (data.root_type == "observable") {
var label = data.value;
delete data.value;
} else {
var label = data.name;
delete data.name;
}
data.label = label;
data.object_type = data.type;
delete data.type;
data.yeti_object_id = `${this.sourceType}/${this.id}`;
this.selected_node = data;
}
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/views/ObjectDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-container fluid>
<v-row align="start" no-gutters>
<v-col>
<v-card class="ma-2" variant="flat">
<v-card class="ma-2" variant="flat" :loading="!object">
<template v-slot:title>
<div class="d-flex yeti-object-title">
<div>
Expand All @@ -29,7 +29,7 @@
>

<object-context
v-if="object"
v-if="object?.context"
:context="object.context"
@update:context="ctx => (object.context = ctx)"
:update-endpoint="`${typeToEndpointMapping[objectType]}/${object.id}`"
Expand Down Expand Up @@ -177,7 +177,7 @@
</v-row>
<v-row>
<v-container fluid>
<v-sheet>
<v-sheet v-if="object">
<v-tabs v-model="activeTab" color="primary">
<v-tab value="related-dfiq-tree" href="#dfiq-tree" v-if="object?.root_type === 'dfiq'"
><v-icon size="x-large" start>mdi-file-tree</v-icon>DFIQ tree</v-tab
Expand Down Expand Up @@ -244,7 +244,7 @@
</v-window-item>

<v-window-item value="related-graph" eager>
<graph-objects :id="id" :source-type="typeToEndpointMapping[objectType]" />
<graph-objects :object="object" :source-type="typeToEndpointMapping[objectType]" />
</v-window-item>

<v-window-item value="related-observables" eager class="my-4">
Expand Down
8 changes: 4 additions & 4 deletions src/views/ObservableDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-container fluid>
<v-row align="start" no-gutters>
<v-col cols="8">
<v-card class="ma-2 break-title" variant="flat">
<v-card class="ma-2 break-title" variant="flat" :loading="!observable">
<template v-slot:title>
<div class="d-flex">
<v-chip class="mr-3 flex-shrink-0" color="primary" :text="observable?.type" label></v-chip>
Expand Down Expand Up @@ -187,7 +187,7 @@
</v-row>
<v-row>
<v-container fluid>
<v-sheet>
<v-sheet v-if="observable">
<v-tabs v-model="activeTab" color="primary">
<v-tab value="graph" @click="emitRefreshGraph"
><v-icon @click="emitRefreshGraph" size="x-large" start>mdi-graph</v-icon>Graph (Beta)
Expand All @@ -206,9 +206,9 @@
</v-tab>
</v-tabs>

<v-window v-model="activeTab" class="pa-5">
<v-window v-model="activeTab" class="pa-5" v-if="observable">
<v-window-item value="graph">
<graph-objects :id="id" source-type="observables" />
<graph-objects :object="observable" source-type="observables" />
</v-window-item>
<v-window-item value="related-observables" eager>
<direct-neighbors
Expand Down