Merge remote-tracking branch 'origin/master'

# Conflicts:
#	build.gradle
#	src/vite-frontend/src/router/index.ts
#	src/vite-frontend/src/views/TheRegister.vue
This commit is contained in:
minseokkang
2022-11-16 10:42:20 +09:00
20 changed files with 0 additions and 21503 deletions

View File

@@ -1,23 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -1,24 +0,0 @@
# frontend
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

View File

@@ -1,19 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,49 +0,0 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"assert": "^2.0.0",
"axios": "^1.1.3",
"core-js": "^3.8.3",
"https-browserify": "^1.0.0",
"path": "^0.12.7",
"request": "^2.88.2",
"vue": "^3.2.13",
"vue-router": "^4.0.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,7 +0,0 @@
<!DOCTYPE html>
<html lang="">
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -1,30 +0,0 @@
<template>
<TheHeader></TheHeader>
<router-view></router-view>
<TheFooter></TheFooter>
</template>
<script>
import TheHeader from '@/components/TheHeader.vue'
import TheFooter from "@/components/TheFooter";
export default {
name: 'App',
components: {
TheHeader,
TheFooter
},
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,20 +0,0 @@
<template>
<footer>
<div class="container">
<a href="/" class="logo-font">conduit</a>
<span class="attribution">
An interactive learning project from <a href="https://thinkster.io">Thinkster</a>. Code &amp; design licensed under MIT.
</span>
</div>
</footer>
</template>
<script>
export default {
name: "TheFooter"
}
</script>
<style scoped>
</style>

View File

@@ -1,49 +0,0 @@
<template>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Conduit</title>
<!-- Import Ionicon icons & Google Fonts our Bootstrap theme relies on -->
<link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Titillium+Web:700|Source+Serif+Pro:400,700|Merriweather+Sans:400,700|Source+Sans+Pro:400,300,600,700,300italic,400italic,600italic,700italic"
rel="stylesheet" type="text/css">
<!-- Import the custom Bootstrap 4 theme from our hosted CDN -->
<link rel="stylesheet" href="//demo.productionready.io/main.css">
</head>
<nav class="navbar navbar-light">
<div class="container">
<a class="navbar-brand" href="/">conduit</a>
<ul class="nav navbar-nav pull-xs-right">
<li class="nav-item">
<!-- Add "active" class when you're on that page" -->
<router-link to="/" class="nav-link active" active-class="active">Home</router-link>
</li>
<li class="nav-item">
<router-link to="/article" class="nav-link" active-class="active">New Article</router-link>
</li>
<li class="nav-item">
<router-link to="/setting" class="nav-link" active-class="active"><i class="ion-gear-a"></i>Settings</router-link>
</li>
<li class="nav-item">
<router-link to="/login" class="nav-link" active-class="active">Sign in</router-link>
</li>
<li class="nav-item">
<router-link to="/register" class="nav-link" active-class="active">Sign up</router-link>
</li>
</ul>
</div>
</nav>
</template>
<script>
export default {
name: "TheHeader"
}
</script>
<style scoped>
</style>

View File

@@ -1,11 +0,0 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from "./router";
import axios from 'axios';
axios.defaults.baseURL = 'http://3.35.44.58:8080/'
const app = createApp(App);
app.config.globalProperties.axios = axios;
app.use(router,axios);
app.mount('#app');

View File

@@ -1,36 +0,0 @@
import { createWebHashHistory, createRouter } from "vue-router";
const routes = [
{
path: "/",
name: "Home",
component: () => import(/* webpackChunkName "home" */ '@/views/TheHome.vue')
},
{
path: "/settings",
name: "Settings",
component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheSetting.vue')
},
{
path: "/login",
name: "Login",
component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheLogin.vue')
},
{
path: "/register",
name: "Register",
component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheRegister.vue')
},
{
path: "/article",
name: "Article",
component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheArticle.vue')
},
];
const router = createRouter({
history: createWebHashHistory(),
routes,
});
export default router;

View File

@@ -1,46 +0,0 @@
<template>
<div class="editor-page">
<div class="container page">
<div class="row">
<div class="col-md-10 offset-md-1 col-xs-12">
<form>
<fieldset>
<fieldset class="form-group">
<input type="text" class="form-control form-control-lg" placeholder="Article Title">
</fieldset>
<fieldset class="form-group">
<input type="text" class="form-control" placeholder="What's this article about?">
</fieldset>
<fieldset class="form-group">
<textarea class="form-control" rows="8"
placeholder="Write your article (in markdown)"></textarea>
</fieldset>
<fieldset class="form-group">
<input type="text" class="form-control" placeholder="Enter tags">
<div class="tag-list"></div>
</fieldset>
<button class="btn btn-lg pull-xs-right btn-primary" type="button">
Publish Article
</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TheArticle"
}
</script>
<style scoped>
</style>

View File

