mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Allow opening editor from DarkConsole error log
Test Plan: Click on "passing a null index to idx()" in DarkConsole. Click on entry in stack trace. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2275
This commit is contained in:
parent
3c22bebc9b
commit
1772410a2b
4 changed files with 14 additions and 11 deletions
|
@ -388,7 +388,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'aphront-dark-console-css' =>
|
||||
array(
|
||||
'uri' => '/res/1a9f84bb/rsrc/css/aphront/dark-console.css',
|
||||
'uri' => '/res/4965d970/rsrc/css/aphront/dark-console.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -1034,7 +1034,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-error-log' =>
|
||||
array(
|
||||
'uri' => '/res/a5cb42a5/rsrc/js/application/core/behavior-error-log.js',
|
||||
'uri' => '/res/f46289e9/rsrc/js/application/core/behavior-error-log.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -75,17 +75,21 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
|
|||
$line .= $entry['class'].'::';
|
||||
}
|
||||
$line .= idx($entry, 'function', '');
|
||||
$onclick = '';
|
||||
$href = null;
|
||||
if (isset($entry['file'])) {
|
||||
$line .= ' called at ['.$entry['file'].':'.$entry['line'].']';
|
||||
$onclick = jsprintf(
|
||||
'open_file(%s, %d)', $entry['file'], $entry['line']);
|
||||
try {
|
||||
$user = $this->getRequest()->getUser();
|
||||
$href = $user->loadEditorLink($entry['file'], $entry['line'], '');
|
||||
} catch (Exception $ex) {
|
||||
// The database can be inaccessible.
|
||||
}
|
||||
}
|
||||
|
||||
$details .= phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'onclick' => $onclick,
|
||||
'href' => $href,
|
||||
),
|
||||
phutil_escape_html($line));
|
||||
$details .= "\n";
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
.dark-console a:link {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.dark-console-tabs {
|
||||
width: 180px;
|
||||
background: #222222;
|
||||
|
|
|
@ -5,11 +5,6 @@
|
|||
|
||||
var current_details = null;
|
||||
|
||||
function open_file(file, row) {
|
||||
// Do some fun some here, e.g., open the diffusion page for the file
|
||||
// or open the file in an editor
|
||||
}
|
||||
|
||||
function show_details(row) {
|
||||
var node = JX.$('row-details-' + row);
|
||||
|
||||
|
|
Loading…
Reference in a new issue