Enable full setup on the setup form

This commit is contained in:
2023-07-05 22:42:59 +10:00
parent 6f298d778f
commit c3d4c1fc31
8 changed files with 89 additions and 88 deletions

View File

@@ -41,6 +41,7 @@ class Setup extends Model
private array $internal = [];
protected $casts = [
'options' => 'array',
'servers' => 'array',
];
@@ -51,7 +52,6 @@ class Setup extends Model
/* EMSI SETTINGS */
$this->do_prevent = 1; /* EMSI - send an immediate EMSI_INQ on connect */
$this->ignore_nrq = 0;
$this->options = 0; /* EMSI - our capabilities */
}
/**
@@ -72,18 +72,23 @@ class Setup extends Model
case 'emsi_port':
return Arr::get($this->servers,str_replace('_','.',$key),DNS::PORT);
case 'options_options':
return Arr::get($this->options,'options');
case 'binkp_active':
case 'dns_active':
case 'emsi_active':
case 'binkp_options':
case 'dns_options':
case 'emsi_options':
return Arr::get($this->servers,'binkp.options');
return Arr::get($this->servers,str_replace('_','.',$key));
case 'binkp_settings':
case 'ignore_nrq':
case 'do_prevent':
return $this->internal[$key] ?? FALSE;
case 'max_msgs_pkt':
return self::MAX_MSGS_PKT;
case 'msgs_pkt':
return Arr::get($this->options,$key,self::MAX_MSGS_PKT);
case 'version':
return File::exists('VERSION') ? chop(File::get('VERSION')) : 'dev';
@@ -110,16 +115,7 @@ class Setup extends Model
case 'emsi_options':
return Arr::set($this->servers,str_replace('_','.',$key),$value);
case 'binkp_settings':
case 'ignore_nrq':
case 'opt_nr':
case 'opt_nd':
case 'opt_nda':
case 'opt_md':
case 'opt_cr':
case 'opt_mb':
case 'opt_cht':
case 'opt_mpwd':
case 'do_prevent':
$this->internal[$key] = $value;
break;
@@ -153,23 +149,6 @@ class Setup extends Model
return $this->belongsTo(System::class);
}
/* ATTRIBUTES */
public function getLocationAttribute()
{
return $this->system->location;
}
public function getSysopAttribute()
{
return $this->system->sysop;
}
public function getSystemNameAttribute()
{
return $this->system->name;
}
/* METHODS */
public function optionClear(int $key,$index='options'): void