Skip to content

Commit

Permalink
feat: cross-job ("top") dashboard
Browse files Browse the repository at this point in the history
update to ink4
  • Loading branch information
starpit committed Apr 16, 2023
1 parent 1e69a26 commit 380b413
Show file tree
Hide file tree
Showing 26 changed files with 1,236 additions and 449 deletions.
814 changes: 408 additions & 406 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion plugins/plugin-codeflare-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"dependencies": {
"@logdna/tail-file": "^3.0.1",
"chokidar": "^3.5.3",
"ink": "^3.2.0",
"ink": "^4.1.0",
"madwizard": "^9.0.3",
"pretty-bytes": "^6.1.0",
"pretty-ms": "^8.0.0",
"strip-ansi": "^7.0.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ type Props = {

export default class Timeline extends React.PureComponent<Props> {
/** Text to use for one cell's worth of time */
private readonly block = {
historic: "■",
latest: "▏",
}
private readonly block = "■"

/** This will help us compute whether we are about to overflow terminal width. */
private get maxLabelLength() {
Expand Down Expand Up @@ -64,7 +61,7 @@ export default class Timeline extends React.PureComponent<Props> {

return (
<Text {...style} key={timeIdx}>
{this.block.historic}
{this.block}
</Text>
)
}
Expand Down
25 changes: 25 additions & 0 deletions plugins/plugin-codeflare-dashboard/src/components/Top/defaults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2023 The Kubernetes Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import type { Resource } from "./types.js"

const defaultValueFor: Record<Resource, number> = {
cpu: 50, // 50m
mem: 64 * 1024 * 1024,
gpu: 0,
}

export default defaultValueFor
Loading

0 comments on commit 380b413

Please sign in to comment.