Explorar o código

try to fix the detailed view

andre %!s(int64=4) %!d(string=hai) anos
pai
achega
de007773cd

+ 5 - 3
app/UI/VmUpdate/Providers/VmUpdateProvider.php

@@ -52,7 +52,6 @@ class VmUpdateProvider extends VmCreateProvider
         $this->data =  $this->vmModel->toArray();
         $vm = \ModulesGarden\ProxmoxAddon\Core\Helper\sl('Vm')->getVm();
         $config = $vm->config();
-        $this->data['password'] = $this->vmModel->getPassword();
         $this->data['description'] = html_entity_decode($config['description']);
         $this->data['searchdomain'] = $config['searchdomain'];
         $ns = explode(" ",$config['nameserver']);
@@ -143,8 +142,11 @@ class VmUpdateProvider extends VmCreateProvider
             Api::beginTransaction();
             DB::beginTransaction();
             $this->fillVmModel();
-            if($this->getFormDataValues()['password']){
-                $this->vmModel->setPassword($this->getFormDataValues()['password']);
+            if($this->getFormDataValues()['ciuser']){
+                $vm->updateConfig(["ciuser" => $this->formData['ciuser']]);
+            }
+            if($this->getFormDataValues()['cipassword']){
+                $vm->updateConfig(["cipassword" => $this->formData['cipassword']]);
             }
             if($this->configuration()->isCalculateSocketsAndCores()){
                 $this->calculateSocketsAndCores();

+ 1 - 1
app/UI/VmUpdate/Sections/Qemu/GeneralSection.php

@@ -67,7 +67,7 @@ class GeneralSection extends BaseSection
         }
         //password
         if($this->configuration()->isPermissionPassword()){
-            $field = new Text('password');
+            $field = new Text('cipassword');
             $field->addValidator( new PasswordValidator());
             $field->setDescription('description');
             $this->addField($field);