Merge branch 'feature-new-errors'
This commit is contained in:
commit
a6a36c5554
|
@ -74,7 +74,7 @@ var Build = Class.extend({
|
||||||
var fullUri = window.APP_URL + uri;
|
var fullUri = window.APP_URL + uri;
|
||||||
|
|
||||||
if (name == 'build-updated') {
|
if (name == 'build-updated') {
|
||||||
fullUri = window.APP_URL + 'build/ajax-data/' + self.buildId + '?per_page=' + PER_PAGE + '&page=' + PAGE + '&plugin=' + BUILD_PLUGIN + '&severity=' + BUI;
|
fullUri = window.APP_URL + 'build/ajax-data/' + self.buildId + '?per_page=' + PER_PAGE + '&page=' + PAGE + '&plugin=' + BUILD_PLUGIN + '&severity=' + BUILD_SEVERITY + '&is_new=' + BUILD_IS_NEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
|
@ -118,7 +118,7 @@ class Builder implements LoggerAwareInterface
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->interpolator = new BuildInterpolator();
|
$this->interpolator = new BuildInterpolator();
|
||||||
$this->buildErrorWriter = new BuildErrorWriter($this->build->getId());
|
$this->buildErrorWriter = new BuildErrorWriter($this->build->getProjectId(), $this->build->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -52,6 +52,7 @@ class BuildController extends Controller
|
||||||
{
|
{
|
||||||
$page = (integer)$this->getParam('page', 1);
|
$page = (integer)$this->getParam('page', 1);
|
||||||
$plugin = $this->getParam('plugin', '');
|
$plugin = $this->getParam('plugin', '');
|
||||||
|
$isNew = $this->getParam('is_new', '');
|
||||||
|
|
||||||
$severity = $this->getParam('severity', null);
|
$severity = $this->getParam('severity', null);
|
||||||
if (null !== $severity && '' !== $severity) {
|
if (null !== $severity && '' !== $severity) {
|
||||||
|
@ -73,7 +74,7 @@ class BuildController extends Controller
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = $_SESSION['php-censor-user'];
|
$user = $_SESSION['php-censor-user'];
|
||||||
$perPage = $user->getFinalPerPage();
|
$perPage = $user->getFinalPerPage();
|
||||||
$data = $this->getBuildData($build, $plugin, $severity, (($page - 1) * $perPage), $perPage);
|
$data = $this->getBuildData($build, $plugin, $severity, $isNew, (($page - 1) * $perPage), $perPage);
|
||||||
$pages = ($data['errors'] === 0)
|
$pages = ($data['errors'] === 0)
|
||||||
? 1
|
? 1
|
||||||
: (integer)ceil($data['errors'] / $perPage);
|
: (integer)ceil($data['errors'] / $perPage);
|
||||||
|
@ -90,13 +91,15 @@ class BuildController extends Controller
|
||||||
$this->view->data = $data;
|
$this->view->data = $data;
|
||||||
|
|
||||||
$this->view->plugin = urldecode($plugin);
|
$this->view->plugin = urldecode($plugin);
|
||||||
$this->view->plugins = $errorStore->getKnownPlugins($buildId);
|
$this->view->plugins = $errorStore->getKnownPlugins($buildId, $severity, $isNew);
|
||||||
$this->view->severity = urldecode(null !== $severity ? $severity : '');
|
$this->view->severity = urldecode(null !== $severity ? $severity : '');
|
||||||
$this->view->severities = $errorStore->getKnownSeverities($buildId, $plugin);
|
$this->view->severities = $errorStore->getKnownSeverities($buildId, $plugin, $isNew);
|
||||||
|
$this->view->isNew = urldecode($isNew);
|
||||||
|
$this->view->isNews = ['only_new', 'only_old'];
|
||||||
|
|
||||||
$this->view->page = $page;
|
$this->view->page = $page;
|
||||||
$this->view->perPage = $perPage;
|
$this->view->perPage = $perPage;
|
||||||
$this->view->paginator = $this->getPaginatorHtml($buildId, $plugin, $severity, $data['errors'], $perPage, $page);
|
$this->view->paginator = $this->getPaginatorHtml($buildId, $plugin, $severity, $isNew, $data['errors'], $perPage, $page);
|
||||||
|
|
||||||
$this->layout->title = Lang::get('build_n', $buildId);
|
$this->layout->title = Lang::get('build_n', $buildId);
|
||||||
$this->layout->subtitle = $build->getProjectTitle();
|
$this->layout->subtitle = $build->getProjectTitle();
|
||||||
|
@ -166,12 +169,13 @@ class BuildController extends Controller
|
||||||
* @param Build $build
|
* @param Build $build
|
||||||
* @param string $plugin
|
* @param string $plugin
|
||||||
* @param integer $severity
|
* @param integer $severity
|
||||||
|
* @param string $isNew
|
||||||
* @param integer $start
|
* @param integer $start
|
||||||
* @param integer $perPage
|
* @param integer $perPage
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function getBuildData(Build $build, $plugin, $severity, $start = 0, $perPage = 10)
|
protected function getBuildData(Build $build, $plugin, $severity, $isNew, $start = 0, $perPage = 10)
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
$data['status'] = (int)$build->getStatus();
|
$data['status'] = (int)$build->getStatus();
|
||||||
|
@ -183,13 +187,13 @@ class BuildController extends Controller
|
||||||
|
|
||||||
/** @var \PHPCensor\Store\BuildErrorStore $errorStore */
|
/** @var \PHPCensor\Store\BuildErrorStore $errorStore */
|
||||||
$errorStore = b8\Store\Factory::getStore('BuildError');
|
$errorStore = b8\Store\Factory::getStore('BuildError');
|
||||||
$errors = $errorStore->getByBuildId($build->getId(), $perPage, $start, $plugin, $severity);
|
$errors = $errorStore->getByBuildId($build->getId(), $perPage, $start, $plugin, $severity, $isNew);
|
||||||
|
|
||||||
$errorView = new b8\View('Build/errors');
|
$errorView = new b8\View('Build/errors');
|
||||||
$errorView->build = $build;
|
$errorView->build = $build;
|
||||||
$errorView->errors = $errors['items'];
|
$errorView->errors = $errors['items'];
|
||||||
|
|
||||||
$data['errors'] = $errorStore->getErrorTotalForBuild($build->getId(), $plugin, $severity);
|
$data['errors'] = $errorStore->getErrorTotalForBuild($build->getId(), $plugin, $severity, $isNew);
|
||||||
$data['errors_total'] = $errorStore->getErrorTotalForBuild($build->getId());
|
$data['errors_total'] = $errorStore->getErrorTotalForBuild($build->getId());
|
||||||
$data['error_html'] = $errorView->render();
|
$data['error_html'] = $errorView->render();
|
||||||
|
|
||||||
|
@ -200,13 +204,14 @@ class BuildController extends Controller
|
||||||
* @param integer $buildId
|
* @param integer $buildId
|
||||||
* @param string $plugin
|
* @param string $plugin
|
||||||
* @param integer $severity
|
* @param integer $severity
|
||||||
|
* @param string $isNew
|
||||||
* @param integer $total
|
* @param integer $total
|
||||||
* @param integer $perPage
|
* @param integer $perPage
|
||||||
* @param integer $page
|
* @param integer $page
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getPaginatorHtml($buildId, $plugin, $severity, $total, $perPage, $page)
|
protected function getPaginatorHtml($buildId, $plugin, $severity, $isNew, $total, $perPage, $page)
|
||||||
{
|
{
|
||||||
$view = new b8\View('pagination');
|
$view = new b8\View('pagination');
|
||||||
|
|
||||||
|
@ -220,6 +225,10 @@ class BuildController extends Controller
|
||||||
$params['severity'] = $severity;
|
$params['severity'] = $severity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($isNew)) {
|
||||||
|
$params['is_new'] = $isNew;
|
||||||
|
}
|
||||||
|
|
||||||
$urlPattern = $urlPattern . '?' . str_replace('%28%3Anum%29', '(:num)', http_build_query(array_merge($params, ['page' => '(:num)']))) . '#errors';
|
$urlPattern = $urlPattern . '?' . str_replace('%28%3Anum%29', '(:num)', http_build_query(array_merge($params, ['page' => '(:num)']))) . '#errors';
|
||||||
$paginator = new Paginator($total, $perPage, $page, $urlPattern);
|
$paginator = new Paginator($total, $perPage, $page, $urlPattern);
|
||||||
|
|
||||||
|
@ -313,6 +322,7 @@ class BuildController extends Controller
|
||||||
$page = (integer)$this->getParam('page', 1);
|
$page = (integer)$this->getParam('page', 1);
|
||||||
$perPage = (integer)$this->getParam('per_page', 10);
|
$perPage = (integer)$this->getParam('per_page', 10);
|
||||||
$plugin = $this->getParam('plugin', '');
|
$plugin = $this->getParam('plugin', '');
|
||||||
|
$isNew = $this->getParam('is_new', '');
|
||||||
|
|
||||||
$severity = $this->getParam('severity', null);
|
$severity = $this->getParam('severity', null);
|
||||||
if (null !== $severity && '' !== $severity) {
|
if (null !== $severity && '' !== $severity) {
|
||||||
|
@ -331,8 +341,8 @@ class BuildController extends Controller
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->getBuildData($build, $plugin, $severity, (($page - 1) * $perPage), $perPage);
|
$data = $this->getBuildData($build, $plugin, $severity, $isNew, (($page - 1) * $perPage), $perPage);
|
||||||
$data['paginator'] = $this->getPaginatorHtml($buildId, $plugin, $severity, $data['errors'], $perPage, $page);
|
$data['paginator'] = $this->getPaginatorHtml($buildId, $plugin, $severity, $isNew, $data['errors'], $perPage, $page);
|
||||||
|
|
||||||
$response->setContent($data);
|
$response->setContent($data);
|
||||||
|
|
||||||
|
|
|
@ -182,11 +182,16 @@ PHP Censor',
|
||||||
// View Build
|
// View Build
|
||||||
'errors' => 'Errors',
|
'errors' => 'Errors',
|
||||||
'information' => 'Information',
|
'information' => 'Information',
|
||||||
|
'is_new' => 'Is new?',
|
||||||
|
'new' => 'New',
|
||||||
'build_x_not_found' => 'Build with ID %d does not exist.',
|
'build_x_not_found' => 'Build with ID %d does not exist.',
|
||||||
'build_n' => 'Build %d',
|
'build_n' => 'Build %d',
|
||||||
'rebuild_now' => 'Rebuild Now',
|
'rebuild_now' => 'Rebuild Now',
|
||||||
|
|
||||||
|
'all_errors' => 'All errors',
|
||||||
|
'only_new' => 'Only new errors',
|
||||||
|
'only_old' => 'Only old errors',
|
||||||
|
'new_errors' => 'New errors',
|
||||||
|
|
||||||
'committed_by_x' => 'Committed by %s',
|
'committed_by_x' => 'Committed by %s',
|
||||||
'commit_id_x' => 'Commit: %s',
|
'commit_id_x' => 'Commit: %s',
|
||||||
|
|
|
@ -175,10 +175,17 @@ PHP Censor',
|
||||||
// View Build
|
// View Build
|
||||||
'errors' => 'Ошибки',
|
'errors' => 'Ошибки',
|
||||||
'information' => 'Информация',
|
'information' => 'Информация',
|
||||||
|
'new' => 'Новая',
|
||||||
|
'is_new' => 'Новая?',
|
||||||
'build_x_not_found' => 'Сборки с ID %d не существует.',
|
'build_x_not_found' => 'Сборки с ID %d не существует.',
|
||||||
'build_n' => 'Сборка %d',
|
'build_n' => 'Сборка %d',
|
||||||
'rebuild_now' => 'Пересобрать сейчас',
|
'rebuild_now' => 'Пересобрать сейчас',
|
||||||
|
|
||||||
|
'all_errors' => 'Все ошибки',
|
||||||
|
'only_new' => 'Только новые',
|
||||||
|
'only_old' => 'Только старые',
|
||||||
|
'new_errors' => 'Новых ошибок',
|
||||||
|
|
||||||
'committed_by_x' => 'Отправил %s',
|
'committed_by_x' => 'Отправил %s',
|
||||||
'commit_id_x' => 'Коммит: %s',
|
'commit_id_x' => 'Коммит: %s',
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Phinx\Migration\AbstractMigration;
|
||||||
|
|
||||||
|
class AddedNewLabelForErrors extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if ($this->hasTable('build_error')) {
|
||||||
|
$table = $this->table('build_error');
|
||||||
|
|
||||||
|
if (!$table->hasColumn('hash')) {
|
||||||
|
$table
|
||||||
|
->addColumn('hash', 'string', ['limit' => 32, 'default' => ''])
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$table->hasColumn('is_new')) {
|
||||||
|
$table
|
||||||
|
->addColumn('is_new', 'boolean', ['default' => false])
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
if ($this->hasTable('build_error')) {
|
||||||
|
$table = $this->table('build_error');
|
||||||
|
|
||||||
|
if ($table->hasColumn('hash')) {
|
||||||
|
$table
|
||||||
|
->removeColumn('hash')
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($table->hasColumn('is_new')) {
|
||||||
|
$table
|
||||||
|
->removeColumn('is_new')
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
namespace PHPCensor\Model;
|
namespace PHPCensor\Model;
|
||||||
|
|
||||||
use PHPCensor\Builder;
|
use PHPCensor\Builder;
|
||||||
|
use PHPCensor\Store\BuildErrorStore;
|
||||||
use Symfony\Component\Yaml\Parser as YamlParser;
|
use Symfony\Component\Yaml\Parser as YamlParser;
|
||||||
use PHPCensor\Model;
|
use PHPCensor\Model;
|
||||||
use b8\Store\Factory;
|
use b8\Store\Factory;
|
||||||
|
@ -47,6 +48,11 @@ class Build extends Model
|
||||||
*/
|
*/
|
||||||
protected $modelName = 'Build';
|
protected $modelName = 'Build';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
protected $newErrorsCount = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -1042,4 +1048,19 @@ OUT;
|
||||||
return 'source_unknown';
|
return 'source_unknown';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getNewErrorsCount()
|
||||||
|
{
|
||||||
|
if (null === $this->newErrorsCount) {
|
||||||
|
/** @var BuildErrorStore $store */
|
||||||
|
$store = Factory::getStore('BuildError');
|
||||||
|
|
||||||
|
$this->newErrorsCount = $store->getNewErrorsCount($this->getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->newErrorsCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ class BuildError extends Model
|
||||||
'severity' => null,
|
'severity' => null,
|
||||||
'message' => null,
|
'message' => null,
|
||||||
'create_date' => null,
|
'create_date' => null,
|
||||||
|
'hash' => null,
|
||||||
|
'is_new' => null,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,6 +58,8 @@ class BuildError extends Model
|
||||||
'severity' => 'getSeverity',
|
'severity' => 'getSeverity',
|
||||||
'message' => 'getMessage',
|
'message' => 'getMessage',
|
||||||
'create_date' => 'getCreateDate',
|
'create_date' => 'getCreateDate',
|
||||||
|
'hash' => 'getHash',
|
||||||
|
'is_new' => 'getIsNew',
|
||||||
|
|
||||||
// Foreign key getters:
|
// Foreign key getters:
|
||||||
'Build' => 'getBuild',
|
'Build' => 'getBuild',
|
||||||
|
@ -75,6 +79,8 @@ class BuildError extends Model
|
||||||
'severity' => 'setSeverity',
|
'severity' => 'setSeverity',
|
||||||
'message' => 'setMessage',
|
'message' => 'setMessage',
|
||||||
'create_date' => 'setCreateDate',
|
'create_date' => 'setCreateDate',
|
||||||
|
'hash' => 'setHash',
|
||||||
|
'is_new' => 'setIsNew',
|
||||||
|
|
||||||
// Foreign key setters:
|
// Foreign key setters:
|
||||||
'Build' => 'setBuild',
|
'Build' => 'setBuild',
|
||||||
|
@ -174,6 +180,26 @@ class BuildError extends Model
|
||||||
return $rtn;
|
return $rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getHash()
|
||||||
|
{
|
||||||
|
$rtn = (string)$this->data['hash'];
|
||||||
|
|
||||||
|
return $rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getIsNew()
|
||||||
|
{
|
||||||
|
$rtn = $this->data['is_new'];
|
||||||
|
|
||||||
|
return $rtn;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value int
|
* @param $value int
|
||||||
*/
|
*/
|
||||||
|
@ -324,6 +350,40 @@ class BuildError extends Model
|
||||||
$this->setModified('create_date');
|
$this->setModified('create_date');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value string
|
||||||
|
*/
|
||||||
|
public function setHash($value)
|
||||||
|
{
|
||||||
|
$this->validateNotNull('hash', $value);
|
||||||
|
$this->validateString('hash', $value);
|
||||||
|
|
||||||
|
if ($this->data['hash'] === $value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['hash'] = $value;
|
||||||
|
|
||||||
|
$this->setModified('hash');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value int
|
||||||
|
*/
|
||||||
|
public function setIsNew($value)
|
||||||
|
{
|
||||||
|
$this->validateNotNull('is_new', $value);
|
||||||
|
$this->validateInt('is_new', $value);
|
||||||
|
|
||||||
|
if ($this->data['is_new'] === $value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['is_new'] = $value;
|
||||||
|
|
||||||
|
$this->setModified('is_new');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Build model for this BuildError by Id.
|
* Get the Build model for this BuildError by Id.
|
||||||
*
|
*
|
||||||
|
@ -425,6 +485,21 @@ class BuildError extends Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $plugin
|
||||||
|
* @param string $file
|
||||||
|
* @param integer $lineStart
|
||||||
|
* @param integer $lineEnd
|
||||||
|
* @param integer $severity
|
||||||
|
* @param string $message
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function generateHash($plugin, $file, $lineStart, $lineEnd, $severity, $message)
|
||||||
|
{
|
||||||
|
return md5($plugin . $file . $lineStart . $lineEnd . $severity . $message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the class to apply to HTML elements representing this error.
|
* Get the class to apply to HTML elements representing this error.
|
||||||
*
|
*
|
||||||
|
|
|
@ -79,7 +79,7 @@ class BuildErrorStore extends Store
|
||||||
*
|
*
|
||||||
* @throws HttpException
|
* @throws HttpException
|
||||||
*/
|
*/
|
||||||
public function getByBuildId($buildId, $limit = null, $offset = 0, $plugin = null, $severity = null)
|
public function getByBuildId($buildId, $limit = null, $offset = 0, $plugin = null, $severity = null, $isNew = null)
|
||||||
{
|
{
|
||||||
if (is_null($buildId)) {
|
if (is_null($buildId)) {
|
||||||
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
|
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
|
||||||
|
@ -92,7 +92,14 @@ class BuildErrorStore extends Store
|
||||||
if (null !== $severity) {
|
if (null !== $severity) {
|
||||||
$query .= ' AND {{severity}} = :severity';
|
$query .= ' AND {{severity}} = :severity';
|
||||||
}
|
}
|
||||||
$query .= ' ORDER BY plugin, severity';
|
|
||||||
|
if ('only_new' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = true';
|
||||||
|
} elseif ('only_old' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = false';
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= ' ORDER BY is_new, severity, plugin';
|
||||||
if (null !== $limit) {
|
if (null !== $limit) {
|
||||||
$query .= ' LIMIT :limit';
|
$query .= ' LIMIT :limit';
|
||||||
}
|
}
|
||||||
|
@ -136,25 +143,36 @@ class BuildErrorStore extends Store
|
||||||
* @param integer $buildId
|
* @param integer $buildId
|
||||||
* @param string $plugin
|
* @param string $plugin
|
||||||
* @param integer $severity
|
* @param integer $severity
|
||||||
|
* @param string $isNew
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getErrorTotalForBuild($buildId, $plugin = null, $severity = null)
|
public function getErrorTotalForBuild($buildId, $plugin = null, $severity = null, $isNew = null)
|
||||||
{
|
{
|
||||||
$query = 'SELECT COUNT(*) AS {{total}} FROM {{build_error}} WHERE {{build_id}} = :build';
|
$query = 'SELECT COUNT(*) AS {{total}} FROM {{build_error}} WHERE {{build_id}} = :build';
|
||||||
|
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
$query .= ' AND {{plugin}} = :plugin';
|
$query .= ' AND {{plugin}} = :plugin';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $severity) {
|
if (null !== $severity) {
|
||||||
$query .= ' AND {{severity}} = :severity';
|
$query .= ' AND {{severity}} = :severity';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('only_new' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = true';
|
||||||
|
} elseif ('only_old' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = false';
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = Database::getConnection('read')->prepareCommon($query);
|
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||||
|
|
||||||
$stmt->bindValue(':build', $buildId, \PDO::PARAM_INT);
|
$stmt->bindValue(':build', $buildId, \PDO::PARAM_INT);
|
||||||
|
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
$stmt->bindValue(':plugin', $plugin, \PDO::PARAM_STR);
|
$stmt->bindValue(':plugin', $plugin, \PDO::PARAM_STR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $severity) {
|
if (null !== $severity) {
|
||||||
$stmt->bindValue(':severity', (integer)$severity, \PDO::PARAM_INT);
|
$stmt->bindValue(':severity', (integer)$severity, \PDO::PARAM_INT);
|
||||||
}
|
}
|
||||||
|
@ -170,14 +188,30 @@ class BuildErrorStore extends Store
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer $buildId
|
* @param integer $buildId
|
||||||
|
* @param integer $severity
|
||||||
|
* @param string $isNew
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getKnownPlugins($buildId)
|
public function getKnownPlugins($buildId, $severity = null, $isNew = '')
|
||||||
{
|
{
|
||||||
$query = 'SELECT DISTINCT {{plugin}} from {{build_error}} WHERE {{build_id}} = :build';
|
$query = 'SELECT DISTINCT {{plugin}} from {{build_error}} WHERE {{build_id}} = :build';
|
||||||
|
|
||||||
|
if (null !== $severity) {
|
||||||
|
$query .= ' AND {{severity}} = :severity';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('only_new' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = true';
|
||||||
|
} elseif ('only_old' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = false';
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = Database::getConnection('read')->prepareCommon($query);
|
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||||
$stmt->bindValue(':build', $buildId);
|
$stmt->bindValue(':build', $buildId);
|
||||||
|
if (null !== $severity) {
|
||||||
|
$stmt->bindValue(':severity', (integer)$severity, \PDO::PARAM_INT);
|
||||||
|
}
|
||||||
|
|
||||||
if ($stmt->execute()) {
|
if ($stmt->execute()) {
|
||||||
$res = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$res = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
@ -196,16 +230,24 @@ class BuildErrorStore extends Store
|
||||||
/**
|
/**
|
||||||
* @param integer $buildId
|
* @param integer $buildId
|
||||||
* @param string $plugin
|
* @param string $plugin
|
||||||
|
* @param string $isNew
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getKnownSeverities($buildId, $plugin = '')
|
public function getKnownSeverities($buildId, $plugin = '', $isNew = '')
|
||||||
{
|
{
|
||||||
$query = 'SELECT DISTINCT {{severity}} from {{build_error}} WHERE {{build_id}} = :build';
|
$query = 'SELECT DISTINCT {{severity}} FROM {{build_error}} WHERE {{build_id}} = :build';
|
||||||
|
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
$query .= ' AND {{plugin}} = :plugin';
|
$query .= ' AND {{plugin}} = :plugin';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('only_new' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = true';
|
||||||
|
} elseif ('only_old' === $isNew) {
|
||||||
|
$query .= ' AND {{is_new}} = false';
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = Database::getConnection('read')->prepareCommon($query);
|
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||||
$stmt->bindValue(':build', $buildId);
|
$stmt->bindValue(':build', $buildId);
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
|
@ -225,4 +267,55 @@ class BuildErrorStore extends Store
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a build error is new.
|
||||||
|
*
|
||||||
|
* @param integer $projectId
|
||||||
|
* @param string $hash
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function getIsNewError($projectId, $hash)
|
||||||
|
{
|
||||||
|
$query = '
|
||||||
|
SELECT COUNT(*) AS {{total}} FROM {{build_error}} AS be
|
||||||
|
LEFT JOIN {{build}} AS b ON be.build_id = b.id
|
||||||
|
WHERE be.hash = :hash AND b.project_id = :project';
|
||||||
|
|
||||||
|
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||||
|
|
||||||
|
$stmt->bindValue(':project', $projectId);
|
||||||
|
$stmt->bindValue(':hash', $hash);
|
||||||
|
|
||||||
|
if ($stmt->execute()) {
|
||||||
|
$res = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return (0 === (integer)$res['total']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer $buildId
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getNewErrorsCount($buildId)
|
||||||
|
{
|
||||||
|
$query = 'SELECT COUNT(*) AS {{total}} FROM {{build_error}} WHERE {{build_id}} = :build AND {{is_new}} = true';
|
||||||
|
|
||||||
|
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||||
|
|
||||||
|
$stmt->bindValue(':build', $buildId);
|
||||||
|
|
||||||
|
if ($stmt->execute()) {
|
||||||
|
$res = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return (integer)$res['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ namespace PHPCensor\Store;
|
||||||
|
|
||||||
use b8\Config;
|
use b8\Config;
|
||||||
use b8\Database;
|
use b8\Database;
|
||||||
|
use PHPCensor\Model\BuildError;
|
||||||
|
use b8\Store\Factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BuildErrorWriter
|
* Class BuildErrorWriter
|
||||||
|
@ -15,6 +17,11 @@ class BuildErrorWriter
|
||||||
*/
|
*/
|
||||||
protected $buildId;
|
protected $buildId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
protected $projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -28,13 +35,14 @@ class BuildErrorWriter
|
||||||
protected $bufferSize;
|
protected $bufferSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BuildErrorWriter constructor.
|
* @param integer $projectId
|
||||||
*
|
* @param integer $buildId
|
||||||
* @param int $buildId
|
|
||||||
*/
|
*/
|
||||||
public function __construct($buildId)
|
public function __construct($projectId, $buildId)
|
||||||
{
|
{
|
||||||
$this->bufferSize = (integer)Config::getInstance()->get('php-censor.build.writer_buffer_size', 500);
|
$this->bufferSize = (integer)Config::getInstance()->get('php-censor.build.writer_buffer_size', 500);
|
||||||
|
|
||||||
|
$this->projectId = $projectId;
|
||||||
$this->buildId = $buildId;
|
$this->buildId = $buildId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +77,11 @@ class BuildErrorWriter
|
||||||
if (is_null($createdDate)) {
|
if (is_null($createdDate)) {
|
||||||
$createdDate = new \DateTime();
|
$createdDate = new \DateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var BuildErrorStore $errorStore */
|
||||||
|
$errorStore = Factory::getStore('BuildError');
|
||||||
|
$hash = BuildError::generateHash($plugin, $file, $lineStart, $lineEnd, $severity, $message);
|
||||||
|
|
||||||
$this->errors[] = [
|
$this->errors[] = [
|
||||||
'plugin' => (string)$plugin,
|
'plugin' => (string)$plugin,
|
||||||
'message' => (string)$message,
|
'message' => (string)$message,
|
||||||
|
@ -77,6 +90,8 @@ class BuildErrorWriter
|
||||||
'line_start' => !is_null($lineStart) ? (int)$lineStart : null,
|
'line_start' => !is_null($lineStart) ? (int)$lineStart : null,
|
||||||
'line_end' => !is_null($lineEnd) ? (int)$lineEnd : null,
|
'line_end' => !is_null($lineEnd) ? (int)$lineEnd : null,
|
||||||
'create_date' => $createdDate->format('Y-m-d H:i:s'),
|
'create_date' => $createdDate->format('Y-m-d H:i:s'),
|
||||||
|
'hash' => $hash,
|
||||||
|
'is_new' => $errorStore->getIsNewError($this->projectId, $hash) ? 1 : 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (count($this->errors) >= $this->bufferSize) {
|
if (count($this->errors) >= $this->bufferSize) {
|
||||||
|
@ -104,7 +119,9 @@ class BuildErrorWriter
|
||||||
:line_end' . $i . ',
|
:line_end' . $i . ',
|
||||||
:severity' . $i . ',
|
:severity' . $i . ',
|
||||||
:message' . $i . ',
|
:message' . $i . ',
|
||||||
:create_date' . $i . '
|
:create_date' . $i . ',
|
||||||
|
:hash' . $i . ',
|
||||||
|
:is_new' . $i . '
|
||||||
)';
|
)';
|
||||||
$insertValuesData['build_id' . $i] = $this->buildId;
|
$insertValuesData['build_id' . $i] = $this->buildId;
|
||||||
$insertValuesData['plugin' . $i] = $error['plugin'];
|
$insertValuesData['plugin' . $i] = $error['plugin'];
|
||||||
|
@ -114,6 +131,8 @@ class BuildErrorWriter
|
||||||
$insertValuesData['severity' . $i] = $error['severity'];
|
$insertValuesData['severity' . $i] = $error['severity'];
|
||||||
$insertValuesData['message' . $i] = $error['message'];
|
$insertValuesData['message' . $i] = $error['message'];
|
||||||
$insertValuesData['create_date' . $i] = $error['create_date'];
|
$insertValuesData['create_date' . $i] = $error['create_date'];
|
||||||
|
$insertValuesData['hash' . $i] = $error['hash'];
|
||||||
|
$insertValuesData['is_new' . $i] = $error['is_new'];
|
||||||
}
|
}
|
||||||
$query = '
|
$query = '
|
||||||
INSERT INTO {{build_error}} (
|
INSERT INTO {{build_error}} (
|
||||||
|
@ -124,12 +143,15 @@ class BuildErrorWriter
|
||||||
{{line_end}},
|
{{line_end}},
|
||||||
{{severity}},
|
{{severity}},
|
||||||
{{message}},
|
{{message}},
|
||||||
{{create_date}}
|
{{create_date}},
|
||||||
|
{{hash}},
|
||||||
|
{{is_new}}
|
||||||
)
|
)
|
||||||
VALUES ' . join(', ', $insertValuesPlaceholders) . '
|
VALUES ' . join(', ', $insertValuesPlaceholders) . '
|
||||||
';
|
';
|
||||||
$stmt = Database::getConnection('write')->prepareCommon($query);
|
$stmt = Database::getConnection('write')->prepareCommon($query);
|
||||||
$stmt->execute($insertValuesData);
|
$stmt->execute($insertValuesData);
|
||||||
|
|
||||||
$this->errors = [];
|
$this->errors = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,19 +14,24 @@ foreach ($errors as $error):
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<span class="label label-<?php print $error->getSeverityClass(); ?>">
|
<?php if ($error->getIsNew()): ?>
|
||||||
<?php print Lang::get($error->getSeverityString()); ?>
|
<span class="label label-danger"><?= Lang::get('new'); ?></span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="label label-<?= $error->getSeverityClass(); ?>">
|
||||||
|
<?= Lang::get($error->getSeverityString()); ?>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td><?php print Lang::get($error->getPlugin()); ?></td>
|
<td><?= Lang::get($error->getPlugin()); ?></td>
|
||||||
<td><a href="<?php print $link; ?>" target="_blank"><?php print $error->getFile(); ?></a></td>
|
<td><a href="<?php print $link; ?>" target="_blank"><?= $error->getFile(); ?></a></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php print $link; ?>" target="_blank">
|
<a href="<?php print $link; ?>" target="_blank">
|
||||||
<?php
|
<?php
|
||||||
if ($error->getLineStart() == $error->getLineEnd() || !$error->getLineEnd()) {
|
if ($error->getLineStart() == $error->getLineEnd() || !$error->getLineEnd()) {
|
||||||
print $error->getLineStart();
|
echo $error->getLineStart();
|
||||||
} else {
|
} else {
|
||||||
print $error->getLineStart() . ' - ' . $error->getLineEnd();
|
echo ($error->getLineStart() . ' - ' . $error->getLineEnd());
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -201,6 +201,31 @@ use PHPCensor\Model\BuildError;
|
||||||
<p><?= Lang::get('errors_selected'); ?>: <?= $data['errors']; ?> / <?= $data['errors_total']; ?></p>
|
<p><?= Lang::get('errors_selected'); ?>: <?= $data['errors']; ?> / <?= $data['errors_total']; ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<?php if (!empty($isNew)) {
|
||||||
|
echo Lang::get($isNew);
|
||||||
|
} else {
|
||||||
|
echo Lang::get('all_errors');
|
||||||
|
} ?> <span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu" role="menu">
|
||||||
|
<li>
|
||||||
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?plugin=<?= urlencode($plugin); ?>&severity=<?= urlencode($severity); ?>#errors"><?= Lang::get('all_errors'); ?></a>
|
||||||
|
</li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
|
||||||
|
<?php if(!empty($isNews)): ?>
|
||||||
|
<?php foreach ($isNews as $currentIsNew) : ?>
|
||||||
|
<li <?= ($currentIsNew === $isNew) ? 'class="active"' : ''; ?>>
|
||||||
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?is_new=<?= urlencode($currentIsNew); ?>&plugin=<?= urlencode($plugin); ?>&severity=<?= urlencode($severity); ?>#errors">
|
||||||
|
<?= Lang::get($currentIsNew); ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
<?php if (!empty($plugin)) {
|
<?php if (!empty($plugin)) {
|
||||||
|
@ -210,13 +235,15 @@ use PHPCensor\Model\BuildError;
|
||||||
} ?> <span class="caret"></span>
|
} ?> <span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" role="menu">
|
<ul class="dropdown-menu" role="menu">
|
||||||
<li><a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?severity=<?= urlencode($severity); ?>#errors"><?= Lang::get('all_plugins'); ?></a></li>
|
<li>
|
||||||
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?is_new=<?= urlencode($isNew); ?>&severity=<?= urlencode($severity); ?>#errors"><?= Lang::get('all_plugins'); ?></a>
|
||||||
|
</li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
|
|
||||||
<?php if(!empty($plugins)): ?>
|
<?php if(!empty($plugins)): ?>
|
||||||
<?php foreach ($plugins as $currentPlugin) : ?>
|
<?php foreach ($plugins as $currentPlugin) : ?>
|
||||||
<li <?= ($currentPlugin === $plugin) ? 'class="active"' : ''; ?>>
|
<li <?= ($currentPlugin === $plugin) ? 'class="active"' : ''; ?>>
|
||||||
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?plugin=<?= urlencode($currentPlugin); ?>&severity=<?= urlencode($severity); ?>#errors">
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?is_new=<?= urlencode($isNew); ?>&plugin=<?= urlencode($currentPlugin); ?>&severity=<?= urlencode($severity); ?>#errors">
|
||||||
<?= Lang::get($currentPlugin); ?>
|
<?= Lang::get($currentPlugin); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -233,13 +260,15 @@ use PHPCensor\Model\BuildError;
|
||||||
} ?> <span class="caret"></span>
|
} ?> <span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" role="menu">
|
<ul class="dropdown-menu" role="menu">
|
||||||
<li><a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?plugin=<?= urlencode($plugin); ?>#errors"><?= Lang::get('all_severities'); ?></a></li>
|
<li>
|
||||||
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?is_new=<?= urlencode($isNew); ?>&plugin=<?= urlencode($plugin); ?>#errors"><?= Lang::get('all_severities'); ?></a>
|
||||||
|
</li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
|
|
||||||
<?php if(!empty($severities)): ?>
|
<?php if(!empty($severities)): ?>
|
||||||
<?php foreach ($severities as $currentSeverity) : ?>
|
<?php foreach ($severities as $currentSeverity) : ?>
|
||||||
<li <?= ($currentSeverity === $severity) ? 'class="active"' : ''; ?>>
|
<li <?= ($currentSeverity === $severity) ? 'class="active"' : ''; ?>>
|
||||||
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?plugin=<?= urlencode($plugin); ?>&severity=<?= urlencode($currentSeverity); ?>#errors">
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>?is_new=<?= urlencode($isNew); ?>&plugin=<?= urlencode($plugin); ?>&severity=<?= urlencode($currentSeverity); ?>#errors">
|
||||||
<?= Lang::get(BuildError::getSeverityName($currentSeverity)); ?>
|
<?= Lang::get(BuildError::getSeverityName($currentSeverity)); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -253,6 +282,7 @@ use PHPCensor\Model\BuildError;
|
||||||
<table class="errors-table table table-hover">
|
<table class="errors-table table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th><?php Lang::out('is_new'); ?></th>
|
||||||
<th><?php Lang::out('severity'); ?></th>
|
<th><?php Lang::out('severity'); ?></th>
|
||||||
<th><?php Lang::out('plugin'); ?></th>
|
<th><?php Lang::out('plugin'); ?></th>
|
||||||
<th><?php Lang::out('file'); ?></th>
|
<th><?php Lang::out('file'); ?></th>
|
||||||
|
@ -281,6 +311,7 @@ use PHPCensor\Model\BuildError;
|
||||||
var PAGE = <?= $page; ?>;
|
var PAGE = <?= $page; ?>;
|
||||||
var BUILD_PLUGIN = '<?= $plugin; ?>';
|
var BUILD_PLUGIN = '<?= $plugin; ?>';
|
||||||
var BUILD_SEVERITY = '<?= $severity; ?>';
|
var BUILD_SEVERITY = '<?= $severity; ?>';
|
||||||
|
var BUILD_IS_NEW = '<?= $isNew; ?>';
|
||||||
|
|
||||||
var ActiveBuild = new Build(<?= $build->getId(); ?>);
|
var ActiveBuild = new Build(<?= $build->getId(); ?>);
|
||||||
ActiveBuild.setupBuild(<?= json_encode($data); ?>, <?= json_encode($build->getFileLinkTemplate()); ?>);
|
ActiveBuild.setupBuild(<?= json_encode($data); ?>, <?= json_encode($build->getFileLinkTemplate()); ?>);
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
<?php use PHPCensor\Helper\Lang; ?>
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \PHPCensor\Model\Build[] $builds
|
||||||
|
*/
|
||||||
|
|
||||||
|
use PHPCensor\Helper\Lang;
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<?php if(empty($builds) || !count($builds)): ?>
|
<?php if(empty($builds) || !count($builds)): ?>
|
||||||
<tr class="">
|
<tr class="">
|
||||||
|
@ -78,6 +86,9 @@ $branches = $build->getExtra('branches');
|
||||||
<td>
|
<td>
|
||||||
<?= $build->getDuration(); ?> <?= Lang::get('seconds'); ?>
|
<?= $build->getDuration(); ?> <?= Lang::get('seconds'); ?>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<?= $build->getNewErrorsCount(); ?>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group btn-group-right">
|
<div class="btn-group btn-group-right">
|
||||||
<a class="btn btn-default btn-sm" href="<?php echo APP_URL ?>build/view/<?php print $build->getId(); ?>"><?php Lang::out('view'); ?></a>
|
<a class="btn btn-default btn-sm" href="<?php echo APP_URL ?>build/view/<?php print $build->getId(); ?>"><?php Lang::out('view'); ?></a>
|
||||||
|
|
|
@ -116,6 +116,7 @@ use PHPCensor\Helper\Lang;
|
||||||
<th><?php Lang::out('branch'); ?></th>
|
<th><?php Lang::out('branch'); ?></th>
|
||||||
<th><?php Lang::out('environment'); ?></th>
|
<th><?php Lang::out('environment'); ?></th>
|
||||||
<th><?php Lang::out('duration'); ?></th>
|
<th><?php Lang::out('duration'); ?></th>
|
||||||
|
<th><?php Lang::out('new_errors'); ?></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -75,10 +75,15 @@ use PHPCensor\Model\Build;
|
||||||
<span><?= $environment; ?></span>
|
<span><?= $environment; ?></span>
|
||||||
—
|
—
|
||||||
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>">
|
<a href="<?= APP_URL; ?>build/view/<?= $build->getId(); ?>">
|
||||||
Build #<?= $build->getId(); ?>
|
<?php Lang::out('build'); ?> #<?= $build->getId(); ?>
|
||||||
</a>
|
</a>
|
||||||
—
|
—
|
||||||
<?php Lang::out($build->getSourceHumanize()); ?>
|
<?php Lang::out($build->getSourceHumanize()); ?>
|
||||||
|
<?php if ($newErrorsCount = $build->getNewErrorsCount()): ?>
|
||||||
|
—
|
||||||
|
<?php Lang::out('new_errors'); ?>:
|
||||||
|
<?= $newErrorsCount; ?>
|
||||||
|
<?php endif; ?>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="timeline-body">
|
<div class="timeline-body">
|
||||||
|
|
|
@ -23,6 +23,6 @@ use PHPCensor\Helper\Lang;
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php if ($paginator->getNextUrl()): ?>
|
<?php if ($paginator->getNextUrl()): ?>
|
||||||
<li><a href="<?php echo $paginator->getNextUrl(); ?>"><?= Lang::get('prev_link'); ?></a></li>
|
<li><a href="<?php echo $paginator->getNextUrl(); ?>"><?= Lang::get('next_link'); ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue