* Add default snapshot.

This commit is contained in:
zhaoke
2023-02-15 10:22:15 +08:00
parent 3d3157075c
commit ecaf6e3ec8
10 changed files with 37 additions and 16 deletions

View File

@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';

View File

@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';

View File

@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';

View File

@@ -91,7 +91,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';

View File

@@ -391,8 +391,7 @@ class zanode extends control
}
else
{
if(isonlybody()) return print(js::alert($this->lang->zanode->actionSuccess) . js::reload('parent.parent'));
return print(js::alert($this->lang->zanode->actionSuccess) . js::locate($this->createLink('zanode', 'browse'), 'parent'));
return print(js::alert($this->lang->zanode->actionSuccess) . js::locate($this->createLink('zanode', 'browse'), 'parent.parent'));
}
}

View File

@@ -91,11 +91,14 @@ $lang->zanode->snapshotEmpty = 'No snapshots';
$lang->zanode->confirmDeleteSnapshot = "The snapshot cannot be restored from the recycle bin after being deleted. Are you sure to continue?";
$lang->zanode->snapshot->statusList['creating'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['completed'] = 'Usable';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Usable';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';

View File

@@ -93,12 +93,15 @@ $lang->zanode->snapshotEmpty = 'No snapshots';
$lang->zanode->confirmDeleteSnapshot = "The snapshot cannot be restored from the recycle bin after being deleted. Are you sure to continue?";
$lang->zanode->snapshot->statusList['creating'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['completed'] = 'Usable';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';
$lang->zanode->snapStatusError = 'Snapshot is not ready.';
$lang->zanode->snapRestoring = 'Snapshot is restoring.';

View File

@@ -95,7 +95,10 @@ $lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Usable';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';

View File

@@ -47,8 +47,15 @@
$isDefalut = $snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system';
if($isDefalut) $editAttr = $restoreAttr = $deleteAttr = 'class="btn disabled"';
$name = $snapshot->localName ? $snapshot->localName : $snapshot->name;
$title = $snapshot->name;
if($snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system')
{
$name = $lang->zanode->snapshot->defaultSnapName;
$title = $name;
}
?>
<td title="<?php echo $snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system' ? $lang->zanode->snapshot->defaultSnapName: $snapshot->name;?>"><?php echo $snapshot->localName ? $snapshot->localName : $snapshot->name;?></td>
<td title="<?php echo $title;?>"><?php echo $name;?></td>
<td class='<?php echo $snapshot->status;?>'><?php echo zget($lang->zanode->snapshot->statusList, $snapshot->status, '');?></td>
<td class="c-createdBy"><?php echo $snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system' ? $lang->zanode->snapshot->defaultSnapUser : zget($users, $snapshot->createdBy, '')?></td>
<td class='c-datetime'><?php echo $snapshot->createdDate;?></td>

View File

@@ -177,13 +177,19 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
<?php
if (empty($zanode->deleted)) {
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
$suspendAttr .= $zanode->status != 'running' && $zanode->status != 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$suspendAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'";
$resumeAttr .= $zanode->status == 'running' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$resumeAttr .= $zanode->status == 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'";
$rebootAttr .= $zanode->status == 'shutoff' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$rebootAttr .= $zanode->status == 'shutoff' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$closeAttr = "title='{$lang->zanode->shutdown}'";
$closeAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$startAttr = "title='{$lang->zanode->boot}'";
$startAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$snapshotAttr = "title='{$lang->zanode->createSnapshot}'";
$snapshotAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"';
@@ -200,11 +206,11 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
if($zanode->status == "shutoff")
{
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-play'></i> " . $lang->zanode->bootNode, '', "title='{$lang->zanode->boot}' class='btn '");
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-play'></i> " . $lang->zanode->bootNode, '', $startAttr);
}
else
{
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', "title='{$lang->zanode->shutdown}' class='btn '");
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', $closeAttr);
}
common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->rebootNode, '', $rebootAttr);