Explorar el Código

try to add ostemplate to templatelist

andre hace 4 años
padre
commit
0baf0fa505
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      app/UI/CustomTemplate/Pages/CustomTemplateDataTable.php

+ 10 - 0
app/UI/CustomTemplate/Pages/CustomTemplateDataTable.php

@@ -85,6 +85,16 @@ class CustomTemplateDataTable extends DataTable implements ClientArea
         return '-';
     }
 
+    public function replaceFieldOsTemplate($key, $row)
+    {
+        $json = \json_decode($row->data, true);
+        if(!$json['osTemplate'] || $json['osTemplate'] =='installationFromIso'){
+            return sl('lang')->abtr('template', "Installation From ISO Image");
+        }
+        $decorator = new OsTemplateDecorator($json['osTemplate']);
+        return sl('lang')->abtr('template', $decorator->toFriendlyName());
+    }
+
     public function replaceFieldDisk($key, $row)
     {
         return sprintf(" %s GB", $row->disk + $row->disks);