Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ export {default as Topology} from "./topology/Topology.vue";
export {default as Status} from "./misc/Status.vue";
export {default as TaskIcon} from "./misc/TaskIcon.vue";
export {default as Collapsible} from "./misc/Collapsible.vue";
export {default as CollapsibleV2} from "./plugins_v2/CollapsibleV2.vue";
export {default as SubgroupCard} from "./misc/SubgroupCard.vue";
export {default as ElementCard} from "./misc/ElementCard.vue";

// plugins
export {default as SchemaToHtml} from "./plugins/SchemaToHtml.vue";
export {default as SchemaToHtmlV2} from "./plugins_v2/SchemaToHtmlV2.vue";
export {default as PluginIndex} from "./plugins/PluginIndex.vue";

// content
Expand Down
132 changes: 132 additions & 0 deletions src/components/misc/ElementCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<template>
<a :href="hrefWithDefault">
<div class="element-card" :class="{'is-active': isActive}">
<div class="top-row">
<h6 class="text-capitalize">
{{ text }}
</h6>
<ChevronRight />
</div>
<div v-if="title">
<slot name="markdown" :content="title.replace(/ *:(?![ /])/g, ': ')" />
</div>
<div class="plugin-info">
<code class="plugin-class">{{ pluginClass }}</code>
</div>
</div>
</a>
</template>
<script setup lang="ts">
import {slugify} from "../../utils/url";
import {computed} from "vue";
import ChevronRight from "vue-material-design-icons/ChevronRight.vue";

const props = defineProps<{
iconB64Svg: string,
text: string,
routePath: string
pluginClass: string
href?: string | undefined
isActive?: boolean
title?: string
}>();

const hrefWithDefault = computed(() => props.href === undefined
? `${props.routePath}/${slugify(props.text)}`
: props.href);
</script>

<style scoped lang="scss">
@use "../../scss/variables" as variables;

a {
display: block;
height: 100%;
text-decoration: none;
}

.element-card {
width: 100%;
height: 100%;
border-radius: 12px;
border: 1px solid var(--kestra-io-token-color-border-secondary);
padding: 1rem;
background: var(--kestra-io-token-color-background-secondary);
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto auto 1fr;
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
transition: 0.4s ease-out;

&:hover {
border-color: var(--kestra-io-token-color-border-active);
box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.25);
transform: scale(1.025);
}

&.is-active {
border-color: variables.$primary;
}

.top-row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: baseline;
min-width: 0;
}

:deep(svg) {
font-size: 1rem;
color: variables.$purple-36 !important;
}

h6 {
color: variables.$white;
font-size: 1rem;
font-weight: 700;
margin: 0;
padding-top: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1 1 auto;
min-width: 0;
}

.plugin-info {
margin-top: 1rem;
min-width: 50px;
max-width: fit-content;
max-height: fit-content;
background: variables.$black-2;
border-radius: 4px;
padding: 0.5rem;
font-size: 0.75rem;
color: var(--ks-content-secondary);
border: 1px solid variables.$black-3;

.plugin-class {
color: variables.$purple-50 !important;
font-size: 12px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: block;
}
}

:deep(p) {
color: var(--ks-content-secondary);
font-size: 12px !important;
line-height: 1rem;
margin: 0;
margin-top: 0.5rem;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
</style>
178 changes: 178 additions & 0 deletions src/components/misc/SubgroupCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<template>
<a :href="hrefWithDefault">
<div class="plugin" :class="{'is-active': isActive}">
<div class="top-row">
<div class="icon-content">
<img :src="iconB64Svg" :alt="`${text} icon`">
</div>
<div class="text-content">
<h6>{{ text }}</h6>
<p v-if="description" class="description">{{ description }}</p>
</div>
</div>
<div class="footer">
<hr>
<div class="bottom-row">
<div class="left">
<p v-if="props.totalCount">{{ props.totalCount ?? 0 }} <span>Tasks</span></p>
<p v-if="props.blueprintsCount">{{ props.blueprintsCount ?? 0 }} <span>Blueprints</span></p>
</div>
<ChevronRight />
</div>
</div>
</div>
</a>
</template>
<script setup lang="ts">
import {computed} from "vue";
import {slugify} from "../../utils/url";
import ChevronRight from "vue-material-design-icons/ChevronRight.vue";

const props = withDefaults(defineProps<{
iconB64Svg: string,
text: string,
routePath: string
totalCount: number,
description?: string,
href?: string | undefined
isActive?: boolean,
blueprintsCount?: number
}>(), {
totalCount: 0,
description: "",
href: undefined,
isActive: false,
blueprintsCount: 0,
});

const hrefWithDefault = computed(() => props.href === undefined
? `${props.routePath}/${slugify(props.text)}`
: props.href);

</script>

<style scoped lang="scss">
@use "../../scss/variables" as variables;
@use "../../scss/color-palette" as color-palette;

.plugin {
width: 100%;
height: 152px;
border-radius: 12px;
border: 1px solid var(--kestra-io-token-color-border-secondary);
padding: 1rem;
background: var(--kestra-io-token-color-background-secondary);
display: flex;
flex-direction: column;
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
transition: 0.4s ease-out;

&:hover {
border-color: var(--kestra-io-token-color-border-active);
box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.25);
transform: scale(1.025);
}

&.is-active {
border-color: variables.$primary;
}

.top-row {
display: flex;
flex-direction: row;
gap: 1rem;
align-items: flex-start;
margin-bottom: 1rem;
}

.icon-content {
width: 60px;
height: 60px;
background: variables.$gray-100;
border-radius: 8px;
border: 1px solid variables.$white-2;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;

img {
width: 45px;
height: 45px;
}
}

.text-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
overflow: hidden;

.description {
color: var(--ks-content-secondary);
font-size: 12px !important;
line-height: 1rem;
margin: 0;
overflow: hidden;
display: -webkit-box;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}

h6 {
color: variables.$white;
font-size: 1rem;
font-weight: 700;
margin: 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
padding-top: 0;
}

hr {
border: 1px solid var(--ks-border-primary);
margin: 0;
}

.footer {
margin-top: auto;
display: flex;
flex-direction: column;
}

.bottom-row {
display: flex;
justify-content: space-between;
align-items: center;
color: color-palette.$base-gray-300;
height: 45px;

.left {
display: flex;
gap: 1rem;
align-items: center;

p {
margin: 0;
font-weight: 700;
font-size: 14px !important;
}

span {
color: color-palette.$base-gray-300;
font-weight: normal;
font-size: 12px;
}
}

:deep(svg) {
font-size: 1rem;
color: variables.$purple-36;
}
}
}
</style>
15 changes: 2 additions & 13 deletions src/components/plugins/CollapsibleProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
extractTypeInfo,
className,
type JSONProperty,
aggregateAllOf
aggregateAllOf,
isDynamic
} from "../../utils/schemaUtils";
import ChevronDown from "vue-material-design-icons/ChevronDown.vue";
import Collapsible from "../misc/Collapsible.vue";
Expand Down Expand Up @@ -104,18 +105,6 @@
}
);

const isDynamic = (property: JSONProperty): boolean => {
if (property["$dynamic"] === true) {
return true;
}

if (property["$dynamic"] === false) {
return false;
}

return property.anyOf?.some(prop => prop["$dynamic"] === true) ?? false;
};

function sortedAndAggregated(schema: Record<string, JSONProperty>): Record<string, JSONProperty> {
const requiredKeys = [];
const nonRequiredKeys = [];
Expand Down
Loading