Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
kbpark9898
2020-06-08 23:27:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e6b39a366a080df9fd894746e0b7854c726fccb7
e6b39a36
1 parent
9abeab90
add recent access and edit
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/components/accessList.vue
front-end/src/views/Main.vue
front-end/src/api/index.js
View file @
e6b39a3
...
...
@@ -88,14 +88,7 @@ function accessedList(curData) {
});
}
function
modifyFile
(
fileData
){
return
axios
.
post
(
`/api/file/modify/
${
fileName
}
`
,
{
params
:
{
user_id
:
fileData
.
id
,
cur
:
fileData
.
cur
,
name
:
fileData
.
rename
,
content
:
fileData
.
content
},
});
return
axios
.
post
(
`/api/file/modify/
${
fileData
.
name
}
`
,
fileData
);
}
...
...
front-end/src/components/FileList.vue
View file @
e6b39a3
...
...
@@ -75,7 +75,7 @@
</v-dialog>
<v-divider inset></v-divider>
<v-subheader inset>Files</v-subheader>
<v-list-item v-for="item in this.$store.getters.fileL" :key="item.title" @click.stop="dialog_file = true; file_detail(item)">
<v-list-item v-for="item in this.$store.getters.fileL" :key="item.title" @
dbl
click.stop="dialog_file = true; file_detail(item)">
<v-list-item-avatar>
<v-icon> mdi-file</v-icon>
</v-list-item-avatar>
...
...
@@ -90,9 +90,11 @@
>
<v-card>
<v-card-title class="headline">
<v-text-field v-model="current_filename"
v-text="current_filename"
></v-text-field>
<v-text-field v-model="current_filename" ></v-text-field>
</v-card-title>
<v-card-text v-model="current_filedata" v-text="current_filedata"></v-card-text>
<v-card-text>
<v-text-field v-model="current_filedata" ></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
...
...
@@ -233,14 +235,13 @@ export default {
};
console.log(curData);
const response = await folder(curData);
const file_response = await file(curData);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
this.folders = this.$store.getters.folderL;
const file_response = await file(curData);
this.$store.commit('setFile', file_response.data.files);
this.folders = this.$store.getters.folderL;
console.log(this.$store.getters.fileL);
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
...
...
@@ -291,6 +292,10 @@ export default {
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
this.folders = this.$store.getters.folderL;
const file_response = await file(curData);
this.$store.commit('setFile', file_response.data.files);
this.folders = this.$store.getters.folderL;
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
console.log(error.response.data);
...
...
@@ -308,6 +313,10 @@ export default {
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
this.folders = this.$store.getters.folderL;
const file_response = await file(curData);
this.$store.commit('setFile', file_response.data.files);
this.folders = this.$store.getters.folderL;
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
console.log(error.response.data);
...
...
@@ -378,8 +387,6 @@ export default {
async delete_file(itemName) {
try {
var itemlist = this.$store.getters.fileL;
console.log(itemlist);
console.log(itemName);
const currentData = {
fileName: null,
user_id: null,
...
...
@@ -387,7 +394,6 @@ export default {
};
for (var i = 0; i < itemlist.length; i++) {
console.log(itemlist[i].file_name);
if (itemlist[i].file_name == itemName) {
currentData.fileName = itemlist[i].file_name;
currentData.user_id = itemlist[i].user_id;
...
...
@@ -397,13 +403,10 @@ export default {
id: currentData.user_id,
cur: currentData.cur,
};
console.log(currentData);
const response = await deleteFile(currentData);
setTimeout(function() {}, 500);
const filelist = await file(filelistData);
console.log(filelist.data.files);
this.$store.commit('setFile', filelist.data.files);
console.log(this.$store.getters.fileL);
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
...
...
@@ -425,6 +428,7 @@ export default {
}
},
async file_detail(fileData){
console.log(fileData);
try{
const currentData = {
id: fileData.user_id,
...
...
@@ -432,9 +436,10 @@ export default {
fileName: fileData.file_name
}
const detailData = await detailFile(currentData)
console.log(detailData)
this.current_filename = detailData.file_name;
this.current_filedata = detailFile.content;
this.current_filename = detailData.data.file_name;
this.current_filedata = detailData.data.content;
console.log(this.current_filename);
console.log(this.current_filedata);
}catch(error){
console.log('에러');
console.log(error);
...
...
front-end/src/components/accessList.vue
View file @
e6b39a3
...
...
@@ -5,7 +5,9 @@
<template v-slot:default>
<thead>
<tr>
<th class="text-left">File ID</th>
<th class="text-left">Name</th>
<th class="text-left">Dir</th>
<th class="text-left">Date</th>
</tr>
</thead>
...
...
front-end/src/views/Main.vue
View file @
e6b39a3
...
...
@@ -24,7 +24,6 @@
<v-layout column>
<v-flex>
<v-toolbar flat>
<v-toolbar-title>빠른 액세스</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-container>
...
...
Please
register
or
login
to post a comment