22
33namespace Dcat \Page \Admin \Controllers ;
44
5+ use Dcat \Admin \Grid ;
6+ use Dcat \Admin \Layout \Content ;
7+ use Dcat \Admin \Widgets \Box ;
58use Dcat \Admin \Widgets \Card ;
6- use DcatPage ;
7- use Illuminate \ Routing \ Controller ;
9+ use Dcat \ Admin \ Widgets \ Table ;
10+ use Dcat \ Admin \ Widgets \ Terminal ;
811use Dcat \Page \Admin \Grid \CompileButton ;
912use Dcat \Page \Admin \Grid \CreateAppButton ;
1013use Dcat \Page \Admin \Grid \IndexButton ;
1114use Dcat \Page \Admin \Repositories \App ;
12- use Dcat \Admin \Grid ;
13- use Dcat \Admin \Layout \Content ;
14- use Dcat \Admin \Widgets \Box ;
15- use Dcat \Admin \Widgets \Terminal ;
16- use Dcat \Admin \Widgets \Table ;
15+ use DcatPage ;
16+ use Illuminate \Routing \Controller ;
1717
1818class AdminController extends Controller
1919{
2020 /**
21- * 应用管理页面
21+ * 应用管理页面.
2222 *
2323 * @param Content $content
24+ *
2425 * @return Content
2526 */
2627 public function index (Content $ content )
@@ -32,7 +33,7 @@ public function index(Content $content)
3233 }
3334
3435 /**
35- * 构建应用列表
36+ * 构建应用列表.
3637 *
3738 * @return Grid
3839 */
@@ -49,25 +50,31 @@ protected function grid()
4950 $ grid ->app ('应用 ' )->label ('primary ' );
5051 $ grid ->column ('description ' , '描述 ' )->width ('360px ' );
5152 $ grid ->homepage ('主页 ' )->display (function ($ value ) {
52- if (!$ value ) return ;
53+ if (!$ value ) {
54+ return ;
55+ }
5356
5457 return "<a href=' $ value' target='_blank'></a> " ;
5558 });
5659 $ grid ->authors ('开发者 ' )->display (function ($ v ) {
57- if (!$ v ) return ;
60+ if (!$ v ) {
61+ return ;
62+ }
5863
5964 foreach ($ v as &$ item ) {
6065 $ item = "<span class='bold text-80'> {$ item ['name ' ]}</span> <<code> {$ item ['email ' ]}</code>> " ;
6166 }
6267
63- return join ('<br/> ' , $ v );
68+ return implode ('<br/> ' , $ v );
6469 });
6570
6671 $ self = $ this ;
6772 $ grid ->config ('配置 ' )->display ('详细 ' )->expand (function () use ($ self ) {
68- if (!$ this ->config ) return ;
73+ if (!$ this ->config ) {
74+ return ;
75+ }
6976
70- return $ self ->formatConfigData ((array )$ this ->config );
77+ return $ self ->formatConfigData ((array ) $ this ->config );
7178 });
7279
7380 $ grid ->action ('操作 ' )->display (function () {
@@ -90,7 +97,7 @@ protected function grid()
9097 }
9198
9299 /**
93- * 创建应用接口
100+ * 创建应用接口.
94101 *
95102 * @return mixed
96103 */
@@ -105,14 +112,14 @@ public function createApp()
105112 }
106113
107114 /**
108- * 编译应用接口
115+ * 编译应用接口.
109116 *
110117 * @return mixed
111118 */
112119 public function compileApp ()
113120 {
114121 $ name = request ('name ' );
115- $ dir = request ('dir ' );
122+ $ dir = request ('dir ' );
116123
117124 $ title = '' ;
118125 if ($ dir ) {
@@ -126,7 +133,7 @@ public function compileApp()
126133 }
127134
128135 /**
129- * 生成索引接口
136+ * 生成索引接口.
130137 *
131138 * @return mixed
132139 */
@@ -142,11 +149,12 @@ public function indexApp()
142149
143150 /**
144151 * @param array $data
152+ *
145153 * @return Table
146154 */
147155 protected function formatConfigData (array $ data )
148156 {
149- $ data = json_encode ($ data , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT );
157+ $ data = json_encode ($ data , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT );
150158
151159 return Card::make ("<pre> $ data</pre> " )->class ('mb-0 ' , true );
152160 }
0 commit comments