@@ -172,7 +172,7 @@ function printServerUrls(
172
172
base : string ,
173
173
info : Logger [ 'info' ]
174
174
) : void {
175
- const urls : Array < { label : string ; url : string } > = [ ]
175
+ const urls : Array < { label : string ; url : string ; disabled ?: boolean } > = [ ]
176
176
const notes : Array < { label : string ; message : string } > = [ ]
177
177
178
178
if ( hostname . host && loopbackHosts . has ( hostname . host ) ) {
@@ -192,11 +192,10 @@ function printServerUrls(
192
192
} )
193
193
194
194
if ( hostname . name === 'localhost' ) {
195
- notes . push ( {
196
- label : 'Hint' ,
197
- message : colors . dim (
198
- `Use ${ colors . white ( colors . bold ( '--host' ) ) } to expose to network.`
199
- )
195
+ urls . push ( {
196
+ label : 'Network' ,
197
+ url : `use ${ colors . white ( colors . bold ( '--host' ) ) } to expose` ,
198
+ disabled : true
200
199
} )
201
200
}
202
201
} else {
@@ -235,17 +234,17 @@ function printServerUrls(
235
234
const print = (
236
235
iconWithColor : string ,
237
236
label : string ,
238
- messageWithColor : string
237
+ messageWithColor : string ,
238
+ disabled ?: boolean
239
239
) => {
240
- info (
241
- ` ${ iconWithColor } ${ colors . bold ( label ) } : ${ ' ' . repeat (
242
- length - label . length
243
- ) } ${ messageWithColor } `
244
- )
240
+ const message = ` ${ iconWithColor } ${
241
+ label ? colors . bold ( label ) + ':' : ' '
242
+ } ${ ' ' . repeat ( length - label . length ) } ${ messageWithColor } `
243
+ info ( disabled ? colors . dim ( message ) : message )
245
244
}
246
245
247
- urls . forEach ( ( { label, url : text } ) => {
248
- print ( colors . green ( '➜' ) , label , text )
246
+ urls . forEach ( ( { label, url : text , disabled } ) => {
247
+ print ( colors . green ( '➜' ) , label , text , disabled )
249
248
} )
250
249
notes . forEach ( ( { label, message : text } ) => {
251
250
print ( colors . white ( '❖' ) , label , text )
0 commit comments