• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / d-installer / 4512499803

pending completion
4512499803

Pull #501

github

Unknown Committer
Unknown Commit Message
Pull Request #501: [web] Add DASD UI - first version

462 of 863 branches covered (53.53%)

Branch coverage included in aggregate %.

64 of 235 new or added lines in 9 files covered. (27.23%)

14 existing lines in 1 file now uncovered.

4668 of 6129 relevant lines covered (76.16%)

10.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/web/src/components/storage/DASDFormatProgress.jsx
1
/*
2
 * Copyright (c) [2023] SUSE LLC
3
 *
4
 * All Rights Reserved.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of version 2 of the GNU General Public License as published
8
 * by the Free Software Foundation.
9
 *
10
 * This program is distributed in the hope that it will be useful, but WITHOUT
11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13
 * more details.
14
 *
15
 * You should have received a copy of the GNU General Public License along
16
 * with this program; if not, contact SUSE LLC.
17
 *
18
 * To contact SUSE LLC about this file by physical or electronic mail, you may
19
 * find current contact information at www.suse.com.
20
 */
21

22
import React, { useEffect, useState } from "react";
23
import { Progress, Skeleton } from '@patternfly/react-core';
24
import { If, Popup } from "~/components/core";
25
import { useInstallerClient } from "~/context/installer";
26

27
export default function DASDFormatProgress({ job, devices, isOpen = true }) {
×
NEW
28
  const { storage: client } = useInstallerClient();
×
NEW
29
  const [progress, setProgress] = useState(undefined);
×
30

NEW
31
  useEffect(() => {
×
NEW
32
    client.dasd.onFormatProgress(job.path, p => setProgress(p));
×
33
  }, [client.dasd, job.path]);
34

NEW
35
  const ProgressContent = ({ progress }) => {
×
NEW
36
    return (
×
37
      <div className="stack dasd-format-progress">
38
        { Object.entries(progress).map(([path, [total, step, done]]) => {
NEW
39
          const device = devices.find(d => d.id === path.split("/").slice(-1)[0]);
×
40

NEW
41
          return (
×
42
            <Progress
43
              key={path}
44
              size="sm"
45
              max={total}
46
              value={step}
47
              title={`${device.channelId} - ${device.name}`}
48
              measureLocation="none"
49
              variant={done ? "success" : undefined}
×
50
            />
51
          );
52
        })}
53
      </div>
54
    );
55
  };
56

NEW
57
  const WaitingProgress = () => (
×
NEW
58
    <div className="stack">
×
59
      <div>Waiting for progress report</div>
60
      <Skeleton height="10px" />
61
      <Skeleton height="10px" />
62
    </div>
63
  );
64

NEW
65
  return (
×
66
    <Popup
67
      title="Formatting DASD devices"
68
      isOpen={isOpen}
69
      disableFocusTrap
70
    >
71

72
      <If
73
        condition={progress}
74
        then={<ProgressContent progress={progress} />}
75
        else={<WaitingProgress />}
76
      />
77
    </Popup>
78
  );
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc