Skip to content
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

Refactor UI #1003

Merged
merged 9 commits into from
Oct 22, 2019
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
4 changes: 2 additions & 2 deletions api_client/python/timesketch_api_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def list_aggregations(self):
"""
data = self.lazyload_data()
aggregations = []
for aggregation in data['meta']['saved_aggregations']:
for aggregation in data['aggregations']:
aggregation_obj = Aggregation(
sketch=self, api=self.api)
aggregation_obj.from_store(aggregation_id=aggregation['id'])
Expand All @@ -413,7 +413,7 @@ def get_aggregation(self, aggregation_id):
otherwise None object.
"""
sketch = self.lazyload_data()
for aggregation in sketch['meta']['saved_aggregations']:
for aggregation in sketch['aggregations']:
if aggregation['id'] != aggregation_id:
continue
aggregation_obj = Aggregation(sketch=self, api=self.api)
Expand Down
7 changes: 1 addition & 6 deletions timesketch/api/v1/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class ResourceMixin(object):
'user': fields.Nested(user_fields),
'timelines': fields.List(fields.Nested(timeline_fields)),
'stories': fields.List(fields.Nested(story_fields)),
'aggregations': fields.Nested(aggregation_fields),
'active_timelines': fields.List(fields.Nested(timeline_fields)),
'status': fields.Nested(status_fields),
'created_at': fields.DateTime,
Expand Down Expand Up @@ -371,12 +372,6 @@ def get(self, sketch_id):
}
meta = dict(
aggregators=aggregators,
saved_aggregations=[{
'name': aggregation.name,
'id': aggregation.id,
'created_at': aggregation.created_at,
'updated_at': aggregation.updated_at
} for aggregation in sketch.get_named_aggregations],
views=[{
'name': view.name,
'id': view.id,
Expand Down

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions timesketch/frontend/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<<<<<<< HEAD
<!DOCTYPE html><html lang=en><head><meta name=csrf-token content="{{ csrf_token() }}"><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/dist/favicon.ico><title>Timesketch</title><link href=/dist/css/chunk-common.47ea6fbe.css rel=preload as=style><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=preload as=style><link href=/dist/js/chunk-common.383c5c14.js rel=preload as=script><link href=/dist/js/chunk-vendors.0cb9db01.js rel=preload as=script><link href=/dist/js/index.0c45ccdf.js rel=preload as=script><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=stylesheet><link href=/dist/css/chunk-common.47ea6fbe.css rel=stylesheet></head><body><div id=app></div><script src=/dist/js/chunk-vendors.0cb9db01.js></script><script src=/dist/js/chunk-common.383c5c14.js></script><script src=/dist/js/index.0c45ccdf.js></script></body></html>
=======
<!DOCTYPE html><html lang=en><head><meta name=csrf-token content="{{ csrf_token() }}"><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/dist/favicon.ico><title>Timesketch</title><link href=/dist/css/chunk-common.d79d4638.css rel=preload as=style><link href=/dist/js/chunk-common.5900ae37.js rel=preload as=script><link href=/dist/js/chunk-vendors.85ca56fe.js rel=preload as=script><link href=/dist/js/index.0c45ccdf.js rel=preload as=script><link href=/dist/css/chunk-common.d79d4638.css rel=stylesheet></head><body><div id=app></div><script src=/dist/js/chunk-vendors.85ca56fe.js></script><script src=/dist/js/chunk-common.5900ae37.js></script><script src=/dist/js/index.0c45ccdf.js></script></body></html>
>>>>>>> master
<!DOCTYPE html><html lang=en><head><meta name=csrf-token content="{{ csrf_token() }}"><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/dist/favicon.ico><title>Timesketch</title><link href=/dist/css/chunk-common.9c48d9e1.css rel=preload as=style><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=preload as=style><link href=/dist/js/chunk-common.aad7f705.js rel=preload as=script><link href=/dist/js/chunk-vendors.0cb9db01.js rel=preload as=script><link href=/dist/js/index.0c45ccdf.js rel=preload as=script><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=stylesheet><link href=/dist/css/chunk-common.9c48d9e1.css rel=stylesheet></head><body><div id=app></div><script src=/dist/js/chunk-vendors.0cb9db01.js></script><script src=/dist/js/chunk-common.aad7f705.js></script><script src=/dist/js/index.0c45ccdf.js></script></body></html>
2 changes: 0 additions & 2 deletions timesketch/frontend/dist/js/chunk-common.383c5c14.js

This file was deleted.

1 change: 0 additions & 1 deletion timesketch/frontend/dist/js/chunk-common.383c5c14.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions timesketch/frontend/dist/js/chunk-common.5900ae37.js

This file was deleted.

1 change: 0 additions & 1 deletion timesketch/frontend/dist/js/chunk-common.5900ae37.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions timesketch/frontend/dist/js/chunk-common.aad7f705.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions timesketch/frontend/dist/js/chunk-common.aad7f705.js.map

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions timesketch/frontend/dist/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@
.card-content {
justify-content: center;
align-items: center;
<<<<<<< HEAD
}</style><link href=/dist/css/chunk-common.47ea6fbe.css rel=preload as=style><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=preload as=style><link href=/dist/js/chunk-common.383c5c14.js rel=preload as=script><link href=/dist/js/chunk-vendors.0cb9db01.js rel=preload as=script><link href=/dist/js/login.c1fa2383.js rel=preload as=script><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=stylesheet><link href=/dist/css/chunk-common.47ea6fbe.css rel=stylesheet></head><body class=login-page><div class=columns><div class=column><div class="card is-wide has-text-centered"><div class=card-content><div class=content><div><img src=/dist/timesketch-color.png style=width:40px;><div style="color: #333; font-size: 1.5em;">time<b>sketch</b></div><div style="color: #666; font-size: 0.8em;">Digital Forensic Timeline Analysis</div></div><br><form method=post style="width:50%;margin-left: auto; margin-right: auto;"><div class=field><div class=control><input type=text class=input name=username placeholder=Username style=text-align:center;></div></div><div class=field><div class=control><input type=password class=input name=password placeholder=Password style=text-align:center;></div></div><div class=field><div class="control has-text-centered"><button type=submit class="button is-rounded is-wide is-info" style=width:100%;>Sign in</button></div></div>{{ form.csrf_token }}</form></div></div></div></div></div><script src=/dist/js/chunk-vendors.0cb9db01.js></script><script src=/dist/js/chunk-common.383c5c14.js></script><script src=/dist/js/login.c1fa2383.js></script></body></html>
=======
}</style><link href=/dist/css/chunk-common.d79d4638.css rel=preload as=style><link href=/dist/js/chunk-common.5900ae37.js rel=preload as=script><link href=/dist/js/chunk-vendors.85ca56fe.js rel=preload as=script><link href=/dist/js/login.c1fa2383.js rel=preload as=script><link href=/dist/css/chunk-common.d79d4638.css rel=stylesheet></head><body class=login-page><div class=columns><div class=column><div class="card is-wide has-text-centered"><div class=card-content><div class=content><div><img src=/dist/timesketch-color.png style=width:40px;><div style="color: #333; font-size: 1.5em;">time<b>sketch</b></div><div style="color: #666; font-size: 0.8em;">Digital Forensic Timeline Analysis</div></div><br><form method=post style="width:50%;margin-left: auto; margin-right: auto;"><div class=field><div class=control><input type=text class=input name=username placeholder=Username style=text-align:center;></div></div><div class=field><div class=control><input type=password class=input name=password placeholder=Password style=text-align:center;></div></div><div class=field><div class="control has-text-centered"><button type=submit class="button is-rounded is-wide is-info" style=width:100%;>Sign in</button></div></div>{{ form.csrf_token }}</form></div></div></div></div></div><script src=/dist/js/chunk-vendors.85ca56fe.js></script><script src=/dist/js/chunk-common.5900ae37.js></script><script src=/dist/js/login.c1fa2383.js></script></body></html>
>>>>>>> master
}</style><link href=/dist/css/chunk-common.9c48d9e1.css rel=preload as=style><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=preload as=style><link href=/dist/js/chunk-common.aad7f705.js rel=preload as=script><link href=/dist/js/chunk-vendors.0cb9db01.js rel=preload as=script><link href=/dist/js/login.c1fa2383.js rel=preload as=script><link href=/dist/css/chunk-vendors.52c8c6fd.css rel=stylesheet><link href=/dist/css/chunk-common.9c48d9e1.css rel=stylesheet></head><body class=login-page><div class=columns><div class=column><div class="card is-wide has-text-centered"><div class=card-content><div class=content><div><img src=/dist/timesketch-color.png style=width:40px;><div style="color: #333; font-size: 1.5em;">time<b>sketch</b></div><div style="color: #666; font-size: 0.8em;">Digital Forensic Timeline Analysis</div></div><br><form method=post style="width:50%;margin-left: auto; margin-right: auto;"><div class=field><div class=control><input type=text class=input name=username placeholder=Username style=text-align:center;></div></div><div class=field><div class=control><input type=password class=input name=password placeholder=Password style=text-align:center;></div></div><div class=field><div class="control has-text-centered"><button type=submit class="button is-rounded is-wide is-info" style=width:100%;>Sign in</button></div></div>{{ form.csrf_token }}</form></div></div></div></div></div><script src=/dist/js/chunk-vendors.0cb9db01.js></script><script src=/dist/js/chunk-common.aad7f705.js></script><script src=/dist/js/login.c1fa2383.js></script></body></html>
18 changes: 1 addition & 17 deletions timesketch/frontend/src/components/AppNavbarSecondary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,14 @@ limitations under the License.
</router-link>
</li>
<li v-bind:class="{'is-active': currentPage === 'stories'}">
<router-link :to="{ name: 'SketchStory' }">
<router-link :to="{ name: 'SketchStoryOverview' }">
<span class="icon is-small"><i class="fas fa-book" aria-hidden="true"></i></span>
<span>Stories</span>
</router-link>
</li>
</ul>
</div>
</div>
<div class="navbar-item" v-if="currentAppContext === 'explore'">
<div class="tabs">
<ul>
<li v-bind:class="{'is-active': currentPage === 'search'}">
<router-link :to="{ name: 'SketchExplore' }">
<span>Search</span>
</router-link>
</li>
<li v-bind:class="{'is-active': currentPage === 'aggregation'}">
<router-link :to="{ name: 'SketchExploreAggregation' }">
<span>Aggregations</span>
</router-link>
</li>
</ul>
</div>
</div>
<div class="navbar-end">
<div class="navbar-item">
<slot></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'
import ApiClient from '../../utils/RestApiClient'

export default {
name: 'ts-home-sketch-create-form',
data () {
return {
form: {
Expand Down Expand Up @@ -68,5 +67,3 @@ export default {
}
</script>

<!-- CSS scoped to this component only -->
<style scoped lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'

export default {
name: 'ts-home-sketch-list',
props: ['sketches'],
props: ['sketches']
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'
import ApiClient from '../../utils/RestApiClient'
import TsVegaLiteChart from './VegaLiteChart'
import TsDynamicForm from './DynamicForm'
import TsSketchExploreAggregatorListDropdown from './SketchExploreAggregatorListDropdown'
import TsSketchExploreAggregatorListDropdown from './AggregationListDropdown'

export default {
name: 'ts-sketch-explore-aggregation',
components: {
TsDynamicForm,
TsVegaLiteChart,
Expand All @@ -48,9 +47,6 @@ export default {
computed: {
sketch () {
return this.$store.state.sketch
},
meta () {
return this.$store.state.meta
}
},
methods: {
Expand Down Expand Up @@ -81,5 +77,3 @@ export default {

}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,24 @@ limitations under the License.

<script>
export default {
name: 'ts-sketch-explore-aggregator-list-dropdown',
props: ['isRounded', 'title'],
data () {
return {
selected: '',
selectedChart: ''
}
},
computed: {
meta () {
return this.$store.state.meta
}
},
methods: {
setActiveAggregator: function () {
let aggregatorClone = JSON.parse(JSON.stringify(this.meta.aggregators[this.selected]))
aggregatorClone.name = this.selected
this.$emit('setActiveAggregator', aggregatorClone)
}
},
computed: {
sketch () {
return this.$store.state.sketch
},
meta () {
return this.$store.state.meta
}
}
}
</script>

<!-- CSS scoped to this component only -->
<style scoped lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'
import ApiClient from '../../utils/RestApiClient'

export default {
name: 'ts-home-sketch-create-form',
data () {
return {
title: ''
Expand Down Expand Up @@ -63,6 +62,3 @@ export default {
}
}
</script>

<!-- CSS scoped to this component only -->
<style scoped lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'
import ApiClient from '../../utils/RestApiClient'

export default {
name: 'ts-home-sketch-create-form',
props: [
'sketchId',
'currentQueryString',
Expand Down Expand Up @@ -62,6 +61,3 @@ export default {
}
}
</script>

<!-- CSS scoped to this component only -->
<style scoped lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ import TsDynamicFormTextInput from './DynamicFormTextInput'
import TsDynamicFormSelectInput from './DynamicFormSelectInput'

export default {
name: 'ts-dynamic-form',
props: ['schema', 'value'],
components: { TsDynamicFormTextInput, TsDynamicFormSelectInput },
props: ['schema', 'value'],
data () {
return {
formData: this.value || {}
Expand All @@ -52,5 +51,3 @@ export default {
}
}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ limitations under the License.

<script>
export default {
name: 'ts-dynamic-form-radio-input',
props: ['options', 'label', 'value']
}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ limitations under the License.
</template>
<script>
export default {
name: 'ts-dynamic-form-text-input',
props: ['placeholder', 'label', 'name', 'value']
}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@ limitations under the License.
-->
<template>
<div>
<section class="section">
<div class="container is-fluid">
<ts-navbar-secondary currentAppContext="sketch" currentPage="explore"></ts-navbar-secondary>
</div>
</section>
<router-view></router-view>
<ts-sketch-explore-event-list-item v-for="(event, index) in eventList" :key="event._id" :event="event" :prevEvent="eventList[index - 1]" @addChip="$emit('addChip', $event)"></ts-sketch-explore-event-list-item>
</div>
</template>

<script>
import TsSketchExploreEventListItem from './EventListItem'

export default {
name: 'ts-sketch-explore',
props: ['sketchId']
components: { TsSketchExploreEventListItem },
props: ['eventList']
}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ limitations under the License.
</template>

<script>
import ApiClient from '../utils/RestApiClient'
import TsSketchExploreEventListItem from './SketchExploreEventListItem'
import ApiClient from '../../utils/RestApiClient'
import TsSketchExploreEventListItem from './EventListItem'

export default {
name: 'ts-sketch-explore-view-event-list',
components: {
TsSketchExploreEventListItem
},
Expand Down Expand Up @@ -68,5 +67,3 @@ export default {
}
}
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -53,40 +53,29 @@ limitations under the License.
<!-- Detailed view -->
<div v-if="showDetail">
<div style="margin:10px 0 10px 0;background:#f9f9f9; border:none;border-radius:5px;padding:15px">
<ts-sketch-explore-event-list-item-detail :event="event"></ts-sketch-explore-event-list-item-detail>
<ts-sketch-explore-event-list-item-detail :event="event" @addChip="$emit('addChip', $event)"></ts-sketch-explore-event-list-item-detail>
</div>
</div>
</div>
</template>

<script>
import TsSketchExploreEventListItemDetail from './SketchExploreEventListItemDetail'
import TsSketchExploreEventListItemDetail from './EventListItemDetail'

export default {
name: 'ts-sketch-explore-event-list-item',
props: ['event', 'prevEvent'],
components: {
TsSketchExploreEventListItemDetail
},
props: ['event', 'prevEvent'],
data () {
return {
showDetail: false
}
},
methods: {
timeline (indexName) {
return this.sketch.timelines.find(function (timeline) {
return timeline.searchindex.index_name === indexName
})
}
},
computed: {
sketch () {
return this.$store.state.sketch
},
meta () {
return this.$store.state.meta
},
timelineColor () {
let hexColor = this.timeline(this.event._index).color
if (!hexColor.startsWith('#')) {
Expand All @@ -109,7 +98,14 @@ export default {
let deltaDays = delta / 60 / 60 / 24
return Math.floor(deltaDays)
}
}
},
methods: {
timeline (indexName) {
return this.sketch.timelines.find(function (timeline) {
return timeline.searchindex.index_name === indexName
})
}
},
}
</script>

Expand Down
Loading