-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jupyter lab dashboard link #1982
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add link to Jupyter Lab from the Dashboard (if Jupyter Lab is installed). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright (C) NIWA & British Crown (Met Office) & Contributors. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* SVG icons for use in the Cylc UI: | ||
* - Centralise icons for use throughout multiple components. | ||
* - Define custom icons. | ||
* - Reformat icons for other source. | ||
* | ||
* Note, the `<v-icon>` component expects icons in the MDI format i.e.: | ||
* - A string representing an SVG path. | ||
* - Consisting of a bezier curve (e.g. `M 0,0 C 1,1 Z`). | ||
* - That fits within a 24px box. | ||
*/ | ||
|
||
import { Jupyter } from 'simple-icons' | ||
|
||
export const jupyterLogo = Jupyter.svg.replace(/.*d="(.*)".*/, '$1') |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |
You are not running Cylc UI via Cylc Hub. | ||
</v-tooltip> | ||
</div> | ||
<div> | ||
<v-list-item | ||
id="jupyter-lab-button" | ||
:disabled="!user.extensions?.lab" | ||
:href="user.extensions?.lab" | ||
target="_blank" | ||
> | ||
<template v-slot:prepend> | ||
<v-icon size="1.6em">{{ $options.icons.jupyterLogo }}</v-icon> | ||
</template> | ||
<v-list-item-title class="text-h6 font-weight-light"> | ||
Jupyter Lab | ||
</v-list-item-title> | ||
<v-list-item-subtitle> | ||
Open Jupyter Lab in a new browser tab. | ||
</v-list-item-subtitle> | ||
</v-list-item> | ||
<v-tooltip :disabled="user.extensions?.lab"> | ||
Jupyter Lab is not installed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no way of telling without modifying the UIS PR providing this data whether There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The easy way is to bundle this with an appropriate UIS version so that this situation never occurs. |
||
</v-tooltip> | ||
</div> | ||
</v-list> | ||
</v-col> | ||
<v-col md="6" lg="6"> | ||
|
@@ -141,6 +162,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |
<script> | ||
import { mapState, mapGetters } from 'vuex' | ||
import { mdiBook, mdiBookMultiple, mdiBookOpenVariant, mdiCog, mdiHubspot, mdiTable } from '@mdi/js' | ||
import { jupyterLogo } from '@/utils/icons' | ||
import subscriptionComponentMixin from '@/mixins/subscriptionComponent' | ||
import { createUrl } from '@/utils/urls' | ||
import { WorkflowState, WorkflowStateOrder } from '@/model/WorkflowState.model' | ||
|
@@ -250,6 +272,7 @@ export default { | |
quickstart: mdiBook, | ||
workflow: mdiBookOpenVariant, | ||
documentation: mdiBookMultiple, | ||
jupyterLogo, | ||
}, | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️