File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77use CodedMonkey \Dirigent \Doctrine \Entity \Credentials ;
88use CodedMonkey \Dirigent \Doctrine \Entity \Registry ;
99use CodedMonkey \Dirigent \Doctrine \Entity \User ;
10+ use CodedMonkey \Dirigent \Doctrine \Repository \PackageRepository ;
1011use EasyCorp \Bundle \EasyAdminBundle \Config \Assets ;
1112use EasyCorp \Bundle \EasyAdminBundle \Config \Dashboard ;
1213use EasyCorp \Bundle \EasyAdminBundle \Config \MenuItem ;
2425class DashboardRootController extends AbstractDashboardController
2526{
2627 public function __construct (
28+ private readonly PackageRepository $ packageRepository ,
2729 #[Autowire(param: 'dirigent.title ' )]
2830 private readonly string $ title ,
2931 #[Autowire(param: 'dirigent.security.registration_enabled ' )]
@@ -102,7 +104,11 @@ public function configureUserMenu(UserInterface $user): UserMenu
102104 #[IsGrantedAccess]
103105 public function index (): Response
104106 {
105- return $ this ->render ('dashboard/index.html.twig ' );
107+ $ packageCount = $ this ->packageRepository ->count ();
108+
109+ return $ this ->render ('dashboard/index.html.twig ' , [
110+ 'packageCount ' => $ packageCount ,
111+ ]);
106112 }
107113
108114 #[Route('/dashboard/docs/usage/{page} ' , name: 'dashboard_usage_docs ' )]
Original file line number Diff line number Diff line change 44 const passwordFieldRow = document .querySelector (' [data-credentials-field="password"]' );
55 const tokenFieldRow = document .querySelector (' [data-credentials-field="token"]' );
66
7- let currentType = document .querySelector (' [name="Credentials[type]"]:checked' ).value ?? null ;
8- updateCredentialsFields (currentType);
7+ const initalType = document .querySelector (' [name="Credentials[type]"]:checked' )? .value ?? null ;
8+ if (initalType) {
9+ updateCredentialsFields (initalType);
10+ }
911
1012 document .querySelectorAll (' [name="Credentials[type]"]' ).forEach (input => {
1113 input .addEventListener (' change' , () => {
Original file line number Diff line number Diff line change 22title: Authenticate with Composer
33---
44
5+ Authenticating for this registry in your Composer installation is easy and can be achieved for all projects on your
6+ system by running the following command in your terminal:
7+
58```shell
69 composer config --global --auth http-basic.{{ app .request .getHost () }} {{ app .user .username }} <access -token >
710```
11+
12+ To learn more about how Composer handles authentication, please read the [Composer documentation][composer-doc-auth].
13+
14+ [composer-doc-auth]: https://getcomposer.org/doc/articles/authentication-for-private-packages.md
Original file line number Diff line number Diff line change @@ -89,4 +89,4 @@ composer config disable-tls true
8989}
9090```
9191
92- **Disabling TLS is dangerous and brings risks .**
92+ **Disabling TLS brings risks and can be dangerous .**
Original file line number Diff line number Diff line change 77{% endblock %}
88
99{% block page_content %}
10- <p >Welcome to <a href =" https://github.com/codedmonkey/dirigent" >Dirigent</a >, a free and open package registry for <a href =" https://getcomposer.org" >Composer</a >.</p >
10+ <p >Welcome to <a href =" https://dirigent.dev" >Dirigent</a >, a free and open package registry for <a href =" https://getcomposer.org" >Composer</a >.</p >
11+
12+ <div class =" mb-3" >
13+ <div class =" row" >
14+ <div class =" col-md-4" >
15+ <div class =" card mb-2" >
16+ <div class =" card-body" >
17+ <div >{{ ' Packages' | trans }}</div >
18+ <div class =" display-6" >{{ packageCount | number_format (thousandSep : ' ' ) }}</div >
19+ </div >
20+ </div >
21+ </div >
22+ </div >
23+ </div >
24+
25+ <hr >
1126
1227 <h2 class =" h5" >Use this registry in a Composer project</h2 >
1328
4459
4560 <h2 class =" h5" >Setup authentication</h2 >
4661
47- <p >Store the authentication credentials in the global Composer `auth.json` with the command below.</p >
62+ <p >Store the authentication credentials in the global Composer <code >auth.json</code > with the command below.</p >
63+
64+ <div class =" bg-body-secondary px-3 py-2 mb-3 rounded" >
65+ <pre class =" m-0" ><code >composer config --global http-basic.{{ app .request .getHost () }} {{ app .user .username }} < access-token> </code ></pre >
66+ </div >
4867{% endblock %}
You can’t perform that action at this time.
0 commit comments