Summary:
This accomplishes three major goals:
# Fixes phutil_render_tag -> phutil_tag callsites in DarkConsole.
# Moves the Ajax request log to a new panel on the left. This panel (and the tabs panel) get scrollbars when they get large, instead of making the page constantly scroll down.
# Loads the panel content over ajax, instead of dumping it into the page body / ajax response body. I've been planning to do this for about 3 years, which is why the plugins are architected the way they are. This should make debugging easier by making response bodies not be 50%+ darkconsole stuff.
Additionally, load the plugins dynamically (the old method predates library maps and PhutilSymbolLoader).
Test Plan:
{F30675}
- Switched between requests and tabs, reloaded page, saw same tab.
- Used "analyze queries", "profile page", triggered errors.
- Verified page does not load anything by default if dark console is closed with Charles.
- Generally banged on it a bit.
Reviewers: vrana, btrahan, chad
Reviewed By: vrana
CC: aran
Maniphest Tasks: T2432
Differential Revision: https://secure.phabricator.com/D4692
91 lines
1.4 KiB
PHP
91 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @group console
|
|
*/
|
|
abstract class DarkConsolePlugin {
|
|
|
|
private $data;
|
|
private $request;
|
|
private $core;
|
|
|
|
abstract public function getName();
|
|
abstract public function getDescription();
|
|
abstract public function renderPanel();
|
|
|
|
public function __construct() {
|
|
|
|
}
|
|
|
|
public function getColor() {
|
|
return null;
|
|
}
|
|
|
|
final public function getOrderKey() {
|
|
return sprintf(
|
|
'%09d%s',
|
|
(int)(999999999 * $this->getOrder()),
|
|
$this->getName());
|
|
}
|
|
|
|
public function getOrder() {
|
|
return 1.0;
|
|
}
|
|
|
|
public function setConsoleCore(DarkConsoleCore $core) {
|
|
$this->core = $core;
|
|
return $this;
|
|
}
|
|
|
|
public function getConsoleCore() {
|
|
return $this->core;
|
|
}
|
|
|
|
public function generateData() {
|
|
return null;
|
|
}
|
|
|
|
public function setData($data) {
|
|
$this->data = $data;
|
|
return $this;
|
|
}
|
|
|
|
public function getData() {
|
|
return $this->data;
|
|
}
|
|
|
|
public function setRequest($request) {
|
|
$this->request = $request;
|
|
return $this;
|
|
}
|
|
|
|
public function getRequest() {
|
|
return $this->request;
|
|
}
|
|
|
|
public function getRequestURI() {
|
|
return $this->getRequest()->getRequestURI();
|
|
}
|
|
|
|
public function shouldStartup() {
|
|
return true;
|
|
}
|
|
|
|
public function didStartup() {
|
|
return null;
|
|
}
|
|
|
|
public function willShutdown() {
|
|
return null;
|
|
}
|
|
|
|
public function didShutdown() {
|
|
return null;
|
|
}
|
|
|
|
public function processRequest() {
|
|
return null;
|
|
}
|
|
|
|
}
|