Browse Source

add altcha and contact request api call

olinox14 1 year ago
parent
commit
ad8a69afaf
10 changed files with 344 additions and 371 deletions
  1. BIN
      .yarn/install-state.gz
  2. 1 1
      README.md
  3. 22 0
      components/AntiBotDialog.client.vue
  4. 25 5
      components/Contact.vue
  5. 1 1
      components/Cursus.vue
  6. 4 1
      lang/en.json
  7. 5 2
      lang/fr.json
  8. 1 14
      nuxt.config.ts
  9. 1 1
      package.json
  10. 284 346
      yarn.lock

BIN
.yarn/install-state.gz


+ 1 - 1
README.md

@@ -14,7 +14,7 @@ Run it (name can be changed):
     docker run -v "$(pwd)":/cv2 -p 3000:3000 --name cv2 cv2
 
     # On Windows
-    docker run -d -v "%cd%:/cv2" -p 3000:3000 -p 4000:4000 --name cv2 cv2
+    docker run -d -v "%cd%:/cv2" -p 3000:3000 --name cv2 cv2
 
 Execute it and install dependencies :
 

+ 22 - 0
components/AntiBotDialog.client.vue

@@ -0,0 +1,22 @@
+<template>
+  <div>
+    {{ $t('anti-bot-test')}}
+
+    <altcha-widget
+      ref="altchaWidget"
+      style="--altcha-max-width:100%"
+      debug
+      test
+    ></altcha-widget>
+  </div>
+</template>
+
+<script setup lang="ts">
+import 'altcha';
+
+
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 25 - 5
components/Contact.vue

@@ -109,11 +109,31 @@ const submit = async (): Promise<void> => {
     return
   }
 
-  mail.send({
-    from: email.value,
-    subject: 'CV - Contact Request',
-    text: 'From : ' + name.value + '\n\n' + message.value,
-  })
+  const url = 'https://api.ogene.fr/api/contact';
+  const headers = {
+    'Content-Type': 'application/ld+json'
+  };
+  const body = {
+    "email": email.value,
+    "name": name.value,
+    "message": message.value
+  };
+
+  try {
+    const response = await fetch(url, {
+      method: 'POST',
+      headers: headers,
+      body: JSON.stringify(body)
+    });
+
+    if (!response.ok) {
+      throw new Error(`HTTP error! status: ${response.status}`);
+    }
+
+    await response.json();
+  } catch (error) {
+    console.error('There was a problem with the fetch operation: ', error);
+  }
 
   contactRequestSent.value = true
   errorMsg.value = null

+ 1 - 1
components/Cursus.vue

@@ -22,7 +22,7 @@
     { year: '2008-2011', label: i18n.t('cursus_engees') },
     { year: '2010', label: i18n.t('cursus_bafia') },
     { year: '2011', label: i18n.t('cursus_imfs') },
-    { year: '2012', label: i18n.t('cursus_public_exam') },
+    { year: '2013', label: i18n.t('cursus_public_exam') },
     { year: '2011-2016', label: i18n.t('cursus_sag_67') },
     { year: '2013', label: i18n.t('cursus_management') },
     { year: '2014', label: i18n.t('cursus_reporting') },

+ 4 - 1
lang/en.json

@@ -8,6 +8,8 @@
   "intro_part_3": "I place great importance on the development of a team spirit, continuous improvement, and the realization of a thorough, tested, documented work.",
   "intro_part_4": "I currently maintain the open source libraries <a href='https://github.com/olinox14/path-php' target='_blank'>Path-PHP</a> and <a href='https://github.com/olinox14/xdice' target='_blank'>xdice</a>, and I'm the author of the (unmaintained) <a href='https://github.com/olinox14/FullMd' target='_blank'>FullMD</a> library.",
   "find_me_on": "Find me on",
+  "download_pdf": "PDF Version",
+  "contact_me": "Contact me",
   "show_more": "Show more",
   "show_less": "Show less",
   "Find me on Github": "Find me on Github",
@@ -36,5 +38,6 @@
   "contact_submit": "Send",
   "contact_confirmation": "Your message has been sent, I will get back to you as soon as possible",
   "continuous_improvement": "Continuous improvement",
