Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a960889f34 | ||
|
25e435b2ee | ||
|
9775c6b0c6 | ||
|
bb0c16501c | ||
|
ecaffef993 | ||
|
82c7b793c0 | ||
|
e0f48c99bd | ||
|
89808e8f6a | ||
|
15e69496b7 | ||
|
710af7eeee | ||
|
74f9e1fd94 | ||
|
16028ba07e | ||
|
3039f3a415 | ||
|
884877572b | ||
|
20069bfe84 | ||
|
8c4f036431 | ||
|
59b138be5e | ||
|
fa83860c0a | ||
|
1b8f85606f | ||
|
da23d9cda0 | ||
|
c20329d2b3 | ||
|
e875af8e49 | ||
|
58a1e109ce | ||
|
0c67cbf6da | ||
|
b124bc8c3a |
95
.drone.yml
Normal file
95
.drone.yml
Normal file
@ -0,0 +1,95 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
|
||||
steps:
|
||||
- name: lintAndBuild
|
||||
image: node:14
|
||||
commands:
|
||||
- npm install
|
||||
- npm run lint
|
||||
- npm run build:prod
|
||||
environment:
|
||||
VUE_APP_API_BASE_URL:
|
||||
from_secret: baseurl
|
||||
|
||||
- name: saveNodeModules
|
||||
image: drillster/drone-volume-cache
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
settings:
|
||||
rebuild: true
|
||||
mount:
|
||||
- ./node_modules
|
||||
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /tmp/cache
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Deploy
|
||||
|
||||
steps:
|
||||
- name: getNodeModules
|
||||
image: drillster/drone-volume-cache
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
settings:
|
||||
restore: true
|
||||
mount:
|
||||
- ./node_modules
|
||||
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
|
||||
|
||||
- name: build
|
||||
image: node:14
|
||||
commands:
|
||||
- npm run build:prod
|
||||
environment:
|
||||
VUE_APP_API_BASE_URL:
|
||||
from_secret: baseurl
|
||||
|
||||
- name: scpFiles
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host: amine-louveau.fr
|
||||
username: ubuntu
|
||||
key:
|
||||
from_secret: privateKey
|
||||
port: 22
|
||||
target: /home/ubuntu/courses
|
||||
source: dist/*
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: amine-louveau.fr
|
||||
user: ubuntu
|
||||
key:
|
||||
from_secret: privateKey
|
||||
command_timeout: 2m
|
||||
script:
|
||||
- cd /home/ubuntu/courses
|
||||
- mv dist/* ./
|
||||
- sudo chown www-data:www-data ./*
|
||||
- sudo rm -rf /var/www/amine/courses/*
|
||||
- sudo mv ./* /var/www/amine/courses/
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /tmp/cache
|
@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build --mode production",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -71,7 +71,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="panel-block" v-bind:class="{'disabled': element.loading}">
|
||||
<span class="icon is-pulled-left" v-if="canMove">
|
||||
<span class="icon is-pulled-left handle" v-if="canMove">
|
||||
<ion-icon name="move-outline"></ion-icon>
|
||||
</span>
|
||||
|
||||
<input type="checkbox" v-model="element.checked" v-on:change="updateItem(element)">
|
||||
<input type="checkbox" v-model="element.checked" v-on:change="updateCheckbox(element)">
|
||||
<div class="field is-horizontal has-addons">
|
||||
<div class="control">
|
||||
<input class="input" type="text" v-bind:disabled="element.checked" v-model="element.content"
|
||||
v-on:blur="updateItem(element)">
|
||||
v-on:blur="updateContent(element)">
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-danger" v-on:click="deleteElement(element)">
|
||||
@ -29,9 +29,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateItem: function () {
|
||||
updateCheckbox: function () {
|
||||
this.$emit('updateItem', {id: this.element.id, checked: this.element.checked}, true)
|
||||
},
|
||||
updateContent: function () {
|
||||
this.$emit('updateItem', {id: this.element.id, content: this.element.content}, true)
|
||||
},
|
||||
deleteElement: function () {
|
||||
this.$emit('deleteElement', this.element.id)
|
||||
}
|
||||
|
@ -26,14 +26,18 @@
|
||||
</div>
|
||||
|
||||
<draggable
|
||||
v-model="searchResults"
|
||||
v-model="uncheckedItems"
|
||||
group="listItems"
|
||||
@change="onChange"
|
||||
item-key="id" v-if="searchQ.length <= 0">
|
||||
item-key="id" v-if="searchQ.length <= 0"
|
||||
handle=".handle">
|
||||
<template #item="{element}">
|
||||
<ListItem v-bind:item="element" v-bind:can-move="!element.checked" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
|
||||
</template>
|
||||
</draggable>
|
||||
<div v-if="searchQ.length <= 0">
|
||||
<ListItem v-for="element in checkedItems" v-bind:can-move="false" :key="element.id" v-bind:item="element" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
|
||||
</div>
|
||||
<div v-if="searchQ.length > 0">
|
||||
<ListItem v-for="element in searchResults" v-bind:can-move="false" :key="element.id" v-bind:item="element" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
|
||||
</div>
|
||||
@ -55,6 +59,8 @@ export default {
|
||||
listName: '',
|
||||
searchQ: '',
|
||||
searchResults: [],
|
||||
uncheckedItems: [],
|
||||
checkedItems: [],
|
||||
initialItems: [],
|
||||
loading: true,
|
||||
addModalShown: false,
|
||||
@ -113,23 +119,20 @@ export default {
|
||||
})
|
||||
},
|
||||
recopyItemsObject: function () {
|
||||
this.searchResults = this.initialItems.map(x => ({...x}));
|
||||
this.uncheckedItems = this.initialItems.filter(x => !x.checked).map(x => ({...x}));
|
||||
this.checkedItems = this.initialItems.filter(x => x.checked).map(x => ({...x}));
|
||||
},
|
||||
searchItem: function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
this.createItem();
|
||||
} else {
|
||||
if (this.searchQ.length > 0) {
|
||||
this.searchResults = this.searchResults.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
|
||||
this.searchResults = this.initialItems.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
|
||||
} else {
|
||||
this.recopyItemsObject();
|
||||
}
|
||||
}
|
||||
},
|
||||
addItem: function (item) {
|
||||
this.initialItems.push(item);
|
||||
this.recopyItemsObject();
|
||||
},
|
||||
onChange: function (event) {
|
||||
if (event.moved) {
|
||||
this.updateItem({
|
||||
@ -157,7 +160,7 @@ export default {
|
||||
body: JSON.stringify({content: this.searchQ})
|
||||
}).then(r => {
|
||||
return r.json();
|
||||
}).then(result => {
|
||||
}).then(() => {
|
||||
this.searchQ = '';
|
||||
this.fetchListAndItems(true);
|
||||
})
|
||||
|
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<div class="level-right">
|
||||
<button class="button is-large" v-on:click="toggleModal">
|
||||
<button class="button is-large" v-on:click="newItem">
|
||||
<span class="icon is-medium">
|
||||
<ion-icon name="add-outline"></ion-icon>
|
||||
</span>
|
||||
@ -20,25 +20,27 @@
|
||||
</nav>
|
||||
<div class="columns">
|
||||
<div class="column is-one-quarter" v-for="item in lists" :key="item.id">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<p class="title">
|
||||
{{item.name}}
|
||||
</p>
|
||||
<router-link :to="{ name: 'List', params: { id: item.id }}" custom v-slot="{ navigate }">
|
||||
<div class="card" @click="navigate">
|
||||
<div class="card-content">
|
||||
<p class="title">
|
||||
{{item.name}}
|
||||
</p>
|
||||
</div>
|
||||
<footer class="card-footer">
|
||||
<a href="#" class="card-footer-item" v-on:click.prevent="selectItem(item)">Edit</a>
|
||||
<a href="#" class="card-footer-item" v-on:click.prevent="deleteItem(item)">Delete</a>
|
||||
</footer>
|
||||
</div>
|
||||
<footer class="card-footer">
|
||||
<router-link class="card-footer-item" :to="{ name: 'List', params: { id: item.id }}">Select</router-link>
|
||||
<a href="#" class="card-footer-item" v-on:click="selectItem(item)">Edit</a>
|
||||
<a href="#" class="card-footer-item" v-on:click="deleteItem(item)">Delete</a>
|
||||
</footer>
|
||||
</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListCreateUpdateModal from "../../../liste-de-courses-www/src/components/ListCreateUpdateModal";
|
||||
import ListCreateUpdateModal from "@/components/ListCreateUpdateModal";
|
||||
|
||||
export default {
|
||||
name: "Lists",
|
||||
components: {ListCreateUpdateModal},
|
||||
@ -71,8 +73,8 @@ export default {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
'X-API-KEY': localStorage.getItem('KEY')
|
||||
}
|
||||
}).then(r => {
|
||||
if (r.status !== 404) {
|
||||
}).then(result => {
|
||||
if (result.status !== 404) {
|
||||
this.lists = this.lists.filter(r => r.id !== item.id);
|
||||
}
|
||||
});
|
||||
@ -80,6 +82,10 @@ export default {
|
||||
toggleModal: function () {
|
||||
this.addModalShown = !this.addModalShown;
|
||||
},
|
||||
newItem: function () {
|
||||
this.selectedItem = null;
|
||||
this.toggleModal();
|
||||
},
|
||||
selectItem: function (item) {
|
||||
this.selectedItem = item;
|
||||
this.toggleModal();
|
||||
@ -103,6 +109,11 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.columns {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
|
@ -46,7 +46,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user