@@ -1,96 +0,0 @@
<template>
<div class="home-page">
<div class="banner">
<div class="container">
<h1 class="logo-font">conduit</h1>
<p>A place to share your knowledge.</p>
</div>
</div>
<div class="container page">
<div class="row">
<div class="col-md-9">
<div class="feed-toggle">
<ul class="nav nav-pills outline-active">
<li class="nav-item">
<a class="nav-link disabled" href="">Your Feed</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="">Global Feed</a>
</li>
</ul>
</div>
<div class="article-preview">
<div class="article-meta">
<a href="profile.html"><img src="http://i.imgur.com/Qr71crq.jpg"/></a>
<div class="info">
<a href="" class="author">Eric Simons</a>
<span class="date">January 20th</span>
</div>
<button class="btn btn-outline-primary btn-sm pull-xs-right">
<i class="ion-heart"></i> 29
</button>
</div>
<a href="" class="preview-link">
<h1>How to build webapps that scale</h1>
<p>This is the description for the post.</p>
<span>Read more...</span>
</a>
</div>
<div class="article-preview">
<div class="article-meta">
<a href="profile.html"><img src="http://i.imgur.com/N4VcUeJ.jpg"/></a>
<div class="info">
<a href="" class="author">Albert Pai</a>
<span class="date">January 20th</span>
</div>
<button class="btn btn-outline-primary btn-sm pull-xs-right">
<i class="ion-heart"></i> 32
</button>
</div>
<a href="" class="preview-link">
<h1>The song you won't ever stop singing. No matter how hard you try.</h1>
<p>This is the description for the post.</p>
<span>Read more...</span>
</a>
</div>
</div>
<div class="col-md-3">
<div class="sidebar">
<p>Popular Tags</p>
<div class="tag-list">
<a href="" class="tag-pill tag-default">programming</a>
<a href="" class="tag-pill tag-default">javascript</a>
<a href="" class="tag-pill tag-default">emberjs</a>
<a href="" class="tag-pill tag-default">angularjs</a>
<a href="" class="tag-pill tag-default">react</a>
<a href="" class="tag-pill tag-default">mean</a>
<a href="" class="tag-pill tag-default">node</a>
<a href="" class="tag-pill tag-default">rails</a>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TheHome"
}
</script>
<style scoped>
</style>

View File

@@ -1,46 +0,0 @@
<template>
<div class="auth-page">
<div class="container page">
<div class="row">
<div class="col-md-6 offset-md-3 col-xs-12">
<h1 class="text-xs-center">Sign up</h1>
<p class="text-xs-center">
<a href="">Have an account?</a>
</p>
<ul class="error-messages">
<li>That email is already taken</li>
</ul>
<form>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Your Name">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Email">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="password" placeholder="Password">
</fieldset>
<button class="btn btn-lg btn-primary pull-xs-right">
Sign up
</button>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TheLogin"
}
</script>
<style scoped>
</style>

View File

@@ -1,110 +0,0 @@
<template>
<div class="auth-page">
<div class="container page">
<div class="row">
<div class="col-md-6 offset-md-3 col-xs-12">
<h1 class="text-xs-center">Sign up</h1>
<p class="text-xs-center">
<a href="">Have an account?</a>
</p>
<ul class="error-messages" v-if="emailDuplicate">
<li align="left">email has already been taken</li>
</ul>
<ul class="error-messages" v-if="usernameDuplicate">
<li align="left">username has already been taken</li>
</ul>
<form>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Your Name" v-model="user.username">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Email" v-model="user.email">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="password" placeholder="Password" v-model="user.password">
</fieldset>
<button @click = "signup" class="btn btn-lg btn-primary pull-xs-right">
Sign up
</button>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
import axios from "axios";
import router from "@/router";
import {reactive, ref} from "vue";
export default {
name: "TheRegister.vue",
setup(){
let emailDuplicate = ref(false);
let usernameDuplicate = ref(false);
const user = reactive({
username: "",
email: "",
password: "",
})
const allHideError = () => {
emailDuplicate.value = false;
usernameDuplicate.value = false;
}
const showEmailUsernameError = () => {
emailDuplicate.value = true;
usernameDuplicate.value = true
};
const showEmailError = () => {
emailDuplicate.value = true;
usernameDuplicate.value = false;
};
const showUsernameError = () => {
usernameDuplicate.value = true;
emailDuplicate.value = false;
};
const signup = () => {
console.log(user)
axios.post('http://3.35.44.58:8080/api/users',{
user
})
.then(response => {
window.localStorage.setItem("token",response.data.user.token);
allHideError();
router.push("/");
})
.catch(error =>{
console.log(error);
const code = error.response.data.errors.code;
if(code == "DUPLICATE_EMAIL_USERNAME"){
showEmailUsernameError();
}else if(code == "DUPLICATE_EMAIL"){
showEmailError();
}else if(code == "DUPLICATE_USERNAME"){
showUsernameError();
}
})
}
return { user, emailDuplicate, usernameDuplicate, signup, showEmailUsernameError,showEmailError, showUsernameError, allHideError }
},
}
</script>
<style scoped>
</style>

View File

@@ -1,48 +0,0 @@
<template>
<div class="settings-page">
<div class="container page">
<div class="row">
<div class="col-md-6 offset-md-3 col-xs-12">
<h1 class="text-xs-center">Your Settings</h1>
<form>
<fieldset>
<fieldset class="form-group">
<input class="form-control" type="text" placeholder="URL of profile picture">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Your Name">
</fieldset>
<fieldset class="form-group">
<textarea class="form-control form-control-lg" rows="8"
placeholder="Short bio about you"></textarea>
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="text" placeholder="Email">
</fieldset>
<fieldset class="form-group">
<input class="form-control form-control-lg" type="password" placeholder="Password">
</fieldset>
<button class="btn btn-lg btn-primary pull-xs-right">
Update Settings
</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TheSetting"
}
</script>
<style scoped>
</style>

View File

@@ -1,18 +0,0 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
outputDir: "../main/resources/static",
devServer: {
port: 4000,
proxy:{
'/': {
target : "http://3.35.44.58:8080",
pathRewrite: {'^/':''},
changeOrigin: true,
secure: false
}
}
}
})