-  "system_administration": "System administration"
+  "system_administration": "System administration",
+  "anti-bot-test": "Anti-bot check"
 }

+ 5 - 2
lang/fr.json

@@ -2,12 +2,14 @@
   "Fullstack developer": "Développeur Fullstack",
   "x_years_experience": "{years} ans d'expérience",
   "x_years": "{years} ans",
-  "intro_short": "Ingénieur de formation, développeur fullstack, avec expérience managériale, système et PO.",
+  "intro_short": "Ingénieur de formation et développeur fullstack, j'ai aussi une expérience sérieuse dans les domaines du management, de l'administration système et du PO.",
   "intro_part_1": "Depuis 2011, mon parcours professionnel m'a permis de développer des compétences très variées, tant d'un point de vue technique: développement, administration système, QA et intégration continue, gestion de bases de données, moteurs de recherche..., que d'un point de vue managérial: encadrement, tutorat, management agile, intelligence collective, animation de réunion.",
   "intro_part_2": "J'ai été amené à travailler avec des services de natures diverses: services des eaux, gestion des déchets, travaux ruraux, conservatoires et écoles de musique, réseaux telecom.",
   "intro_part_3": "J'accorde beaucoup d'importance au développement d'un esprit d'équipe, à l'amélioration continue, et à la réalisation d'un travail abouti, testé, documenté.",
   "intro_part_4": "Je maintiens actuellement les librairies opensource <a href='https://github.com/olinox14/path-php' target='_blank'>Path-PHP</a> et <a href='https://github.com/olinox14/xdice' target='_blank'>xdice</a>, et suis l'auteur de la librairie (non-maintenue) <a href='https://github.com/olinox14/FullMd' target='_blank'>FullMD</a>.",
   "find_me_on": "Retrouvez moi sur",
+  "download_pdf": "Version PDF",
+  "contact_me": "Contact",
   "show_more": "Voir plus",
   "show_less": "Réduire",
   "Find me on Github": "Retrouvez moi sur Github",
@@ -36,5 +38,6 @@
   "contact_submit": "Envoyer",
   "contact_confirmation": "Votre message a bien été envoyé, je reviendrais vers vous dès que possible",
   "continuous_improvement": "Amélioration continue",
-  "system_administration": "Administration système"
+  "system_administration": "Administration système",
+  "anti-bot-test": "Contrôle anti-robots"
 }

+ 1 - 14
nuxt.config.ts

@@ -4,12 +4,10 @@ export default defineNuxtConfig({
   ssr: true,
   target: 'static',
   title: 'C.V. Olivier Massot',
-
   devtools: {
     // @see https://github.com/nuxt/devtools
     enabled: true,
   },
-
   app: {
     head: {
       title: 'C.V. Olivier Massot',
@@ -25,15 +23,12 @@ export default defineNuxtConfig({
       }
     },
   },
-
   build: {
     transpile: ['vuetify'],
   },
-
   hooks: {
     'builder:watch': console.log,
   },
-
   modules: [
     async (_, nuxt) => {
       nuxt.hooks.hook('vite:extendConfig', (config) =>
@@ -103,17 +98,9 @@ export default defineNuxtConfig({
       strictMessage: false,
     },
     defaultLocale: 'fr',
+    //@ts-ignore
     detectBrowserLanguage: true,
   },
-  mail: {
-    message: {
-      to: 'olinox14@tuta.io',
-    },
-    smtp: {
-      host: "localhost",
-      port: 587,
-    },
-  },
   googleFonts: {
     families: {
       Inter: true,

+ 1 - 1
package.json

@@ -19,11 +19,11 @@
     "@nuxtjs/i18n": "^8.3.1",
     "@nuxtjs/mdc": "^0.7.1",
     "@nuxtjs/sitemap": "^5.2.0",
+    "altcha": "^1.0.0",
     "core-js": "^3.35.1",
     "highlight.js": "^11.9.0",
     "nuxt": "^3.11.2",
     "nuxt-lodash": "^2.5.3",
-    "nuxt-mail": "^5.0.1",
     "sass": "^1.70.0",
     "vite-plugin-vuetify": "^2.0.3",
     "vue-matomo": "^4.2.0",

File diff suppressed because it is too large
+ 284 - 346
yarn.lock


Some files were not shown because too many files changed in this diff