From a7d4edb4ad03bca3fdcdb369c2865b9082c3c2b5 Mon Sep 17 00:00:00 2001 From: Peter Morton Date: Wed, 19 Oct 2022 00:07:36 -0500 Subject: [PATCH] Added router --- .env.production | 2 +- index.html | 2 +- package-lock.json | 35 ++++++++++++++++++++++- package.json | 5 ++-- src/App.vue | 46 ++++-------------------------- src/ReferenceID.vue | 42 +++++++++++++++++++++++++++ src/components/ContactsSummary.vue | 2 +- src/main.js | 25 +++++++++++++--- src/style.css | 1 - src/views/About.vue | 5 ++++ src/views/Home.vue | 5 ++++ 11 files changed, 118 insertions(+), 52 deletions(-) create mode 100644 src/ReferenceID.vue create mode 100644 src/views/About.vue create mode 100644 src/views/Home.vue diff --git a/.env.production b/.env.production index 07eff93..34c2f85 100644 --- a/.env.production +++ b/.env.production @@ -1 +1 @@ -VITE_EO_SERVICES_URL=https://eo-services.mortons.site +VITE_EO_SERVICES_URL=https://eo-services.mortons.site/api diff --git a/index.html b/index.html index 795e4fb..ca49f57 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Vite + Vue + Engagement Orchestration Services
diff --git a/package-lock.json b/package-lock.json index a3c486d..23ca56d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,8 @@ "name": "vite-project", "version": "0.0.0", "dependencies": { - "vue": "^3.2.37" + "vue": "^3.2.37", + "vue-router": "^4.1.5" }, "devDependencies": { "@vitejs/plugin-vue": "^3.1.0", @@ -117,6 +118,11 @@ "@vue/shared": "3.2.41" } }, + "node_modules/@vue/devtools-api": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.4.5.tgz", + "integrity": "sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==" + }, "node_modules/@vue/reactivity": { "version": "3.2.41", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.41.tgz", @@ -754,6 +760,20 @@ "@vue/server-renderer": "3.2.41", "@vue/shared": "3.2.41" } + }, + "node_modules/vue-router": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.5.tgz", + "integrity": "sha512-IsvoF5D2GQ/EGTs/Th4NQms9gd2NSqV+yylxIyp/OYp8xOwxmU8Kj/74E9DTSYAyH5LX7idVUngN3JSj1X4xcQ==", + "dependencies": { + "@vue/devtools-api": "^6.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } } }, "dependencies": { @@ -829,6 +849,11 @@ "@vue/shared": "3.2.41" } }, + "@vue/devtools-api": { + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.4.5.tgz", + "integrity": "sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==" + }, "@vue/reactivity": { "version": "3.2.41", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.41.tgz", @@ -1192,6 +1217,14 @@ "@vue/server-renderer": "3.2.41", "@vue/shared": "3.2.41" } + }, + "vue-router": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.5.tgz", + "integrity": "sha512-IsvoF5D2GQ/EGTs/Th4NQms9gd2NSqV+yylxIyp/OYp8xOwxmU8Kj/74E9DTSYAyH5LX7idVUngN3JSj1X4xcQ==", + "requires": { + "@vue/devtools-api": "^6.1.4" + } } } } diff --git a/package.json b/package.json index 32025e3..36bc710 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,11 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.2.37" + "vue": "^3.2.37", + "vue-router": "^4.1.5" }, "devDependencies": { "@vitejs/plugin-vue": "^3.1.0", "vite": "^3.1.0" } -} \ No newline at end of file +} diff --git a/src/App.vue b/src/App.vue index f44a660..a06181f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,42 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/src/ReferenceID.vue b/src/ReferenceID.vue new file mode 100644 index 0000000..5f6c561 --- /dev/null +++ b/src/ReferenceID.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/components/ContactsSummary.vue b/src/components/ContactsSummary.vue index 984aec2..b321c62 100644 --- a/src/components/ContactsSummary.vue +++ b/src/components/ContactsSummary.vue @@ -26,7 +26,7 @@ defineProps(["summary"]);
-
{{ (summary.totalInboundActiveSeconds / 6).toFixed(2) }}
+
{{ (summary.totalInboundActiveSeconds / 60).toFixed(2) }}
Total [INBOUND] Active Time (minutes)
diff --git a/src/main.js b/src/main.js index 2425c0f..0ab8880 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,22 @@ -import { createApp } from 'vue' -import './style.css' -import App from './App.vue' +import { createApp } from "vue"; +import { createRouter, createWebHashHistory } from "vue-router"; -createApp(App).mount('#app') +import "./style.css"; +import App from "./App.vue"; +import Home from "./views/Home.vue"; +import About from "./views/About.vue"; +import ReferenceID from "./ReferenceID.vue"; + +const routes = [ + { path: "/", component: Home }, + { path: "/about", component: About }, + { path: "/referenceId/", component: ReferenceID }, +]; + +const router = createRouter({ + // 4. Provide the history implementation to use. We are using the hash history for simplicity here. + history: createWebHashHistory(), + routes, // short for `routes: routes` +}); + +createApp(App).use(router).mount("#app"); diff --git a/src/style.css b/src/style.css index 191f727..819859a 100644 --- a/src/style.css +++ b/src/style.css @@ -74,7 +74,6 @@ button { min-width: 0px; font-size: 12px; padding: 0 6px !important; - margin: 0; font-family: "OpenSans", Arial, sans-serif; text-align: center; background-repeat: no-repeat; diff --git a/src/views/About.vue b/src/views/About.vue new file mode 100644 index 0000000..f96be2d --- /dev/null +++ b/src/views/About.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue new file mode 100644 index 0000000..f64dc4f --- /dev/null +++ b/src/views/Home.vue @@ -0,0 +1,5 @@ + \ No newline at end of file