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
leeseohyeon
2020-05-28 23:15:40 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
a2e3c78742f3373e90eba06f88fbcf18f1262df3
a2e3c787
2 parents
805af94d
ec5658f9
merge file
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
64 deletions
backend/package-lock.json
backend/routes/folders.js
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/components/FolderList.vue
front-end/src/routes/index.js
front-end/src/store/index.js
front-end/src/views/FolderPage.vue
backend/package-lock.json
View file @
a2e3c78
...
...
@@ -114,9 +114,9 @@
"integrity"
:
"sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sdk"
:
{
"version"
:
"2.68
3
.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.68
3
.0.tgz"
,
"integrity"
:
"sha512-m
i1175pJMbQhCWhBEQ5ccQ3SDE+SJzbapuAQtcb7tdLLV7dPKf4zQXhpqK1uG0dysm8NhsNtgxwA2diYOKWlTg
=="
,
"version"
:
"2.68
5
.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.68
5
.0.tgz"
,
"integrity"
:
"sha512-m
AOj7b4PuXRxIZkNdSkBWZ28lS2wYUY7O9u33nH9a7BawlttMNbxOgE/wDCPMrTLfj+RLQx0jvoIYj8BKCTRFw
=="
,
"requires"
:
{
"buffer"
:
"4.9.1"
,
"events"
:
"1.1.1"
,
...
...
backend/routes/folders.js
View file @
a2e3c78
...
...
@@ -6,6 +6,7 @@ const moment = require("moment");
const
BUCKET_NAME
=
"hong-s3-cloud"
;
let
curPath
=
""
;
let
user_id
=
""
;
let
parentPath
=
""
;
const
s3
=
new
AWS
.
S3
({
accessKeyId
:
process
.
env
.
AWS_ACCESS_KEY_ID
,
...
...
@@ -17,16 +18,37 @@ router.get('/show', function(req, res, next) {
console
.
log
(
req
.
query
);
user_id
=
req
.
query
.
id
;
curPath
=
req
.
query
.
cur
;
if
(
curPath
==
'/'
)
{
parentPath
=
'/'
;
}
else
{
let
pathSplit
=
curPath
.
split
(
'/'
)
console
.
log
(
pathSplit
);
parentPath
=
'/'
;
for
(
let
i
=
1
;
i
<
pathSplit
.
length
-
2
;
i
++
)
{
parentPath
+=
pathSplit
[
i
];
parentPath
+=
'/'
;
}
}
folders
=
{}
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
curPath
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
404
).
send
()
}
else
{
res
.
send
({
error
:
"Does not exist"
});
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
,
parentPath
:
parentPath
})
}
else
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
,
parentPath
:
parentPath
})
}
}
});
});
...
...
@@ -69,8 +91,7 @@ router.post('/makefolder', function(req, res, next) {
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
folders
:
rows
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
...
...
front-end/src/api/index.js
View file @
a2e3c78
...
...
@@ -27,6 +27,7 @@ function makeFolder(folderData) {
return
axios
.
post
(
'/api/folder/makefolder'
,
folderData
);
}
<<<<<<<
HEAD
function
file
(
userData
){
return
axios
.
get
(
'/api/file'
,
userData
,
{
params
:
{
...
...
@@ -44,3 +45,6 @@ function dropbox(userData){
}
// export { registerUser, loginUser, dropbox, makeFolder };
=======
export
{
registerUser
,
loginUser
,
folder
,
makeFolder
};
>>>>>>>
ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
...
...
front-end/src/components/FileList.vue
View file @
a2e3c78
...
...
@@ -17,7 +17,7 @@
<v-list-item
v-for="item in this.$store.getters.folderL"
:key="item.title"
@click="
$router.push({name: 'Folder'}
)"
@click="
moveF(item.folder_name
)"
>
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
...
...
@@ -29,6 +29,9 @@
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
</v-btn>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-delete</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
<v-divider inset></v-divider>
...
...
@@ -47,6 +50,9 @@
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
</v-btn>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-delted</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-list>
...
...
@@ -101,7 +107,11 @@
<v-container>
<div>
<v-icon>mdi-folder</v-icon>
<<<<<<< HEAD
<v-text-field placeholder="name" id="foldername" type="text" v-model="foldername" ></v-text-field>
=======
<v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field>
>>>>>>> ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
</div>
</v-container>
<v-card-actions>
...
...
@@ -120,12 +130,11 @@
</v-dialog>
</div>
</template>
<script>
import { folder, makeFolder } from '../api/index';
export default {
data() {
return {
return {
foldername:'',
folders: [],
files: [],
...
...
@@ -138,11 +147,19 @@ import { folder, makeFolder } from '../api/index';
try {
const curData = {
id : this.$store.state.id,
cur:
this.$store.state.cur
cur:
'/'
}
<<<<<<< HEAD
const response = await dropbox(userData);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setFile', response.data.files);
=======
const response = await folder(curData);
console.log(response.data);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
>>>>>>> ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
} catch (error) {
console.log("에러");
console.log(error.response.data);
...
...
@@ -159,10 +176,10 @@ import { folder, makeFolder } from '../api/index';
cur : this.$store.state.cur,
folder_name : this.foldername
};
const response = await makeFolder(folderData);
console.log(response.data)
console.log("폴더 생성 완료");
this.$store.commit('setFolder', response.data.folders);
const response = await makeFolder(folderData);
console.log(response.data)
console.log("폴더 생성 완료");
this.$store.commit('setFolder', response.data.folders);
} catch (error) {
console.log("에러");
console.log(error.response.data);
...
...
@@ -170,8 +187,29 @@ import { folder, makeFolder } from '../api/index';
this.initFolderName();
this.dialog = false;
}
<<<<<<< HEAD
}
}
=======
},
async moveF(move_folder_name){
try {
const curData = {
id : this.$store.state.id,
cur: this.$store.state.cur + move_folder_name + '/'
}
const response = await folder(curData);
console.log(response.data);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
} catch (error) {
console.log("에러");
console.log(error.response.data);
}
}
}
>>>>>>> ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
}
</script>
</script>
\ No newline at end of file
...
...
front-end/src/components/FolderList.vue
deleted
100644 → 0
View file @
805af94
<template>
<div>
<v-list>
<v-icon>mdi-folder</v-icon>
<v-header>Folders</v-header>
<v-list-item
v-for="item in items"
:key="item.files">
</v-list-item>
</v-list>
</div>
</template>
<script>
export default {
props:{
}
}
</script>
<style>
</style>
\ No newline at end of file
front-end/src/routes/index.js
View file @
a2e3c78
...
...
@@ -67,10 +67,14 @@ export default new VueRouter ({
name
:
'Feedback'
,
component
:
()
=>
import
(
'../views/Feedback.vue'
)
},
<<<<<<<
HEAD
{
path
:
'/folder'
,
name
:
'Folder'
,
component
:
()
=>
import
(
'../views/FolderPage.vue'
)
},
=======
>>>>>>>
ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
]
})
...
...
front-end/src/store/index.js
View file @
a2e3c78
...
...
@@ -9,6 +9,10 @@ export default new Vuex.Store({
folders
:
{},
files
:
{},
cur
:
'/'
,
<<<<<<<
HEAD
=======
parent
:
'/'
>>>>>>>
ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
},
mutations
:
{
setId
(
state
,
userid
)
{
...
...
@@ -25,6 +29,9 @@ export default new Vuex.Store({
},
setCur
(
state
,
cur
)
{
state
.
cur
=
cur
;
},
setParent
(
state
,
parent
)
{
state
.
parent
=
parent
;
}
},
getters
:
{
...
...
@@ -42,6 +49,7 @@ export default new Vuex.Store({
},
cur
(
state
)
{
return
state
.
cur
;
<<<<<<<
HEAD
},
setFolder
(
state
,
folderlist
){
state
.
folders
=
folderlist
;
...
...
@@ -50,4 +58,11 @@ export default new Vuex.Store({
state
.
files
=
filelist
;
},
},
=======
},
parent
(
state
)
{
return
state
.
parent
;
}
}
>>>>>>>
ec5658f978ed2a5a94bba39bcb9aecf9edc70c36
})
\ No newline at end of file
...
...
front-end/src/views/FolderPage.vue
deleted
100644 → 0
View file @
805af94
<template>
<div>
<FolderList></FolderList>
</div>
</template>
<script>
import FolderList from '../components/FolderList'
export default {
components: {
FolderList,
}
}
</script>
<style>
</style>
\ No newline at end of file
Please
register
or
login
to post a comment