Handle the case when mode is set to fdisk and parted installed

This commit is contained in:
iliajie
2022-07-23 15:43:58 +03:00
parent 7aa4b6add0
commit 5ea16f73b0
3 changed files with 9 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ $d || &error($text{'disk_egone'});
$caneditpart =
$d->{'table'} ne 'gpt' ||
($d->{'table'} eq 'gpt' &&
&has_command('parted'));
&has_command('parted') && $config{'mode'} ne 'fdisk');
# Work out links to add partitions
foreach $p (@parts) {
@@ -74,7 +74,9 @@ if ($d->{'table'}) {
print &ui_links_row(\@info),"<p>\n";
if ($wantsparted) {
print "<p>$text{'edit_edisk'}</p>\n";
my $label = $config{'mode'} eq 'fdisk' ?
'edit_edisk2' : 'edit_edisk';
print "<p>$text{$label}</p>\n";
}
# Show table of partitions, if any

View File

@@ -294,7 +294,9 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
}
} elsif (!$mounted &&
$pinfo->{'edittype'} == 2) {
print "$text{'edit_eparted'}\n";
my $label = $config{'mode'} eq 'fdisk' ?
'edit_eparted2' : 'edit_eparted';
print "$text{$label}\n";
}
&ui_print_footer("edit_disk.cgi?device=$dinfo->{'device'}",

View File

@@ -99,7 +99,9 @@ edit_volid=Volume ID
edit_blocks=$1 blocks
edit_inuse=This partition cannot be changed as it is currently in use or configured for use.
edit_eparted=This partition cannot be changed unless <tt>parted</tt> command is installed.
edit_eparted2=This partition cannot be changed unless <tt>parted</tt> is set as management command in module config.
edit_edisk=This disk cannot be edited unless <tt>parted</tt> command is installed.
edit_edisk2=This disk cannot be edited unless <tt>parted</tt> is set as management command in module config.
edit_mkfs=Create New Filesystem
edit_mkfs2=Create Filesystem:
edit_mkfsmsg=Builds a new $1 filesystem on this partition, permanently erasing any existing files. You must do this after creating a new partition or changing an existing one.