1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-27 15:08:20 +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:
vrana 2012-04-18 12:50:06 -07:00
parent 3c22bebc9b
commit 1772410a2b
4 changed files with 14 additions and 11 deletions

View file

@ -388,7 +388,7 @@ celerity_register_resource_map(array(
), ),
'aphront-dark-console-css' => 'aphront-dark-console-css' =>
array( array(
'uri' => '/res/1a9f84bb/rsrc/css/aphront/dark-console.css', 'uri' => '/res/4965d970/rsrc/css/aphront/dark-console.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -1034,7 +1034,7 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-error-log' => 'javelin-behavior-error-log' =>
array( 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', 'type' => 'js',
'requires' => 'requires' =>
array( array(

View file

@ -75,17 +75,21 @@ final class DarkConsoleErrorLogPlugin extends DarkConsolePlugin {
$line .= $entry['class'].'::'; $line .= $entry['class'].'::';
} }
$line .= idx($entry, 'function', ''); $line .= idx($entry, 'function', '');
$onclick = ''; $href = null;
if (isset($entry['file'])) { if (isset($entry['file'])) {
$line .= ' called at ['.$entry['file'].':'.$entry['line'].']'; $line .= ' called at ['.$entry['file'].':'.$entry['line'].']';
$onclick = jsprintf( try {
'open_file(%s, %d)', $entry['file'], $entry['line']); $user = $this->getRequest()->getUser();
$href = $user->loadEditorLink($entry['file'], $entry['line'], '');
} catch (Exception $ex) {
// The database can be inaccessible.
}
} }
$details .= phutil_render_tag( $details .= phutil_render_tag(
'a', 'a',
array( array(
'onclick' => $onclick, 'href' => $href,
), ),
phutil_escape_html($line)); phutil_escape_html($line));
$details .= "\n"; $details .= "\n";

View file

@ -13,6 +13,10 @@
z-index: 1; z-index: 1;
} }
.dark-console a:link {
color: inherit;
}
.dark-console-tabs { .dark-console-tabs {
width: 180px; width: 180px;
background: #222222; background: #222222;

View file

@ -5,11 +5,6 @@
var current_details = null; 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) { function show_details(row) {
var node = JX.$('row-details-' + row); var node = JX.$('row-details-' + row);