diff --git a/src/components/JobDetailsTree.vue b/src/components/JobDetailsTree.vue
index 8cdaf5a..0da63da 100644
--- a/src/components/JobDetailsTree.vue
+++ b/src/components/JobDetailsTree.vue
@@ -4,10 +4,10 @@
{{ isExpanded(key) ? '-' : '+' }}
- {{ key }}:
+ {{ prettifyKey(key) }}:
-
{{ key }}:
+
{{ prettifyKey(key) }}:
{{ value }}
@@ -39,6 +39,14 @@
isExpanded(key) {
return !!this.expandedNodes[key];
},
+ prettifyKey(key) {
+ // Convert snake_case and camelCase to human readable format
+ return key
+ .replace(/([A-Z])/g, ' $1') // Insert space before capital letters
+ .replace(/_/g, ' ') // Replace underscores with spaces
+ .replace(/\b\w/g, l => l.toUpperCase()) // Capitalize first letter of each word
+ .trim();
+ },
},
};
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index 7dc23d4..430cf84 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -12,10 +12,10 @@
Home
- Files
+ Files
- Jobs
+ Jobs
Profile
@@ -56,6 +56,22 @@ export default defineComponent({
async logout () {
await this.$store.dispatch('logOut');
this.$router.push('/login');
+ },
+ goToFiles() {
+ // Force reload the Files page by navigating away and back
+ if (this.$route.path === '/files') {
+ window.location.reload();
+ } else {
+ this.$router.push('/files');
+ }
+ },
+ goToJobs() {
+ // Force reload the Jobs page by navigating away and back
+ if (this.$route.path === '/jobs') {
+ window.location.reload();
+ } else {
+ this.$router.push('/jobs');
+ }
}
},
});
diff --git a/src/main.js b/src/main.js
index b9072f6..ca4c972 100644
--- a/src/main.js
+++ b/src/main.js
@@ -47,6 +47,16 @@ async function initializeApp() {
const app = createApp(App);
app.use(router);
app.use(store);
+
+ // Check if user is already authenticated on app startup
+ try {
+ await Auth.currentAuthenticatedUser();
+ await store.dispatch('viewMe');
+ } catch (error) {
+ // User is not authenticated, this is fine
+ console.log('No authenticated user found on startup');
+ }
+
app.mount("#app");
} catch (error) {
console.error("Error during app initialization:", error);
diff --git a/src/views/FilesView.vue b/src/views/FilesView.vue
index ae6d67d..ca515ec 100644
--- a/src/views/FilesView.vue
+++ b/src/views/FilesView.vue
@@ -78,14 +78,13 @@ export default defineComponent({
}
this.fetchFiles();
},
- createFolder() {
- fileService.createFolder(this.path + 'new')
- .then(() => {
- this.fetchFiles();
- })
- .catch(error => {
- this.errorMessage = "Error creating folder: " + error.message;
- });
+ async createFolder() {
+ try {
+ await fileService.createFolder(this.path + 'new');
+ await this.fetchFiles(); // Wait for the files to be fetched before continuing
+ } catch (error) {
+ this.errorMessage = "Error creating folder: " + error.message;
+ }
},
uploadSingleFile() {
document.getElementById('fileInput').click();
@@ -134,6 +133,12 @@ export default defineComponent({
});
},
renameItem(path, newName) {
+ // Check if the original item is a directory and ensure the new name has trailing slash
+ const originalItem = this.files.find(file => file.path === path);
+ if (originalItem && originalItem.type === 'directory' && !newName.endsWith('/')) {
+ newName += '/';
+ }
+
let newPath = this.path.trimEnd("/") + '/' + newName;
fileService.renameItem(path, newPath)
.then(() => {
diff --git a/src/views/JobCreationView.vue b/src/views/JobCreationView.vue
index b6d373e..66bc035 100644
--- a/src/views/JobCreationView.vue
+++ b/src/views/JobCreationView.vue
@@ -69,7 +69,7 @@
Select environment
cloud
local
- any
+ any
@@ -152,9 +152,13 @@
},
async fetchInputFiles() {
const response_cfg = await fileService.getFiles("config/");
- this.configFiles = response_cfg.data.map(file => file.path.replace('config/', ''));
+ this.configFiles = response_cfg.data
+ .filter(file => file.type === 'directory')
+ .map(file => file.path.replace('config/', ''));
const response_data = await fileService.getFiles("data/");
- this.dataFiles = response_data.data.map(file => file.path.replace('data/', ''));
+ this.dataFiles = response_data.data
+ .filter(file => file.type === 'directory')
+ .map(file => file.path.replace('data/', ''));
const response_art = await fileService.getFiles("artifact/");
this.artifactFiles = response_art.data.map(file => file.path.replace('artifact/', ''));
},
diff --git a/vue.config.js b/vue.config.js
index 220ae71..a5d451e 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,4 +1,3 @@
-const { defineConfig } = require('@vue/cli-service')
module.exports = {
publicPath: process.env.PUBLIC_PATH || '/DECODE_Cloud_UserFrontend/',
transpileDependencies: true