최동원

Merge branch 'share,favorite' into 'master'

Share,favorite



See merge request !1
Showing 46 changed files with 1844 additions and 954 deletions
...@@ -113,4 +113,7 @@ dist ...@@ -113,4 +113,7 @@ dist
113 .yarn/unplugged 113 .yarn/unplugged
114 .yarn/build-state.yml 114 .yarn/build-state.yml
115 .yarn/install-state.gz 115 .yarn/install-state.gz
116 -.pnp.*
...\ No newline at end of file ...\ No newline at end of file
116 +.pnp.*
117 +
118 +backend/routes/modules/s3/download/*
119 +backend/routes/modules/awsconfig.json
......
...@@ -12,7 +12,10 @@ var registerRouter = require('./routes/userlogin/register'); ...@@ -12,7 +12,10 @@ var registerRouter = require('./routes/userlogin/register');
12 var fileRouter = require('./routes/file/router'); 12 var fileRouter = require('./routes/file/router');
13 //var trashcanRouter = require('./routes/trashcan/router'); 13 //var trashcanRouter = require('./routes/trashcan/router');
14 var folderRouter = require('./routes/folders'); 14 var folderRouter = require('./routes/folders');
15 -var contactRouter = require('./routes/contact') 15 +var quickRouter = require('./routes/quick');
16 +var favoritesRouter = require('./routes/favorites');
17 +var shareRouter = require('./routes/share');
18 +var trashcanRouter = require('./routes/trashcan');
16 19
17 20
18 var passport = require('passport'); 21 var passport = require('passport');
...@@ -60,10 +63,12 @@ app.use('/api/user', userRouter); ...@@ -60,10 +63,12 @@ app.use('/api/user', userRouter);
60 app.use('/api/login', loginRouter); 63 app.use('/api/login', loginRouter);
61 app.use('/api/RegistUser', registerRouter); 64 app.use('/api/RegistUser', registerRouter);
62 app.use('/api/folder', folderRouter); 65 app.use('/api/folder', folderRouter);
66 +app.use('/api/favorites', favoritesRouter);
67 +app.use('/api/share', shareRouter);
68 +app.use('/api/trashcan', trashcanRouter);
63 //app.use('/users', usersRouter); 69 //app.use('/users', usersRouter);
64 app.use('/api/file', fileRouter); 70 app.use('/api/file', fileRouter);
65 -app.use('/api/contact',contactRouter); 71 +app.use('/api/quick', quickRouter);
66 -//app.use('/api/trashcan', trashcanRouter);
67 72
68 // catch 404 and forward to error handler 73 // catch 404 and forward to error handler
69 app.use(function(req, res, next) { 74 app.use(function(req, res, next) {
...@@ -81,4 +86,4 @@ app.use(function(err, req, res, next) { ...@@ -81,4 +86,4 @@ app.use(function(err, req, res, next) {
81 res.render('error'); 86 res.render('error');
82 }); 87 });
83 88
84 -module.exports = app; 89 +module.exports = app;
...\ No newline at end of file ...\ No newline at end of file
......
1 +const express = require('express');
2 +const router = express.Router();
3 +
4 +router.get('/show', function(req, res, next) {
5 + console.log(req.query);
6 + user_id = req.query.id;
7 + let checkfolder = 'SELECT * FROM folders WHERE user_id = ? AND favorite = 1;';
8 + let checkfiles = 'SELECT * FROM files WHERE user_id = ? AND favorite = 1;';
9 + connection.query(checkfolder, [user_id], function(err, folder, fields) {
10 + if (err) {
11 + console.log('select error');
12 + res.status(404).send();
13 + } else {
14 + connection.query(checkfiles, [user_id], function(err, file, fields) {
15 + if (err) {
16 + console.log('select error');
17 + res.status(404).send();
18 + } else {
19 + res.status(200).send({
20 + folders: folder,
21 + files: file
22 + });
23 + }
24 + });
25 + }
26 + });
27 +});
28 +
29 +router.post('/addfolder', function(req, res, next) {
30 + let user_id = req.body.id;
31 + let folder_name = req.body.name;
32 + let cur = req.body.cur;
33 + console.log(req.body);
34 + let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name = ? AND favorite = 1;';
35 + connection.query(checkfolder, [cur, user_id, folder_name], function(err, rows, fields) {
36 + if (err) {
37 + console.log('select error');
38 + res.status(400).send({ error: err });
39 + } else {
40 + if (rows.length == 0) {
41 + let sql = 'UPDATE folders SET favorite = 1 WHERE location = ? AND folder_name = ? AND user_id = ?;';
42 + connection.query(sql, [cur, folder_name, user_id], function(err, result, fields) {
43 + if (err) {
44 + console.log('update error');
45 + res.status(400).send({ error: err });
46 + } else {
47 + let getfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;';
48 + connection.query(getfolder, [cur, user_id, 'trashcan'], function(err, folders, fields) {
49 + res.status(200).send({
50 + folders: folders
51 + })
52 + });
53 + }
54 + });
55 + } else {
56 + console.log('already exist error');
57 + res.status(400).send({ error: err });
58 + }
59 + }
60 + });
61 +});
62 +
63 +router.post('/addfile', function(req, res, next) {
64 + let user_id = req.body.id;
65 + let file_name = req.body.name;
66 + let cur = req.body.cur;
67 + console.log(req.body);
68 + let checkfolder = 'SELECT * FROM files WHERE location = ? AND user_id = ? AND file_name = ? AND favorite = 1;';
69 + connection.query(checkfolder, [cur, user_id, file_name], function(err, rows, fields) {
70 + if (err) {
71 + console.log('select error');
72 + res.status(400).send({ error: err });
73 + } else {
74 + if (rows.length == 0) {
75 + let sql = 'UPDATE files SET favorite = 1 WHERE location = ? AND file_name = ? AND user_id = ?;';
76 + connection.query(sql, [cur, file_name, user_id], function(err, result, fields) {
77 + if (err) {
78 + console.log('update error');
79 + res.status(400).send({ error: err });
80 + } else {
81 + let getfolder = 'SELECT * FROM files WHERE location = ? AND user_id = ?;';
82 + connection.query(getfolder, [cur, user_id], function(err, files, fields) {
83 + res.status(200).send({
84 + files: files
85 + })
86 + });
87 + }
88 + });
89 + } else {
90 + console.log('already exist error');
91 + res.status(400).send({ error: err });
92 + }
93 + }
94 + });
95 +});
96 +
97 +router.post('/delfolder', function(req, res, next) {
98 + let user_id = req.body.id;
99 + let folder_name = req.body.name;
100 + let cur = req.body.cur;
101 + let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name = ? AND favorite = 1;';
102 +
103 + connection.query(checkfolder, [cur, user_id, folder_name], function(err, rows, fields) {
104 + if (err) {
105 + console.log('select error');
106 + res.status(400).send({ error: err });
107 + } else {
108 + if (rows.length != 0) {
109 + let sql = 'UPDATE folders SET favorite = 0 WHERE location = ? AND folder_name = ? AND user_id = ?;';
110 + connection.query(sql, [cur, folder_name, user_id], function(err, result, fields) {
111 + if (err) {
112 + console.log('update error');
113 + res.status(400).send({ error: err });
114 + } else {
115 + let getfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;';
116 + connection.query(getfolder, [cur, user_id, 'trashcan'], function(err, folders, fields) {
117 + res.status(200).send({
118 + folders: folders
119 + })
120 + });
121 + }
122 + });
123 + } else {
124 + console.log('dont exist error');
125 + res.status(400).send({ error: err });
126 + }
127 + }
128 + });
129 +});
130 +
131 +router.post('/delfile', function(req, res, next) {
132 + let user_id = req.body.id;
133 + let file_name = req.body.name;
134 + let cur = req.body.cur;
135 + let checkfile = 'SELECT * FROM files WHERE location = ? AND user_id = ? AND file_name = ? AND favorite = 1;';
136 +
137 + connection.query(checkfile, [cur, user_id, file_name], function(err, rows, fields) {
138 + if (err) {
139 + console.log('select error');
140 + res.status(400).send({ error: err });
141 + } else {
142 + if (rows.length != 0) {
143 + let sql = 'UPDATE files SET favorite = 0 WHERE location = ? AND file_name = ? AND user_id = ?;';
144 + connection.query(sql, [cur, file_name, user_id], function(err, result, fields) {
145 + if (err) {
146 + console.log('update error');
147 + res.status(400).send({ error: err });
148 + } else {
149 + let getfile = 'SELECT * FROM files WHERE location = ? AND user_id = ?;';
150 + connection.query(getfile, [cur, user_id], function(err, files, fields) {
151 + res.status(200).send({
152 + files: files
153 + })
154 + });
155 + }
156 + });
157 + } else {
158 + console.log('dont exist error');
159 + res.status(400).send({ error: err });
160 + }
161 + }
162 + });
163 +});
164 +
165 +
166 +
167 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
...@@ -7,7 +7,9 @@ var S3 = require('../modules/s3/s3'); ...@@ -7,7 +7,9 @@ var S3 = require('../modules/s3/s3');
7 7
8 8
9 // /file/delete/:name 9 // /file/delete/:name
10 -router.get('/:name', function (req, res) { 10 +router.get('/:name', function(req, res) {
11 + console.log(req.query);
12 + console.log(req.params);
11 var file_name = req.params.name; 13 var file_name = req.params.name;
12 var user_id = req.query.id; 14 var user_id = req.query.id;
13 var curPath = req.query.cur; 15 var curPath = req.query.cur;
...@@ -15,32 +17,56 @@ router.get('/:name', function (req, res) { ...@@ -15,32 +17,56 @@ router.get('/:name', function (req, res) {
15 var targetPath = 'trashcan'; 17 var targetPath = 'trashcan';
16 var sourceFile = curPath.substring(1) + file_name; 18 var sourceFile = curPath.substring(1) + file_name;
17 19
18 - var sql1 = 'DELETE FROM files WHERE file_name = (?) AND location=(?) AND user_Id = (?)'; 20 + var sql1 = 'UPDATE files SET location = ? WHERE location = ? AND file_name = ? AND user_id = ?;';
19 - var sql2 = 'INSERT INTO trashcan (trash_name, location, user_Id) VALUES (?, ?, ?)'; 21 + connection.query(sql1, ['/trashcan/', curPath, file_name, user_id], function(err) {
20 -
21 - connection.query(sql1, [file_name, curPath, user_id], function (err) {
22 if (err) { 22 if (err) {
23 - console.log('delete db error'); 23 + console.log('update db error');
24 - res.send({erorr: 'db delete error'}); 24 + res.send({ erorr: 'db update error' });
25 - } 25 + } else {
26 - else { 26 + S3.moveFile2(S3.BUCKET_NAME, user_id, sourceFile, file_name, targetPath, function(result) {
27 - connection.query(sql2, [file_name, '/trashcan'+curPath, user_id], function (err) { 27 + if (result) {
28 - if (err) { 28 + res.send("move to trashcan success");
29 - console.log('insert in trashcan db error');
30 - res.send({error: 'db insert error'});
31 - }
32 - else {
33 - // /drive/user_id/sourceFile --> /drive/user_id/trashcan/sourceFile
34 - S3.moveFile2(S3.BUCKET_NAME, user_id, sourceFile, targetPath, function (result) {
35 - if (result) {
36 - res.send("move to trashcan success");
37 - }
38 - })
39 } 29 }
40 }) 30 })
41 } 31 }
42 }) 32 })
43 }); 33 });
44 34
35 +// // /file/delete/:name
36 +// router.get('/:name', function (req, res) {
37 +// var file_name = req.params.name;
38 +// var user_id = req.query.id;
39 +// var curPath = req.query.cur;
40 +
41 +// var targetPath = 'trashcan';
42 +// var sourceFile = curPath.substring(1) + file_name;
43 +
44 +// var sql1 = 'DELETE FROM files WHERE file_name = (?) AND location=(?) AND user_Id = (?)';
45 +// var sql2 = 'INSERT INTO trashcan (trash_name, location, user_Id) VALUES (?, ?, ?)';
46 +
47 +// connection.query(sql1, [file_name, curPath, user_id], function (err) {
48 +// if (err) {
49 +// console.log('delete db error');
50 +// res.send({erorr: 'db delete error'});
51 +// }
52 +// else {
53 +// connection.query(sql2, [file_name, '/trashcan'+curPath, user_id], function (err) {
54 +// if (err) {
55 +// console.log('insert in trashcan db error');
56 +// res.send({error: 'db insert error'});
57 +// }
58 +// else {
59 +// // /drive/user_id/sourceFile --> /drive/user_id/trashcan/sourceFile
60 +// S3.moveFile2(S3.BUCKET_NAME, user_id, sourceFile, targetPath, function (result) {
61 +// if (result) {
62 +// res.send("move to trashcan success");
63 +// }
64 +// })
65 +// }
66 +// })
67 +// }
68 +// })
69 +// });
70 +
45 71
46 module.exports = router; 72 module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,6 +2,7 @@ var express = require('express'); ...@@ -2,6 +2,7 @@ var express = require('express');
2 var router = express.Router(); 2 var router = express.Router();
3 3
4 var fs = require('fs'); 4 var fs = require('fs');
5 +var moment = require('moment');
5 6
6 var AWS = require('aws-sdk'); 7 var AWS = require('aws-sdk');
7 AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json"); 8 AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json");
...@@ -19,7 +20,14 @@ router.get('/:name', function (req, res) { ...@@ -19,7 +20,14 @@ router.get('/:name', function (req, res) {
19 20
20 S3.downloadFile3(S3.BUCKET_NAME, user_id, targetFile, function (result, downloadDir) { 21 S3.downloadFile3(S3.BUCKET_NAME, user_id, targetFile, function (result, downloadDir) {
21 if (result) { 22 if (result) {
22 - res.send({ src: downloadDir }) 23 + var sql = 'UPDATE files SET recent_access=(?) WHERE user_id=(?) AND location=(?) AND file_name=(?)';
24 + connection.query(sql, [moment().format(), user_id, curPath, file_name], function(err){
25 + if (err){
26 + res.send({err: 'update error'});
27 + }else{
28 + res.send({ src: downloadDir })
29 + }
30 + })
23 }else{ 31 }else{
24 res.send({ err: 'download error'}) 32 res.send({ err: 'download error'})
25 } 33 }
......
...@@ -9,42 +9,50 @@ var fs = require('fs'); ...@@ -9,42 +9,50 @@ var fs = require('fs');
9 9
10 10
11 // /file 11 // /file
12 -router.get('/', function (req, res) { 12 +router.get('/', function(req, res) {
13 + console.log(req.query);
13 var user_id = req.query.id; 14 var user_id = req.query.id;
14 - var curPath = req.query.cur; // /folder1/folder2/ 15 + var curPath = req.query.cur; // /folder1/folder2/
15 16
16 var sql = 'SELECT * FROM files WHERE user_id=(?) AND location=(?) ORDER BY date DESC'; 17 var sql = 'SELECT * FROM files WHERE user_id=(?) AND location=(?) ORDER BY date DESC';
17 - connection.query(sql, [user_id, curPath], function (err, result) { 18 + connection.query(sql, [user_id, curPath], function(err, result) {
18 - if (err){ 19 + if (err) {
19 - res.send({error: 'select error'}); 20 + res.send({ error: 'select error' });
20 - }else{ 21 + } else {
21 22
22 - res.status(200).send({files: result}); 23 + res.status(200).send({ files: result });
23 } 24 }
24 }) 25 })
25 }); 26 });
26 27
27 28
28 29
29 -router.get('/:name', function (req, res) { 30 +router.get('/:name', function(req, res) {
30 var file_name = req.params.name; 31 var file_name = req.params.name;
31 - var curPath = req.query.cur; // /folder1/folder2/ 32 + var curPath = req.query.cur; // /folder1/folder2/
32 var user_id = req.query.id; 33 var user_id = req.query.id;
33 34
34 - var targetFile = curPath.substring(1) + file_name; // folder1/folder2/test.txt 35 + var targetFile = curPath.substring(1) + file_name; // folder1/folder2/test.txt
35 var extension = targetFile.split('.')[1].toLowerCase(); 36 var extension = targetFile.split('.')[1].toLowerCase();
36 37
37 38
38 - S3.downloadFile3(S3.BUCKET_NAME, user_id, targetFile, function(result, downloadDir){ 39 + S3.downloadFile2(S3.BUCKET_NAME, user_id, targetFile, function(result, downloadDir) {
39 - if (result){ 40 + if (result) {
40 - if (extension == 'jpg' || extension == 'jpeg' || extension == 'png') { 41 + var content;
41 - res.status(200).send({ type: 'image', src: downloadDir}) 42 + content = fs.readFileSync(downloadDir, 'utf8');
42 - }else{ 43 + res.send({ file_name: file_name, content: content });
43 - res.status(200).send({type: 'text', src: downloadDir}) 44 +
44 - } 45 + //if (extension == 'jpg' || extension == 'jpeg' || extension == 'png') {
46 + // res.send({ type: 'image', src: downloadDir})
47 + //}else{
48 + // var content;
49 + // content = fs.readFileSync(downloadDir, 'utf8');
50 + // res.send({file_name: file_name, content: content});
51 + // //res.status(200).send({type: 'text', src: downloadDir})
52 + //}
45 } 53 }
46 }) 54 })
47 -}); 55 +});
48 56
49 57
50 module.exports = router; 58 module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
......
1 +var express = require('express');
2 +var router = express.Router();
3 +
4 +var AWS = require('aws-sdk');
5 +AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json");
6 +var S3 = require('../modules/s3/s3');
7 +
8 +var fs = require('fs');
9 +var moment = require('moment');
10 +
11 +
12 +
13 +// /file/modify/:name
14 +router.post('/:name', function(req, res){
15 + var user_id = req.body.user_id;
16 + var curPath = req.body.cur; // /folder1/folder2/
17 + var file_name = req.params.name;
18 + var modified_name = req.body.name;
19 + var modified_content = req.body.content;
20 +
21 + var targetPath;
22 + if (curPath == '/') {
23 + targetPath = '';
24 + } else {
25 + targetPath = curPath.substring(1, curPaht.length-1); // folder1/folder2
26 + }
27 +
28 + var originalDir = __dirname + '/../modules/s3/download/' + user_id + curPath + file_name;
29 + var tempDownloadDir;
30 +
31 + // 파일 이름 변경
32 + S3.renameFile(S3.BUCKET_NAME, user_id, file_name, modified_name, targetPath, function(result, r_modified_name){
33 + if (result){
34 + modified_name = r_modified_name;
35 + tempDownloadDir = __dirname + '/../modules/s3/download/' + user_id + curPath + modified_name;
36 + fs.unlink(originalDir, function(err){
37 + if (err){
38 + console.log(err);
39 + res.send({error: 'original file not exists in server'});
40 + }else{
41 + // 파일 내용 변경
42 + fs.writeFileSync(tempDownloadDir, modified_content);
43 +
44 + S3.coverFile(S3.BUCKET_NAME, user_id, modified_name, targetPath, tempDownloadDir, function (result) {
45 + if (result) {
46 + var sql = 'UPDATE files SET file_name=(?), updated=(?), recent_access=(?) WHERE user_id=(?) AND location=(?) AND file_name=(?)';
47 + connection.query(sql, [modified_name, moment().format(), moment().format(), user_id, curPath, file_name], function (err) {
48 + if (err) {
49 + console.log(err);
50 + res.send({ error: 'update error' });
51 + } else {
52 + fs.unlinkSync(tempDownloadDir);
53 + res.send('modify file success');
54 + }
55 + })
56 + } else {
57 + res.send({ error: 'modify file failed' });
58 + }
59 + })
60 + }
61 + });
62 + }else{
63 + res.send({error: 'rename error'});
64 + }
65 + })
66 +});
67 +
68 +
69 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
...@@ -6,12 +6,14 @@ var files = require('./files'); ...@@ -6,12 +6,14 @@ var files = require('./files');
6 var uploadFile = require('./uploadFile'); 6 var uploadFile = require('./uploadFile');
7 var downloadFile = require('./downloadFile'); 7 var downloadFile = require('./downloadFile');
8 var deleteFile = require('./deleteFile'); 8 var deleteFile = require('./deleteFile');
9 +var modifyFile = require('./modifyFile');
9 10
10 11
11 router.use('/', files); 12 router.use('/', files);
12 router.use('/upload', uploadFile); 13 router.use('/upload', uploadFile);
13 router.use('/download', downloadFile); 14 router.use('/download', downloadFile);
14 router.use('/delete', deleteFile); 15 router.use('/delete', deleteFile);
16 +router.use('/modify', modifyFile);
15 17
16 18
17 module.exports = router; 19 module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,6 +2,7 @@ var express = require('express'); ...@@ -2,6 +2,7 @@ var express = require('express');
2 var router = express.Router(); 2 var router = express.Router();
3 3
4 var formidable = require('formidable'); 4 var formidable = require('formidable');
5 +var moment = require('moment');
5 6
6 var AWS = require('aws-sdk'); 7 var AWS = require('aws-sdk');
7 AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json"); 8 AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json");
...@@ -43,6 +44,7 @@ router.post('/', function (req, res) { ...@@ -43,6 +44,7 @@ router.post('/', function (req, res) {
43 }else{ 44 }else{
44 sourceFiles.push(files.file.name); 45 sourceFiles.push(files.file.name);
45 bodies.push(files.file.path); 46 bodies.push(files.file.path);
47 + console.log('bodies', bodies);
46 } 48 }
47 }else{ 49 }else{
48 for (var file of files.file) { // 파일 여러개일 때 50 for (var file of files.file) { // 파일 여러개일 때
...@@ -65,8 +67,8 @@ router.post('/', function (req, res) { ...@@ -65,8 +67,8 @@ router.post('/', function (req, res) {
65 } 67 }
66 } 68 }
67 for (var sourceFile of noErrSourceFiles) { 69 for (var sourceFile of noErrSourceFiles) {
68 - var sql = 'INSERT INTO files (file_name, user_id, location) VALUES (?, ?, ?)'; 70 + var sql = 'INSERT INTO files (file_name, user_id, location, recent_access) VALUES (?, ?, ?, ?)';
69 - connection.query(sql, [sourceFile, user_id, curPath], function (err, result) { 71 + connection.query(sql, [sourceFile, user_id, curPath, moment().format()], function (err, result) {
70 if (err) { 72 if (err) {
71 console.log('insert error'); 73 console.log('insert error');
72 res.send({error: 'insert error'}); 74 res.send({error: 'insert error'});
......
This diff is collapsed. Click to expand it.
1 { 1 {
2 - "accessKeyId": "ASIAXZL2SWFEYG2GUYVJ", 2 + "accessKeyId": "",
3 - "secretAccessKey": "ceYvfLs25iiBDfigO7PbP67kJoKswJdfduqROrJt", 3 + "secretAccessKey": "",
4 - "sessionToken": "FwoGZXIvYXdzEDMaDGvezwF9kQrAJ+uhfSLDASWFKBk7UNbRzZVEM1eoGJ3E+UI9d4xSpqEDqRYjsOTn5wYIGM3mUCZ8S6/XCnGP5yFz+qv9mBLDf311iP9ajY091OhQ8c2nB6l+JHuRKAz6FhGLrjHtD1AecHtjHOu5dXODU2+9ctvGj7V60KYqjToah5Tvv84EVac/41Les3rtrqcXS/bbmVwv5kDz9K1FJStln4sXZ/foueGHZAkAJQ6LAtIQWg4/reFUcWAi8E0bUjMckmymDQhnVNWcSbgQ+htBYiiPg+P2BTItOqWuZojM5lw32rTv7+PuOaeyHjx3+Vcd4bo3orSJr57P2ZPfmglZNKY7W5aw", 4 + "sessionToken": "",
5 - "region": "us-east-1" 5 + "region": "ap-northeast-2"
6 -} 6 +}
...\ No newline at end of file ...\ No newline at end of file
......
1 -asdf
...\ No newline at end of file ...\ No newline at end of file
...@@ -13,11 +13,10 @@ ...@@ -13,11 +13,10 @@
13 // targetFile: folder2/file.txt 13 // targetFile: folder2/file.txt
14 14
15 15
16 -
17 var AWS = require('aws-sdk'); 16 var AWS = require('aws-sdk');
18 AWS.config.update({ region: 'ap-northeast-2' }); 17 AWS.config.update({ region: 'ap-northeast-2' });
19 18
20 -var BUCKET_NAME = 'khuloud'; 19 +var BUCKET_NAME = 'qkrrlqja-test';
21 20
22 var s3 = new AWS.S3(); 21 var s3 = new AWS.S3();
23 var fs = require('fs'); 22 var fs = require('fs');
...@@ -73,6 +72,32 @@ var S3 = { ...@@ -73,6 +72,32 @@ var S3 = {
73 }) 72 })
74 }, 73 },
75 74
75 + // 파일 덮어쓰기
76 + coverFile: function(bucketName, userId, sourceFile, targetPath, body, callback) {
77 + var pathbody = fs.createReadStream(body);
78 +
79 + if (targetPath != '' && targetPath[targetPath.length - 1] != '/') {
80 + targetPath = targetPath + '/';
81 + }
82 + var targetFile = targetPath + sourceFile;
83 +
84 + var coverParams = {
85 + Bucket: bucketName,
86 + Key: 'drive/' + userId + '/' + targetFile,
87 + Body: pathbody
88 + };
89 +
90 + s3.upload(coverParams, function (err, data) {
91 + if (err) {
92 + console.log("Cover Error" + err);
93 + callback(false);
94 + } else {
95 + console.log("Cover Success");
96 + callback(true);
97 + }
98 + })
99 + },
100 +
76 deleteFile: function (bucketName, userId, targetFile, callback) { 101 deleteFile: function (bucketName, userId, targetFile, callback) {
77 // targetFile => folder1/folder2/test.txt 102 // targetFile => folder1/folder2/test.txt
78 var deleteParams = { 103 var deleteParams = {
...@@ -104,10 +129,8 @@ var S3 = { ...@@ -104,10 +129,8 @@ var S3 = {
104 console.log("Download File Error", err); 129 console.log("Download File Error", err);
105 callback(false); 130 callback(false);
106 } else { 131 } else {
107 - if (data) { 132 + console.log("Get File Success");
108 - console.log("Get File Success"); 133 + callback(true, data.Body.toString());
109 - callback(true, data.body.toString());
110 - }
111 } 134 }
112 }) 135 })
113 }, 136 },
...@@ -143,10 +166,13 @@ var S3 = { ...@@ -143,10 +166,13 @@ var S3 = {
143 Key: 'drive/' + userId + '/' + targetFile 166 Key: 'drive/' + userId + '/' + targetFile
144 }; 167 };
145 try { 168 try {
146 - s3.getObject(params).createReadStream().pipe(file); 169 + var stream = s3.getObject(params).createReadStream().pipe(file);
147 - callback(true, tempDownloadDir); 170 + stream.on('end', function(){
171 + console.log('end!');
172 + callback(true, tempDownloadDir);
173 + });
148 }catch(err){ 174 }catch(err){
149 - console.log('no such file'); 175 + console.log('no such file', err);
150 callback(false); 176 callback(false);
151 } 177 }
152 }else{ 178 }else{
...@@ -277,6 +303,75 @@ var S3 = { ...@@ -277,6 +303,75 @@ var S3 = {
277 }) 303 })
278 }, 304 },
279 305
306 + // 파일 이름이 달라지는 경우
307 + moveFile3: function (bucketName, userId, oldFile, newFile, targetPath, callback) {
308 + if (targetPath != ''){
309 + targetPath = targetPath + '/';
310 + }
311 + sourceFile = targetPath + oldFile; // test.txt or folder1/test.txt
312 + var targetFile = targetPath + newFile;
313 +
314 + S3.copyFile2(bucketName, userId, sourceFile, targetFile, function(result){
315 + if (!result){
316 + console.log("Move Error on Copying File3");
317 + callback(false);
318 + }else{
319 + S3.deleteFile(bucketName, userId, sourceFile, function (res) {
320 + if (!res) {
321 + console.log("Move Error on Deleting File");
322 + callback(false);
323 + } else {
324 + console.log("Move Success");
325 + callback(true);
326 + }
327 + })
328 + }
329 + })
330 + },
331 +
332 + renameFile: function(bucketName, userId, sourceFile, modiFile, targetPath, callback){
333 + // sourceFile = test.txt
334 + // modiFile = test2.txt
335 + // targetPath = '' or 'folder1/folder2'
336 +
337 + if (sourceFile == modiFile){ // 이름 변경되지 않은 경우
338 + callback(true, sourceFile);
339 + }else{
340 + if (targetPath != '') {
341 + targetPath = targetpath + '/';
342 + }
343 + var targetFile = targetPath + modiFile;
344 +
345 + S3.isFileOverlapped(bucketName, userId, targetFile, function (res, ans, lvNum) {
346 + if (!res) {
347 + console.log("Overlap Check failed");
348 + callback(false, sourceFile);
349 + } else {
350 + if (ans) {
351 + console.log("File Duplication");
352 + S3.makeVersion(bucketName, userId, targetFile, lvNum + 1, function (res, versionedSourceFile) {
353 + if (!res) {
354 + console.log("Make version failed");
355 + callback(false, sourceFile);
356 + } else {
357 + S3.renameFile(bucketName, userId, sourceFile, versionedSourceFile, targetPath, callback);
358 + }
359 + })
360 + } else {
361 + S3.moveFile3(bucketName, userId, sourceFile, modiFile, targetPath, function (result) {
362 + if (result) {
363 + callback(true, modiFile);
364 + } else {
365 + console.log('File Rename failed');
366 + callback(false);
367 + }
368 + })
369 + }
370 + }
371 + });
372 + }
373 + },
374 +
280 uploadFile: function (bucketName, userId, sourceFile, targetPath, body, callback) { 375 uploadFile: function (bucketName, userId, sourceFile, targetPath, body, callback) {
281 var pathbody = fs.createReadStream(body); 376 var pathbody = fs.createReadStream(body);
282 377
......
1 +var express = require('express');
2 +var router = express.Router();
3 +
4 +
5 +router.get('/', function(req, res){
6 + var user_id = req.query.id;
7 +
8 + var sql = 'SELECT * FROM files WHERE recent_access>date_sub(now(), interval 3 day) AND user_id=(?)';
9 + connection.query(sql, user_id, function(err, result){
10 + if (err){
11 + console.log('select error');
12 + res.send({error: 'quick error'});
13 + }else{
14 + res.send(result);
15 + }
16 + })
17 +})
18 +
19 +
20 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
1 +const express = require('express');
2 +const router = express.Router();
3 +const AWS = require("aws-sdk");
4 +const moment = require("moment");
5 +AWS.config.loadFromPath(__dirname + "/modules/awsconfig.json");
6 +
7 +const BUCKET_NAME = "hong-s3-cloud";
8 +
9 +const s3 = new AWS.S3();
10 +
11 +
12 +router.post('/', function(req, res, next) {
13 + console.log(req.body);
14 + let user_id = req.body.id;
15 + let cur = req.body.cur;
16 + let curPath = user_id + cur;
17 + let name = req.body.file_name;
18 + let target_id = req.body.target_id;
19 +
20 + let checkfile = 'SELECT * FROM files WHERE location = ? AND file_name = ? AND user_id = ?';
21 + connection.query(checkfile, [cur, name, user_id], function(err1, rows, fields) {
22 + if (rows.length != 0) {
23 + let copy_params = {
24 + Bucket: BUCKET_NAME,
25 + CopySource: BUCKET_NAME + '/drive/' + curPath + name,
26 + Key: 'drive/' + target_id + '/share/' + name
27 + };
28 + s3.copyObject(copy_params, function(err, data) {
29 + if (err) {
30 + console.log(err, data);
31 + res.status(304).send({ error: "copy error" });
32 + } else {
33 + let values = [name, '/share/', target_id];
34 + let sharesql = 'INSERT INTO files (file_name,location,user_id) values (?,?,?);';
35 + connection.query(sharesql, values, function(err3, result, field) {
36 + if (err3) {
37 + console.log("sharesql error");
38 + res.status(304).send({ error: "sharesql error" });
39 + } else {
40 + res.status(200).send({});
41 + }
42 + });
43 + }
44 + });
45 + } else {
46 + console.log("Does not exist");
47 + res.status(304).send({ error: "Does not exist" });
48 + }
49 + });
50 +
51 +});
52 +
53 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 var express = require('express'); 1 var express = require('express');
2 var request = require('request'); 2 var request = require('request');
3 var async = require('async'); 3 var async = require('async');
4 - 4 +const AWS = require("aws-sdk");
5 +AWS.config.loadFromPath(__dirname + "/../modules/awsconfig.json");
5 var cryptoM = require('./../../routes/modules/cryptoM.js'); 6 var cryptoM = require('./../../routes/modules/cryptoM.js');
7 +const moment = require("moment");
8 +
9 +const BUCKET_NAME = "hong-s3-cloud";
10 +const s3 = new AWS.S3();
6 11
7 var router = express.Router(); 12 var router = express.Router();
8 13
...@@ -14,32 +19,90 @@ router.get('/', function(req, res, next) { ...@@ -14,32 +19,90 @@ router.get('/', function(req, res, next) {
14 19
15 router.post('/', function(req, res, next) { 20 router.post('/', function(req, res, next) {
16 console.log(req.body); 21 console.log(req.body);
17 - var user_id=req.body.user_id; 22 + var user_id = req.body.user_id;
18 - var user_pw=req.body.user_pw; 23 + var user_pw = req.body.user_pw;
19 - var user_email=req.body.user_email; 24 + var user_email = req.body.user_email;
20 - var user_name=req.body.user_name; 25 + var user_name = req.body.user_name;
21 - var user_phone=req.body.user_phone; 26 + var user_phone = req.body.user_phone;
22 27
23 var sqlquery = "SELECT * FROM users WHERE user_id = ?"; 28 var sqlquery = "SELECT * FROM users WHERE user_id = ?";
24 - connection.query(sqlquery, [user_id], function (err, rows) { 29 + connection.query(sqlquery, [user_id], function(err, rows) {
25 - if (rows.length == 0) { 30 + if (rows.length == 0) {
26 - user_pw=cryptoM.encrypt(user_pw); 31 + user_pw = cryptoM.encrypt(user_pw);
27 - console.log(user_pw); 32 + console.log(user_pw);
28 - var sql = 'INSERT INTO users(user_id,user_pw, user_email, user_phone, user_name) values (?,?,?,?,?)'; 33 + var sql = 'INSERT INTO users(user_id,user_pw, user_email, user_phone, user_name) values (?,?,?,?,?)';
29 - var values = [user_id, user_pw, user_email, user_phone,user_name]; 34 + var values = [user_id, user_pw, user_email, user_phone, user_name];
30 - connection.query(sql, values, function (err) { 35 + connection.query(sql, values, function(err) {
31 - if (err) { 36 + if (err) {
32 - console.log("inserting user failed"); 37 + console.log("inserting user failed");
33 - throw err; 38 + res.status(400).send({ err: err });
34 - } else { 39 + } else {
35 - res.status(200).send('saved'); 40 + let params = {
36 - 41 + Bucket: BUCKET_NAME,
37 - } 42 + Key: 'drive/' + user_id + '/',
38 - }); 43 + Body: "",
39 - } else { 44 + ACL: "public-read-write"
40 - res.status(404).send(err); 45 + };
41 - } 46 + s3.putObject(params, function(err, data) {
42 - }); 47 + if (err) {
48 + console.log('s3 error');
49 + res.status(400).send({ err: err });
50 + } else {
51 + let params2 = {
52 + Bucket: BUCKET_NAME,
53 + Key: 'drive/' + user_id + '/share/',
54 + Body: "",
55 + ACL: "public-read-write"
56 + };
57 + s3.putObject(params2, function(err, data) {
58 + if (err) {
59 + console.log('s3 error');
60 + res.status(400).send({ err: err });
61 + } else {
62 + let params3 = {
63 + Bucket: BUCKET_NAME,
64 + Key: 'drive/' + user_id + '/trashcan/',
65 + Body: "",
66 + ACL: "public-read-write"
67 + };
68 + s3.putObject(params3, function(err, data) {
69 + if (err) {
70 + console.log('s3 error');
71 + res.status(400).send({ err: err });
72 + } else {
73 + let date = moment().format();
74 + let root = '/';
75 + let sql = "INSERT INTO folders (folder_name,location,user_id,created) values (?,?,?,?);";
76 + connection.query(sql, ['share', root, user_id, date], function(err, result, field) {
77 + if (err) {
78 + console.log('insert1 error');
79 + res.status(400).send({ err: err });
80 + } else {
81 + let sql = "INSERT INTO folders (folder_name,location,user_id,created) values (?,?,?,?);";
82 + connection.query(sql, ['trashcan', root, user_id, date], function(err, result, field) {
83 + if (err) {
84 + console.log('insert2 error');
85 + res.status(400).send({ err: err });
86 + } else {
87 + res.status(200).send('saved');
88 + }
89 + });
90 + }
91 + });
92 + }
93 + });
94 + }
95 + });
96 + }
97 + });
98 +
99 +
100 + }
101 + });
102 + } else {
103 + res.status(404).send(err);
104 + }
105 + });
43 }); 106 });
44 107
45 -module.exports = router; 108 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
9 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"> 9 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
10 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"> 10 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
11 <meta name="viewport" content="width=device-width,initial-scale=1.0"> 11 <meta name="viewport" content="width=device-width,initial-scale=1.0">
12 + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css" integrity="sha384-Bfad6CLCknfcloXFOyFnlgtENryhrpZCe29RTifKEixXQZ38WheV+i/6YWSzkz3V" crossorigin="anonymous">
12 </head> 13 </head>
13 <body> 14 <body>
14 <noscript> 15 <noscript>
......
1 <template> 1 <template>
2 - <tool-view></tool-view> 2 + <tool-view></tool-view>
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 -import ToolView from './components/ToolView' 6 +import ToolView from './components/ToolView';
7 7
8 - export default {
9 - data() {
10 - return {
11 -
12 - }
13 - },
14 - components: {
15 - ToolView,
16 - }
17 - }
18 -</script>
...\ No newline at end of file ...\ No newline at end of file
8 +export default {
9 + data() {
10 + return {};
11 + },
12 + components: {
13 + ToolView,
14 + },
15 +};
16 +</script>
......
...@@ -18,7 +18,7 @@ function folder(curData) { ...@@ -18,7 +18,7 @@ function folder(curData) {
18 return axios.get('/api/folder/show', { 18 return axios.get('/api/folder/show', {
19 params: { 19 params: {
20 id: curData.id, 20 id: curData.id,
21 - cur: curData.cur, 21 + folder_id: curData.folder_id,
22 }, 22 },
23 }); 23 });
24 } 24 }
...@@ -53,7 +53,7 @@ function uploadFile(fileData) { ...@@ -53,7 +53,7 @@ function uploadFile(fileData) {
53 } 53 }
54 54
55 function detailFile(fileData) { 55 function detailFile(fileData) {
56 - return axios.get(`/api/file/${fileData.name}`, { 56 + return axios.get(`/api/file/${fileData.fileName}`, {
57 params: { 57 params: {
58 id: fileData.id, 58 id: fileData.id,
59 cur: fileData.cur, 59 cur: fileData.cur,
...@@ -70,8 +70,9 @@ function deleteFile(fileData) { ...@@ -70,8 +70,9 @@ function deleteFile(fileData) {
70 }, 70 },
71 }); 71 });
72 } 72 }
73 +
73 function downloadFile(fileData) { 74 function downloadFile(fileData) {
74 - return axios.get(`api/file/download/${fileData.fileName}`, { 75 + return axios.get(`/api/file/download/${fileData.fileName}`, {
75 params: { 76 params: {
76 //현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다. 77 //현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다.
77 id: fileData.id, 78 id: fileData.id,
...@@ -80,6 +81,84 @@ function downloadFile(fileData) { ...@@ -80,6 +81,84 @@ function downloadFile(fileData) {
80 }); 81 });
81 } 82 }
82 83
84 +function accessedList(curData) {
85 + return axios.get('/api/quick', {
86 + params: {
87 + id: curData.id,
88 + },
89 + });
90 +}
91 +
92 +function showTrashcan(userId) {
93 + return axios.get('/api/trashcan/show', {
94 + params: {
95 + id: userId,
96 + },
97 + });
98 +}
99 +
100 +function modifyFile(fileData) {
101 + return axios.post(`/api/file/modify/${fileData.name}`, fileData);
102 +}
103 +
104 +function delFavorite(folderData) {
105 + return axios.post('/api/favorites/delfolder', folderData);
106 +}
107 +
108 +function addFavorite(folderData) {
109 + return axios.post('/api/favorites/addfolder', folderData);
110 +}
111 +
112 +function moveFile(fileData) {
113 + return axios.post('/api/folder/move', fileData);
114 +}
115 +
116 +function delFavoriteFile(fileData) {
117 + return axios.post('/api/favorites/delfile', fileData);
118 +}
119 +
120 +function addFavoriteFile(fileData) {
121 + return axios.post('/api/favorites/addfile', fileData);
122 +}
123 +
124 +function getFavoriteList(userId) {
125 + return axios.get('/api/favorites/show', {
126 + params: {
127 + id: userId,
128 + },
129 + });
130 +}
131 +
132 +function shareFile(shareData) {
133 + return axios.post('/api/share', shareData);
134 +}
135 +
136 +function tdelFolder(tData) {
137 + return axios.get('/api/trashcan/delfolder', {
138 + params: {
139 + id: tData.id,
140 + folder_id: tData.folder_id,
141 + },
142 + });
143 +}
144 +
145 +function tdelFile(tData) {
146 + return axios.get('/api/trashcan/delfile', {
147 + params: {
148 + id: tData.id,
149 + file_id: tData.file_id,
150 + },
151 + });
152 +}
153 +
154 +function tdelAll(userId) {
155 + return axios.get('/api/trashcan/all', {
156 + params: {
157 + id: userId,
158 + },
159 + });
160 +}
161 +
83 export { 162 export {
84 registerUser, 163 registerUser,
85 loginUser, 164 loginUser,
...@@ -91,4 +170,18 @@ export { ...@@ -91,4 +170,18 @@ export {
91 uploadFile, 170 uploadFile,
92 deleteFile, 171 deleteFile,
93 downloadFile, 172 downloadFile,
173 + delFavorite,
174 + addFavorite,
175 + moveFile,
176 + delFavoriteFile,
177 + addFavoriteFile,
178 + accessedList,
179 + detailFile,
180 + modifyFile,
181 + getFavoriteList,
182 + shareFile,
183 + tdelFolder,
184 + tdelFile,
185 + tdelAll,
186 + showTrashcan,
94 }; 187 };
......
This diff is collapsed. Click to expand it.
1 <template> 1 <template>
2 - <v-card 2 + <v-card max-width="98%" class="mx-auto">
3 - max-width="98%" 3 + <v-toolbar color="light-blue" dark>
4 - class="mx-auto" 4 + <v-toolbar-title>파일</v-toolbar-title>
5 - > 5 + <v-spacer></v-spacer>
6 - <v-toolbar 6 + </v-toolbar>
7 - color="light-blue" 7 + <v-list two-line subheader>
8 - dark 8 + <v-list-item v-for="item in items" :key="item.title" @click="">
9 - > 9 + <v-list-item-avatar>
10 - <v-toolbar-title>파일</v-toolbar-title> 10 + <v-icon :class="[item.iconClass]" v-text="item.icon"></v-icon>
11 - <v-spacer></v-spacer> 11 + </v-list-item-avatar>
12 - </v-toolbar> 12 + <v-list-item-content>
13 - <v-list two-line subheader> 13 + <v-list-item-title v-text="item.title"></v-list-item-title>
14 - <v-list-item 14 + <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
15 - v-for="item in items" 15 + </v-list-item-content>
16 - :key="item.title" 16 + <v-list-item-action>
17 - @click="" 17 + <v-btn icon>
18 - > 18 + <v-icon color="grey lighten-1">mdi-information</v-icon>
19 - <v-list-item-avatar> 19 + </v-btn>
20 - <v-icon 20 + </v-list-item-action>
21 - :class="[item.iconClass]" 21 + </v-list-item>
22 - v-text="item.icon" 22 + <v-list-item v-for="item in items2" :key="item.title" @click="">
23 - ></v-icon> 23 + <v-list-item-avatar>
24 - </v-list-item-avatar> 24 + <v-icon :class="[item.iconClass]" v-text="item.icon"></v-icon>
25 - <v-list-item-content> 25 + </v-list-item-avatar>
26 - <v-list-item-title v-text="item.title"></v-list-item-title> 26 + <v-list-item-content>
27 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle> 27 + <v-list-item-title v-text="item.title"></v-list-item-title>
28 - </v-list-item-content> 28 + <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
29 - <v-list-item-action> 29 + </v-list-item-content>
30 - <v-btn icon> 30 + <v-list-item-action>
31 - <v-icon color="grey lighten-1">mdi-information</v-icon> 31 + <v-btn icon>
32 - </v-btn> 32 + <v-icon color="grey lighten-1">mdi-information</v-icon>
33 - </v-list-item-action> 33 + </v-btn>
34 - </v-list-item> 34 + </v-list-item-action>
35 - <v-list-item 35 + </v-list-item>
36 - v-for="item in items2" 36 + </v-list>
37 - :key="item.title" 37 + </v-card>
38 - @click=""
39 - >
40 - <v-list-item-avatar>
41 - <v-icon
42 - :class="[item.iconClass]"
43 - v-text="item.icon"
44 - ></v-icon>
45 - </v-list-item-avatar>
46 - <v-list-item-content>
47 - <v-list-item-title v-text="item.title"></v-list-item-title>
48 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
49 - </v-list-item-content>
50 - <v-list-item-action>
51 - <v-btn icon>
52 - <v-icon color="grey lighten-1">mdi-information</v-icon>
53 - </v-btn>
54 - </v-list-item-action>
55 - </v-list-item>
56 - </v-list>
57 - </v-card>
58 </template> 38 </template>
59 39
60 <script> 40 <script>
61 - export default { 41 +export default {
62 - data: () => ({ 42 + data: () => ({
63 - items: [ 43 + items: [
64 - { icon: 'folder', iconClass: 'grey lighten-1 white--text', title: 'Photos', subtitle: 'Jan 9, 2014' }, 44 + {
65 - { icon: 'folder', iconClass: 'grey lighten-1 white--text', title: 'Recipes', subtitle: 'Jan 17, 2014' }, 45 + icon: 'folder',
66 - { icon: 'folder', iconClass: 'grey lighten-1 white--text', title: 'Work', subtitle: 'Jan 28, 2014' }, 46 + iconClass: 'grey lighten-1 white--text',
67 - ], 47 + title: 'Photos',
68 - items2: [ 48 + subtitle: 'Jan 9, 2014',
69 - { icon: 'assignment', iconClass: 'blue white--text', title: 'Vacation itinerary', subtitle: 'Jan 20, 2014' }, 49 + },
70 - { icon: 'call_to_action', iconClass: 'amber white--text', title: 'Kitchen remodel', subtitle: 'Jan 10, 2014' }, 50 + {
71 - ], 51 + icon: 'folder',
72 - }), 52 + iconClass: 'grey lighten-1 white--text',
73 - } 53 + title: 'Recipes',
54 + subtitle: 'Jan 17, 2014',
55 + },
56 + {
57 + icon: 'folder',
58 + iconClass: 'grey lighten-1 white--text',
59 + title: 'Work',
60 + subtitle: 'Jan 28, 2014',
61 + },
62 + ],
63 + items2: [
64 + {
65 + icon: 'assignment',
66 + iconClass: 'blue white--text',
67 + title: 'Vacation itinerary',
68 + subtitle: 'Jan 20, 2014',
69 + },
70 + {
71 + icon: 'call_to_action',
72 + iconClass: 'amber white--text',
73 + title: 'Kitchen remodel',
74 + subtitle: 'Jan 10, 2014',
75 + },
76 + ],
77 + }),
78 +};
74 </script> 79 </script>
......
1 +<template lang="html">
2 + <v-dialog v-model="dialog" max-width="290">
3 + <v-card>
4 + <v-card-title class="headline"
5 + >Use Google's location service?</v-card-title
6 + >
7 +
8 + <v-card-text>
9 + Let Google help apps determine location. This means sending anonymous
10 + location data to Google, even when no apps are running.
11 + </v-card-text>
12 +
13 + <v-card-actions>
14 + <v-spacer></v-spacer>
15 +
16 + <v-btn color="green darken-1" text @click="dialog = false">
17 + Disagree
18 + </v-btn>
19 +
20 + <v-btn color="green darken-1" text @click="dialog = false">
21 + Agree
22 + </v-btn>
23 + </v-card-actions>
24 + </v-card>
25 + </v-dialog>
26 +</template>
27 +
28 +<script>
29 +export default {
30 + data() {
31 + return {
32 + dialog: false,
33 + };
34 + },
35 +};
36 +</script>
37 +
38 +<style lang="css" scoped></style>
This diff is collapsed. Click to expand it.
...@@ -47,15 +47,7 @@ ...@@ -47,15 +47,7 @@
47 <v-list-item-title>연락처</v-list-item-title> 47 <v-list-item-title>연락처</v-list-item-title>
48 </v-list-item-content> 48 </v-list-item-content>
49 </v-list-item> 49 </v-list-item>
50 - <v-list-item router :to="{ name: 'Main' }" exact> 50 + <v-list-item router :to="{ name: 'Trash' }" exact>
51 - <v-list-item-action>
52 - <v-icon>mdi-settings</v-icon>
53 - </v-list-item-action>
54 - <v-list-item-content>
55 - <v-list-item-title>설정</v-list-item-title>
56 - </v-list-item-content>
57 - </v-list-item>
58 - <v-list-item>
59 <v-list-item-action> 51 <v-list-item-action>
60 <v-icon>mdi-delete</v-icon> 52 <v-icon>mdi-delete</v-icon>
61 </v-list-item-action> 53 </v-list-item-action>
......
1 +<template>
2 + <div>
3 + <v-toolbar flat>
4 + <v-toolbar-title>휴지통</v-toolbar-title>
5 + <v-spacer></v-spacer>
6 + <v-btn @click="delAll">비우기</v-btn>
7 + </v-toolbar>
8 + <v-list>
9 + <!-- <v-subheader inset>Folders</v-subheader> -->
10 + <!-- Folder view -->
11 + <v-list-item
12 + v-for="item in this.$store.getters.trashFolderL"
13 + :key="item.folder_id"
14 + :search="search"
15 + @click.right="show(item, $event)"
16 + @click=""
17 + >
18 + <v-list-item-avatar>
19 + <v-icon>mdi-folder</v-icon>
20 + </v-list-item-avatar>
21 + <v-list-item-content>
22 + <v-list-item-title v-text="item.folder_name"></v-list-item-title>
23 + </v-list-item-content>
24 + </v-list-item>
25 + <!-- File view -->
26 + <v-list-item
27 + v-for="item in this.$store.getters.trashFileL"
28 + :key="item.title"
29 + @click.right="showF(item, $event)"
30 + >
31 + <v-list-item-avatar>
32 + <v-icon> mdi-file</v-icon>
33 + </v-list-item-avatar>
34 + <v-list-item-content>
35 + <v-list-item-title v-text="item.file_name"></v-list-item-title>
36 + </v-list-item-content>
37 + </v-list-item>
38 + </v-list>
39 + <v-menu
40 + v-model="showMenu"
41 + :position-x="x"
42 + :position-y="y"
43 + absolute
44 + offset-y
45 + >
46 + <v-list dense>
47 + <v-list-item @click.prevent="delFolder">
48 + <v-list-item-icon>
49 + <v-icon>mdi-delete</v-icon>
50 + </v-list-item-icon>
51 + <v-list-item-content>
52 + <v-list-item-title>삭제</v-list-item-title>
53 + </v-list-item-content>
54 + </v-list-item>
55 + <v-list-item @click.prevent="transferF">
56 + <v-list-item-icon>
57 + <v-icon>fas fa-trash-restore</v-icon>
58 + </v-list-item-icon>
59 + <v-list-item-content>
60 + <v-list-item-title>복원</v-list-item-title>
61 + </v-list-item-content>
62 + </v-list-item>
63 + </v-list>
64 + </v-menu>
65 + <v-menu
66 + v-model="showMenuF"
67 + :position-x="x"
68 + :position-y="y"
69 + absolute
70 + offset-y
71 + >
72 + <v-list dense>
73 + <v-list-item @click.prevent="delFile">
74 + <v-list-item-icon>
75 + <v-icon>mdi-delete</v-icon>
76 + </v-list-item-icon>
77 + <v-list-item-content>
78 + <v-list-item-title>삭제</v-list-item-title>
79 + </v-list-item-content>
80 + </v-list-item>
81 + <v-list-item @click.prevent="transferFile">
82 + <v-list-item-icon>
83 + <v-icon>fas fa-trash-restore</v-icon>
84 + </v-list-item-icon>
85 + <v-list-item-content>
86 + <v-list-item-title>복원</v-list-item-title>
87 + </v-list-item-content>
88 + </v-list-item>
89 + </v-list>
90 + </v-menu>
91 + </div>
92 +</template>
93 +
94 +<script>
95 +import {
96 + tdelFolder,
97 + tdelFile,
98 + tdelAll,
99 + moveFolder,
100 + moveFile,
101 + showTrashcan,
102 +} from '../api/index';
103 +export default {
104 + data() {
105 + return {
106 + curfName: {},
107 + showMenu: false,
108 + search: '',
109 + x: 0,
110 + y: 0,
111 + cfilename: {},
112 + showMenuF: false,
113 + };
114 + },
115 + created() {
116 + this.fetchData();
117 + },
118 + watch: {
119 + $route: 'fetchData',
120 + },
121 + methods: {
122 + async fetchData() {
123 + try {
124 + const id = this.$store.state.id;
125 + const response = await showTrashcan(id);
126 + console.log(response.data);
127 + this.$store.commit('settrashFolderList', response.data.folders);
128 + this.$store.commit('settrashFileList', response.data.files);
129 + } catch (error) {
130 + console.log('에러');
131 + }
132 + },
133 + async delFolder() {
134 + try {
135 + const tData = {
136 + id: this.$store.state.id,
137 + folder_id: this.curfName.folder_id,
138 + };
139 + const response = await tdelFolder(tData);
140 + this.$store.commit('settrashFolderList', response.data.folders);
141 + } catch (error) {
142 + console.log('에러');
143 + alert('삭제 실패');
144 + }
145 + },
146 + async delFile() {
147 + try {
148 + const tData = {
149 + id: this.$store.state.id,
150 + folder_id: this.cfilename.file_id,
151 + };
152 + const response = await tdelFile(tData);
153 + this.$store.commit('settrashFileList', response.data.files);
154 + } catch (error) {
155 + console.log('에러');
156 + alert('삭제 실패');
157 + }
158 + },
159 + async delAll() {
160 + try {
161 + const id = this.$store.state.id;
162 + const response = await tdelAll(id);
163 + this.$store.commit('settrashFolderList', response.data.folders);
164 + this.$store.commit('settrashFileList', response.data.files);
165 + } catch (error) {
166 + console.log('에러');
167 + alert('삭제 실패');
168 + }
169 + },
170 + async transferF() {
171 + try {
172 + const cData = {
173 + id: this.$store.state.id,
174 + cur: '/trashcan/',
175 + name: this.curfName.folder_name,
176 + isfolder: true,
177 + newPath: '/',
178 + };
179 + const response = await moveFolder(cData);
180 + console.log(response);
181 + this.$store.commit('settrashFolderList', response.data.folders);
182 + } catch (error) {
183 + console.log('에러');
184 + console.log(error.response.data);
185 + }
186 + },
187 + async transferFile() {
188 + try {
189 + const fData = {
190 + id: this.$store.state.id,
191 + cur: '/trashcan/',
192 + name: this.cfilename.file_name,
193 + isfolder: false,
194 + newPath: '/',
195 + };
196 + const response = await moveFile(fData);
197 + console.log(response);
198 + this.$store.commit('settrashFileList', response.data.files);
199 + } catch (error) {
200 + console.log('에러');
201 + console.log(error.response.data);
202 + }
203 + },
204 + show(folderObj, e) {
205 + e.preventDefault();
206 + this.curfName = folderObj;
207 + this.showMenu = false;
208 + this.x = e.clientX;
209 + this.y = e.clientY;
210 + this.$nextTick(() => {
211 + this.showMenu = true;
212 + });
213 + },
214 + showF(fileObj, e) {
215 + e.preventDefault();
216 + this.cfilename = fileObj;
217 + this.showMenuF = false;
218 + this.x = e.clientX;
219 + this.y = e.clientY;
220 + this.$nextTick(() => {
221 + this.showMenuF = true;
222 + });
223 + },
224 + },
225 +};
226 +</script>
227 +
228 +<style></style>
1 +<template lang="html">
2 + <v-flex>
3 + <h1>빠른액세스</h1>
4 + <v-simple-table>
5 + <template v-slot:default>
6 + <thead>
7 + <tr>
8 + <th class="text-left">File ID</th>
9 + <th class="text-left">Name</th>
10 + <th class="text-left">Dir</th>
11 + <th class="text-left">Date</th>
12 + </tr>
13 + </thead>
14 + <tbody>
15 + <tr v-for="item in recent_list" :key="item.name">
16 + <td>{{ item.file_id }}</td>
17 + <td>{{ item.file_name }}</td>
18 + <td>{{ item.location }}</td>
19 + <td>{{ item.date }}</td>
20 + </tr>
21 + </tbody>
22 + </template>
23 + </v-simple-table>
24 + <v-divider></v-divider>
25 + </v-flex>
26 +</template>
27 +
28 +<script>
29 +import { accessedList } from '../api/index';
30 +import Axios from 'axios';
31 +export default {
32 + data() {
33 + return {
34 + recent_list: [],
35 + };
36 + },
37 + async created() {
38 + try {
39 + const curData = {
40 + id: this.$store.state.id,
41 + };
42 + console.log(curData);
43 + const list_reponse = await accessedList(curData);
44 + this.$store.commit('setRecentList', list_reponse.data);
45 + this.recent_list = this.$store.getters.recentL;
46 + console.log(this.$store.getters.recentL);
47 + } catch (error) {
48 + console.log('에러');
49 + console.log(error);
50 + }
51 + },
52 + methods: {},
53 +};
54 +</script>
55 +
56 +<style lang="css" scoped></style>
This diff is collapsed. Click to expand it.
1 -import Vue from 'vue' 1 +import Vue from 'vue';
2 -import App from './App.vue' 2 +import App from './App.vue';
3 -import router from './routes/index' 3 +import router from './routes/index';
4 -import store from './store/index' 4 +import store from './store/index';
5 import vuetify from './plugins/vuetify'; 5 import vuetify from './plugins/vuetify';
6 6
7 -Vue.config.productionTip = false 7 +Vue.config.productionTip = false;
8 8
9 new Vue({ 9 new Vue({
10 - router, 10 + router,
11 - store, 11 + store,
12 - vuetify, 12 + vuetify,
13 - render: h => h(App) 13 + render: h => h(App),
14 -}).$mount('#app') 14 +}).$mount('#app');
......
...@@ -67,9 +67,15 @@ export default new VueRouter({ ...@@ -67,9 +67,15 @@ export default new VueRouter({
67 component: () => import('../views/Feedback.vue'), 67 component: () => import('../views/Feedback.vue'),
68 }, 68 },
69 { 69 {
70 - path: '/folder', 70 + path: '/file/:id',
71 name: 'Folder', 71 name: 'Folder',
72 - component: () => import('../views/FolderPage.vue'), 72 + component: () => import('../components/folderc'),
73 + props: true,
74 + },
75 + {
76 + path: '/trash',
77 + name: 'Trash',
78 + component: () => import('../views/TrashPage'),
73 }, 79 },
74 ], 80 ],
75 }); 81 });
......
1 -import Vue from 'vue' 1 +import Vue from 'vue';
2 -import Vuex from 'vuex' 2 +import Vuex from 'vuex';
3 3
4 -Vue.use(Vuex) 4 +Vue.use(Vuex);
5 5
6 export default new Vuex.Store({ 6 export default new Vuex.Store({
7 - state: {
8 - id: '',
9 - folders: [],
10 - files: [],
11 - cur: '/',
12 - parent: '/'
13 - },
14 - mutations: {
15 - setId(state, userid) {
16 - state.id = userid;
17 - },
18 - clearid(state) {
19 - state.id = '';
20 - },
21 - setFolder(state, folderlist) {
22 - state.folders = folderlist;
23 - },
24 - setFile(state, filelist) {
25 - state.files = filelist;
26 - },
27 - setCur(state, cur) {
28 - state.cur = cur;
29 - },
30 - setParent(state, parent) {
31 - state.parent = parent;
32 - }
33 - },
34 - getters: {
35 - isLogin(state) {
36 - return state.id !== '';
37 - },
38 - userID(state) {
39 - return state.id;
40 - },
41 - folderL(state) {
42 - return state.folders;
43 - },
44 - fileL(state) {
45 - return state.files;
46 - },
47 - cur(state) {
48 - return state.cur;
49 - },
50 - setFolder(state, folderlist){
51 - state.folders = folderlist;
52 - },
53 - setFile(state, filelist){
54 - state.files = filelist;
55 - },
56 - },
57 -})
...\ No newline at end of file ...\ No newline at end of file
7 + state: {
8 + id: '',
9 + folders: [],
10 + files: [],
11 + cur: '/',
12 + parent: '/',
13 + recentList: [],
14 + favFolderList: [],
15 + favFileList: [],
16 + trashFolderList: [],
17 + trashFileList: [],
18 + },
19 + mutations: {
20 + setId(state, userid) {
21 + state.id = userid;
22 + },
23 + clearid(state) {
24 + state.id = '';
25 + },
26 + setFolder(state, folderlist) {
27 + state.folders = folderlist;
28 + },
29 + setFile(state, filelist) {
30 + state.files = filelist;
31 + },
32 + setCur(state, cur) {
33 + state.cur = cur;
34 + },
35 + setParent(state, parent) {
36 + state.parent = parent;
37 + },
38 + setRecentList(state, list) {
39 + state.recentList = list;
40 + },
41 + setfavFolderList(state, fflist) {
42 + state.favFolderList = fflist;
43 + },
44 + setfavFileList(state, fflist) {
45 + state.favFileList = fflist;
46 + },
47 + settrashFolderList(state, tflist) {
48 + state.trashFolderList = tflist;
49 + },
50 + settrashFileList(state, tflist) {
51 + state.trashFileList = tflist;
52 + },
53 + },
54 + getters: {
55 + isLogin(state) {
56 + return state.id !== '';
57 + },
58 + userID(state) {
59 + return state.id;
60 + },
61 + folderL(state) {
62 + return state.folders;
63 + },
64 + fileL(state) {
65 + return state.files;
66 + },
67 + recentL(state) {
68 + return state.recentList;
69 + },
70 + cur(state) {
71 + return state.cur;
72 + },
73 + setFolder(state, folderlist) {
74 + state.folders = folderlist;
75 + },
76 + setFile(state, filelist) {
77 + state.files = filelist;
78 + },
79 + favFolderL(state) {
80 + return state.favFolderList;
81 + },
82 + favFileL(state) {
83 + return state.favFileList;
84 + },
85 + trashFolderL(state) {
86 + return state.trashFolderList;
87 + },
88 + trashFileL(state) {
89 + return state.trashFileList;
90 + },
91 + },
92 +});
......
1 <template lang="html"> 1 <template lang="html">
2 - <contact></contact> 2 + <contact></contact>
3 </template> 3 </template>
4 4
5 <script> 5 <script>
6 - import contact from '@/components/make_contact.vue' 6 +import contact from '@/components/make_contact.vue';
7 - export default { 7 +export default {
8 - components:{ 8 + components: {
9 - contact 9 + contact,
10 - } 10 + },
11 - } 11 +};
12 </script> 12 </script>
13 13
14 -<style lang="css" scoped> 14 +<style lang="css" scoped></style>
15 -</style>
......
1 <template> 1 <template>
2 - <div> 2 + <div>
3 - <v-toolbar flat> 3 + <Fav_list></Fav_list>
4 - <v-toolbar-title>즐겨찾기</v-toolbar-title> 4 + </div>
5 -
6 - <v-spacer></v-spacer>
7 - <v-text-field
8 - v-model="search"
9 - append-icon="mdi-magnify"
10 - label="즐겨찾기 검색"
11 - single-line
12 - hide-details
13 - ></v-text-field>
14 - </v-toolbar>
15 -
16 - <v-list two-line subheader>
17 -
18 -
19 - <v-list-item
20 - v-for="item in items"
21 - :key="item.title"
22 - @click=""
23 - >
24 - <v-list-item-avatar>
25 - <v-icon
26 -
27 - >{{item.iconClass}}</v-icon>
28 - </v-list-item-avatar>
29 -
30 - <v-list-item-content>
31 - <v-list-item-title v-text="item.title"></v-list-item-title>
32 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
33 - </v-list-item-content>
34 -
35 - <v-list-item-action>
36 - <v-btn icon>
37 - <v-icon color="grey lighten-1">mdi-information</v-icon>
38 - </v-btn>
39 - </v-list-item-action>
40 - </v-list-item>
41 -
42 -
43 - <v-list-item
44 - v-for="item in items2"
45 - :key="item.title"
46 - @click=""
47 - >
48 - <v-list-item-avatar>
49 - <v-icon> {{item.iconClass}}</v-icon>
50 - </v-list-item-avatar>
51 -
52 - <v-list-item-content>
53 - <v-list-item-title v-text="item.title"></v-list-item-title>
54 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
55 - </v-list-item-content>
56 -
57 - <v-list-item-action>
58 - <v-btn icon>
59 - <v-icon color="grey lighten-1">mdi-information</v-icon>
60 - </v-btn>
61 - </v-list-item-action>
62 - </v-list-item>
63 - </v-list>
64 - </div>
65 </template> 5 </template>
66 6
67 <script> 7 <script>
68 - export default { 8 +import Fav_list from '../components/Fav_list';
69 - data: () => ({ 9 +export default {
70 - items: [ 10 + components: {
71 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Photos', subtitle: 'Jan 9, 2014' }, 11 + Fav_list,
72 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Recipes', subtitle: 'Jan 17, 2014' }, 12 + },
73 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Work', subtitle: 'Jan 28, 2014' }, 13 +};
74 - ],
75 - items2: [
76 - { icon: 'assignment', iconClass: 'mdi-file', title: 'Vacation itinerary', subtitle: 'Jan 20, 2014' },
77 - { icon: 'call_to_action', iconClass: 'mdi-PdfBox', title: 'Kitchen remodel', subtitle: 'Jan 10, 2014' },
78 - ],
79 - }),
80 - }
81 </script> 14 </script>
15 +
16 +<style></style>
......
1 <template lang="html"> 1 <template lang="html">
2 - <v-container fluid> 2 + <v-container fluid>
3 - <FileList></FileList> 3 + <FileList></FileList>
4 - </v-container> 4 + </v-container>
5 </template> 5 </template>
6 6
7 -
8 -
9 <script> 7 <script>
10 - import FileList from '@/components/FileList' 8 +import FileList from '@/components/FileList';
11 - import Favlist from '@/components/Fav_list' 9 +import Favlist from '@/components/Fav_list';
12 - export default { 10 +export default {
13 - components:{ 11 + components: {
14 - FileList, 12 + FileList,
15 - Favlist 13 + Favlist,
16 - }, 14 + },
17 - data () { 15 + data() {
18 - return { 16 + return {
19 - headers: [ 17 + headers: [
20 - { 18 + {
21 - text: 'Dessert (100g serving)', 19 + text: 'Dessert (100g serving)',
22 - align: 'start', 20 + align: 'start',
23 - sortable: false, 21 + sortable: false,
24 - value: 'name', 22 + value: 'name',
25 - }, 23 + },
26 - { text: 'Calories', value: 'calories' }, 24 + { text: 'Calories', value: 'calories' },
27 - { text: 'Fat (g)', value: 'fat' }, 25 + { text: 'Fat (g)', value: 'fat' },
28 - { text: 'Carbs (g)', value: 'carbs' }, 26 + { text: 'Carbs (g)', value: 'carbs' },
29 - { text: 'Protein (g)', value: 'protein' }, 27 + { text: 'Protein (g)', value: 'protein' },
30 - { text: 'Iron (%)', value: 'iron' }, 28 + { text: 'Iron (%)', value: 'iron' },
31 - ], 29 + ],
32 - desserts: [ 30 + desserts: [
33 - { 31 + {
34 - name: 'Frozen Yogurt', 32 + name: 'Frozen Yogurt',
35 - calories: 159, 33 + calories: 159,
36 - fat: 6.0, 34 + fat: 6.0,
37 - carbs: 24, 35 + carbs: 24,
38 - protein: 4.0, 36 + protein: 4.0,
39 - iron: '1%', 37 + iron: '1%',
40 - format : 'dir' 38 + format: 'dir',
41 - }, 39 + },
42 - { 40 + {
43 - name: 'Ice cream sandwich', 41 + name: 'Ice cream sandwich',
44 - calories: 237, 42 + calories: 237,
45 - fat: 9.0, 43 + fat: 9.0,
46 - carbs: 37, 44 + carbs: 37,
47 - protein: 4.3, 45 + protein: 4.3,
48 - iron: '1%', 46 + iron: '1%',
49 - format: 'pdf' 47 + format: 'pdf',
50 - }, 48 + },
51 - { 49 + {
52 - name: 'Eclair', 50 + name: 'Eclair',
53 - calories: 262, 51 + calories: 262,
54 - fat: 16.0, 52 + fat: 16.0,
55 - carbs: 23, 53 + carbs: 23,
56 - protein: 6.0, 54 + protein: 6.0,
57 - iron: '7%', 55 + iron: '7%',
58 - format: 'file' 56 + format: 'file',
59 - }, 57 + },
60 - { 58 + {
61 - name: 'Cupcake', 59 + name: 'Cupcake',
62 - calories: 305, 60 + calories: 305,
63 - fat: 3.7, 61 + fat: 3.7,
64 - carbs: 67, 62 + carbs: 67,
65 - protein: 4.3, 63 + protein: 4.3,
66 - iron: '8%', 64 + iron: '8%',
67 - format : 'dir' 65 + format: 'dir',
68 - }, 66 + },
69 - { 67 + {
70 - name: 'Gingerbread', 68 + name: 'Gingerbread',
71 - calories: 356, 69 + calories: 356,
72 - fat: 16.0, 70 + fat: 16.0,
73 - carbs: 49, 71 + carbs: 49,
74 - protein: 3.9, 72 + protein: 3.9,
75 - iron: '16%', 73 + iron: '16%',
76 - format : 'pdf' 74 + format: 'pdf',
77 - }, 75 + },
78 - { 76 + {
79 - name: 'Jelly bean', 77 + name: 'Jelly bean',
80 - calories: 375, 78 + calories: 375,
81 - fat: 0.0, 79 + fat: 0.0,
82 - carbs: 94, 80 + carbs: 94,
83 - protein: 0.0, 81 + protein: 0.0,
84 - iron: '0%', 82 + iron: '0%',
85 - format:'file' 83 + format: 'file',
86 - }, 84 + },
87 - { 85 + {
88 - name: 'Lollipop', 86 + name: 'Lollipop',
89 - calories: 392, 87 + calories: 392,
90 - fat: 0.2, 88 + fat: 0.2,
91 - carbs: 98, 89 + carbs: 98,
92 - protein: 0, 90 + protein: 0,
93 - iron: '2%', 91 + iron: '2%',
94 - format:'dir' 92 + format: 'dir',
95 - }, 93 + },
96 - { 94 + {
97 - name: 'Honeycomb', 95 + name: 'Honeycomb',
98 - calories: 408, 96 + calories: 408,
99 - fat: 3.2, 97 + fat: 3.2,
100 - carbs: 87, 98 + carbs: 87,
101 - protein: 6.5, 99 + protein: 6.5,
102 - iron: '45%', 100 + iron: '45%',
103 - foramt:'file' 101 + foramt: 'file',
104 - }, 102 + },
105 - { 103 + {
106 - name: 'Donut', 104 + name: 'Donut',
107 - calories: 452, 105 + calories: 452,
108 - fat: 25.0, 106 + fat: 25.0,
109 - carbs: 51, 107 + carbs: 51,
110 - protein: 4.9, 108 + protein: 4.9,
111 - iron: '22%', 109 + iron: '22%',
112 - foramt:'pdf' 110 + foramt: 'pdf',
113 - }, 111 + },
114 - { 112 + {
115 - name: 'KitKat', 113 + name: 'KitKat',
116 - calories: 518, 114 + calories: 518,
117 - fat: 26.0, 115 + fat: 26.0,
118 - carbs: 65, 116 + carbs: 65,
119 - protein: 7, 117 + protein: 7,
120 - iron: '6%', 118 + iron: '6%',
121 - foramt:'dir' 119 + foramt: 'dir',
122 - }, 120 + },
123 - ], 121 + ],
124 - favorite:[ 122 + favorite: [
125 - { 123 + {
126 - name: 'KitKat', 124 + name: 'KitKat',
127 - date: '20.05.17' 125 + date: '20.05.17',
128 - }, 126 + },
129 - { 127 + {
130 - name: 'Vuetify', 128 + name: 'Vuetify',
131 - date: '20.05.17' 129 + date: '20.05.17',
132 - } 130 + },
133 - ], 131 + ],
134 - } 132 + };
135 - }, 133 + },
136 - } 134 +};
137 </script> 135 </script>
......
1 +<template lang="html">
2 + <FileDetail></FileDetail>
3 +</template>
4 +
5 +<script>
6 +import FileDetail from '@/components/FileDetail';
7 +export default {
8 + components: {
9 + FileDetail,
10 + },
11 +};
12 +</script>
13 +
14 +<style lang="css" scoped></style>
1 +<template>
2 + <div>
3 + <folderc v-bind:folderId="folderId"></folderc>
4 + </div>
5 +</template>
6 +
7 +<script>
8 +import folderc from '../components/folderc';
9 +export default {
10 + props: {
11 + folderId: Number,
12 + },
13 + components: {
14 + folderc,
15 + },
16 +};
17 +</script>
18 +
19 +<style></style>
......
1 <template lang="html"> 1 <template lang="html">
2 - <v-container> 2 + <v-container>
3 - <div> 3 + <div>
4 - <h2>안녕하세요!</h2> 4 + <h2>안녕하세요!</h2>
5 - <br><br> 5 + <br /><br />
6 - </div> 6 + </div>
7 - <v-layout column> 7 + <v-layout column>
8 - <v-flex> 8 + <v-flex>
9 - <v-layout row wrap> 9 + <v-layout row wrap>
10 - <v-flex xs6> 10 + <v-flex xs6>
11 - <v-flex> 11 + <v-flex>
12 - <h1>파일</h1> 12 + <h1>파일</h1>
13 - <v-data-table 13 + <v-data-table
14 - :headers="headers" 14 + :headers="headers"
15 - :items="desserts" 15 + :items="desserts"
16 - :expand-icon="home" 16 + :expand-icon="home"
17 - :items-per-page="5" 17 + :items-per-page="5"
18 - class="elevation-1" 18 + class="elevation-1"
19 - ></v-data-table> 19 + ></v-data-table>
20 - <v-spacer></v-spacer> 20 + <v-spacer></v-spacer>
21 - </v-flex> 21 + </v-flex>
22 - <v-flex><br><v-divider></v-divider><br></v-flex> 22 + <v-flex><br /><v-divider></v-divider><br /></v-flex>
23 - <v-flex> 23 + <v-container>
24 - <h1>빠른액세스</h1> 24 + <accessList></accessList>
25 - <v-simple-table> 25 + </v-container>
26 - <template v-slot:default> 26 + </v-flex>
27 - <thead> 27 + <v-flex><br /><v-divider></v-divider><br /></v-flex>
28 - <tr> 28 + <v-flex xs6>
29 - <th class="text-left">Name</th> 29 + <h1>즐겨찾기</h1>
30 - <th class="text-left">Date</th> 30 + <v-simple-table>
31 - </tr> 31 + <template v-slot:default>
32 - </thead> 32 + <thead>
33 - <tbody> 33 + <tr>
34 - <tr v-for="item in favorite" :key="item.name"> 34 + <th class="text-left">Name</th>
35 - <td>{{ item.name }}</td> 35 + <th class="text-left">Date</th>
36 - <td>{{ item.date }}</td> 36 + </tr>
37 - </tr> 37 + </thead>
38 - </tbody> 38 + <tbody>
39 - </template> 39 + <tr v-for="item in favorite" :key="item.name">
40 - </v-simple-table> 40 + <td>{{ item.name }}</td>
41 - <v-divider></v-divider> 41 + <td>{{ item.date }}</td>
42 - </v-flex> 42 + </tr>
43 - </v-flex> 43 + </tbody>
44 - <v-flex><br><v-divider></v-divider><br></v-flex> 44 + </template>
45 - <v-flex xs6> 45 + </v-simple-table>
46 - <h1>즐겨찾기</h1> 46 + <v-divider></v-divider>
47 - <v-simple-table> 47 + </v-flex>
48 - <template v-slot:default> 48 + </v-layout>
49 - <thead> 49 + </v-flex>
50 - <tr> 50 + </v-layout>
51 - <th class="text-left">Name</th> 51 + </v-container>
52 - <th class="text-left">Date</th>
53 - </tr>
54 - </thead>
55 - <tbody>
56 - <tr v-for="item in favorite" :key="item.name">
57 - <td>{{ item.name }}</td>
58 - <td>{{ item.date }}</td>
59 - </tr>
60 - </tbody>
61 - </template>
62 - </v-simple-table>
63 - <v-divider></v-divider>
64 - </v-flex>
65 - </v-layout>
66 - </v-flex>
67 -
68 - </v-layout>
69 - </v-container>
70 </template> 52 </template>
71 53
72 -
73 -
74 <script> 54 <script>
75 - export default { 55 +import accessList from '@/components/accessList.vue';
76 - data () { 56 +export default {
77 - return { 57 + data() {
78 - headers: [ 58 + return {
79 - { 59 + headers: [
80 - text: 'Dessert (100g serving)', 60 + {
81 - align: 'start', 61 + text: 'Dessert (100g serving)',
82 - sortable: false, 62 + align: 'start',
83 - value: 'name', 63 + sortable: false,
84 - }, 64 + value: 'name',
85 - { text: 'Calories', value: 'calories' }, 65 + },
86 - { text: 'Fat (g)', value: 'fat' }, 66 + { text: 'Calories', value: 'calories' },
87 - { text: 'Carbs (g)', value: 'carbs' }, 67 + { text: 'Fat (g)', value: 'fat' },
88 - { text: 'Protein (g)', value: 'protein' }, 68 + { text: 'Carbs (g)', value: 'carbs' },
89 - { text: 'Iron (%)', value: 'iron' }, 69 + { text: 'Protein (g)', value: 'protein' },
90 - ], 70 + { text: 'Iron (%)', value: 'iron' },
91 - desserts: [ 71 + ],
92 - { 72 + desserts: [
93 - name: 'Frozen Yogurt', 73 + {
94 - calories: 159, 74 + name: 'Frozen Yogurt',
95 - fat: 6.0, 75 + calories: 159,
96 - carbs: 24, 76 + fat: 6.0,
97 - protein: 4.0, 77 + carbs: 24,
98 - iron: '1%', 78 + protein: 4.0,
99 - format : 'dir' 79 + iron: '1%',
100 - }, 80 + format: 'dir',
101 - { 81 + },
102 - name: 'Ice cream sandwich', 82 + {
103 - calories: 237, 83 + name: 'Ice cream sandwich',
104 - fat: 9.0, 84 + calories: 237,
105 - carbs: 37, 85 + fat: 9.0,
106 - protein: 4.3, 86 + carbs: 37,
107 - iron: '1%', 87 + protein: 4.3,
108 - format: 'pdf' 88 + iron: '1%',
109 - }, 89 + format: 'pdf',
110 - { 90 + },
111 - name: 'Eclair', 91 + {
112 - calories: 262, 92 + name: 'Eclair',
113 - fat: 16.0, 93 + calories: 262,
114 - carbs: 23, 94 + fat: 16.0,
115 - protein: 6.0, 95 + carbs: 23,
116 - iron: '7%', 96 + protein: 6.0,
117 - format: 'file' 97 + iron: '7%',
118 - }, 98 + format: 'file',
119 - { 99 + },
120 - name: 'Cupcake', 100 + {
121 - calories: 305, 101 + name: 'Cupcake',
122 - fat: 3.7, 102 + calories: 305,
123 - carbs: 67, 103 + fat: 3.7,
124 - protein: 4.3, 104 + carbs: 67,
125 - iron: '8%', 105 + protein: 4.3,
126 - format : 'dir' 106 + iron: '8%',
127 - }, 107 + format: 'dir',
128 - { 108 + },
129 - name: 'Gingerbread', 109 + {
130 - calories: 356, 110 + name: 'Gingerbread',
131 - fat: 16.0, 111 + calories: 356,
132 - carbs: 49, 112 + fat: 16.0,
133 - protein: 3.9, 113 + carbs: 49,
134 - iron: '16%', 114 + protein: 3.9,
135 - format : 'pdf' 115 + iron: '16%',
136 - }, 116 + format: 'pdf',
137 - { 117 + },
138 - name: 'Jelly bean', 118 + {
139 - calories: 375, 119 + name: 'Jelly bean',
140 - fat: 0.0, 120 + calories: 375,
141 - carbs: 94, 121 + fat: 0.0,
142 - protein: 0.0, 122 + carbs: 94,
143 - iron: '0%', 123 + protein: 0.0,
144 - format:'file' 124 + iron: '0%',
145 - }, 125 + format: 'file',
146 - { 126 + },
147 - name: 'Lollipop', 127 + {
148 - calories: 392, 128 + name: 'Lollipop',
149 - fat: 0.2, 129 + calories: 392,
150 - carbs: 98, 130 + fat: 0.2,
151 - protein: 0, 131 + carbs: 98,
152 - iron: '2%', 132 + protein: 0,
153 - format:'dir' 133 + iron: '2%',
154 - }, 134 + format: 'dir',
155 - { 135 + },
156 - name: 'Honeycomb', 136 + {
157 - calories: 408, 137 + name: 'Honeycomb',
158 - fat: 3.2, 138 + calories: 408,
159 - carbs: 87, 139 + fat: 3.2,
160 - protein: 6.5, 140 + carbs: 87,
161 - iron: '45%', 141 + protein: 6.5,
162 - foramt:'file' 142 + iron: '45%',
163 - }, 143 + foramt: 'file',
164 - { 144 + },
165 - name: 'Donut', 145 + {
166 - calories: 452, 146 + name: 'Donut',
167 - fat: 25.0, 147 + calories: 452,
168 - carbs: 51, 148 + fat: 25.0,
169 - protein: 4.9, 149 + carbs: 51,
170 - iron: '22%', 150 + protein: 4.9,
171 - foramt:'pdf' 151 + iron: '22%',
172 - }, 152 + foramt: 'pdf',
173 - { 153 + },
174 - name: 'KitKat', 154 + {
175 - calories: 518, 155 + name: 'KitKat',
176 - fat: 26.0, 156 + calories: 518,
177 - carbs: 65, 157 + fat: 26.0,
178 - protein: 7, 158 + carbs: 65,
179 - iron: '6%', 159 + protein: 7,
180 - foramt:'dir' 160 + iron: '6%',
181 - }, 161 + foramt: 'dir',
182 - ], 162 + },
183 - favorite:[ 163 + ],
184 - { 164 + favorite: [
185 - name: 'KitKat', 165 + {
186 - date: '20.05.17' 166 + name: 'KitKat',
187 - }, 167 + date: '20.05.17',
188 - { 168 + },
189 - name: 'Vuetify', 169 + {
190 - date: '20.05.17' 170 + name: 'Vuetify',
191 - } 171 + date: '20.05.17',
192 - ], 172 + },
193 - } 173 + ],
194 - }, 174 + };
195 - } 175 + },
176 +};
196 </script> 177 </script>
......
1 <template> 1 <template>
2 - <div> 2 + <div>
3 - <LoginForm></LoginForm> 3 + <LoginForm></LoginForm>
4 - </div> 4 + </div>
5 </template> 5 </template>
6 6
7 <script> 7 <script>
8 -import LoginForm from '../components/LoginForm' 8 +import LoginForm from '../components/LoginForm';
9 9
10 export default { 10 export default {
11 - components: { 11 + components: {
12 - LoginForm, 12 + LoginForm,
13 - } 13 + },
14 -} 14 +};
15 </script> 15 </script>
16 16
17 -<style>
18 -
19 -</style>
...\ No newline at end of file ...\ No newline at end of file
17 +<style></style>
......
1 <template lang="html"> 1 <template lang="html">
2 - <v-container> 2 + <v-container>
3 - <div> 3 + <v-layout column>
4 - <h2>안녕하세요!</h2> 4 + <v-flex>
5 - <br><br> 5 + <v-layout column>
6 - </div> 6 + <v-flex><br /><br /></v-flex>
7 - <v-layout column> 7 + <v-flex>
8 - <v-flex> 8 + <FileList></FileList>
9 - <v-layout row wrap> 9 + </v-flex>
10 - <v-flex lg6> 10 + </v-layout>
11 - <v-flex> 11 + </v-flex>
12 - <Filecard></Filecard> 12 + </v-layout>
13 - </v-flex> 13 + <v-flex><br /><br /></v-flex>
14 - <v-flex><br><br></v-flex> 14 + <v-divider></v-divider>
15 - </v-flex> 15 + <v-layout column>
16 - <v-flex><br><br></v-flex> 16 + <v-flex>
17 - <v-flex lg6> 17 + <v-container>
18 - <Favlist></Favlist> 18 + <accessList></accessList>
19 - </v-flex> 19 + </v-container>
20 - </v-layout> 20 + <v-divider></v-divider>
21 - </v-flex> 21 + </v-flex>
22 - </v-layout> 22 + </v-layout>
23 - <v-divider></v-divider> 23 + </v-container>
24 - <v-layout column>
25 - <v-flex>
26 - <v-toolbar flat>
27 - <v-toolbar-title>빠른 액세스</v-toolbar-title>
28 - <v-spacer></v-spacer>
29 - </v-toolbar>
30 - <v-simple-table>
31 - <template v-slot:default>
32 - <thead>
33 - <tr>
34 - <th class="text-left">Name</th>
35 - <th class="text-left">Date</th>
36 - </tr>
37 - </thead>
38 - <tbody>
39 - <tr v-for="item in favorite" :key="item.name">
40 - <td>{{ item.name }}</td>
41 - <td>{{ item.date }}</td>
42 - </tr>
43 - </tbody>
44 - </template>
45 - </v-simple-table>
46 - <v-divider></v-divider>
47 - </v-flex>
48 - </v-layout>
49 - </v-container>
50 </template> 24 </template>
51 25
52 -
53 -
54 <script> 26 <script>
55 - import FileList from '@/components/FileList' 27 +import accessList from '@/components/accessList.vue';
56 - import Favlist from '@/components/Fav_list' 28 +import FileList from '@/components/FileList';
57 - import Filecard from '@/components/FileCardlist.vue' 29 +import Favlist from '@/components/Fav_list';
58 - export default { 30 +import Filecard from '@/components/FileCardlist.vue';
59 - components:{ 31 +export default {
60 - FileList, 32 + components: {
61 - Favlist, 33 + FileList,
62 - Filecard 34 + Favlist,
63 - }, 35 + Filecard,
64 - data () { 36 + accessList,
65 - return { 37 + },
66 - headers: [ 38 + data() {
67 - { 39 + return {
68 - text: 'Dessert (100g serving)', 40 + headers: [
69 - align: 'start', 41 + {
70 - sortable: false, 42 + text: 'Dessert (100g serving)',
71 - value: 'name', 43 + align: 'start',
72 - }, 44 + sortable: false,
73 - { text: 'Calories', value: 'calories' }, 45 + value: 'name',
74 - { text: 'Fat (g)', value: 'fat' }, 46 + },
75 - { text: 'Carbs (g)', value: 'carbs' }, 47 + { text: 'Calories', value: 'calories' },
76 - { text: 'Protein (g)', value: 'protein' }, 48 + { text: 'Fat (g)', value: 'fat' },
77 - { text: 'Iron (%)', value: 'iron' }, 49 + { text: 'Carbs (g)', value: 'carbs' },
78 - ], 50 + { text: 'Protein (g)', value: 'protein' },
79 - desserts: [ 51 + { text: 'Iron (%)', value: 'iron' },
80 - { 52 + ],
81 - name: 'Frozen Yogurt', 53 + desserts: [
82 - calories: 159, 54 + {
83 - fat: 6.0, 55 + name: 'Frozen Yogurt',
84 - carbs: 24, 56 + calories: 159,
85 - protein: 4.0, 57 + fat: 6.0,
86 - iron: '1%', 58 + carbs: 24,
87 - format : 'dir' 59 + protein: 4.0,
88 - }, 60 + iron: '1%',
89 - { 61 + format: 'dir',
90 - name: 'Ice cream sandwich', 62 + },
91 - calories: 237, 63 + {
92 - fat: 9.0, 64 + name: 'Ice cream sandwich',
93 - carbs: 37, 65 + calories: 237,
94 - protein: 4.3, 66 + fat: 9.0,
95 - iron: '1%', 67 + carbs: 37,
96 - format: 'pdf' 68 + protein: 4.3,
97 - }, 69 + iron: '1%',
98 - { 70 + format: 'pdf',
99 - name: 'Eclair', 71 + },
100 - calories: 262, 72 + {
101 - fat: 16.0, 73 + name: 'Eclair',
102 - carbs: 23, 74 + calories: 262,
103 - protein: 6.0, 75 + fat: 16.0,
104 - iron: '7%', 76 + carbs: 23,
105 - format: 'file' 77 + protein: 6.0,
106 - }, 78 + iron: '7%',
107 - { 79 + format: 'file',
108 - name: 'Cupcake', 80 + },
109 - calories: 305, 81 + {
110 - fat: 3.7, 82 + name: 'Cupcake',
111 - carbs: 67, 83 + calories: 305,
112 - protein: 4.3, 84 + fat: 3.7,
113 - iron: '8%', 85 + carbs: 67,
114 - format : 'dir' 86 + protein: 4.3,
115 - }, 87 + iron: '8%',
116 - { 88 + format: 'dir',
117 - name: 'Gingerbread', 89 + },
118 - calories: 356, 90 + {
119 - fat: 16.0, 91 + name: 'Gingerbread',
120 - carbs: 49, 92 + calories: 356,
121 - protein: 3.9, 93 + fat: 16.0,
122 - iron: '16%', 94 + carbs: 49,
123 - format : 'pdf' 95 + protein: 3.9,
124 - }, 96 + iron: '16%',
125 - { 97 + format: 'pdf',
126 - name: 'Jelly bean', 98 + },
127 - calories: 375, 99 + {
128 - fat: 0.0, 100 + name: 'Jelly bean',
129 - carbs: 94, 101 + calories: 375,
130 - protein: 0.0, 102 + fat: 0.0,
131 - iron: '0%', 103 + carbs: 94,
132 - format:'file' 104 + protein: 0.0,
133 - }, 105 + iron: '0%',
134 - { 106 + format: 'file',
135 - name: 'Lollipop', 107 + },
136 - calories: 392, 108 + {
137 - fat: 0.2, 109 + name: 'Lollipop',
138 - carbs: 98, 110 + calories: 392,
139 - protein: 0, 111 + fat: 0.2,
140 - iron: '2%', 112 + carbs: 98,
141 - format:'dir' 113 + protein: 0,
142 - }, 114 + iron: '2%',
143 - { 115 + format: 'dir',
144 - name: 'Honeycomb', 116 + },
145 - calories: 408, 117 + {
146 - fat: 3.2, 118 + name: 'Honeycomb',
147 - carbs: 87, 119 + calories: 408,
148 - protein: 6.5, 120 + fat: 3.2,
149 - iron: '45%', 121 + carbs: 87,
150 - foramt:'file' 122 + protein: 6.5,
151 - }, 123 + iron: '45%',
152 - { 124 + foramt: 'file',
153 - name: 'Donut', 125 + },
154 - calories: 452, 126 + {
155 - fat: 25.0, 127 + name: 'Donut',
156 - carbs: 51, 128 + calories: 452,
157 - protein: 4.9, 129 + fat: 25.0,
158 - iron: '22%', 130 + carbs: 51,
159 - foramt:'pdf' 131 + protein: 4.9,
160 - }, 132 + iron: '22%',
161 - { 133 + foramt: 'pdf',
162 - name: 'KitKat', 134 + },
163 - calories: 518, 135 + {
164 - fat: 26.0, 136 + name: 'KitKat',
165 - carbs: 65, 137 + calories: 518,
166 - protein: 7, 138 + fat: 26.0,
167 - iron: '6%', 139 + carbs: 65,
168 - foramt:'dir' 140 + protein: 7,
169 - }, 141 + iron: '6%',
170 - ], 142 + foramt: 'dir',
171 - favorite:[ 143 + },
172 - { 144 + ],
173 - name: 'KitKat', 145 + favorite: [
174 - date: '20.05.17' 146 + {
175 - }, 147 + name: 'KitKat',
176 - { 148 + date: '20.05.17',
177 - name: 'Vuetify', 149 + },
178 - date: '20.05.17' 150 + {
179 - } 151 + name: 'Vuetify',
180 - ], 152 + date: '20.05.17',
181 - } 153 + },
182 - }, 154 + ],
183 - } 155 + };
156 + },
157 +};
184 </script> 158 </script>
......
1 <template> 1 <template>
2 - <div> 2 + <div>
3 - <v-toolbar flat> 3 + <v-toolbar flat>
4 - <v-toolbar-title>빠른액세스</v-toolbar-title> 4 + <v-toolbar-title>빠른액세스</v-toolbar-title>
5 5
6 - <v-spacer></v-spacer> 6 + <v-spacer></v-spacer>
7 - <v-text-field 7 + <v-text-field
8 - v-model="search" 8 + v-model="search"
9 - append-icon="mdi-magnify" 9 + append-icon="mdi-magnify"
10 - label="검색" 10 + label="검색"
11 - single-line 11 + single-line
12 - hide-details 12 + hide-details
13 - ></v-text-field> 13 + ></v-text-field>
14 - </v-toolbar> 14 + </v-toolbar>
15 15
16 - <v-list two-line subheader> 16 + <v-list two-line subheader>
17 + <v-list-item v-for="item in items" :key="item.title" @click="">
18 + <v-list-item-avatar>
19 + <v-icon>{{ item.iconClass }}</v-icon>
20 + </v-list-item-avatar>
17 21
22 + <v-list-item-content>
23 + <v-list-item-title v-text="item.title"></v-list-item-title>
24 + <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
25 + </v-list-item-content>
18 26
19 - <v-list-item 27 + <v-list-item-action>
20 - v-for="item in items" 28 + <v-btn icon>
21 - :key="item.title" 29 + <v-icon color="grey lighten-1">mdi-information</v-icon>
22 - @click="" 30 + </v-btn>
23 - > 31 + </v-list-item-action>
24 - <v-list-item-avatar> 32 + </v-list-item>
25 - <v-icon
26 33
27 - >{{item.iconClass}}</v-icon> 34 + <v-list-item v-for="item in items2" :key="item.title" @click="">
28 - </v-list-item-avatar> 35 + <v-list-item-avatar>
36 + <v-icon> {{ item.iconClass }}</v-icon>
37 + </v-list-item-avatar>
29 38
30 - <v-list-item-content> 39 + <v-list-item-content>
31 - <v-list-item-title v-text="item.title"></v-list-item-title> 40 + <v-list-item-title v-text="item.title"></v-list-item-title>
32 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle> 41 + <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
33 - </v-list-item-content> 42 + </v-list-item-content>
34 43
35 - <v-list-item-action> 44 + <v-list-item-action>
36 - <v-btn icon> 45 + <v-btn icon>
37 - <v-icon color="grey lighten-1">mdi-information</v-icon> 46 + <v-icon color="grey lighten-1">mdi-information</v-icon>
38 - </v-btn> 47 + </v-btn>
39 - </v-list-item-action> 48 + </v-list-item-action>
40 - </v-list-item> 49 + </v-list-item>
41 - 50 + </v-list>
42 - 51 + </div>
43 - <v-list-item
44 - v-for="item in items2"
45 - :key="item.title"
46 - @click=""
47 - >
48 - <v-list-item-avatar>
49 - <v-icon> {{item.iconClass}}</v-icon>
50 - </v-list-item-avatar>
51 -
52 - <v-list-item-content>
53 - <v-list-item-title v-text="item.title"></v-list-item-title>
54 - <v-list-item-subtitle v-text="item.subtitle"></v-list-item-subtitle>
55 - </v-list-item-content>
56 -
57 - <v-list-item-action>
58 - <v-btn icon>
59 - <v-icon color="grey lighten-1">mdi-information</v-icon>
60 - </v-btn>
61 - </v-list-item-action>
62 - </v-list-item>
63 - </v-list>
64 - </div>
65 </template> 52 </template>
66 53
67 <script> 54 <script>
68 - export default { 55 +export default {
69 - data: () => ({ 56 + data: () => ({
70 - items: [ 57 + items: [
71 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Photos', subtitle: 'Jan 9, 2014' }, 58 + {
72 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Recipes', subtitle: 'Jan 17, 2014' }, 59 + icon: 'folder',
73 - { icon: 'folder', iconClass: 'mdi-folder', title: 'Work', subtitle: 'Jan 28, 2014' }, 60 + iconClass: 'mdi-folder',
74 - ], 61 + title: 'Photos',
75 - items2: [ 62 + subtitle: 'Jan 9, 2014',
76 - { icon: 'assignment', iconClass: 'mdi-file', title: 'Vacation itinerary', subtitle: 'Jan 20, 2014' }, 63 + },
77 - { icon: 'call_to_action', iconClass: 'mdi-PdfBox', title: 'Kitchen remodel', subtitle: 'Jan 10, 2014' }, 64 + {
78 - ], 65 + icon: 'folder',
79 - }), 66 + iconClass: 'mdi-folder',
80 - } 67 + title: 'Recipes',
68 + subtitle: 'Jan 17, 2014',
69 + },
70 + {
71 + icon: 'folder',
72 + iconClass: 'mdi-folder',
73 + title: 'Work',
74 + subtitle: 'Jan 28, 2014',
75 + },
76 + ],
77 + items2: [
78 + {
79 + icon: 'assignment',
80 + iconClass: 'mdi-file',
81 + title: 'Vacation itinerary',
82 + subtitle: 'Jan 20, 2014',
83 + },
84 + {
85 + icon: 'call_to_action',
86 + iconClass: 'mdi-PdfBox',
87 + title: 'Kitchen remodel',
88 + subtitle: 'Jan 10, 2014',
89 + },
90 + ],
91 + }),
92 +};
81 </script> 93 </script>
......
1 <template> 1 <template>
2 - <div> 2 + <div>
3 - <SignupForm></SignupForm> 3 + <SignupForm></SignupForm>
4 - </div> 4 + </div>
5 </template> 5 </template>
6 6
7 <script> 7 <script>
8 -import SignupForm from '../components/SignupForm' 8 +import SignupForm from '../components/SignupForm';
9 export default { 9 export default {
10 - components: { 10 + components: {
11 - SignupForm, 11 + SignupForm,
12 - } 12 + },
13 -} 13 +};
14 </script> 14 </script>
15 15
16 -<style>
17 -
18 -</style>
...\ No newline at end of file ...\ No newline at end of file
16 +<style></style>
......
1 +<template>
2 + <TrashList></TrashList>
3 +</template>
4 +
5 +<script>
6 +import TrashList from '../components/TrashList';
7 +export default {
8 + components: {
9 + TrashList,
10 + },
11 +};
12 +</script>
13 +
14 +<style></style>
...@@ -2,34 +2,10 @@ ...@@ -2,34 +2,10 @@
2 "requires": true, 2 "requires": true,
3 "lockfileVersion": 1, 3 "lockfileVersion": 1,
4 "dependencies": { 4 "dependencies": {
5 - "axios": { 5 + "readline": {
6 - "version": "0.19.2", 6 + "version": "1.3.0",
7 - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", 7 + "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz",
8 - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", 8 + "integrity": "sha1-xYDXfvLPyHUrEySYBg3JeTp6wBw="
9 - "requires": {
10 - "follow-redirects": "1.5.10"
11 - }
12 - },
13 - "debug": {
14 - "version": "3.1.0",
15 - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
16 - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
17 - "requires": {
18 - "ms": "2.0.0"
19 - }
20 - },
21 - "follow-redirects": {
22 - "version": "1.5.10",
23 - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
24 - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
25 - "requires": {
26 - "debug": "=3.1.0"
27 - }
28 - },
29 - "ms": {
30 - "version": "2.0.0",
31 - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
32 - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
33 } 9 }
34 } 10 }
35 } 11 }
......