Browse Source

try to disable delete button on root disk

andre 4 years ago
parent
commit
043b673e70
1 changed files with 11 additions and 4 deletions
  1. 11 4
      app/UI/Disk/Pages/DiskDataTable.php

+ 11 - 4
app/UI/Disk/Pages/DiskDataTable.php

@@ -134,10 +134,17 @@ class DiskDataTable extends DataTable implements ClientArea
                 "bytes"  => $entity->getBytes(),
                 "master" => $entity->isMaster(),
             ];
-//            if ( $entity->getId() =='disk-1' ) {
-                $deleteButton = $this->getActionButtons()['deleteDiskButton'];
-                $deleteButton->addClass('disabled');
-//            }
+            if ( $entity->getId() =='disk-1' ) {
+                $actionButtons = $this->getActionButtons();
+                $actionButtons['deleteDiskButton']->addClass('disabled');
+                logModuleCall(
+                    'proxmoxCloud',
+                    __FUNCTION__,
+                    $actionButtons['deleteDiskButton'],
+                    'Debug',
+                    $entity->getId()
+                );
+            }
         }
         $dataProv = new ArrayDataProvider();
         $dataProv->setDefaultSorting("name", 'ASC');