* Adjust app list edit,binduser.

This commit is contained in:
zenggang
2023-07-28 06:05:10 +00:00
parent e946d835ad
commit 64cb88dea1
6 changed files with 75 additions and 12 deletions
+6 -6
View File
@@ -2045,13 +2045,13 @@ class InstanceModel extends model
*/
public function isClickable(object $instance, string $action): bool
{
if($action == 'start') return empty($instance->type) ? $this->canDo('start', $instance) : false;
if($action == 'stop') return empty($instance->type) ? $this->canDo('stop', $instance) : false;
if($action == 'uninstall') return empty($instance->solution) && $this->canDo('uninstall', $instance);
if($action == 'visit') return empty($instance->type) ? ($instance->domain && $this->canDo('visit', $instance)) : true;
if($action == 'start') return $instance->type == 'app' ? $this->canDo('start', $instance) : false;
if($action == 'stop') return $instance->type == 'app' ? $this->canDo('stop', $instance) : false;
if($action == 'uninstall') return $instance->type == 'app' && $this->canDo('uninstall', $instance);
if($action == 'visit') return $instance->type == 'app' ? ($instance->domain && $this->canDo('visit', $instance)) : true;
if($action == 'upgrade') return !empty($instance->latestVersion);
if($action == 'bindUser') return empty($instance->type) ? false : true;
if($action == 'edit') return empty($instance->type) ? false : true;
if($action == 'bindUser') return ($instance->type == 'external' && in_array($instance->appName, array('Gitlab', 'Gitea', 'Gogs'))) ? true : false;
if($action == 'edit') return $instance->type == 'app' ? false : true;
return true;
}