diff --git a/nuxt/.env.dist b/nuxt/.env.dist index fb8ea11..c505f6f 100644 --- a/nuxt/.env.dist +++ b/nuxt/.env.dist @@ -1,5 +1,6 @@ BASE_URL="https://yufu-manifest.ddev.site" JSONAPI_PATH="/jsonapi" FILE_PATH="/sites/default/files" -ETHERPAD_URL="https://pisi.kompot.si/" +ETHERPAD_URL="https://pisi.kompot.si" +ETHERPAD_API_URL="https://yufu-manifest.ddev.site/etherpad-api" ETHERPAD_PREFIX="yufu-" diff --git a/nuxt/components/DodajPojem.vue b/nuxt/components/DodajPojem.vue index 134353f..7f555f1 100644 --- a/nuxt/components/DodajPojem.vue +++ b/nuxt/components/DodajPojem.vue @@ -1,12 +1,17 @@ diff --git a/nuxt/components/EtherpadTextarea.vue b/nuxt/components/EtherpadTextarea.vue index 5e54562..c19fcf3 100644 --- a/nuxt/components/EtherpadTextarea.vue +++ b/nuxt/components/EtherpadTextarea.vue @@ -14,7 +14,7 @@ const embed = ref(null) onMounted(() => { // Ce ni revisionId propertyja, se random generira. const uuid = props.revisionId ? props.revisionId : crypto.randomUUID() - const padUrl = `${etherpadUrl}p/${etherpadPrefix}${uuid}?showChat=false&showLineNumbers=false&toc=false` + const padUrl = `${etherpadUrl}/p/${etherpadPrefix}${uuid}?showChat=false&showLineNumbers=false&toc=false` embed.value.src = padUrl }) diff --git a/nuxt/components/PojemForm.vue b/nuxt/components/PojemForm.vue index 657a703..6e8c084 100644 --- a/nuxt/components/PojemForm.vue +++ b/nuxt/components/PojemForm.vue @@ -26,10 +26,6 @@ const oddajPredlog = data => { } const etherNalozen = ev => { - // @TODO DRY - const padUrl = `${etherpadUrl}p/${etherpadPrefix}${props.revisionId}?showChat=false&showLineNumbers=false&toc=false` - // Izprazni pad! - console.log('etherpad nalozen!') window.location.hash = props.revisionId } diff --git a/nuxt/nuxt.config.js b/nuxt/nuxt.config.js index 32c73f5..0e16821 100644 --- a/nuxt/nuxt.config.js +++ b/nuxt/nuxt.config.js @@ -36,6 +36,7 @@ export default defineNuxtConfig({ baseUrl: process.env.BASE_URL, jsonapiPath: process.env.JSONAPI_PATH, etherpadUrl: process.env.ETHERPAD_URL, + etherpadApiUrl: process.env.ETHERPAD_API_URL, etherpadPrefix: process.env.ETHERPAD_PREFIX } }, diff --git a/web/modules/custom/etherpad_api/src/Client.php b/web/modules/custom/etherpad_api/src/Client.php index 8fc4c4a..1f54f02 100644 --- a/web/modules/custom/etherpad_api/src/Client.php +++ b/web/modules/custom/etherpad_api/src/Client.php @@ -46,14 +46,14 @@ class Client { } public function checkToken() { - return $this->request('get', '/checkToken'); + return $this->request('get', 'checkToken'); } /** * Method description. */ public function request($method, $url) { - $uri = "{$this->baseUrl}/" . self::API_VERSION . $url; + $uri = "{$this->baseUrl}/" . self::API_VERSION . '/' . $url; if (str_contains($uri, '?')) { $uri .= "&apikey={$this->apiKey}";