Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891591
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
6 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/repository/controller/PhabricatorRepositoryController.php b/src/applications/repository/controller/PhabricatorRepositoryController.php
index ba5bfacc23..6ba863f39d 100644
--- a/src/applications/repository/controller/PhabricatorRepositoryController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryController.php
@@ -1,66 +1,24 @@
<?php
abstract class PhabricatorRepositoryController extends PhabricatorController {
public function shouldRequireAdmin() {
// Most of these controllers are admin-only.
return true;
}
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName('Repositories');
$page->setBaseURI('/repository/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("rX");
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
- private function isPullDaemonRunning() {
- $daemons = id(new PhabricatorDaemonLogQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
- ->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE)
- ->withDaemonClasses(array('PhabricatorRepositoryPullLocalDaemon'))
- ->setLimit(1)
- ->execute();
-
- return (bool)$daemons;
- }
-
- protected function renderDaemonNotice() {
- $documentation = phutil_tag(
- 'a',
- array(
- 'href' => PhabricatorEnv::getDoclink(
- 'article/Diffusion_User_Guide.html'),
- ),
- 'Diffusion User Guide');
-
- $common = hsprintf(
- "Without this daemon, Phabricator will not be able to import or update ".
- "repositories. For instructions on starting the daemon, see %s.",
- phutil_tag('strong', array(), $documentation));
-
- $daemon_running = $this->isPullDaemonRunning();
- if ($daemon_running) {
- return null;
- }
- $title = "Repository Daemon Not Running";
- $message = hsprintf(
- "<p>The repository daemon is not running. %s</p>",
- $common);
-
- $view = new AphrontErrorView();
- $view->setSeverity(AphrontErrorView::SEVERITY_WARNING);
- $view->setTitle($title);
- $view->appendChild($message);
-
- return $view;
- }
-
}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryListController.php b/src/applications/repository/controller/PhabricatorRepositoryListController.php
index b7c839e427..0c4ea1b1fd 100644
--- a/src/applications/repository/controller/PhabricatorRepositoryListController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryListController.php
@@ -1,155 +1,154 @@
<?php
final class PhabricatorRepositoryListController
extends PhabricatorRepositoryController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$is_admin = $user->getIsAdmin();
$repos = id(new PhabricatorRepositoryQuery())
->setViewer($user)
->execute();
$repos = msort($repos, 'getName');
$rows = array();
foreach ($repos as $repo) {
if ($repo->isTracked()) {
$diffusion_link = phutil_tag(
'a',
array(
'href' => '/diffusion/'.$repo->getCallsign().'/',
),
'View in Diffusion');
} else {
$diffusion_link = phutil_tag('em', array(), 'Not Tracked');
}
$rows[] = array(
$repo->getCallsign(),
$repo->getName(),
PhabricatorRepositoryType::getNameForRepositoryType(
$repo->getVersionControlSystem()),
$diffusion_link,
phutil_tag(
'a',
array(
'class' => 'button small grey',
'href' => '/diffusion/'.$repo->getCallsign().'/edit/',
),
'Edit'),
);
}
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Callsign',
'Repository',
'Type',
'Diffusion',
'',
));
$table->setColumnClasses(
array(
null,
'wide',
null,
null,
'action',
));
$table->setColumnVisibility(
array(
true,
true,
true,
true,
$is_admin,
));
$panel = new AphrontPanelView();
$panel->setHeader('Repositories');
if ($is_admin) {
$panel->setCreateButton('Create New Repository', '/diffusion/create/');
}
$panel->appendChild($table);
$panel->setNoBackground();
$projects = id(new PhabricatorRepositoryArcanistProject())->loadAll();
$rows = array();
foreach ($projects as $project) {
$repo = idx($repos, $project->getRepositoryID());
if ($repo) {
$repo_name = $repo->getName();
} else {
$repo_name = '-';
}
$rows[] = array(
$project->getName(),
$repo_name,
phutil_tag(
'a',
array(
'href' => '/repository/project/edit/'.$project->getID().'/',
'class' => 'button grey small',
),
'Edit'),
javelin_tag(
'a',
array(
'href' => '/repository/project/delete/'.$project->getID().'/',
'class' => 'button grey small',
'sigil' => 'workflow',
),
'Delete'),
);
}
$project_table = new AphrontTableView($rows);
$project_table->setHeaders(
array(
'Project ID',
'Repository',
'',
'',
));
$project_table->setColumnClasses(
array(
'',
'wide',
'action',
'action',
));
$project_table->setColumnVisibility(
array(
true,
true,
$is_admin,
$is_admin,
));
$project_panel = new AphrontPanelView();
$project_panel->setHeader('Arcanist Projects');
$project_panel->appendChild($project_table);
$project_panel->setNoBackground();
return $this->buildStandardPageResponse(
array(
- $this->renderDaemonNotice(),
$panel,
$project_panel,
),
array(
'title' => 'Repository List',
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 15:26 (3 w, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125975
Default Alt Text
(6 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment