diff --git a/package.json b/package.json
index cd05721..4e84c03 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"vue": "^3.2.39",
"vuex": "next",
"vue-select": "beta",
+ "v-calendar": "next",
"@meforma/vue-toaster": "^1.3.0",
"vuetify": "^3.0.0-beta.0",
"webfontloader": "^1.0.0"
diff --git a/src/components/Grid/Main/Filter/Datepicker.vue b/src/components/Grid/Main/Filter/Datepicker.vue
new file mode 100644
index 0000000..b6d3f9b
--- /dev/null
+++ b/src/components/Grid/Main/Filter/Datepicker.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/LogViewer.vue b/src/components/LogViewer.vue
index 3c2cb78..6bba3e8 100644
--- a/src/components/LogViewer.vue
+++ b/src/components/LogViewer.vue
@@ -1,14 +1,24 @@
-
-
- Stream new lines
-
-
+
+
+
+
+
+ Logmower
+
+
+
+ Stream new lines
+
+
+
+
@@ -32,6 +44,7 @@ import { AgGridVue } from "ag-grid-vue3";
import "ag-grid-community/styles//ag-grid.css";
import "ag-grid-community/styles//ag-theme-material.css";
import { VBtn } from 'vuetify/components/VBtn'
+import { VRow, VCol } from 'vuetify/components/VGrid'
import ExamineLogModal from "./Modal/ExamineLogModal.vue";
import ComboboxFilter from "./Grid/Main/Filter/ComboboxFilter.js";
import ErrLevelRenderer from "./Grid/Main/ErrLevelRenderer";
@@ -39,14 +52,18 @@ import flattenObj from "../helpers/flattenObj";
import parseEventData from "../helpers/parseEventData";
import {mapActions, mapGetters} from 'vuex';
import config from "./Grid/Main/config";
+import Datepicker from "./Grid/Main/Filter/Datepicker.vue";
export default {
components: {
+ Datepicker,
ExamineLogModal,
AgGridVue,
ComboboxFilter,
ErrLevelRenderer,
- VBtn
+ VBtn,
+ VRow,
+ VCol
},
data() {
return {
@@ -62,7 +79,7 @@ export default {
computed: {
...mapGetters([
'filterQuery',
- 'streaming',
+ 'streaming'
]),
},
watch: {
@@ -78,6 +95,8 @@ export default {
queryParams = Object.fromEntries(queryParams);
this.initialFilter = queryParams
queryParams['initial'] = true
+ queryParams['from'] && (queryParams['from'] = Number(queryParams['from']))
+ queryParams['to'] && (queryParams['to'] = Number(queryParams['to']))
this.setFilterQuery(queryParams)
},
methods: {
@@ -86,6 +105,9 @@ export default {
setFilterQuery: 'setFilterQuery',
toggleFilterQueryStreaming: 'toggleFilterQueryStreaming',
}),
+ refreshFilterState() {
+ this.gridApi.onFilterChanged();
+ },
setupStream() {
this.es && this.es.close();
let url = new URL('/events', window.location.href);
@@ -143,6 +165,8 @@ export default {
}
})
query['streaming'] = this.streaming
+ this.filterQuery.from && (query['from'] = this.filterQuery.from)
+ this.filterQuery.to && (query['to'] = this.filterQuery.to)
this.setFilterQuery(query)
}
});
@@ -203,6 +227,13 @@ export default {
});
setTimeout(this.$toast.clear, 3000);
},
+ doesExternalFilterPass(node) {
+ if (node.data && this.filterQuery.from && this.filterQuery.to) {
+ let ts = new Date(node.data['@timestamp']).getTime()
+ return (ts >= this.filterQuery.from && ts <= this.filterQuery.to)
+ }
+ return true;
+ },
openExamineLog (row) {
const selectedRow = row.data
row.node.setSelected(false)
diff --git a/src/main.js b/src/main.js
index 5007228..2ef7723 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,14 +3,17 @@ import store from "./stores";
import App from './App.vue'
import vuetify from './plugins/vuetify'
import Toaster from "@meforma/vue-toaster";
+import VCalendar from 'v-calendar';
import { loadFonts } from './plugins/webfontloader'
import './assets/main.css'
import 'vue-select/dist/vue-select.css';
+import 'v-calendar/dist/style.css';
loadFonts()
const app = createApp(App);
app.use(store);
app.use(vuetify);
app.use(Toaster);
+app.use(VCalendar, {});
app.mount("#app");
diff --git a/src/stores/index.js b/src/stores/index.js
index 765f124..db2373f 100644
--- a/src/stores/index.js
+++ b/src/stores/index.js
@@ -23,6 +23,13 @@ const store = createStore({
toggleFilterQueryStreaming(context) {
context.commit("TOGGLE_FILTER_QUERY_STREAMING");
},
+ setFilterQueryTimeRange({commit, state}, {from, to}) {
+ let query = state.filterQuery
+ query.from = from
+ query.to = to
+ query.streaming = false
+ commit("SET_FILTER_QUERY", query);
+ },
},
mutations: {
SET_FILTER_OPTIONS(state, payload) {
@@ -37,9 +44,15 @@ const store = createStore({
},
TOGGLE_FILTER_QUERY_STREAMING(state) {
let query = state.filterQuery
- query['streaming'] = (query['streaming'] === undefined) ? false : query['streaming']
- query['streaming'] = !(query['streaming'])
+ let streaming = (query['streaming'] === undefined) ? false : query['streaming']
+ query['streaming'] = !(streaming)
query['initial'] = false
+
+ if (!streaming) {
+ delete query['from']
+ delete query['to']
+ }
+
state.filterQuery = query
},
},