Skip to content

Commit

Permalink
Merge branch 'sprint/17' of https://gitlab.zcorp.cc/pangu/qucheng int…
Browse files Browse the repository at this point in the history
…o 17
  • Loading branch information
zhouxin committed Jul 13, 2022
2 parents 388cf43 + 4cddda9 commit 325d1a5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions frontend/module/common/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1345,18 +1345,19 @@ public static function printProgressBar($percent, $color = '', $tip = '')
* @param float $percent
* @param string $color HEX value of color
* @param string $tip
* @param string $tipPosition available values: left, right, top, bottom
* @static
* @access public
* @return void
*/
public static function printProgressPie($percent, $color = '', $tip = '')
public static function printProgressPie($percent, $color = '', $tip = '', $tipPosition = 'bottom')
{
if(empty($color)) $color = self::getColorByLevel($percent);

$title = $tip ? $tip : $percent . '%';

echo <<<EOT
<div title='{$title}' data-toggle='tooltip' class='progress-pie' data-doughnut-size='85' data-color='{$color}' data-value='{$percent}' data-width='120' data-height='120' data-back-color='#e8edf3'>
<div title='{$title}' data-toggle='tooltip' data-placement='{$tipPosition}' class='progress-pie' data-doughnut-size='85' data-color='{$color}' data-value='{$percent}' data-width='120' data-height='120' data-back-color='#e8edf3'>
<div class='progress-info' style='line-height: 120px; padding-top: 0; font-size:25px;'>{$percent}%</div>
</div>
EOT;
Expand Down
4 changes: 4 additions & 0 deletions frontend/module/instance/lang/zh-cn.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
$lang->instance->sourceList['cloud'] = '渠成公共市场';
$lang->instance->sourceList['local'] = '本地市场';

$lang->instance->channelList = array();
$lang->instance->channelList['test'] = '测试版';
$lang->instance->channelList['stable'] = '稳定版';

$lang->instance->statusList = array();
$lang->instance->statusList['installationFail'] = '安装失败';
$lang->instance->statusList['creating'] = '创建中';
Expand Down
2 changes: 0 additions & 2 deletions frontend/module/instance/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ public function install($app, $settings = array(), $customData = null, $spaceID
$instanceData->introduction = isset($app->introduction) ? $app->introduction : $app->desc;
$instanceData->source = 'cloud';
$instanceData->channel = $this->app->session->cloudChannel ? $this->app->session->cloudChannel : $this->config->cloud->api->channel;
$instanceData->cpu = $app->cpu;
$instanceData->mem = $app->memory;
$instanceData->chart = $app->chart;
$instanceData->appVersion = $app->app_version;
$instanceData->version = $app->version;
Expand Down
1 change: 1 addition & 0 deletions frontend/module/space/control.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class space extends control
*/
public function browse($spaceID = null, $browseType = 'bycard', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->app->loadLang('instance');
$this->loadModel('instance');
$this->loadModel('store');

Expand Down
3 changes: 2 additions & 1 deletion frontend/module/space/view/browsebycard.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
</div>
</div>
<div class='panel-footer instance-footer'>
<div class="pull-left"><?php echo $instance->appVersion;?></div>
<?php $channel = zget($lang->instance->channelList, $instance->channel, '');?>
<div class="pull-left"><?php echo $instance->appVersion . ($config->cloud->api->switchChannel && $channel ? " ($channel)" : '');?></div>
<div class="pull-right instance-status" instance-id="<?php echo $instance->id;?>" data-status="<?php echo $instance->status;?>">
<?php $this->instance->printStatus($instance);?>
</div>
Expand Down

0 comments on commit 325d1a5

Please sign in to comment.