first attempt to generate time schedule from assets in js
This commit is contained in:
parent
83ee5f7853
commit
031a04e545
4
Makefile
4
Makefile
|
@ -1,6 +1,8 @@
|
||||||
default : concat
|
default : concat
|
||||||
concat:
|
concat:
|
||||||
bash scripts/concat_org.sh >> scripts/stats.org
|
echo "* " | tee -a scripts/stats.org
|
||||||
|
date | tee -a scripts/stats.org
|
||||||
|
bash scripts/concat_org.sh |tee -a scripts/stats.org
|
||||||
convert:
|
convert:
|
||||||
npm start
|
npm start
|
||||||
copyTasksJson :
|
copyTasksJson :
|
||||||
|
|
|
@ -9,21 +9,71 @@ const timespan_base = {
|
||||||
duration: "60", // minutes
|
duration: "60", // minutes
|
||||||
content: null
|
content: null
|
||||||
}
|
}
|
||||||
const days = [{
|
|
||||||
label: "lundi"
|
const day_start_hour = 9;
|
||||||
}, {
|
const day_activities_hours = 10;
|
||||||
label: "mardi"
|
const activity_duration_default=60;
|
||||||
}, {
|
|
||||||
label: "mercredi"
|
const ressources_nope = [
|
||||||
}, {
|
{
|
||||||
label: "jeudi"
|
label: "social sorting"
|
||||||
}, {
|
},
|
||||||
label: "vendredi"
|
{
|
||||||
}, {
|
label: "gestion de l'information"
|
||||||
label: "samedi"
|
},
|
||||||
}, {
|
{
|
||||||
label: "dimanche"
|
label: "lecture"
|
||||||
},
|
}, {
|
||||||
|
|
||||||
|
label: "architecture"
|
||||||
|
}, {
|
||||||
|
label: "climat"
|
||||||
|
}, {
|
||||||
|
label: "nucléaire"
|
||||||
|
}, {
|
||||||
|
label: "dessins"
|
||||||
|
}, {
|
||||||
|
label: "partage de documents"
|
||||||
|
}, {
|
||||||
|
label: "recherche et éducation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "emploi du temps"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const categories = [
|
||||||
|
'aires de responsabilité',
|
||||||
|
'archives',
|
||||||
|
'ressources',
|
||||||
|
'projets',
|
||||||
|
]
|
||||||
|
|
||||||
|
const projects = ['emploi du temps','rangement','migration Rise','dev','calendar maker','noeud garage','report orgmode','partage ftp']
|
||||||
|
const areas = [
|
||||||
|
'achats',
|
||||||
|
'administratif',
|
||||||
|
'apprendre emacs',
|
||||||
|
'associations',
|
||||||
|
'boulot',
|
||||||
|
'communication et écriture',
|
||||||
|
'corvées',
|
||||||
|
'habitudes',
|
||||||
|
'santé',
|
||||||
|
'social',
|
||||||
|
'travaux bricolage',
|
||||||
|
'vacances'
|
||||||
|
]
|
||||||
|
const ressources = [
|
||||||
|
'social sorting',
|
||||||
|
'PIM',
|
||||||
|
'lecture',
|
||||||
|
'architecture',
|
||||||
|
'climat',
|
||||||
|
'nucléaire',
|
||||||
|
'dessins',
|
||||||
|
'partage de documents',
|
||||||
|
'recherche et éducation'
|
||||||
]
|
]
|
||||||
// préremplir avec des créneaux réservés
|
// préremplir avec des créneaux réservés
|
||||||
|
|
||||||
|
@ -53,7 +103,7 @@ const hours_spans = [
|
||||||
color: "white"
|
color: "white"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: "19",
|
start: "21",
|
||||||
duration: "30", // minutes
|
duration: "30", // minutes
|
||||||
label: "préparation dodo",
|
label: "préparation dodo",
|
||||||
color: "white"
|
color: "white"
|
||||||
|
@ -61,41 +111,143 @@ const hours_spans = [
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const ressources = [
|
const days = [{
|
||||||
|
label: "lundi"
|
||||||
|
}, {
|
||||||
|
label: "mardi"
|
||||||
|
}, {
|
||||||
|
label: "mercredi"
|
||||||
|
}, {
|
||||||
|
label: "jeudi"
|
||||||
|
}, {
|
||||||
|
label: "vendredi"
|
||||||
|
},
|
||||||
|
/**
|
||||||
{
|
{
|
||||||
label: "social sorting"
|
label: "samedi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "gestion de l'information"
|
label: "dimanche"
|
||||||
},
|
},
|
||||||
{
|
**/
|
||||||
label: "lecture"
|
|
||||||
}, {
|
|
||||||
|
|
||||||
label: "architecture"
|
|
||||||
}, {
|
|
||||||
label: "climat"
|
|
||||||
}, {
|
|
||||||
label: "nucléaire"
|
|
||||||
}, {
|
|
||||||
label: "dessins"
|
|
||||||
}, {
|
|
||||||
label: "partage de documents"
|
|
||||||
}, {
|
|
||||||
label: "recherche et éducation"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "emploi du temps"
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
function displayDays() {
|
function displayDays() {
|
||||||
|
|
||||||
|
console.log('projets', projects.length)
|
||||||
|
console.log('aires de responsabilité', areas.length)
|
||||||
|
console.log('ressources actuelles', ressources.length)
|
||||||
|
|
||||||
|
|
||||||
days.forEach((elem, index) => {
|
days.forEach((elem, index) => {
|
||||||
|
|
||||||
console.log('*' , elem.label)
|
// ajouter les créneaux à chaque journée
|
||||||
|
console.log('' )
|
||||||
|
console.log('*' , elem.label )
|
||||||
|
loopOneDay();
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// configs qui bouclent pour chaque catégorie
|
||||||
|
let category_index = 0;
|
||||||
|
let projects_index = 0;
|
||||||
|
let area_index = 0;
|
||||||
|
let ressources_index = 0;
|
||||||
|
let day_hour = day_start_hour;
|
||||||
|
let day_minutes_counter = 0;
|
||||||
|
let max_min_a_day = day_minutes_counter * day_activities_hours;
|
||||||
|
let daily_duration = 15; // minutes
|
||||||
|
|
||||||
|
let day_categories_map = [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
function loopOneDay(){
|
||||||
|
// passer sur les catégories et faire progresser l'index des éléments des catégories
|
||||||
|
|
||||||
|
console.log('** ' ,day_hour ,'h revue journalière')
|
||||||
|
day_minutes_counter += daily_duration
|
||||||
|
|
||||||
|
console.log('** ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,'h appels tel')
|
||||||
|
day_minutes_counter += 20
|
||||||
|
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** areas : ' ,area_index, ' : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,areas[area_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
area_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** areas : ' ,area_index, ' : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,areas[area_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
area_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** projects : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,projects[projects_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
projects_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** projects : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,projects[projects_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
projects_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** projects : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,projects[projects_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
projects_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** ressources : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,ressources[ressources_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
ressources_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** ressources : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,ressources[ressources_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
ressources_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
console.log('** ressources : ' ,convertMinutesOfDayToHourDisplay(day_minutes_counter) ,ressources[ressources_index])
|
||||||
|
day_minutes_counter += activity_duration_default
|
||||||
|
ressources_index++
|
||||||
|
resetIndexesIfNeeded()
|
||||||
|
|
||||||
|
day_minutes_counter = 0;
|
||||||
|
// for(let ii =day_minutes_counter; ii < max_min_a_day; ii+=activity_duration_default ){
|
||||||
|
|
||||||
|
// day_minutes_counter += activity_duration_default
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetIndexesIfNeeded(){
|
||||||
|
if(area_index >= areas.length){
|
||||||
|
area_index = 0;
|
||||||
|
console.log('# --- retour de areas --- ')
|
||||||
|
}
|
||||||
|
if(ressources_index >= ressources.length){
|
||||||
|
ressources_index = 0;
|
||||||
|
console.log('# --- retour de ressources --- ')
|
||||||
|
}
|
||||||
|
if(projects_index >= projects.length){
|
||||||
|
projects_index = 0;
|
||||||
|
console.log('# --- retour de projets --- ')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO améliorer le rendu pour avoir les minutes arrondies dans l'heure
|
||||||
|
function convertMinutesOfDayToHourDisplay(max_min_a_day){
|
||||||
|
|
||||||
|
// return day_start_hour + (max_min_a_day/60) + ' h'
|
||||||
|
return day_start_hour + Math.round(max_min_a_day/60) + 'h'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log("* Emploi du temps pour une semaine \n")
|
||||||
displayDays();
|
displayDays();
|
|
@ -0,0 +1,67 @@
|
||||||
|
* Emploi du temps pour une semaine
|
||||||
|
|
||||||
|
projets 8
|
||||||
|
aires de responsabilité 12
|
||||||
|
ressources actuelles 9
|
||||||
|
|
||||||
|
* lundi
|
||||||
|
** 9 h revue journalière
|
||||||
|
** 9h h appels tel
|
||||||
|
** areas : 0 : 10h achats
|
||||||
|
** areas : 1 : 11h administratif
|
||||||
|
** projects : 12h emploi du temps
|
||||||
|
** projects : 13h rangement
|
||||||
|
** projects : 14h migration Rise
|
||||||
|
** ressources : 15h social sorting
|
||||||
|
** ressources : 16h PIM
|
||||||
|
** ressources : 17h lecture
|
||||||
|
|
||||||
|
* mardi
|
||||||
|
** 9 h revue journalière
|
||||||
|
** 9h h appels tel
|
||||||
|
** areas : 2 : 10h apprendre emacs
|
||||||
|
** areas : 3 : 11h associations
|
||||||
|
** projects : 12h dev
|
||||||
|
** projects : 13h calendar maker
|
||||||
|
** projects : 14h noeud garage
|
||||||
|
** ressources : 15h architecture
|
||||||
|
** ressources : 16h climat
|
||||||
|
** ressources : 17h nucléaire
|
||||||
|
|
||||||
|
* mercredi
|
||||||
|
** 9 h revue journalière
|
||||||
|
** 9h h appels tel
|
||||||
|
** areas : 4 : 10h boulot
|
||||||
|
** areas : 5 : 11h communication et écriture
|
||||||
|
** projects : 12h report orgmode
|
||||||
|
** projects : 13h partage ftp
|
||||||
|
# --- retour de projets ---
|
||||||
|
** projects : 14h emploi du temps
|
||||||
|
** ressources : 15h dessins
|
||||||
|
** ressources : 16h partage de documents
|
||||||
|
** ressources : 17h recherche et éducation
|
||||||
|
# --- retour de ressources ---
|
||||||
|
|
||||||
|
* jeudi
|
||||||
|
** 9 h revue journalière
|
||||||
|
** 9h h appels tel
|
||||||
|
** areas : 6 : 10h corvées
|
||||||
|
** areas : 7 : 11h habitudes
|
||||||
|
** projects : 12h rangement
|
||||||
|
** projects : 13h migration Rise
|
||||||
|
** projects : 14h dev
|
||||||
|
** ressources : 15h social sorting
|
||||||
|
** ressources : 16h PIM
|
||||||
|
** ressources : 17h lecture
|
||||||
|
|
||||||
|
* vendredi
|
||||||
|
** 9 h revue journalière
|
||||||
|
** 9h h appels tel
|
||||||
|
** areas : 8 : 10h santé
|
||||||
|
** areas : 9 : 11h social
|
||||||
|
** projects : 12h calendar maker
|
||||||
|
** projects : 13h noeud garage
|
||||||
|
** projects : 14h report orgmode
|
||||||
|
** ressources : 15h architecture
|
||||||
|
** ressources : 16h climat
|
||||||
|
** ressources : 17h nucléaire
|
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
touch all_tasks.org
|
touch all_tasks.org
|
||||||
echo "" > all_tasks.org
|
echo "" > all_tasks.org
|
||||||
cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org >> all_tasks.org
|
cat ~/Nextcloud/textes/orgmode/tasks.org >> all_tasks.org
|
||||||
cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org_archive >> all_tasks.org
|
cat ~/Nextcloud/textes/orgmode/tasks.org_archive >> all_tasks.org
|
||||||
cp all_tasks.org /home/tykayn/Nextcloud/textes/orgmode/stats
|
cp all_tasks.org ~/Nextcloud/textes/orgmode/stats
|
||||||
|
|
||||||
|
|
||||||
touch stats.org
|
touch stats.org
|
||||||
|
@ -36,7 +36,7 @@ echo " finis : $finis"
|
||||||
counter=`grep -o '* CREATED' all_tasks.org | wc -l`
|
counter=`grep -o '* CREATED' all_tasks.org | wc -l`
|
||||||
echo " CREATED : $counter"
|
echo " CREATED : $counter"
|
||||||
echo " en tout : $tout"
|
echo " en tout : $tout"
|
||||||
counter=`ls -l /home/tykayn/Nextcloud/textes/orgmode/org-roam/*.org | wc -l`
|
counter=`ls -l ~/Nextcloud/textes/orgmode/org-roam/*.org | wc -l`
|
||||||
echo " Roam files : $counter"
|
echo " Roam files : $counter"
|
||||||
|
|
||||||
#pandoc -i all_tasks.org -o all_tasks.json
|
#pandoc -i all_tasks.org -o all_tasks.json
|
||||||
|
|
Loading…
Reference in New Issue