mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-26 05:00:31 -05:00
Compare commits
1 Commits
run-develo
...
fix/plugin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d61bfb61b |
@@ -1,49 +1,83 @@
|
||||
<template>
|
||||
<div class="d-flex full-height">
|
||||
<div v-if="$slots.menu" :style="{flex: collapsed ? '0 1 0px' : '0 0 306px'}" :class="{collapsed}" class="sidebar d-flex flex-column gap-3">
|
||||
<!--
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
<el-button @click="collapsed = !collapsed">
|
||||
<chevron-right v-if="collapsed" />
|
||||
<chevron-left v-else />
|
||||
</el-button>
|
||||
<span class="toggle-btn text-body-tertiary">{{ $t((collapsed ? 'open' : 'close') + ' sidebar').toUpperCase() }}</span>
|
||||
</div>
|
||||
-->
|
||||
<div class="d-flex full-height docs-layout-container">
|
||||
<div
|
||||
v-if="mobileMenuOpen && $slots.menu"
|
||||
class="mobile-backdrop"
|
||||
@click="mobileMenuOpen = false"
|
||||
/>
|
||||
|
||||
<div v-if="$slots.menu" :style="{flex: collapsed ? '0 1 0px' : '0 0 306px'}" :class="[{collapsed}, {'mobile-open': mobileMenuOpen}]" class="sidebar d-flex flex-column gap-3">
|
||||
<el-button
|
||||
v-if="isPluginsRoute"
|
||||
:class="['mobile-close-toggle']"
|
||||
@click="mobileMenuOpen = false"
|
||||
:icon="Close"
|
||||
:aria-label="'Close menu'"
|
||||
link
|
||||
/>
|
||||
<div v-if="!collapsed" class="d-flex flex-column gap-3">
|
||||
<slot name="menu" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="container main-container">
|
||||
<div class="content">
|
||||
<slot name="content" />
|
||||
<div class="main-content-wrapper">
|
||||
<div v-if="$slots['secondary-header']" class="secondary-header">
|
||||
<el-button
|
||||
v-if="$slots.menu && isPluginsRoute"
|
||||
:class="['mobile-menu-toggle']"
|
||||
@click="mobileMenuOpen = !mobileMenuOpen"
|
||||
:icon="Menu"
|
||||
:aria-label="'Open menu'"
|
||||
link
|
||||
/>
|
||||
<slot name="secondary-header" />
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<div class="content">
|
||||
<slot name="content" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, computed} from "vue"
|
||||
import {ref, computed, watch} from "vue"
|
||||
import {useRoute} from "vue-router";
|
||||
import {useScrollMemory} from "../../composables/useScrollMemory";
|
||||
import Menu from "vue-material-design-icons/Menu.vue";
|
||||
import Close from "vue-material-design-icons/Close.vue";
|
||||
|
||||
const collapsed = ref(false);
|
||||
const mobileMenuOpen = ref(false);
|
||||
const route = useRoute();
|
||||
const scrollKey = computed(() => `docs:${route.fullPath}`);
|
||||
|
||||
const isPluginsRoute = computed(() => {
|
||||
return route.path.startsWith("/main/plugins") ||
|
||||
(typeof route.name === "string" && route.name.startsWith("plugins/"));
|
||||
});
|
||||
|
||||
useScrollMemory(scrollKey, undefined, true);
|
||||
|
||||
watch(() => route.fullPath, () => {
|
||||
mobileMenuOpen.value = false;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "@kestra-io/ui-libs/src/scss/variables";
|
||||
|
||||
.docs-layout-container {
|
||||
height: calc(100vh - 80px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background: var(--ks-background-card);
|
||||
padding: 2rem;
|
||||
height: calc(100vh - 80px);
|
||||
top: 80px;
|
||||
position: sticky;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
|
||||
&.collapsed {
|
||||
@@ -61,15 +95,42 @@
|
||||
}
|
||||
}
|
||||
|
||||
.main-content-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.secondary-header {
|
||||
background-color: var(--ks-background-panel);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
min-height: 64px;
|
||||
flex-shrink: 0;
|
||||
|
||||
.mobile-menu-toggle {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.main-container {
|
||||
max-width: 100%;
|
||||
flex: 1;
|
||||
background-color: var(--ks-background-panel);
|
||||
position: relative;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: $spacer;
|
||||
margin: 0;
|
||||
padding: 1rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
|
||||
h1 {
|
||||
margin-bottom: $spacer;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
#{--bs-link-color}: #8405FF;
|
||||
@@ -230,4 +291,226 @@
|
||||
padding-bottom: 1px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-menu-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-close-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-backdrop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.docs-layout-container {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.main-content-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.secondary-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
|
||||
.mobile-menu-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
padding-left: 1rem;
|
||||
flex-shrink: 0;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
:deep(.material-design-icon) {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-close-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 1001;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
:deep(.material-design-icon) {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-backdrop {
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 999;
|
||||
animation: fadeIn 0.3s ease;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
left: -100%;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
width: calc(100vw - 44px);
|
||||
max-width: 100vw;
|
||||
z-index: 1000;
|
||||
transition: left 0.3s ease-in-out;
|
||||
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
||||
padding: 1rem;
|
||||
padding-top: 3.5rem;
|
||||
padding-right: 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
&.mobile-open {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
> div {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 0;
|
||||
padding: 0.75rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) and (max-width: 767px) {
|
||||
.sidebar {
|
||||
width: 90vw;
|
||||
max-width: 450px;
|
||||
top: 65px;
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
.mobile-menu-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-close-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-backdrop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
display: flex !important;
|
||||
position: sticky;
|
||||
left: auto;
|
||||
width: auto;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 0;
|
||||
padding: 1rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
|
||||
h1 {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
.mobile-menu-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-close-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-backdrop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
display: flex !important;
|
||||
position: sticky;
|
||||
left: auto;
|
||||
width: auto;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 0;
|
||||
padding: 1.25rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
|
||||
h1 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(xl) {
|
||||
.content {
|
||||
margin: 0;
|
||||
padding: 1.5rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
|
||||
h1 {
|
||||
margin-bottom: $spacer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,54 +4,55 @@
|
||||
<PluginHome v-if="filteredPlugins" :plugins="filteredPlugins" />
|
||||
</template>
|
||||
<DocsLayout v-else>
|
||||
<template #secondary-header>
|
||||
<div class="plugin-secondary-header">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<TaskIcon
|
||||
class="plugin-icon"
|
||||
:cls="pluginType"
|
||||
onlyIcon
|
||||
:icons="pluginsStore.icons"
|
||||
/>
|
||||
<h4 class="mb-0 plugin-name">
|
||||
{{ pluginName }}
|
||||
</h4>
|
||||
<el-button
|
||||
v-if="releaseNotesUrl"
|
||||
size="small"
|
||||
class="release-notes-btn"
|
||||
:icon="GitHub"
|
||||
@click="openReleaseNotes"
|
||||
>
|
||||
{{ $t('plugins.release') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="versions" v-if="(pluginsStore.versions?.length ?? 0) > 0">
|
||||
<el-select
|
||||
v-model="version"
|
||||
placeholder="Version"
|
||||
size="small"
|
||||
:disabled="(pluginsStore.versions?.length ?? 0) === 1"
|
||||
@change="selectVersion(version)"
|
||||
>
|
||||
<template #label="{value}">
|
||||
<span>Version: </span>
|
||||
<span style="font-weight: bold">{{ value }}</span>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in pluginsStore.versions"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #menu>
|
||||
<Toc @router-change="onRouterChange" v-if="pluginsStore.plugins" :plugins="pluginsStore.plugins.filter(p => !p.subGroup)" />
|
||||
</template>
|
||||
<template #content>
|
||||
<div class="plugin-doc">
|
||||
<div class="d-flex align-items-center justify-content-between gap-3">
|
||||
<div class="d-flex gap-3 mb-3 align-items-center">
|
||||
<TaskIcon
|
||||
class="plugin-icon"
|
||||
:cls="pluginType"
|
||||
onlyIcon
|
||||
:icons="pluginsStore.icons"
|
||||
/>
|
||||
<h4 class="mb-0">
|
||||
{{ pluginName }}
|
||||
</h4>
|
||||
<el-button
|
||||
v-if="releaseNotesUrl"
|
||||
size="small"
|
||||
class="release-notes-btn"
|
||||
:icon="GitHub"
|
||||
@click="openReleaseNotes"
|
||||
>
|
||||
{{ $t('plugins.release') }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 versions" v-if="(pluginsStore.versions?.length ?? 0) > 0">
|
||||
<el-select
|
||||
v-model="version"
|
||||
placeholder="Version"
|
||||
size="small"
|
||||
:disabled="(pluginsStore.versions?.length ?? 0) === 1"
|
||||
@change="selectVersion(version)"
|
||||
>
|
||||
<template #label="{value}">
|
||||
<span>Version: </span>
|
||||
<span style="font-weight: bold">{{ value }}</span>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in pluginsStore.versions"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<Suspense v-loading="isLoading">
|
||||
<SchemaToHtml
|
||||
class="plugin-schema"
|
||||
@@ -219,13 +220,89 @@
|
||||
<style scoped lang="scss">
|
||||
@import "../../styles/components/plugin-doc";
|
||||
|
||||
.plugin-secondary-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.5rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
flex: 1;
|
||||
min-height: 64px;
|
||||
|
||||
.plugin-icon {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.plugin-name {
|
||||
font-size: 1.5rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.release-notes-btn {
|
||||
background-color: var(--ks-background-info);
|
||||
color: var(--ks-content-info);
|
||||
border: 1px solid var(--ks-border-info);
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
white-space: nowrap;
|
||||
|
||||
:deep(.material-design-icon) {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.versions {
|
||||
min-width: 200px;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
:deep(.main-container) {
|
||||
background: var(--ks-background-panel);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.plugin-doc {
|
||||
padding: 1rem;
|
||||
background-color: var(--ks-background-panel);
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.plugin-secondary-header {
|
||||
flex-wrap: wrap;
|
||||
padding: 0.5rem;
|
||||
gap: 0.5rem;
|
||||
border-bottom: 1px solid var(--ks-border-primary);
|
||||
|
||||
.plugin-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
.plugin-name {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.release-notes-btn {
|
||||
padding: 6px 12px;
|
||||
font-size: 0.875rem;
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.versions {
|
||||
width: 100%;
|
||||
min-width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.plugin-doc {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
padding: 1rem ;
|
||||
min-height: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import {isEntryAPluginElementPredicate, TaskIcon} from "@kestra-io/ui-libs";
|
||||
import {mapStores} from "pinia";
|
||||
import {usePluginsStore} from "../../stores/plugins";
|
||||
@@ -190,23 +190,39 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@import "@kestra-io/ui-libs/src/scss/variables";
|
||||
|
||||
.plugins-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
.search {
|
||||
flex-shrink: 0;
|
||||
background-color: var(--ks-background-panel);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.el-collapse {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
&.enhance-readability {
|
||||
padding: 1.5rem;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.el-collapse-item__header {
|
||||
font-size: 0.875rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding-inline-start: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: var(--font-size-xs);
|
||||
margin-left: .5rem;
|
||||
font-size: 0.6875rem;
|
||||
margin-left: .25rem;
|
||||
}
|
||||
|
||||
h6,
|
||||
@@ -217,26 +233,26 @@
|
||||
|
||||
.toc-h3 {
|
||||
.icon {
|
||||
width: var(--font-size-sm);
|
||||
height: var(--font-size-sm);
|
||||
width: 0.875rem;
|
||||
height: 0.875rem;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.toc-h4 {
|
||||
margin-left: .5rem;
|
||||
margin-left: .25rem;
|
||||
|
||||
h6 {
|
||||
font-size: var(--font-size-sm);
|
||||
margin-bottom: .5rem;
|
||||
font-size: 0.6875rem;
|
||||
margin-bottom: .25rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: .5rem;
|
||||
margin-bottom: .25rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,4 +261,92 @@
|
||||
.selected {
|
||||
color: var(--ks-content-link);
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.plugins-list {
|
||||
.search {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.el-collapse {
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
.plugins-list {
|
||||
.el-collapse-item__header {
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
ul {
|
||||
font-size: 0.75rem;
|
||||
margin-left: .375rem;
|
||||
}
|
||||
|
||||
.toc-h3 {
|
||||
.icon {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.toc-h4 {
|
||||
margin-left: .375rem;
|
||||
|
||||
h6 {
|
||||
font-size: 0.75rem;
|
||||
margin-bottom: .375rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: .375rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
.plugins-list {
|
||||
.el-collapse-item__header {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
ul {
|
||||
font-size: var(--font-size-xs);
|
||||
margin-left: .5rem;
|
||||
}
|
||||
|
||||
.toc-h3 {
|
||||
.icon {
|
||||
width: var(--font-size-sm);
|
||||
height: var(--font-size-sm);
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.toc-h4 {
|
||||
margin-left: .5rem;
|
||||
|
||||
h6 {
|
||||
font-size: var(--font-size-sm);
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user