isVmCreate()) { $this->customTplVars['warning'] = sl("lang")->abtr('The process of Virtual Machine creation is in progress.'); } else if ($this->isVmReinstall()) { $this->customTplVars['warning'] = sl("lang")->abtr('Rebuild VM in progress. Please try again later.'); } else if ($this->isVmUpgrade()){ $this->customTplVars['warning'] = sl("lang")->abtr('Upgrading VM in progress. Please try again later.'); }else { $this->customTplVars['warning'] = sl("lang")->abtr('Unknown error.'); } } private function isVmCreate() { $jobs = [ CloneQemuJob::class, CreateQemuJob::class, CreateLxcJob::class, ]; return Job::waiting()->ofHostingId($this->getWhmcsParamByKey("serviceid"))->ofJobs($jobs)->count(); } private function isVmReinstall() { $jobs = [ CreateVmJob::class ]; return Job::waiting()->ofHostingId($this->getWhmcsParamByKey("serviceid"))->ofJobs($jobs)->count(); } private function isVmUpgrade() { $jobs = [ MigrateVmJob::class, \ModulesGarden\ProxmoxAddon\App\Jobs\Cloud\RestoreVm::class, UpgradeVmJob::class ]; return Job::waiting()->ofHostingId($this->getWhmcsParamByKey("serviceid"))->ofJobs($jobs)->count(); } }