From efa7f0c7afd431a8b1f0ccb7bef30ae4dca36643 Mon Sep 17 00:00:00 2001 From: stitch1 Date: Mon, 24 Jun 2024 10:52:05 +0200 Subject: [PATCH 1/9] load a dynamic content, hide the signup form --- .../css/vendor/internet_nl/style-min.css | 2 +- src/components/SiteMenu.vue | 2 +- src/main.js | 52 ++++++++++++++++--- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/assets/css/vendor/internet_nl/style-min.css b/src/assets/css/vendor/internet_nl/style-min.css index 8c46299..49cbc1b 100755 --- a/src/assets/css/vendor/internet_nl/style-min.css +++ b/src/assets/css/vendor/internet_nl/style-min.css @@ -1010,7 +1010,7 @@ footer ul li:last-child { .home .block.news, .home { position: relative; - padding-bottom: 32px + /* padding-bottom: 32px */ } .home .block.news .read-more, .home .read-more { diff --git a/src/components/SiteMenu.vue b/src/components/SiteMenu.vue index 4cce515..b73242c 100644 --- a/src/components/SiteMenu.vue +++ b/src/components/SiteMenu.vue @@ -216,7 +216,7 @@ li a { diff --git a/src/main.js b/src/main.js index 0a45279..3789289 100644 --- a/src/main.js +++ b/src/main.js @@ -65,6 +65,35 @@ Vue.component('content-block', ContentBlock); Vue.component('loading', loading) Vue.component('server-response', server_response) +// start load config +// this should be done as early as possible, so the delay on the user experience is minimal. This might be pre-rendered +// yet that calls for a lot of trickery and expensive components +import http from './httpclient'; +let data_url = '/data/config/'; +let timeout = 10*1000; +http.get(data_url, {timeout}).then(data => { + if (!(data && data.data && Object.keys(data.data).length != 0)){ + throw new Error("Config is empty!"); + } + + // store config + store.commit('set_config', data.data) +}).catch((error) => { + console.error(`Could not retrieve config. Using default minimal config. Error: ${error}`) + // show error page when loading failed, promping user to reload and give email address to report issues + Vue.prototype.$loadError = true; +}).finally( () => { + + new Vue({ + i18n, + router, + store, + render: h => h(App), + }).$mount('#app') + +}) +// end load config + // https://stackoverflow.com/questions/54166847/how-to-access-the-window-object-in-vue-js Vue.prototype.window = window; @@ -124,6 +153,11 @@ const store = new Vuex.Store({ // tables for reports, rendered by chartjs, and then shown as table, not really nice but fastest to get this rendered_chart_to_table: { 'overall': {} + }, + config: { + show: { + signup_form: true, + } } }, @@ -141,6 +175,9 @@ const store = new Vuex.Store({ set_user(state, value) { state.user = value; }, + set_config(state, value) { + state.config = value; + }, set_visible_metrics(state, value) { state.visible_metrics = value; }, @@ -158,7 +195,13 @@ const store = new Vuex.Store({ } }, - plugins: [createPersistedState()], + plugins: [createPersistedState( + { + // 'uploads_performed','scan_monitor_data', 'user', + // 'visible_metrics','report_ids', 'tags', 'ad_hoc_report_custom_date', 'ad_hoc_report_custom_time' + paths: [ 'locale', ] + } + )], }); @@ -398,10 +441,3 @@ Vue.use(VueMatomo, { trackSiteSearch: false }); -new Vue({ - i18n, - router, - store, - render: h => h(App), -}).$mount('#app') - From 025b40e6c05643e947920816106317711334ac29 Mon Sep 17 00:00:00 2001 From: stitch1 Date: Mon, 24 Jun 2024 11:13:28 +0200 Subject: [PATCH 2/9] remove internet.nl support references while keeping internet.nl dashboard branding --- src/App.vue | 6 ++++-- src/components/SiteMenu.vue | 6 ++++-- src/components/admin/InstantAddAccount.vue | 2 +- src/components/home/PublicReports.vue | 4 ++-- src/components/home/PublicReportsTable.vue | 4 ++-- src/components/scans/ScanMonitorScan.vue | 4 ++-- src/components/scans/stop.vue | 12 ++++++------ src/main.js | 3 +++ 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/App.vue b/src/App.vue index 8666575..da9ed34 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,11 +20,12 @@ - + -