feature: rename directory in ConfigFilesPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
1 parent
ee4a07c9b2
commit
f6679effd9
2 files changed
+34
No files matched your search
@@ -149,6 +149,9 @@
|
||||
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Settings.ConfigFilesPanel.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Settings.ConfigFilesPanel.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Settings.ConfigFilesPanel.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -217,6 +220,19 @@
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Settings.ConfigFilesPanel.RenameDirectory') }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Settings.ConfigFilesPanel.Name')" required v-model="dialogRenameDirectory.newName"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">{{ $t('Settings.ConfigFilesPanel.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Settings.ConfigFilesPanel.Rename') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Settings.ConfigFilesPanel.DeleteDirectory') }}</v-card-title>
|
||||
@@ -341,6 +357,11 @@ export default {
|
||||
show: false,
|
||||
name: "",
|
||||
},
|
||||
dialogRenameDirectory: {
|
||||
show: false,
|
||||
newName: "",
|
||||
item: {}
|
||||
},
|
||||
dialogDeleteDirectory: {
|
||||
show: false,
|
||||
item: {}
|
||||
@@ -614,6 +635,18 @@ export default {
|
||||
path: this.currentPath.substring(1)+"/"+this.dialogCreateDirectory.name
|
||||
}, 'files/getCreateDir');
|
||||
},
|
||||
renameDirectory(item) {
|
||||
this.dialogRenameDirectory.item = item;
|
||||
this.dialogRenameDirectory.newName = item.filename;
|
||||
this.dialogRenameDirectory.show = true;
|
||||
},
|
||||
renameDirectoryAction() {
|
||||
this.dialogRenameDirectory.show = false;
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameDirectory.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameDirectory.newName
|
||||
}, 'files/getMove');
|
||||
},
|
||||
deleteDirectory(item) {
|
||||
this.dialogDeleteDirectory.item = item;
|
||||
this.dialogDeleteDirectory.show = true;
|
||||
|
||||
@@ -328,6 +328,7 @@
|
||||
"Create": "Create",
|
||||
"CreateFile": "Create File",
|
||||
"CreateDirectory": "Create Directory",
|
||||
"RenameDirectory": "Rename Directory",
|
||||
"DeleteDirectory": "Delete Directory",
|
||||
"DeleteDirectoryQuestion": "Do you really want to delete the \"{name}\" directory with all its contents?",
|
||||
"Uploading": "Uploading",
|
||||
|
||||
Reference in new issue
Block a user