File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -808,12 +808,12 @@ func (this *BookController) GitPull() {
808808 }
809809 //GitHub项目链接
810810 link := this .GetString ("link" )
811- folder := "store/" + identify
812- err := utils .GitClone (link , folder )
813- if err != nil {
814- this .JsonResult (1 , err .Error ())
815- }
816811 go func () {
812+ folder := "store/" + identify
813+ err := utils .GitClone (link , folder )
814+ if err != nil {
815+ this .JsonResult (1 , err .Error ())
816+ }
817817 this .loadByFolder (book .BookId , identify , folder )
818818 }()
819819
Original file line number Diff line number Diff line change 133133 </ ul >
134134 </ div >
135135 <!-- Split button -->
136- < div class ="btn-group ">
136+ < div class ="btn-group btn-group-download ">
137137 < button type ="button " class ="btn btn-default "> < i class ="fa fa-cloud-download "> </ i > 导出项目</ button >
138138 < button type ="button " class ="btn btn-default dropdown-toggle " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="false ">
139139 < span class ="caret "> </ span >
140140 < span class ="sr-only "> Toggle Dropdown</ span >
141141 </ button >
142142 < ul class ="dropdown-menu ">
143- < li > < a href ="# "> 导出 PDF</ a > </ li >
144- < li > < a href ="# "> 导出 MOBI</ a > </ li >
145- < li > < a href ="# "> 导出 EPUB</ a > </ li >
146- {{/*< li > < a href ="# "> 导出 MD</ a > </ li > */}}
143+ < li > < a :href ="'{{urlfor "DocumentController.Export " ":key" ""}}' + item.identify+'?output=pdf '"> 导出 PDF</ a > </ li >
144+ < li > < a :href ="'{{urlfor "DocumentController.Export " ":key" ""}}' + item.identify+'?output=mobi '"> 导出 MOBI</ a > </ li >
145+ < li > < a :href ="'{{urlfor "DocumentController.Export " ":key" ""}}' + item.identify+'?output=epub '"> 导出 EPUB</ a > </ li >
147146 </ ul >
148147 </ div >
149148 </ div >
@@ -306,7 +305,17 @@ <h4 class="modal-title" id="myModalLabel">添加项目</h4>
306305 }
307306 } ) ;
308307
309-
308+ $ ( ".btn-group-download a" ) . click ( function ( e ) {
309+ e . preventDefault ( ) ;
310+ var href = $ ( this ) . attr ( "href" ) ;
311+ $ . get ( href , function ( res ) {
312+ if ( res . errcode == 1 ) {
313+ alertTips ( "error" , res . message , 3000 ) ;
314+ } else {
315+ location . href = res . data . url ;
316+ }
317+ } ) ;
318+ } ) ;
310319
311320 } ) ;
312321</ script >
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ <h4 class="modal-title" id="ModalPullByGitLabel">拉取项目</h4>
3535 < input type ="text " name ="link " required class ="form-control " placeholder ="请输入Git仓库地址 ">
3636 < input type ="hidden " value ="" name ="identify ">
3737 </ div >
38- < div class ="help-block "> 从Git仓库拉取markdown项目</ div >
38+ < div class ="help-block "> 从Git仓库拉取markdown项目(只支持git公开仓库项目的导入) </ div >
3939 </ div >
4040 < div class ="modal-footer ">
4141 < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> 取消</ button >
You can’t perform that action at this time.
0 commit comments