From c1a1e52413a4c2dac274dd5fff86fd1aabc08312 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 5 Mar 2024 09:04:40 +0800 Subject: [PATCH] * Adjust zanode action content. --- module/action/model.php | 3 ++- module/zanode/model.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index fc7d9f2320..8d8c83d002 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -201,6 +201,7 @@ class actionModel extends model if(in_array($actionName, array('linkstory', 'unlinkstory', 'createchildrenstory', 'linkur', 'unlinkur'))) $this->actionTao->processLinkStoryAndBugActionExtra($action, 'story', 'view'); if(in_array($actionName, array('linkbug', 'unlinkbug'))) $this->actionTao->processLinkStoryAndBugActionExtra($action, 'bug', 'view'); if($actionName == 'repocreated') $action->extra = str_replace("class='iframe'", 'data-app="devops"', $action->extra); + if($actionName == 'createdsnapshot' && in_array($action->objectType, array('vm', 'zanode')) && $action->extra == 'defaultSnap') $action->actor = $this->lang->action->system; $action->history = zget($histories, $actionID, array()); foreach($action->history as $history) @@ -575,7 +576,7 @@ class actionModel extends model } else { - if($actionType == 'restoredsnapshot' && in_array($action->objectType, array('vm', 'zanode')) && $value == 'defaultSnap') $value = $this->lang->{$objectType}->snapshot->defaultSnapName; + if(in_array($actionType, array('restoredsnapshot', 'createdsnapshot')) && in_array($action->objectType, array('vm', 'zanode')) && $value == 'defaultSnap') $value = $this->lang->{$objectType}->snapshot->defaultSnapName; $desc = str_replace('$' . $key, (string)$value, $desc); } diff --git a/module/zanode/model.php b/module/zanode/model.php index a0be666d36..0857a432bb 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -140,7 +140,6 @@ class zanodemodel extends model if(!empty($result) && $result->code == 'success') { - if($snapshot->name == 'defaultSnap') $snapshot->name = $this->lang->zanode->snapshot->defaultSnapName; $this->loadModel('action')->create('zanode', $node->id, 'createdSnapshot', '', $snapshot->name); $this->dao->update(TABLE_ZAHOST)->set('status')->eq(static::STATUS_CREATING_SNAP)->where('id')->eq($node->id)->exec();