Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

UI improvements #9773

Merged
merged 62 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
eccb2e3
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
fb46785
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
c087de4
Merge branch '4.19'
DaanHoogland Oct 2, 2024
0a097c4
Show service ip in management server details tab
abh1sar Oct 3, 2024
0d024c3
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
f53092e
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
a79b603
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
d6181d5
Fix `updateTemplatePermission` when the UI is set to a language other…
lucas-a-martins Oct 4, 2024
e666800
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
88ad004
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
8fdfbdd
Merge remote-tracking branch 'upstream/main' into ui-improv
abh1sar Oct 10, 2024
c2174f4
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
e0fe1c7
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
90f8300
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
b6ae5fa
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
df6672d
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
5224243
Minor naming changes and grammar
abh1sar Oct 23, 2024
cd1fa9e
Merge remote-tracking branch 'upstream/main' into ui-improv
abh1sar Oct 23, 2024
320b7f0
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
e289502
Merge branch 'main' into ui-improv
borisstoyanov Nov 13, 2024
e3991bf
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
f97321c
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
0acaa77
Show service ip in management server details tab
abh1sar Oct 3, 2024
019b8dd
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
4d198ee
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
79203b6
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
1086c42
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
a352c47
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
5b9df20
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
2d936d9
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
4f5edd5
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
0488e17
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
d0f044f
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
f694d2f
Minor naming changes and grammar
abh1sar Oct 23, 2024
2919d53
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
416e78d
Merge branch 'ui-improv' of https://github.com/abh1sar/cloudstack int…
abh1sar Dec 1, 2024
8d79c4c
Show Usage Server configuration in a separate pane
abh1sar Oct 1, 2024
92a8896
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
dc85057
Show service ip in management server details tab
abh1sar Oct 3, 2024
5957396
change Schedule Snapshots to Recurring Snapshots
abh1sar Oct 3, 2024
e6ec31a
Change the hypervisor order so that kvm, vmware, xenserver show up first
abh1sar Oct 3, 2024
feb4791
Remove extra space in hypervisor names in config.java
abh1sar Oct 4, 2024
eac913d
Autofill vcenter details in add cluster form
abh1sar Oct 6, 2024
8b362f0
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
7dd5a59
Fix alignment on wrapping in global settings tabs
abh1sar Oct 18, 2024
4112a1e
rename Autofill vCenter credentials to Autofill vCenter credentials f…
abh1sar Oct 18, 2024
020be6c
Rename Service Ip to Ip Address in management server response
abh1sar Oct 18, 2024
8bc6bf4
Change description of kvm.snapshot.enabled to say that it applies to …
abh1sar Oct 18, 2024
736fce9
Return error when kvm vm snapshot is taken withoutsnapshot memory
abh1sar Oct 22, 2024
0cfa879
Minor naming changes and grammar
abh1sar Oct 23, 2024
c221a9e
Fix tooltip for attach volume to instance button
abh1sar Oct 29, 2024
92d8c3e
UI: Option to attach volume to an instance during create volume
abh1sar Oct 2, 2024
27ab123
UI: condition to display create vm-vol-snapshots to same as create vo…
abh1sar Oct 6, 2024
145e7ab
Merge branch 'ui-improv' of https://github.com/abh1sar/cloudstack int…
abh1sar Dec 3, 2024
2f72e5b
moved db changes from 41900to42000 to 42000to42010
abh1sar Dec 3, 2024
2ffca62
Merge remote-tracking branch 'upstream/4.20' into ui-polish
abh1sar Dec 4, 2024
e7ffd8c
Update group_id in already present usage configuration settings
abh1sar Dec 6, 2024
92a3dcd
Merge branch '4.20' into ui-improv
abh1sar Dec 17, 2024
475df60
Merge remote-tracking branch 'upstream/4.20' into ui-polish
abh1sar Jan 13, 2025
a7a8cdf
remove "schedule" from message in create Recurring Snapshots form
abh1sar Jan 13, 2025
6442663
Merge branch '4.20' into ui-improv
abh1sar Jan 24, 2025
c59c122
Update server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerIm…
andrijapanicsb Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ public class ApiConstants {
public static final String SENT = "sent";
public static final String SENT_BYTES = "sentbytes";
public static final String SERIAL = "serial";
public static final String SERVICE_IP = "serviceip";
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
public static final String SESSIONKEY = "sessionkey";
public static final String SHOW_CAPACITIES = "showcapacities";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
@Param(description = "the running OS kernel version for this Management Server")
private String kernelVersion;

@SerializedName(ApiConstants.SERVICE_IP)
@SerializedName(ApiConstants.IP_ADDRESS)
@Param(description = "the IP Address for this Management Server")
private String serviceIp;
private String ipAddress;

public String getId() {
return this.id;
Expand Down Expand Up @@ -116,8 +116,8 @@
return lastBoot;
}

public String getServiceIp() {
return serviceIp;
public String getIpAddress() {
return ipAddress;

Check warning on line 120 in api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java#L119-L120

Added lines #L119 - L120 were not covered by tests
}

public void setId(String id) {
Expand Down Expand Up @@ -164,8 +164,8 @@
this.kernelVersion = kernelVersion;
}

public void setServiceIp(String serviceIp) {
this.serviceIp = serviceIp;
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;

Check warning on line 168 in api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java#L167-L168

Added lines #L167 - L168 were not covered by tests
}

public String getKernelVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,11 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervi

CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.vm_instance', 'delete_protection', 'boolean DEFAULT FALSE COMMENT "delete protection for vm" ');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.volumes', 'delete_protection', 'boolean DEFAULT FALSE COMMENT "delete protection for volumes" ');

-- Create a new group for Usage Server related configurations
INSERT INTO `cloud`.`configuration_group` (`name`, `description`, `precedence`) VALUES ('Usage Server', 'Usage Server related configuration', 9);
DELETE FROM `cloud`.`configuration_subgroup` WHERE `name`='Usage';
INSERT INTO `cloud`.`configuration_subgroup` (`name`, `keywords`, `precedence`, `group_id`) VALUES ('Usage', NULL, 1, (SELECT id FROM `cloud`.`configuration_group` WHERE `name` = 'Usage Server'));

-- Update the description to indicate this setting applies only to volume snapshots on running instances
UPDATE `cloud`.`configuration` SET `description`='whether volume snapshot is enabled on running instances on KVM hosts' WHERE `name`='kvm.snapshot.enabled';
Original file line number Diff line number Diff line change
Expand Up @@ -5377,7 +5377,7 @@
mgmtResponse.setLastServerStart(mgmt.getLastJvmStart());
mgmtResponse.setLastServerStop(mgmt.getLastJvmStop());
mgmtResponse.setLastBoot(mgmt.getLastSystemBoot());
mgmtResponse.setServiceIp(mgmt.getServiceIP());
mgmtResponse.setIpAddress(mgmt.getServiceIP());

Check warning on line 5380 in server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java#L5380

Added line #L5380 was not covered by tests
mgmtResponse.setObjectName("managementserver");
return mgmtResponse;
}
Expand Down
6 changes: 3 additions & 3 deletions server/src/main/java/com/cloud/configuration/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public enum Config {
"The time interval in seconds when the management server polls for snapshots to be scheduled.",
null),
SnapshotDeltaMax("Snapshots", SnapshotManager.class, Integer.class, "snapshot.delta.max", "16", "max delta snapshots between two full snapshots.", null),
KVMSnapshotEnabled("Hidden", SnapshotManager.class, Boolean.class, "kvm.snapshot.enabled", "false", "whether snapshot is enabled for KVM hosts", null),
KVMSnapshotEnabled("Hidden", SnapshotManager.class, Boolean.class, "kvm.snapshot.enabled", "false", "Whether volume snapshot is enabled on running instances on a KVM host", null),

