diff --git a/src/renderer/components/DirectorySelect.vue b/src/renderer/components/DirectorySelect.vue index dde7b6b..64dbfab 100644 --- a/src/renderer/components/DirectorySelect.vue +++ b/src/renderer/components/DirectorySelect.vue @@ -3,7 +3,7 @@
...
- + @@ -20,9 +20,15 @@ methods: { handleFileChange (e) { - var first = e.target.files[0].webkitRelativePath.split("/")[0]; - var webkitdirectoryPath = e.target.files[0].path.split(first)[0] + first; - this.$emit('input', webkitdirectoryPath) + try { + if (e.target.files && e.target.files.length>0) { + var first = e.target.files[0].webkitRelativePath.split("/")[0]; + var webkitdirectoryPath = e.target.files[0].path.split(first)[0] + first; + this.$emit('input', webkitdirectoryPath) + } + } catch (error) { + console.error(error) + } } } } @@ -39,6 +45,8 @@ text-align: center; font-weight: bold; + width: 28px; + height: 28px; } .directory-select > input[type="file"] { diff --git a/src/renderer/components/SettingsPanel.vue b/src/renderer/components/SettingsPanel.vue index ee3ea39..d3c8789 100644 --- a/src/renderer/components/SettingsPanel.vue +++ b/src/renderer/components/SettingsPanel.vue @@ -11,17 +11,25 @@ Airports Directory - {{ airports_directory }} - - + {{ airports_directory }} + + + + Flightgear Data Directory - {{ flightgear_directory }} - + {{ flightgear_directory }} + - Traffic Directory - {{ Traffic_directory }} + Traffic Directory + + + {{ Traffic_directory }} - APT File - {{ apt_file }} + APT File + + + {{ apt_file }} Export Directory - {{ test_directory }} + {{ test_directory }} @@ -194,6 +206,14 @@ flightgear_directory: function () { return this.$store.state.Settings.settings.flightgearDirectory }, + flightgear_directory_ok: function () { + try { + fs.accessSync(this.$store.state.Settings.settings.flightgearDirectory) + return true + } catch (error) { + return false + } + }, AI_directory: function () { return this.$store.state.Settings.settings.flightgearDirectory_ai }, @@ -222,9 +242,25 @@ airports_directory: function () { return this.$store.state.Settings.settings.airportsDirectory }, + airports_directory_ok: function () { + try { + fs.accessSync(this.$store.state.Settings.settings.airportsDirectory) + return true + } catch (error) { + return false + } + }, test_directory: function () { return this.$store.state.Settings.settings.testDirectory }, + test_directory_ok: function () { + try { + fs.accessSync(this.$store.state.Settings.settings.testDirectory) + return true + } catch (error) { + return false + } + }, scanLogging: { // getter get: function () { @@ -247,14 +283,14 @@ border-radius: 4px; } .label { - padding: 10px; + padding: 5px; font-weight: bold; } -.file-label { - padding: 10px; +.file_label { + padding: 5px; } .invalid { - padding: 10px; + padding: 5px; background-color: red; }