Skip to content

Commit 44cd18c

Browse files
authored
Merge pull request #60 from adityawbwce/main
#46 and #48 fix
2 parents 6f41b6f + c9a0b45 commit 44cd18c

2 files changed

Lines changed: 2 additions & 22 deletions

File tree

modules/servers/upCloudVps/lib/configOptions.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,9 @@ public function configs(){
3232
'Default Location' => ['Type' => 'dropdown', 'Options' => $this->getZoneLocation()],
3333
'Plan' => ['Type' => 'dropdown', 'Options' => $this->getVmplans()],
3434
'Template' => ['Type' => 'dropdown', 'Options' => $this->getTemplateIds()],
35-
//'Backup' => ['Type' => 'dropdown', 'Options' => $this->getBackups()],
36-
//'Networking' => ['Type' => 'dropdown', 'Options' => $this->getNetworking()],
3735
];
3836
}
3937

40-
private function getNetworking()
41-
{
42-
$nw['ipv4only'] = "Public IPv4 Only";
43-
$nw['default'] = "Public Default (IPv4, IPv6 & Utility)";
44-
return $nw;
45-
}
46-
4738
private function createCustomConfigurableOptions($product)
4839
{
4940
$currencyId = Capsule::table('tblcurrencies')->where('default', '1')->first()->id;
@@ -78,7 +69,6 @@ private function createGlobalConfigurableOptions($product)
7869
$this->createLocationFields($groupId, $zones, $currencyId);
7970
$this->createTemplateFields($groupId, $pomTemplates, $currencyId, $currencyCode);
8071
$this->createBackupFields($groupId, $this->getBackups());
81-
$this->createIPFields($groupId, $this->getNetworking());
8272
}
8373
}
8474

@@ -92,16 +82,6 @@ private function createBackupFields($groupId, $backup){
9282
}
9383
}
9484

95-
private function createIPFields($groupId, $ips){
96-
$optionId = Capsule::table('tblproductconfigoptions')->where('gid', $groupId)->where('optionname', 'ipaddress|IP Address')->first()->id;
97-
if(!$optionId){
98-
$optionId = Capsule::table('tblproductconfigoptions')->insertGetId(['gid' => $groupId, 'optionname' => 'ipaddress|IP Address', 'optiontype' => 1]);
99-
foreach ($ips as $id => $val) {
100-
Capsule::table('tblproductconfigoptionssub')->updateOrInsert(['optionname' => $id.'|'.$val], ['configid' => $optionId]);
101-
}
102-
}
103-
}
104-
10585
private function createRAMFields($groupId, $currencyId, $currencyCode){
10686
$mems = array();
10787
for ($i = 4; $i <= 64; $i += 1) {

modules/servers/upCloudVps/lib/vmManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public function create(){
6262
$OsUUID = $this->params['configoptions']['template'] ?? $this->params['configoption3'];
6363
$sshkey = $this->params['customfields']['ssh_key'];
6464
$user_data = $this->params['customfields']['userData'];
65-
$Hostname = $this->params['domain'] ?? 'client' . $this->params['serviceid'] . '.' . $_SERVER['SERVER_NAME'];
65+
$Hostname = !empty($this->params['domain']) ? $this->params['domain'] : 'client' . $this->params['serviceid'] . '.' . $_SERVER['SERVER_NAME'];
6666
$sshkey = empty($sshkey) ? "na" : $sshkey;
6767
$user_data = empty($user_data) ? "na" : $user_data;
6868
$backup = $this->params['configoptions']['backup'];
69-
$networking = $this->params['configoptions']['ipaddress'];
69+
$networking = "ipv4only";
7070

7171
if($Plan == "custom"){
7272
$ram = $this->params['configoptions']['ram'];

0 commit comments

Comments
 (0)