Compare commits

..

34 Commits
main ... drone

Author SHA1 Message Date
aminecmi
1a949e6e87 Truc. 2022-07-19 21:53:09 +02:00
aminecmi
d3aa355ae3 test 2022-07-19 21:44:46 +02:00
aminecmi
3b870ff634 Truc. 2022-07-19 21:41:49 +02:00
aminecmi
eb844d9ebe Fuc 2022-07-19 21:36:14 +02:00
aminecmi
10675e08fe Fix. 2022-07-19 21:32:26 +02:00
aminecmi
12a6b4f669 get. 2022-07-19 21:30:08 +02:00
aminecmi
d745ac1c3f Node version. 2022-07-19 21:24:30 +02:00
aminecmi
7abeebea83 More trying. 2022-07-19 21:14:09 +02:00
aminecmi
d1982623ed Trying. 2022-07-19 21:12:39 +02:00
aminecmi
1b533e63aa Will this fix all the issues ?! 2022-07-19 20:02:12 +02:00
aminecmi
9fceeefd66 Build au cas ou 2022-07-19 18:28:46 +02:00
aminecmi
b58b90ce15 finger crossed 2022-07-19 18:21:38 +02:00
aminecmi
da7790bb48 push 2022-07-19 18:18:18 +02:00
aminecmi
97a4250524 service. 2022-07-19 18:16:24 +02:00
aminecmi
01f507e8b7 Soyons faus 2022-07-19 18:14:29 +02:00
aminecmi
6aa4c1f300 Pfff 2022-07-19 18:10:34 +02:00
aminecmi
cf869fb4d0 faalse. 2022-07-19 18:09:07 +02:00
aminecmi
e9eaff9554 Yarn ? 2022-07-19 18:03:37 +02:00
aminecmi
07ecbfe6b3 Drooooone. 2022-07-19 17:58:30 +02:00
aminecmi
9392b2add6 Vue cli. 2022-07-19 17:52:39 +02:00
aminecmi
0e8bf5474c This should woork. 2022-07-19 17:50:41 +02:00
aminecmi
c1a246eda7 Downgrade. 2022-07-19 17:48:32 +02:00
aminecmi
114de4468f Fucking 2022-07-19 17:41:27 +02:00
aminecmi
414561f13f WIP. 2022-07-19 17:38:48 +02:00
aminecmi
bb626b67e9 c 2022-07-19 17:36:24 +02:00
aminecmi
83355e8412 fuck 2022-07-19 17:35:19 +02:00
aminecmi
d9559c9be3 debug. 2022-07-19 17:34:45 +02:00
aminecmi
951480d901 Drone. 2022-07-19 17:30:31 +02:00
aminecmi
e074eb9be3 Dro e. 2022-07-19 17:28:45 +02:00
aminecmi
b9c7618b80 Python 2 2022-07-19 17:25:56 +02:00
aminecmi
08f09b08ed Python 2 2022-07-19 17:25:32 +02:00
aminecmi
9944907aa8 Alpine. 2022-07-19 17:20:36 +02:00
aminecmi
1c5edd2024 Python issues. 2022-07-19 17:18:57 +02:00
aminecmi
3829f44c7c Drone config. 2022-07-19 17:09:45 +02:00
7 changed files with 40 additions and 116 deletions

View File

@ -1,64 +1,19 @@
kind: pipeline
type: docker
name: build
steps:
- name: lintAndBuild
- name: build
image: node:14
commands:
- npm install
- echo $VUE_APP_API_BASE_URL
- 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
- name: scp files
image: appleboy/drone-scp
settings:
host: amine-louveau.fr
@ -68,28 +23,3 @@ steps:
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

View File

@ -1,5 +1,7 @@
# An alternative front to Google Keep
[![Build Status](http://18.0.0.7:46053/api/badges/AmineL/liste-de-courses-www/status.svg?ref=refs/heads/main)](http://18.0.0.7:46053/AmineL/liste-de-courses-www)
## HOW TO USE
- Change the api url

View File

@ -71,3 +71,7 @@ export default {
}
}
</script>
<style scoped>
</style>

View File

@ -1,14 +1,14 @@
<template>
<div class="panel-block" v-bind:class="{'disabled': element.loading}">
<span class="icon is-pulled-left handle" v-if="canMove">
<span class="icon is-pulled-left" v-if="canMove">
<ion-icon name="move-outline"></ion-icon>
</span>
<input type="checkbox" v-model="element.checked" v-on:change="updateCheckbox(element)">
<input type="checkbox" v-model="element.checked" v-on:change="updateItem(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="updateContent(element)">
v-on:blur="updateItem(element)">
</div>
<div class="control">
<a class="button is-danger" v-on:click="deleteElement(element)">
@ -29,12 +29,9 @@ export default {
}
},
methods: {
updateCheckbox: function () {
updateItem: 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)
}

View File

@ -26,18 +26,14 @@
</div>
<draggable
v-model="uncheckedItems"
v-model="searchResults"
group="listItems"
@change="onChange"
item-key="id" v-if="searchQ.length <= 0"
handle=".handle">
item-key="id" v-if="searchQ.length <= 0">
<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>
@ -59,8 +55,6 @@ export default {
listName: '',
searchQ: '',
searchResults: [],
uncheckedItems: [],
checkedItems: [],
initialItems: [],
loading: true,
addModalShown: false,
@ -119,20 +113,23 @@ export default {
})
},
recopyItemsObject: function () {
this.uncheckedItems = this.initialItems.filter(x => !x.checked).map(x => ({...x}));
this.checkedItems = this.initialItems.filter(x => x.checked).map(x => ({...x}));
this.searchResults = this.initialItems.map(x => ({...x}));
},
searchItem: function (e) {
if (e.key === 'Enter') {
this.createItem();
} else {
if (this.searchQ.length > 0) {
this.searchResults = this.initialItems.filter(i => i.content.toLowerCase().indexOf(this.searchQ.toLowerCase()) >= 0)
this.searchResults = this.searchResults.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({
@ -160,7 +157,7 @@ export default {
body: JSON.stringify({content: this.searchQ})
}).then(r => {
return r.json();
}).then(() => {
}).then(result => {
this.searchQ = '';
this.fetchListAndItems(true);
})

View File

@ -11,7 +11,7 @@
</div>
<div class="level-right">
<button class="button is-large" v-on:click="newItem">
<button class="button is-large" v-on:click="toggleModal">
<span class="icon is-medium">
<ion-icon name="add-outline"></ion-icon>
</span>
@ -20,19 +20,18 @@
</nav>
<div class="columns">
<div class="column is-one-quarter" v-for="item in lists" :key="item.id">
<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 class="card">
<div class="card-content">
<p class="title">
{{item.name}}
</p>
</div>
</router-link>
<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>
</div>
</div>
</div>
@ -73,8 +72,8 @@ export default {
'Content-Type': 'application/json;charset=utf-8',
'X-API-KEY': localStorage.getItem('KEY')
}
}).then(result => {
if (result.status !== 404) {
}).then(r => {
if (r.status !== 404) {
this.lists = this.lists.filter(r => r.id !== item.id);
}
});
@ -82,10 +81,6 @@ export default {
toggleModal: function () {
this.addModalShown = !this.addModalShown;
},
newItem: function () {
this.selectedItem = null;
this.toggleModal();
},
selectItem: function (item) {
this.selectedItem = item;
this.toggleModal();
@ -109,11 +104,6 @@ export default {
}
</script>
<style scoped>
.columns {
flex-wrap: wrap;
}
</style>

View File

@ -46,3 +46,7 @@ export default {
}
}
</script>
<style scoped>
</style>