|
@@ -30,17 +30,27 @@
|
|
|
</select-input>
|
|
|
|
|
|
<text-input placeholder="path to folder (leave empty to disable)"
|
|
|
- v-model="external">
|
|
|
+ v-model="external"
|
|
|
+ @change="checkDirectory">
|
|
|
External Storage
|
|
|
</text-input>
|
|
|
|
|
|
<div class="external">
|
|
|
+ <template v-if="externalPathInformation !== null">
|
|
|
+ <template v-if="externalPathInformation.exists">
|
|
|
+ The given directory contains {{ externalPathInformation.count }} files.<br>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ The given directory is not valid.<br>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
The external storage mode disables file uploads and loads them from the given directory instead.
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<button-row class="footer">
|
|
|
- <button-input @click="createProject" type="primary">
|
|
|
+ <button-input @click="createProject" type="primary"
|
|
|
+ :disabled="externalPathInformation !== null && !externalPathInformation.exists">
|
|
|
Create Project
|
|
|
</button-input>
|
|
|
|
|
@@ -95,7 +105,8 @@ export default {
|
|
|
labels: [],
|
|
|
label: null,
|
|
|
|
|
|
- external: ''
|
|
|
+ external: '',
|
|
|
+ externalPathInformation: null
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -129,6 +140,18 @@ export default {
|
|
|
.then(response => response.json())
|
|
|
.then(labels => this.labels = labels);
|
|
|
},
|
|
|
+ checkDirectory: function (value) {
|
|
|
+ if (!value) {
|
|
|
+ this.externalPathInformation = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$root.socket.post('/folder', {
|
|
|
+ 'folder': this.external
|
|
|
+ })
|
|
|
+ .then(response => response.json())
|
|
|
+ .then(data => this.externalPathInformation = data);
|
|
|
+ },
|
|
|
createProject: function () {
|
|
|
// check input
|
|
|
this.nameError = !this.name;
|