diff --git a/app/docker/models/volume.ts b/app/docker/models/volume.ts index 5e664cfa5..827f09287 100644 --- a/app/docker/models/volume.ts +++ b/app/docker/models/volume.ts @@ -5,7 +5,9 @@ import { IResource } from '@/react/docker/components/datatable/createOwnershipCo import { PortainerResponse } from '@/react/docker/types'; export class VolumeViewModel implements IResource { - Id: Volume['Name']; + Id: string; + + Name: Volume['Name']; CreatedAt?: Volume['CreatedAt']; @@ -28,7 +30,7 @@ export class VolumeViewModel implements IResource { ResourceControl?: ResourceControlViewModel; constructor(data: PortainerResponse & { ResourceID?: string }) { - this.Id = data.Name; + this.Name = data.Name; this.CreatedAt = data.CreatedAt; this.Driver = data.Driver; this.Options = data.Options; @@ -52,5 +54,10 @@ export class VolumeViewModel implements IResource { this.NodeName = data.Portainer.Agent.NodeName; } } + + this.Id = data.Name; + if (this.NodeName) { + this.Id = `${data.Name}-${this.NodeName}`; + } } } diff --git a/app/docker/views/volumes/volumesController.js b/app/docker/views/volumes/volumesController.js index 44f7b883b..b37a012c6 100644 --- a/app/docker/views/volumes/volumesController.js +++ b/app/docker/views/volumes/volumesController.js @@ -13,9 +13,9 @@ angular.module('portainer.docker').controller('VolumesController', [ function ($q, $scope, $state, VolumeService, ServiceService, VolumeHelper, Notifications, Authentication, endpoint) { $scope.removeAction = async function (selectedItems) { async function doRemove(volume) { - return VolumeService.remove(volume.Id, volume.NodeName) + return VolumeService.remove(volume.Name, volume.NodeName) .then(function success() { - Notifications.success('Volume successfully removed', volume.Id); + Notifications.success('Volume successfully removed', volume.Name); var index = $scope.volumes.indexOf(volume); $scope.volumes.splice(index, 1); }) diff --git a/app/react/docker/volumes/ListView/VolumesDatatable/columns/name.tsx b/app/react/docker/volumes/ListView/VolumesDatatable/columns/name.tsx index 8a9c2660f..0ae680492 100644 --- a/app/react/docker/volumes/ListView/VolumesDatatable/columns/name.tsx +++ b/app/react/docker/volumes/ListView/VolumesDatatable/columns/name.tsx @@ -15,7 +15,7 @@ import { getTableMeta } from '../tableMeta'; import { columnHelper } from './helper'; -export const name = columnHelper.accessor('Id', { +export const name = columnHelper.accessor('Name', { id: 'name', header: 'Name', cell: Cell,