Skip to content

Commit

Permalink
WIP - unified overview
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Aug 30, 2023
1 parent aec503c commit ed6b0fa
Show file tree
Hide file tree
Showing 19 changed files with 563 additions and 93 deletions.
21 changes: 19 additions & 2 deletions pkg/storaged/block-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ import React from "react";

import { Card, CardBody, CardTitle } from "@patternfly/react-core/dist/esm/components/Card/index.js";
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
import { Stack } from "@patternfly/react-core/dist/esm/layouts/Stack/index.js";

import * as utils from "./utils.js";
import { StdDetailsLayout } from "./details.jsx";
import * as Content from "./content-views.jsx";
import { create_tabs } from "./content-views.jsx";

const _ = cockpit.gettext;

export class BlockDetails extends React.Component {
render() {
const block = this.props.block;
const tabs = create_tabs(this.props.client, block, {});
console.log("T", tabs);

const header = (
<Card>
Expand All @@ -51,7 +54,21 @@ export class BlockDetails extends React.Component {
</Card>
);

const content = <Content.Block client={this.props.client} block={block} />;
function make_tab(t) {
return (
<Card>
<CardTitle component="h2">{t.name}</CardTitle>
<CardBody>
<t.renderer {...t.data} />
</CardBody>
</Card>
);
}

const content = (
<Stack hasGutter>
{tabs.renderers.map(make_tab)}
</Stack>);

return <StdDetailsLayout client={this.props.client} header={header} content={content} />;
}
Expand Down
22 changes: 21 additions & 1 deletion pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function is_multipath_master(block) {
}

function update_indices() {
let path, block, mdraid, vgroup, pvol, lvol, pool, blockdev, fsys, part, i;
let path, block, mdraid, vgroup, pvol, lvol, pool, blockdev, fsys, part, session, i;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable session.

client.broken_multipath_present = false;
client.drives_multipath_blocks = { };
Expand Down Expand Up @@ -457,6 +457,26 @@ function update_indices() {
client.blocks_partitions[path].sort(function (a, b) { return a.Offset - b.Offset });
}

client.iscsi_sessions_drives = { };
client.drives_iscsi_session = { };
for (path in client.drives) {
const block = client.drives_block[path];
if (!block)
continue;
for (const session_path in client.iscsi_sessions) {
const session = client.iscsi_sessions[session_path];
for (i = 0; i < block.Symlinks.length; i++) {
console.log("??", block.Symlinks[i], session.data["target_name"]);
if (utils.decode_filename(block.Symlinks[i]).includes(session.data["target_name"])) {
client.drives_iscsi_session[path] = session;
if (!client.iscsi_sessions_drives[session_path])
client.iscsi_sessions_drives[session_path] = [];
client.iscsi_sessions_drives[session_path].push(client.drives[path]);
}
}
}
}

client.path_jobs = { };
function enter_job(job) {
if (!job.Objects || !job.Objects.length)
Expand Down
Loading

0 comments on commit ed6b0fa

Please sign in to comment.