Ver código fonte

U wind status update view

Piotr Labudda 6 anos atrás
pai
commit
305066d19e

+ 9 - 4
SE/se-lib/Route/UrlAction/WindykacjaUpdateStatus.php.view.js

@@ -68,7 +68,7 @@ var P5UI__WindykacjaStatusUpdate = createReactClass({
 
 	runAgainIfNotDone: function () {
 		if (!this.state.execAgain) return;
-		if (this.state.responseBody && 100 === this.state.responseBody.percentDone) {
+		if (this.state.responseBody && 100 === this.state.responseBody.percentDone && 0 === this.state.responseBody.totalToUpdate) {
 			return;
 		}
 		if (this.state.execCounter > this.state.execLimit) {
@@ -127,6 +127,7 @@ var P5UI__WindykacjaStatusUpdate = createReactClass({
 
 	render: function () {
 		DBG && console.log('DBG:render', { state: this.state });
+		var isDone = (this.state.responseBody && 100 === this.state.responseBody.percentDone && 0 === this.state.responseBody.totalToUpdate);
 		var percent = (this.state.responseBody) ? Math.round(this.state.responseBody.percentDone, 2) : 0;
 		var panelClass = (percent < 100) ? "warning" : "success";
 		if (this.state.errorMsg) panelClass = "danger";
@@ -141,9 +142,13 @@ var P5UI__WindykacjaStatusUpdate = createReactClass({
 					h('p', {}, [
 						"Aktaulizacja statusu " + this.props.total + " rekordów ",
 						" ",
-						(this.state.execAgain)
-						? h('button', { className: "btn btn-xs btn-default", onClick: this.handleClickPause }, [ iconPause, "Zatrzymaj" ])
-						: h('button', { className: "btn btn-xs btn-default", onClick: this.handleClickPlay }, [ iconPlay, "Uruchom ponownie" ]),
+						(!isDone)
+						?	(
+								(this.state.execAgain)
+								? h('button', { className: "btn btn-xs btn-default", onClick: this.handleClickPause }, [ iconPause, "Zatrzymaj" ])
+								: h('button', { className: "btn btn-xs btn-default", onClick: this.handleClickPlay }, [ iconPlay, "Uruchom ponownie" ])
+							)
+						: '',
 					]),
 					h('div', { className: "progress" }, [
 						h('div', { className: "progress-bar",