-
-
- load->view('system/logs/logsViewerData.php'); ?>
+
diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php
index dff868eab..b9ac0134e 100644
--- a/application/views/templates/FHC-Footer.php
+++ b/application/views/templates/FHC-Footer.php
@@ -52,7 +52,7 @@
if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js');
// Bootstrap 5 JS
- if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/js/bootstrap.min.js');
+ if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js');
// Securimage JS
if ($captcha3 === true) generateJSsInclude('vendor/dapphp/securimage/securimage.js');
diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php
index eed8b6590..181796bfc 100644
--- a/application/views/templates/FHC-Header.php
+++ b/application/views/templates/FHC-Header.php
@@ -34,7 +34,7 @@
if ($bootstrap3 === true) generateCSSsInclude('vendor/twbs/bootstrap3/dist/css/bootstrap.min.css');
// Bootstrap 5 CSS
- if ($bootstrap5 === true) generateCSSsInclude('vendor/twbs/bootstrap5/css/bootstrap.min.css');
+ if ($bootstrap5 === true) generateCSSsInclude('vendor/twbs/bootstrap5/dist/css/bootstrap.min.css');
// jQuery UI CSS
if ($jqueryui1 === true) generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css');
diff --git a/public/js/apps/LogsViewer.js b/public/js/apps/LogsViewer.js
new file mode 100644
index 000000000..44e918432
--- /dev/null
+++ b/public/js/apps/LogsViewer.js
@@ -0,0 +1,19 @@
+const logsViewerApp = Vue.createApp({
+ data() {
+ return {
+ appSideMenuEntries: {}
+ };
+ },
+ components: {
+ Navigation,
+ Filter
+ },
+ methods: {
+ newSideMenuEntryHandler(payload) {
+ this.appSideMenuEntries = payload;
+ }
+ }
+});
+
+logsViewerApp.mount('#main');
+
diff --git a/public/js/components/Filter.js b/public/js/components/Filter.js
new file mode 100644
index 000000000..421ca2e6f
--- /dev/null
+++ b/public/js/components/Filter.js
@@ -0,0 +1,132 @@
+const Filter = {
+ emits: ['nwNewEntry'],
+ data() {
+ return {
+ fieldsToDisplay: null,
+ dataset: null,
+ selectedFields: null
+ };
+ },
+ created() {
+ this.fetchFilterData();
+ },
+ updated() {
+ var filterWidgetTablesorter = $("#filterTableDataset");
+
+ // Checks if the table contains data (rows)
+ if (filterWidgetTablesorter.find("tbody:empty").length == 0
+ && filterWidgetTablesorter.find("tr:empty").length == 0
+ && filterWidgetTablesorter.hasClass("table-condensed"))
+ {
+ filterWidgetTablesorter.tablesorter({
+ dateFormat: "ddmmyyyy",
+ widgets: ["zebra", "filter"],
+ widgetOptions: {
+ filter_saveFilters : true
+ }
+ });
+
+ $.tablesorter.updateAll(filterWidgetTablesorter[0].config, true, null);
+ }
+ },
+ props: {
+ filterType: {
+ type: String,
+ required: true
+ }
+ },
+ methods: {
+ clkNewEntry() {
+ console.log('emit');
+ this.$emit(
+ 'nwNewEntry',
+ {
+ "link": "#",
+ "description": 'New side menu ' + Math.floor(Math.random() * 10),
+ "icon": "dashboard",
+ "sort": 1
+ }
+ );
+ },
+ fetchFilterData() {
+ FHC_AjaxClient.ajaxCallGet(
+ "widgets/Filters/getFilter",
+ {
+ filterUniqueId: this.getFilterUniqueIdPrefix(),
+ filterType: this.filterType, // props!!
+ filterId: 170
+ },
+ {
+ successCallback: this.renderTableSorter
+ }
+ );
+ },
+ getFilterUniqueIdPrefix() {
+ return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
+ },
+ renderTableSorter(data) {
+
+ if (FHC_AjaxClient.hasData(data))
+ {
+ this._setFieldsToDisplay(FHC_AjaxClient.getData(data));
+ this.dataset = FHC_AjaxClient.getData(data).dataset;
+ this.selectedFields = FHC_AjaxClient.getData(data).selectedFields;
+ }
+ else
+ {
+ console.error(FHC_AjaxClient.getError(data));
+ }
+ },
+ _setFieldsToDisplay(data) {
+
+ let arrayFieldsToDisplay = [];
+
+ if (data.hasOwnProperty("selectedFields") && $.isArray(data.selectedFields))
+ {
+ if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases))
+ {
+ for (let sfc = 0; sfc < data.selectedFields.length; sfc++)
+ {
+ for (let fc = 0; fc < data.fields.length; fc++)
+ {
+ if (data.selectedFields[sfc] == data.fields[fc])
+ {
+ arrayFieldsToDisplay[sfc] = data.columnsAliases[fc];
+ }
+ }
+ }
+ }
+ else
+ {
+ arrayFieldsToDisplay = data.selectedFields;
+ }
+ }
+
+ this.fieldsToDisplay = arrayFieldsToDisplay;
+ }
+ },
+ template: `
+
+
+
+
+
+ | {{ fieldToDisplay }} |
+
+
+
+
+
+
+
+
+ | {{ value }} |
+
+
+
+
+
+
+ `
+};
+
diff --git a/public/js/components/Navigation.js b/public/js/components/Navigation.js
new file mode 100644
index 000000000..852b0bd17
--- /dev/null
+++ b/public/js/components/Navigation.js
@@ -0,0 +1,106 @@
+const Navigation = {
+ data() {
+ return {
+ headerMenu: {},
+ sideMenu: {}
+ };
+ },
+ created() {
+ this.fetchDataHeader();
+ this.fetchDataMenu();
+ },
+ props: {
+ addHeaderMenuEntries: Object,
+ addSideMenuEntries: Object
+ },
+ methods: {
+ getNavigationPage() {
+ return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
+ },
+ fetchDataHeader() {
+ // Retrives the header menu array
+ FHC_AjaxClient.ajaxCallGet(
+ 'system/Navigation/header',
+ {
+ navigation_page: this.getNavigationPage()
+ },
+ {
+ successCallback: this.setHeaders
+ }
+ );
+ },
+ setHeaders(data) {
+ if (FHC_AjaxClient.hasData(data)) this.headerMenu = FHC_AjaxClient.getData(data);
+ },
+ fetchDataMenu() {
+ // Retrives the side menu array
+ FHC_AjaxClient.ajaxCallGet(
+ 'system/Navigation/menu',
+ {
+ navigation_page: this.getNavigationPage()
+ },
+ {
+ successCallback: this.setSideMenu
+ }
+ );
+ },
+ setSideMenu(data) {
+ if (FHC_AjaxClient.hasData(data)) this.sideMenu = FHC_AjaxClient.getData(data);
+ },
+ getDataBsToggle(header) {
+ return !header.children ? null : 'dropdown';
+ }
+ },
+ computed: {
+ headerMenuEntries() {
+ if (this.headerMenu != null && this.addHeaderMenuEntries != null && Object.keys(this.addHeaderMenuEntries).length > 0)
+ {
+ this.headerMenu[this.addHeaderMenuEntries.description] = this.addHeaderMenuEntries;
+ }
+ return this.headerMenu;
+ },
+ sideMenuEntries() {
+ if (this.sideMenu != null && this.addSideMenuEntries != null && Object.keys(this.addSideMenuEntries).length > 0)
+ {
+ this.sideMenu[this.addSideMenuEntries.description] = this.addSideMenuEntries;
+ }
+ return this.sideMenu;
+ }
+ },
+ template: `
+
+
+
+
+
+ `
+};
+