-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web: Revamp the Storage page UI (#1104)
As part of the Storage UI changes described at https://github.com/openSUSE/agama/blob/master/doc/storage_ui.md document, this PR aims to merge into master the changes already available in the `storage_ui` feature branch, which has been already tested and validated. Namely, * #1071 Added the following information to D-Bus: * The list of actions includes the SID of the affected device. * The partition table exports the unused slots. * The LVM devices (volume groups, physical volumes and logical volumes) are exported. * The block devices includes their start block and also indicates whether the device is encrypted. * The staging devices are exported. * #1079 Adapt the storage client to the changes in the D-Bus API and adapt `ProposalPage` component to read the information about the devices if needed. * #1082 Added new D-Bus interfaces `Device` , `Partition`, `LVM.LogicalVolume` and adapt `Filesystem` interface. It requires yast/yast-storage-ng#1373. * #1088 Replaced the `Planned Actions` section in the storage proposal for a `Result` one which presents how the storage would look after installation instead of just the list of actions. * #1090 Moved the space policy configuration to a popup. * #1098 Replace a `Resize` by `Before` label as it was suggested during the presentation of the UI in a review meeting.
- Loading branch information
Showing
65 changed files
with
5,380 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
service/lib/agama/dbus/storage/interfaces/device/device.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
# | ||
# All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of version 2 of the GNU General Public License as published | ||
# by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, contact SUSE LLC. | ||
# | ||
# To contact SUSE LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
require "dbus" | ||
require "y2storage/device_description" | ||
|
||
module Agama | ||
module DBus | ||
module Storage | ||
module Interfaces | ||
module Device | ||
# Interface for a device. | ||
# | ||
# @note This interface is intended to be included by {Agama::DBus::Storage::Device}. | ||
module Device | ||
# Whether this interface should be implemented for the given device. | ||
# | ||
# @note All devices implement this interface. | ||
# | ||
# @param _storage_device [Y2Storage::Device] | ||
# @return [Boolean] | ||
def self.apply?(_storage_device) | ||
true | ||
end | ||
|
||
DEVICE_INTERFACE = "org.opensuse.Agama.Storage1.Device" | ||
private_constant :DEVICE_INTERFACE | ||
|
||
# sid of the device. | ||
# | ||
# @return [Integer] | ||
def device_sid | ||
storage_device.sid | ||
end | ||
|
||
# Name to represent the device. | ||
# | ||
# @return [String] e.g., "/dev/sda". | ||
def device_name | ||
storage_device.display_name || "" | ||
end | ||
|
||
# Description of the device. | ||
# | ||
# @return [String] e.g., "EXT4 Partition". | ||
def device_description | ||
Y2Storage::DeviceDescription.new(storage_device).to_s | ||
end | ||
|
||
def self.included(base) | ||
base.class_eval do | ||
dbus_interface DEVICE_INTERFACE do | ||
dbus_reader :device_sid, "u", dbus_name: "SID" | ||
dbus_reader :device_name, "s", dbus_name: "Name" | ||
dbus_reader :device_description, "s", dbus_name: "Description" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.