Skip to content

Commit f01116d

Browse files
committed
feat: s3 browsing guidebook
This PR restores the hamburger sidebar, so that we can show more than one guidebook (dashboard, browse s3, etc.) It also reverts the `productTitle` back to "CodeFlare", from "CodeFlare Dashboard", as the "Dashboard part is now in the tab title.
1 parent 032022f commit f01116d

File tree

11 files changed

+205
-113
lines changed

11 files changed

+205
-113
lines changed

package-lock.json

Lines changed: 91 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@
8383
"printWidth": 120
8484
},
8585
"devDependencies": {
86-
"@kui-shell/builder": "11.5.0-dev-20220623-110659",
87-
"@kui-shell/proxy": "11.5.0-dev-20220623-110659",
88-
"@kui-shell/react": "11.5.0-dev-20220623-110659",
89-
"@kui-shell/webpack": "11.5.0-dev-20220623-110659",
86+
"@kui-shell/builder": "11.5.0-dev-20220628-111118",
87+
"@kui-shell/proxy": "11.5.0-dev-20220628-111118",
88+
"@kui-shell/react": "11.5.0-dev-20220628-111118",
89+
"@kui-shell/webpack": "11.5.0-dev-20220628-111118",
9090
"@playwright/test": "^1.22.2",
9191
"@types/debug": "^4.1.7",
9292
"@types/node": "14.11.8",
@@ -108,16 +108,16 @@
108108
},
109109
"dependencies": {
110110
"@kui-shell/client": "file:./plugins/plugin-client-default",
111-
"@kui-shell/core": "11.5.0-dev-20220623-110659",
112-
"@kui-shell/plugin-bash-like": "11.5.0-dev-20220623-110659",
113-
"@kui-shell/plugin-client-common": "11.5.0-dev-20220623-110659",
111+
"@kui-shell/core": "11.5.0-dev-20220628-111118",
112+
"@kui-shell/plugin-bash-like": "11.5.0-dev-20220628-111118",
113+
"@kui-shell/plugin-client-common": "11.5.0-dev-20220628-111118",
114114
"@kui-shell/plugin-codeflare": "file:./plugins/plugin-codeflare",
115-
"@kui-shell/plugin-core-support": "11.5.0-dev-20220623-110659",
116-
"@kui-shell/plugin-electron-components": "11.5.0-dev-20220623-110659",
117-
"@kui-shell/plugin-kubectl": "11.5.0-dev-20220623-110659",
115+
"@kui-shell/plugin-core-support": "11.5.0-dev-20220628-111118",
116+
"@kui-shell/plugin-electron-components": "11.5.0-dev-20220628-111118",
117+
"@kui-shell/plugin-kubectl": "11.5.0-dev-20220628-111118",
118118
"@kui-shell/plugin-madwizard": "file:./plugins/plugin-madwizard",
119-
"@kui-shell/plugin-patternfly4-themes": "11.5.0-dev-20220623-110659",
120-
"@kui-shell/plugin-proxy-support": "11.5.0-dev-20220623-110659",
121-
"@kui-shell/plugin-s3": "11.5.0-dev-20220623-110659"
119+
"@kui-shell/plugin-patternfly4-themes": "11.5.0-dev-20220628-111118",
120+
"@kui-shell/plugin-proxy-support": "11.5.0-dev-20220628-111118",
121+
"@kui-shell/plugin-s3": "11.5.0-dev-20220628-111118"
122122
}
123123
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"productName": "CodeFlare",
3-
"productTitle": "CodeFlare Dashboard"
3+
"productTitle": "CodeFlare"
44
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"label": "Notebooks",
33
"submenu": [
4-
{ "notebook": "Dashboard", "filepath": "dashboard.md" },
5-
{ "notebook": "Dashboard (live)", "filepath": "dashboard-live.md" }
4+
{ "notebook": "Dashboard", "filepath": "/kui/client/dashboard.md" },
5+
{ "notebook": "S3 Browser", "filepath": "/kui/client/s3.md" }
66
]
77
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
title: Dashboard
23
layout:
34
1:
45
position: default
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: S3 Browser
3+
---
4+
5+
```shell
6+
---
7+
execute: now
8+
---
9+
browse s3
10+
```

plugins/plugin-client-default/src/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ export default function renderMain(props: KuiProps) {
5858
version={version}
5959
productName={productTitle}
6060
lightweightTables
61+
noNewTabButton
62+
noNewSplitButton
6163
{...props}
64+
initialTabTitle="Dashboard"
6265
isPopup={false}
63-
noTopTabs
64-
guidebooks={false}
6566
quietExecCommand={false}
6667
toplevel={!Capabilities.inBrowser() && <Search />}
6768
>
6869
<ContextWidgets>
69-
<TextWithIconWidget text={`${productName} ${version}`} viewLevel="normal" />
70+
<TextWithIconWidget text={`${productName} v${version}`} viewLevel="normal" />
7071
<GitHubIcon />
7172
{/* <CurrentContext />
7273
<CurrentNamespace /> */}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 { Arguments, Registrar } from "@kui-shell/core"
18+
19+
import "../../web/scss/components/Dashboard/s3.scss"
20+
21+
async function browseS3(args: Arguments) {
22+
await import("@kui-shell/plugin-s3").then((_) => _.enable())
23+
return args.REPL.qexec("ls /s3")
24+
}
25+
26+
export default function registerBrowseCommands(registrar: Registrar) {
27+
registrar.listen("/browse/s3", browseS3, {
28+
needsUI: true,
29+
width: 1280,
30+
height: 960,
31+
})
32+
}

plugins/plugin-codeflare/src/plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616

1717
import { Registrar } from "@kui-shell/core"
18+
19+
import browse from "./controller/browse"
1820
import dashboard from "./controller/dashboard"
1921
import charts from "./controller/charts"
2022
import description from "./controller/description"
@@ -28,6 +30,7 @@ codeflare chart gpu /path/to/logdir`
2830

2931
/** Register Kui Commands */
3032
export default function registerCodeflareCommands(registrar: Registrar) {
33+
browse(registrar)
3134
dashboard(registrar)
3235
charts(registrar)
3336
description(registrar)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
@use "sass:color";
1817
@import "@kui-shell/plugin-client-common/web/scss/components/Card/mixins";
1918
@import "@kui-shell/plugin-client-common/web/scss/components/Editor/mixins";
2019
@import "@kui-shell/plugin-client-common/web/scss/components/Terminal/mixins";
@@ -24,9 +23,9 @@
2423

2524
@import "mixins";
2625

27-
@include TopTabStripe {
26+
/*@include TopTabStripe {
2827
display: none !important;
29-
}
28+
}*/
3029

3130
@include TopLevelTab {
3231
@include Split(3) {

0 commit comments

Comments
 (0)