Skip to content

Commit 856146b

Browse files
Pablo Carmonastarpit
authored andcommitted
add new hello layout page with asciinema thumbnails and profiles listings
1 parent 9156ce3 commit 856146b

File tree

6 files changed

+89
-5
lines changed

6 files changed

+89
-5
lines changed

plugins/plugin-client-default/notebooks/hello.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,33 @@ layout:
66
position: default
77
2:
88
position: default
9+
3:
10+
position: default
911
---
1012

1113
<img alt="CodeFlare Icon" src="@kui-shell/client/icons/svg/codeflare.svg" width="200" height="200" align="left" />
1214
CodeFlare is a framework to simplify the integration, scaling and acceleration of complex multi-step analytics and machine learning pipelines on the cloud.
1315

16+
From your terminal, try running `codeflare` to be guided through running jobs against the Cloud.
17+
1418
---
1519

16-
## Next Steps
20+
```shell
21+
---
22+
execute: now
23+
outputOnly: true
24+
---
25+
codeflare gallery
26+
```
1727

18-
From your terminal, try running `codeflare` to be guided through running jobs against the Cloud.
28+
---
29+
30+
## Available Appliances
31+
32+
```shell
33+
---
34+
execute: now
35+
outputOnly: true
36+
---
37+
codeflare get profile
38+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2022 The Kubernetes Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import React from "react"
18+
import { Gallery, GalleryItem } from "@patternfly/react-core"
19+
20+
export default class CodeFlareGallery extends React.PureComponent {
21+
public render() {
22+
return (
23+
<Gallery className="hello__use-cases" hasGutter>
24+
<GalleryItem>
25+
<a href="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ" target="_blank">
26+
<img src="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ.svg" />
27+
</a>
28+
</GalleryItem>
29+
<GalleryItem>
30+
<a href="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ" target="_blank">
31+
<img src="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ.svg" />
32+
</a>
33+
</GalleryItem>
34+
<GalleryItem>
35+
<a href="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ" target="_blank">
36+
<img src="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ.svg" />
37+
</a>
38+
</GalleryItem>
39+
<GalleryItem>
40+
<a href="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ" target="_blank">
41+
<img src="https://asciinema.org/a/kYps2jg978lUwvyLfQXKrBsUZ.svg" />
42+
</a>
43+
</GalleryItem>
44+
</Gallery>
45+
)
46+
}
47+
}

plugins/plugin-codeflare/src/controller/hello.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ import { Arguments } from "@kui-shell/core"
1818

1919
import "../../web/scss/components/Hello/_index.scss"
2020

21+
export async function gallery() {
22+
const React = await import("react")
23+
const CodeFlareGallery = await import("../components/CodeFlareGallery")
24+
return {
25+
react: React.createElement(CodeFlareGallery.default, {}),
26+
}
27+
}
28+
2129
export default function hello(args: Arguments) {
2230
return args.REPL.qexec("commentary --readonly -f /kui/client/hello.md")
2331
}

plugins/plugin-codeflare/src/controller/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function registerCodeflareCommands(registrar: Registrar) {
5050

5151
registrar.listen("/codeflare/rename/profile", (args) => import("./profile/rename").then((_) => _.default(args)))
5252

53-
registrar.listen("/codeflare/get/profile", (args) => import("./profile/get").then((_) => _.default(args)), {
53+
registrar.listen("/codeflare/get/profile", () => import("./profile/get").then((_) => _.default()), {
5454
needsUI: true,
5555
})
5656
registrar.listen("/codeflare/get/run", (args) => import("./run/get").then((_) => _.default(args)), {
@@ -66,6 +66,10 @@ export default function registerCodeflareCommands(registrar: Registrar) {
6666
height: 600,
6767
})
6868

69+
registrar.listen("/codeflare/gallery", () => import("./hello").then((_) => _.gallery()), {
70+
outputOnly: true,
71+
})
72+
6973
/**
7074
* Register a catch-all command handler: any `/^codeflare/` command
7175
* lines, send to madwizard.

plugins/plugin-codeflare/src/controller/profile/get.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616

1717
import React from "react"
1818
import { Profiles } from "madwizard"
19-
import { Arguments } from "@kui-shell/core"
2019
import { Grid, GridItem, Tile } from "@patternfly/react-core"
2120

2221
// eslint-disable-next-line @typescript-eslint/no-unused-vars
23-
export default async function getProfiles(args: Arguments) {
22+
export default async function getProfiles() {
2423
const profiles = await Profiles.list({})
2524

2625
return {

plugins/plugin-codeflare/web/scss/components/Hello/_index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
grid-template-columns: 1fr;
2626
grid-template-areas: "T1" "T2";
2727
}
28+
29+
@include Split(3) {
30+
grid-template-rows: 1fr 1fr 1fr;
31+
grid-template-columns: 1fr;
32+
grid-template-areas: "T1" "T2" "T3";
33+
}
2834
}
2935
}
3036

0 commit comments

Comments
 (0)