// Advanced
EventPurgeInterval(
Expand Down Expand Up @@ -665,8 +665,8 @@ public enum Config {
ManagementServer.class,
String.class,
"hypervisor.list",
HypervisorType.Hyperv + "," + HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," +
HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
HypervisorType.KVM + "," + HypervisorType.VMware + "," + HypervisorType.XenServer + "," + HypervisorType.Hyperv + "," +
HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
"The list of hypervisors that this deployment will use.",
"hypervisorList",
ConfigKey.Kind.CSV,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
private void validatePrerequisiteVpnGateway(Site2SiteVpnGateway vpnGateway) {
// check if gateway has been defined on the VPC
if (_vpnGatewayDao.findByVpcId(vpnGateway.getVpcId()) == null) {
throw new InvalidParameterValueException("we can not create a VPN connection for a VPC that does not have a VPN gateway defined");
throw new InvalidParameterValueException("We can not create a VPN connection for a VPC that does not have a VPN gateway defined");

Check warning on line 348 in server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java#L348

Added line #L348 was not covered by tests
}
}

Expand Down Expand Up @@ -592,7 +592,7 @@
private void stopVpnConnection(Long id) throws ResourceUnavailableException {
Site2SiteVpnConnectionVO conn = _vpnConnectionDao.acquireInLockTable(id);
if (conn == null) {
throw new CloudRuntimeException("Unable to acquire lock for stopping of VPN connection with ID " + id);
throw new CloudRuntimeException("Unable to acquire lock for stopping VPN connection with ID " + id);

Check warning on line 595 in server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java#L595

Added line #L595 was not covered by tests
}
try {
if (conn.getState() == State.Pending) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import com.cloud.storage.snapshot.SnapshotManager;
import org.apache.cloudstack.annotation.AnnotationService;
import org.apache.cloudstack.annotation.dao.AnnotationDao;
import org.apache.cloudstack.api.ApiConstants;
Expand Down Expand Up @@ -380,9 +381,14 @@
//StorageVMSnapshotStrategy - allows volume snapshots without memory; VM has to be in Running state; No limitation of the image format if the storage plugin supports volume snapshots; "kvm.vmstoragesnapshot.enabled" has to be enabled
//Other Storage volume plugins could integrate this with their own functionality for group snapshots
VMSnapshotStrategy snapshotStrategy = storageStrategyFactory.getVmSnapshotStrategy(userVmVo.getId(), rootVolumePool.getId(), snapshotMemory);

if (snapshotStrategy == null) {
String message = "KVM does not support the type of snapshot requested";
String message;

Check warning on line 385 in server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java#L385

Added line #L385 was not covered by tests
if (!SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
message = "KVM does not support instance snapshot without snapshot memory on a running instance";

Check warning on line 387 in server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java#L387

Added line #L387 was not covered by tests
} else {
message = "KVM does not support the type of snapshot requested";

Check warning on line 389 in server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java#L389

Added line #L389 was not covered by tests
}

logger.debug(message);
throw new CloudRuntimeException(message);
}
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,6 @@
"label.save.new.rule": "Neue Regel Speichern",
"label.schedule": "Zeitplan",
"label.scheduled.backups": "geplante Backups",
"label.scheduled.snapshots": "geplante Schnappschüsse",
"label.scope": "Geltungsbereich",
"label.search": "Suche",
"label.secondary.isolated.vlan.type.isolated": "Isoliert",
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/el_GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,6 @@
"label.scale.vm": "Κλίμακα εικονικής μηχανής",
"label.schedule": "Πρόγραμμα",
"label.scheduled.backups": "Προγραμματισμένα αντίγραφα ασφαλείας",
"label.scheduled.snapshots": "Προγραμματισμένα στιγμιότυπα",
"label.scope": "Πεδίο εφαρμογής",
"label.search": "Αναζήτηση",
"label.secondary.isolated.vlan.type.isolated": "Απομονωμένες",
Expand Down
3 changes: 2 additions & 1 deletion ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"label.action": "Action",
"label.action.attach.disk": "Attach disk",
"label.action.attach.iso": "Attach ISO",
"label.action.attach.to.instance": "Attach to Instance",
"label.action.bulk.delete.egress.firewall.rules": "Bulk delete egress firewall rules",
"label.action.bulk.delete.firewall.rules": "Bulk delete firewall rules",
"label.action.bulk.delete.ip.v6.firewall.rules": "Bulk remove IPv6 firewall rules",
Expand Down Expand Up @@ -401,6 +402,7 @@
"label.attaching": "Attaching",
"label.authentication.method": "Authentication Method",
"label.authentication.sshkey": "System SSH Key",
"label.use.existing.vcenter.credentials.from.zone": "Use existing vCenter credentials from the Zone",
"label.autoscale": "AutoScale",
"label.autoscalevmgroupname": "AutoScaling Group",
"label.author.email": "Author e-mail",
Expand Down Expand Up @@ -1985,7 +1987,6 @@
"label.schedule": "Schedule",
"label.schedule.add": "Add schedule",
"label.scheduled.backups": "Scheduled backups",
"label.scheduled.snapshots": "Scheduled Snapshots",
"label.schedules": "Schedules",
"label.scope": "Scope",
"label.scope.tooltip": "Primary Storage Pool Scope",
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,6 @@
"label.scaleup.policy": "スケールアップポリシー",
"label.schedule": "スケジュール",
"label.scheduled.backups": "スケジュールされたバックアップ",
"label.scheduled.snapshots": "スケジュールされたスナップショット",
"label.scope": "スコープ",
"label.search": "検索",
"label.secondary.isolated.vlan.type.isolated": "隔離",
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,6 @@
"label.scale.vm": "VM \ud655\uc7a5",
"label.schedule": "\uc2a4\ucf00\uc904",
"label.scheduled.backups": "\uc608\uc57d\ub41c \ubc31\uc5c5",
"label.scheduled.snapshots": "\uc608\uc57d\ub41c \uc2a4\ub0c5\uc0f7",
"label.scope": "\ubc94\uc704",
"label.search": "\uac80\uc0c9",
"label.secondary.isolated.vlan.type.isolated": "isolated",
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,6 @@
"label.scale.vm": "Escalar VM",
"label.schedule": "Programar",
"label.scheduled.backups": "Backups programados",
"label.scheduled.snapshots": "Snapshots programados",
"label.scope": "Escopo",
"label.search": "Pesquisar",
"label.secondary.isolated.vlan.type.isolated": "Isolada",
Expand Down
1 change: 0 additions & 1 deletion ui/public/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,6 @@

"label.schedule": "\u65E5\u7A0B",
"label.scheduled.backups": "\u5B9A\u65F6\u5907\u4EFD",
"label.scheduled.snapshots": "\u8BA1\u5212\u5FEB\u7167",
"label.scope": "\u8303\u56F4",
"label.search": "\u641C\u7D22",

Expand Down
7 changes: 4 additions & 3 deletions ui/src/config/section/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ export default {
docHelp: 'adminguide/virtual_machines.html#virtual-machine-snapshots',
dataView: true,
popup: true,
show: (record) => {
return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') ||
(['Stopped'].includes(record.state) && !['KVM', 'LXC'].includes(record.hypervisor)))
show: (record, store) => {
return (record.hypervisor !== 'KVM') ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why destroyed state?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep the UI conditions same as the service layer. Please see hostSupportsSnapsthotForVolume().

But I'm ok if we don't want to allow snapshot creation from UI for destroyed VMs.

['Stopped', 'Destroyed'].includes(record.state) ||
store.features.kvmsnapshotenabled
},
disabled: (record) => { return record.hostcontrolstate === 'Offline' && record.hypervisor === 'KVM' },
component: shallowRef(defineAsyncComponent(() => import('@/views/compute/CreateSnapshotWizard.vue')))
Expand Down
4 changes: 2 additions & 2 deletions ui/src/config/section/infra/managementServers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export default {
permission: ['listManagementServersMetrics'],
resourceType: 'ManagementServer',
columns: () => {
const fields = ['name', 'state', 'serviceip', 'version', 'osdistribution', 'agentcount']
const fields = ['name', 'state', 'ipaddress', 'version', 'osdistribution', 'agentcount']
const metricsFields = ['collectiontime', 'availableprocessors', 'cpuload', 'heapmemoryused']
if (store.getters.metrics) {
fields.push(...metricsFields)
}
return fields
},
details: ['collectiontime', 'usageislocal', 'dbislocal', 'lastserverstart', 'lastserverstop', 'lastboottime', 'version', 'loginfo', 'systemtotalcpucycles', 'systemloadaverages', 'systemcycleusage', 'systemmemorytotal', 'systemmemoryfree', 'systemmemoryvirtualsize', 'availableprocessors', 'javadistribution', 'javaversion', 'osdistribution', 'kernelversion', 'agentcount', 'sessions', 'heapmemoryused', 'heapmemorytotal', 'threadsblockedcount', 'threadsdeamoncount', 'threadsnewcount', 'threadsrunnablecount', 'threadsterminatedcount', 'threadstotalcount', 'threadswaitingcount'],
details: ['ipaddress', 'collectiontime', 'usageislocal', 'dbislocal', 'lastserverstart', 'lastserverstop', 'lastboottime', 'version', 'loginfo', 'systemtotalcpucycles', 'systemloadaverages', 'systemcycleusage', 'systemmemorytotal', 'systemmemoryfree', 'systemmemoryvirtualsize', 'availableprocessors', 'javadistribution', 'javaversion', 'osdistribution', 'kernelversion', 'agentcount', 'sessions', 'heapmemoryused', 'heapmemorytotal', 'threadsblockedcount', 'threadsdeamoncount', 'threadsnewcount', 'threadsrunnablecount', 'threadsterminatedcount', 'threadstotalcount', 'threadswaitingcount'],
tabs: [
{
name: 'details',
Expand Down
14 changes: 8 additions & 6 deletions ui/src/config/section/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ export default {
label: 'label.action.take.snapshot',
dataView: true,
show: (record, store) => {
return record.state === 'Ready' && (record.hypervisor !== 'KVM' ||
record.hypervisor === 'KVM' && record.vmstate === 'Running' && store.features.kvmsnapshotenabled ||
record.hypervisor === 'KVM' && record.vmstate !== 'Running')
return record.state === 'Ready' &&
(record.hypervisor !== 'KVM' ||
['Stopped', 'Destroyed'].includes(record.vmstate) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, why destroyed state ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this change, the button would be shown for all states part from 'Running'.
Now it will only be shown for 'Stopped' or 'Destroyed' states

store.features.kvmsnapshotenabled)
},
popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/TakeSnapshot.vue')))
Expand All @@ -179,9 +180,10 @@ export default {
label: 'label.action.recurring.snapshot',
dataView: true,
show: (record, store) => {
return record.state === 'Ready' && (record.hypervisor !== 'KVM' ||
record.hypervisor === 'KVM' && record.vmstate === 'Running' && store.features.kvmsnapshotenabled ||
record.hypervisor === 'KVM' && record.vmstate !== 'Running')
return record.state === 'Ready' &&
(record.hypervisor !== 'KVM' ||
(['Stopped', 'Destroyed'].includes(record.vmstate)) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same doubt as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

(store.features.kvmsnapshotenabled))
},
popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/RecurringSnapshotVolume.vue'))),
Expand Down
Loading
Loading