Skip to content

Commit

Permalink
Proxy Command: Ask for large table sync (#144)
Browse files Browse the repository at this point in the history
* Proxy Command: ask for large tables

* Proxy Command: ask for large tables

* Update CHANGELOG.md
  • Loading branch information
boehsermoe authored and nadar committed May 31, 2018
1 parent de9f569 commit 01ac734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. This projec
+ [#128](https://github.com/luyadev/luya-module-admin/issues/128) A new indicator display the amount of time left until the user is logged out automatically. Also every keystroke inside any text field will reset the logout timer to null. No more timeouts while working!
+ [#126](https://github.com/luyadev/luya-module-admin/issues/126) Provide option to eager load api model relations.
+ [#20](https://github.com/luyadev/luya-module-admin/issues/20) New option `--sync-requests-count` for proxy command.
+ [#144](https://github.com/luyadev/luya-module-admin/pull/144) Proxy command ask for large table sync.

### Fixed

Expand Down
8 changes: 8 additions & 0 deletions src/proxy/ClientTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
class ClientTable extends BaseObject
{
const LARGE_TABLE_PROMPT = 10000;

private $_data;

/**
Expand Down Expand Up @@ -120,6 +122,12 @@ public function getContentRowCount()
*/
public function syncData()
{
if (Yii::$app->controller->interactive && $this->getRows() > self::LARGE_TABLE_PROMPT) {
if (Console::confirm("{$this->getName()} has {$this->getRows()} entries. Do you want continue table sync?", true) === false) {
return;
}
}

$sqlMode = $this->prepare();

try {
Expand Down

0 comments on commit 01ac734

Please sign in to comment.