-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server traffic chart dynamic update implemented
- Loading branch information
1 parent
1e1b697
commit b61bdb0
Showing
8 changed files
with
156 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace hipanel\modules\server\helpers; | ||
|
||
use hipanel\modules\server\models\ServerUse; | ||
use yii\helpers\ArrayHelper; | ||
|
||
class ServerHelper | ||
{ | ||
public static function groupUsesForChart($uses) | ||
{ | ||
$labels = []; | ||
$data = []; | ||
|
||
ArrayHelper::multisort($uses, 'date'); | ||
|
||
foreach ($uses as $use) { | ||
/** @var ServerUse $use */ | ||
$labels[$use->date] = $use; | ||
$data[$use->type][] = $use->getDisplayAmount(); | ||
} | ||
|
||
foreach ($labels as $date => $use) { | ||
$labels[$date] = $use->getDisplayDate(); | ||
} | ||
|
||
return [$labels, $data]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @link http://hiqdev.com/hipanel-module-server | ||
* @license http://hiqdev.com/hipanel-module-server/license | ||
* @copyright Copyright (c) 2015 HiQDev | ||
*/ | ||
|
||
namespace hipanel\modules\server\models; | ||
|
||
use hipanel\modules\finance\models\RUse; | ||
use Yii; | ||
use yii\base\InvalidParamException; | ||
|
||
class ServerUseSearch extends ServerUse | ||
{ | ||
use \hipanel\base\SearchModelTrait; | ||
|
||
public function formName() | ||
{ | ||
return 'ServerUse'; | ||
} | ||
|
||
public static function index() | ||
{ | ||
return 'Servers'; | ||
} | ||
|
||
public static function type() | ||
{ | ||
return 'Server'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters