Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eryn Rizky Napitupulu #22

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md

This file was deleted.

2 changes: 2 additions & 0 deletions client/admin/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 1%
last 2 versions
7 changes: 7 additions & 0 deletions client/admin/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
17 changes: 17 additions & 0 deletions client/admin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
};
21 changes: 21 additions & 0 deletions client/admin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
26 changes: 26 additions & 0 deletions client/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# client

## 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/).


5 changes: 5 additions & 0 deletions client/admin/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
};
12,333 changes: 12,333 additions & 0 deletions client/admin/package-lock.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions client/admin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.5.0",
"core-js": "^3.6.4",
"vue": "^2.6.11",
"vue-router": "^3.1.5",
"vue-strap": "^1.1.40",
"vue-sweetalert2": "^3.0.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-plugin-router": "~4.2.0",
"@vue/cli-service": "~4.2.0",
"@vue/eslint-config-airbnb": "^5.0.2",
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-vue": "^6.1.2",
"vue-template-compiler": "^2.6.11"
}
}
Binary file added client/admin/public/favicon.ico
Binary file not shown.
26 changes: 26 additions & 0 deletions client/admin/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Bike-Commerce</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
16 changes: 16 additions & 0 deletions client/admin/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>

export default {
created() {
this.$store.dispatch('loadData');
},
};
</script>
<style>

</style>
Binary file added client/admin/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions client/admin/src/assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
body {
color: rgb(51, 51, 51);
background: #f5f5f5;
font-family: 'Varela Round', sans-serif;
margin: 0;
}
.container-fluid{
padding-left: 0;
padding-right: 0;
}
.form-control {
box-shadow: none;
border-color: #ddd;
}
.form-control:focus {
border-color: #4aba70;
}
.login-form {
width: 350px;
margin: 0 auto;
padding: 30px 0;
}
.login-form form {
color: #434343;
border-radius: 1px;
margin-bottom: 15px;
background: #fff;
border: 1px solid #f3f3f3;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.login-form h4 {
text-align: center;
font-size: 22px;
margin-bottom: 20px;
}
.login-form .avatar {
color: #fff;
margin: 0 auto 30px;
text-align: center;
width: 100px;
height: 100px;
border-radius: 50%;
z-index: 9;
background: #4aba70;
padding: 15px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}
.login-form .avatar i {
font-size: 62px;
}
.login-form .form-group {
margin-bottom: 20px;
}
.login-form .form-control, .login-form .btn {
min-height: 40px;
border-radius: 2px;
transition: all 0.5s;
}
.login-form .close {
position: absolute;
top: 15px;
right: 15px;
}
.login-form .btn {
background: #4aba70;
border: none;
line-height: normal;
}
.login-form .btn:hover, .login-form .btn:focus {
background: #42ae68;
}
.login-form .checkbox-inline {
float: left;
}
.login-form input[type="checkbox"] {
margin-top: 2px;
}
.login-form .forgot-link {
float: right;
}
.login-form .small {
font-size: 13px;
}
.login-form a {
color: #4aba70;
}
.admin-control{
height: 4em;
background-color: #074e88;
}
.list{
text-align: left;
margin: 10px;
}
.card{
width: 80%;
}
.card img{
object-fit: cover;
height: 300px;
}
.card-body .btn {
color: white;
}
.table .btn{
margin: 20px;
}
.button-control{
height:3em;
}
.button-control button{
margin-left: 10px;
}
.formadd{
position: absolute;
background-color: #dbdbdb;
left: 50%;
top: 10%;
margin-left: -15vw;
width: 30vw;
}
.back{
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #2e2e2e93;
}
.formadd form {
padding: 15px;
}

.formadd h5{
padding: 15px;
}
38 changes: 38 additions & 0 deletions client/admin/src/components/AdminControl.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div class="container-fluid">
<div class="d-flex align-items-center justify-content-around admin-control">
<router-link to="/">
<button type="button" class="btn btn-warning" v-if="loadData">
Total Product : {{loadData.length}}</button>
</router-link>
<router-link to="/sold"><button type="button" class="btn btn-primary">
Total Sold : 0</button></router-link>
<router-link to="/outofstock">
<button type="button" class="btn btn-danger">
Out Of Stock : {{emptyData.length}}</button>
</router-link>
</div>
</div>
</template>

<script>


export default {
name: 'AdminControl',
computed: {
loadData() {
return this.$store.state.allData;
},
emptyData() {
return this.$store.state.emptyStock;
},
},
method: {
},
};
</script>

<style>

</style>
50 changes: 50 additions & 0 deletions client/admin/src/components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="navbar-collapse collapse w-100 order-1 order-md-0 dual-collapse2">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Admin Control</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Client View</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Card View</a>
</li>
</ul>
</div>
<div class="mx-auto order-0">
<a class="navbar-brand mx-auto" href="#">Bike-Commerce</a>
<button class="navbar-toggler" type="button"
data-toggle="collapse" data-target=".dual-collapse2">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<button type="button" @click="logout" class="btn btn-primary btn-sm">Log Out</button>
</li>
</ul>
</div>
</nav>
</template>

<script>

export default {
name: 'Navbar',
methods: {
logout() {
localStorage.clear();
this.$router.push({ name: 'login' });
},
},
};

</script>


<style>

</style>
Loading