diff --git a/packages/client/hmi-client/DEVELOPMENT.md b/packages/client/hmi-client/DEVELOPMENT.md index 3ebd44a599..5eb95e53c2 100644 --- a/packages/client/hmi-client/DEVELOPMENT.md +++ b/packages/client/hmi-client/DEVELOPMENT.md @@ -88,9 +88,7 @@ Basic rules to write organised code. /> ``` -## `LOGGING & TOASTS` - -### LOGGING +## Logging & Toasts There is a new logging service in place that buffers log messages to be posted to the `/logs` hmi-server endpoint. The HMI server then echos out the message for kibana to eventually consume. @@ -129,7 +127,7 @@ toast.showToast( ); ``` -[## TERA-MATH-EDITOR](src/components/mathml/README.md) +## [TERA-MATH-EDITOR](src/components/mathml/README.md) Terrarium uses [mathlive](https://cortexjs.io/docs/mathlive/) & [mathjax 2.7.2](https://docs.mathjax.org/en/v2.7-latest/start.html) via a the `vue-mathjax-next` component to create a custom component: `tera-math-editor` diff --git a/packages/client/hmi-client/index.html b/packages/client/hmi-client/index.html index e830b32921..bcf8c8a6d5 100644 --- a/packages/client/hmi-client/index.html +++ b/packages/client/hmi-client/index.html @@ -8,9 +8,10 @@ Terarium + - + \ No newline at end of file diff --git a/packages/client/hmi-client/src/components/documents/Document.vue b/packages/client/hmi-client/src/components/documents/Document.vue index 24486864c7..01d93b6a9e 100644 --- a/packages/client/hmi-client/src/components/documents/Document.vue +++ b/packages/client/hmi-client/src/components/documents/Document.vue @@ -13,6 +13,7 @@ class="p-button-secondary p-button-sm" label="PDF" icon="pi pi-file" + :loading="!pdfLink" @click="documentView = DocumentView.PDF" :active="documentView === DocumentView.PDF" /> @@ -256,7 +257,11 @@ -
PDF Preview
+ @@ -276,6 +281,7 @@ import { ResultType, Tab } from '@/types/common'; import { getRelatedArtifacts } from '@/services/provenance'; import TeraShowMoreText from '@/components/widgets/tera-show-more-text.vue'; import ImportCodeButton from '@/components/widgets/import-code-button.vue'; +import PdfEmbed from '@/components/widgets/pdf-embed.vue'; import { Model } from '@/types/Model'; import { Dataset } from '@/types/Dataset'; import { ProvenanceType } from '@/types/Types'; @@ -424,7 +430,10 @@ const openPDF = () => { else if (doi.value) window.open(`https://doi.org/${doi.value}`); return; } - if (pdfLink.value) window.open(pdfLink.value); + if (pdfLink.value) { + const pdfWindow = window.open(pdfLink.value); + if (pdfWindow) pdfWindow.document.title = doi.value; + } }; watch(doi, async (currentValue, oldValue) => { diff --git a/packages/client/hmi-client/src/components/widgets/pdf-embed.vue b/packages/client/hmi-client/src/components/widgets/pdf-embed.vue new file mode 100644 index 0000000000..049821c45c --- /dev/null +++ b/packages/client/hmi-client/src/components/widgets/pdf-embed.vue @@ -0,0 +1,50 @@ + + +