File tree 3 files changed +25
-5
lines changed
3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -299,11 +299,11 @@ export default function Description() {
299
299
subscribeCtrl
300
300
. upsert ( upsertScript as Subscribe )
301
301
. then ( ( ) => {
302
- Message . success ( "订阅成功,1秒后关闭窗口 " ) ;
302
+ Message . success ( "订阅成功" ) ;
303
303
setBtnText ( "订阅成功" ) ;
304
304
setTimeout ( ( ) => {
305
305
closeWindow ( ) ;
306
- } , 1000 ) ;
306
+ } , 200 ) ;
307
307
} )
308
308
. catch ( ( e ) => {
309
309
Message . error ( `订阅失败: ${ e } ` ) ;
@@ -314,15 +314,15 @@ export default function Description() {
314
314
. upsert ( upsertScript as Script )
315
315
. then ( ( ) => {
316
316
if ( isUpdate ) {
317
- Message . success ( "更新成功,1秒后关闭窗口 " ) ;
317
+ Message . success ( "更新成功" ) ;
318
318
setBtnText ( "更新成功" ) ;
319
319
} else {
320
- Message . success ( "安装成功,1秒后关闭窗口 " ) ;
320
+ Message . success ( "安装成功" ) ;
321
321
setBtnText ( "安装成功" ) ;
322
322
}
323
323
setTimeout ( ( ) => {
324
324
closeWindow ( ) ;
325
- } , 1000 ) ;
325
+ } , 200 ) ;
326
326
} )
327
327
. catch ( ( e ) => {
328
328
Message . error ( `安装失败: ${ e } ` ) ;
Original file line number Diff line number Diff line change @@ -124,6 +124,22 @@ function installUrlToHome(installUrl: string) {
124
124
/>
125
125
) ;
126
126
}
127
+ if ( installUrl . indexOf ( "github.com" ) !== - 1 ) {
128
+ const repo = `${ installUrl . split ( "/" ) [ 3 ] } /${ installUrl . split ( "/" ) [ 4 ] } ` ;
129
+ return (
130
+ < Button
131
+ type = "text"
132
+ iconOnly
133
+ size = "small"
134
+ target = "_blank"
135
+ href = { `https://github.com/${ repo } ` }
136
+ style = { {
137
+ color : "var(--color-text-1)" ,
138
+ } }
139
+ icon = { < IconGithub /> }
140
+ />
141
+ ) ;
142
+ }
127
143
} catch ( e ) {
128
144
// ignore error
129
145
}
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ export async function fetchScriptInfo(
106
106
if ( resp . status !== 200 ) {
107
107
throw new Error ( "fetch script info failed" ) ;
108
108
}
109
+ if ( resp . headers . get ( "content-type" ) ?. indexOf ( "text/html" ) !== - 1 ) {
110
+ throw new Error ( "url is html" ) ;
111
+ }
112
+
109
113
const body = await resp . text ( ) ;
110
114
const ok = parseMetadata ( body ) ;
111
115
if ( ! ok ) {
You can’t perform that action at this time.
0 commit comments