diff --git a/NUXT/layouts/default.vue b/NUXT/layouts/default.vue index d696dd2..ea72dac 100644 --- a/NUXT/layouts/default.vue +++ b/NUXT/layouts/default.vue @@ -88,7 +88,8 @@ ], dropdownMenu: [ { title: "Settings", link: "/settings" }, - { title: "About", link: "/about" } + { title: "About", link: "/about" }, + { title: "Logs", link: "/logs" } ] }), mounted() { diff --git a/NUXT/pages/logs.vue b/NUXT/pages/logs.vue new file mode 100644 index 0000000..2d4369f --- /dev/null +++ b/NUXT/pages/logs.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/NUXT/plugins/youtube.js b/NUXT/plugins/youtube.js index 3ac7fdb..7289e4a 100644 --- a/NUXT/plugins/youtube.js +++ b/NUXT/plugins/youtube.js @@ -1,18 +1,32 @@ +//--- Modules/Imports ---// import { Http } from '@capacitor-community/http'; -const module = { - async autoComplete(text, callback) { +//--- Logger Function ---// +function logger(func, data) { + module.logs.push({ + name: func, + time: Date.now(), + data: data + }) +} - const response = await Http.request({ +const module = { + logs: new Array(), + + //--- Get YouTube's Search Auto Complete ---// + async autoComplete(text, callback) { + const res = await Http.request({ method: 'GET', url: 'https://suggestqueries-clients6.youtube.com/complete/search', params: { client: 'youtube', q: text } }); - callback(response) - + logger("autoComplete", res); + callback(res); } } +//--- Start ---// export default ({ app }, inject) => { inject('youtube', module) } +logger("Initialize","Program Started");