mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
Feature/nodejs (#397)
* Add node support using nvm * Add icon * Rename to NodeJS * Rename to NodeJS * update php and node logo * only services which have units can be started,restarted,stopped,disabled and enabled * add tests --------- Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com> Co-authored-by: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com>
This commit is contained in:
@ -318,6 +318,17 @@ public function installedPHPVersions(): array
|
||||
return $versions;
|
||||
}
|
||||
|
||||
public function installedNodejsVersions(): array
|
||||
{
|
||||
$versions = [];
|
||||
$nodes = $this->services()->where('type', 'nodejs')->get(['version']);
|
||||
foreach ($nodes as $node) {
|
||||
$versions[] = $node->version;
|
||||
}
|
||||
|
||||
return $versions;
|
||||
}
|
||||
|
||||
public function type(): ServerType
|
||||
{
|
||||
$typeClass = config('core.server_types_class')[$this->type];
|
||||
@ -377,6 +388,15 @@ public function php(?string $version = null): ?Service
|
||||
return $this->service('php', $version);
|
||||
}
|
||||
|
||||
public function nodejs(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('nodejs');
|
||||
}
|
||||
|
||||
return $this->service('nodejs', $version);
|
||||
}
|
||||
|
||||
public function memoryDatabase(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
|
@ -43,6 +43,8 @@
|
||||
* @property ?Ssl $activeSsl
|
||||
* @property string $ssh_key_name
|
||||
* @property ?SourceControl $sourceControl
|
||||
*
|
||||
* @TODO: Add nodejs_version column
|
||||
*/
|
||||
class Site extends AbstractModel
|
||||
{
|
||||
|
Reference in New Issue
Block a user