diff --git a/common/static/css/style.css b/common/static/css/style.css
index a66bf8f..5bb4f5a 100644
--- a/common/static/css/style.css
+++ b/common/static/css/style.css
@@ -7,6 +7,7 @@
width: 100%;
z-index: 999;
backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
background-color: rgba(22, 22, 23, .8);
}
diff --git a/histogram_file_manager/static/histogram_file_manager/js/components/file_discover.js b/histogram_file_manager/static/histogram_file_manager/js/components/file_discover.js
new file mode 100644
index 0000000..64d4bb8
--- /dev/null
+++ b/histogram_file_manager/static/histogram_file_manager/js/components/file_discover.js
@@ -0,0 +1,189 @@
+app_discover.component('file-discover', {
+ // delimiters: ['{', '}'],
+ template:
+ /*html*/
+ `
+
+
+ `,
+ data() {
+ return {
+ errors: [],
+ success: [],
+ message_id: 0,
+ };
+ },
+ props: {
+ is_visible: {
+ type: Boolean,
+ required: true,
+ }
+ },
+ methods: {
+ clicked_close() {
+ console.debug('Modal was closed');
+ this.errors = [];
+ this.success = [];
+ this.message_id = 0;
+ this.$emit('clicked-close');
+ },
+ // Callback for discovering files
+ discover_files() {
+ console.debug('Initialising file discovery');
+ data = {};
+ console.debug('Sending the following data wtih GET request:');
+ console.debug(data);
+ console.debug(get_axios_config());
+ axios.get(
+ `/api/histogram_data_files/discover/`, data, get_axios_config(),
+ )
+ .then((response) => {
+ console.log(response);
+ this.success.push({
+ id: this.message_id,
+ message: `File discovery initialised.`
+ });
+ this.message_id += 1;
+ })
+ .catch((error) => {
+ console.error(error);
+ this.errors.push({
+ id: this.message_id,
+ message: `${error}: ${error.response.data}`
+ });
+ this.message_id += 1;
+ });
+ },
+ // Callback for error dismissal from errors component
+ dismiss_error(error) {
+ console.debug(`this.errors is ${this.errors}`)
+ console.debug(`Dismissing error alert with ID ${error.id}`);
+ for (var i = 0; i < this.errors.length; i++) {
+ if (this.errors[i].id === error.id) {
+ this.errors.splice(i, 1);
+ i -= 1;
+ }
+ }
+ console.debug(`Now this.errors is ${this.errors}`)
+ },
+ dismiss_success(s) {
+ console.debug(`Dismissing success alert with ID ${s.id}`);
+ for (var i = 0; i < this.success.length; i++) {
+ if (this.success[i].id === s.id) {
+ this.success.splice(i, 1);
+ i -= 1;
+ }
+ }
+ },
+ },
+});
+
+app_discover.component('errors', {
+ template:
+ /*html*/
+ `
+
+
+
+
+
+
+
+ {{ error.message }}
+
+
+
+
+
+ `,
+ props: {
+ errors: {
+ type: Array,
+ required: true,
+ },
+ },
+ computed: {
+ has_errors() {
+ return this.errors.length > 0;
+ },
+ },
+ methods: {
+ dismiss_error(error) {
+ this.$emit('dismissed-error', error);
+ },
+ },
+});
+
+app_discover.component('success', {
+ template:
+ /*html*/
+ `
+
+
+
+
+
+
+
+ {{ s.message }}
+
+
+
+
+
+ `,
+ props: {
+ success: {
+ type: Array,
+ required: true,
+ },
+ },
+ computed: {
+ has_success() {
+ return this.success.length > 0;
+ },
+ },
+ methods: {
+ dismiss_success(success) {
+ this.$emit('dismissed-success', success);
+ },
+ },
+});
diff --git a/histogram_file_manager/static/histogram_file_manager/js/histogram_file_manager_discover.js b/histogram_file_manager/static/histogram_file_manager/js/histogram_file_manager_discover.js
new file mode 100644
index 0000000..5190a1e
--- /dev/null
+++ b/histogram_file_manager/static/histogram_file_manager/js/histogram_file_manager_discover.js
@@ -0,0 +1,29 @@
+const app_discover = Vue.createApp({
+ data() {
+ return {
+ file_discover_is_visible: false,
+ api_base: '/api/histogram_data_files/',
+ page_current_url:
+ '/api/histogram_data_files/' + window.location.search,
+ abort_controller: new AbortController(), // To cancel a request
+ };
+ },
+ // This will run as soon as the app is mounted
+ methods: {
+ // Private method to fetch updated files information
+ // via the API
+ show_file_discover_modal() {
+ this.file_discover_is_visible = true;
+ },
+ hide_file_discover_modal() {
+ this.file_discover_is_visible = false;
+ },
+ },
+ computed: {
+ request_url() {
+ // window.location.search contains the filters
+ // selected by the user in the filter form
+ return this.page_current_url;
+ },
+ },
+});
diff --git a/histogram_file_manager/templates/histogram_file_manager/filter_histogram_file_manager.html b/histogram_file_manager/templates/histogram_file_manager/filter_histogram_file_manager.html
index d9901e3..b9a43ca 100644
--- a/histogram_file_manager/templates/histogram_file_manager/filter_histogram_file_manager.html
+++ b/histogram_file_manager/templates/histogram_file_manager/filter_histogram_file_manager.html
@@ -1,6 +1,19 @@
{% load widget_tweaks %}
Histogram file manager
+
+ {% csrf_token %}
+
+
+
+
+
+