2020use crossterm:: style:: Stylize ;
2121
2222use crate :: { option:: Config , storage:: StorageMetadata } ;
23+ use crate :: utils:: { uid:: Uid } ;
2324
2425pub fn print ( config : & Config , meta : StorageMetadata ) {
2526 let scheme = config. parseable . get_scheme ( ) ;
26- status_info ( config, & scheme) ;
27+ status_info ( config, & scheme, meta . deployment_id ) ;
2728 storage_info ( config) ;
28- version :: print ( meta . deployment_id ) ;
29+ about :: print ( ) ;
2930 println ! ( ) ;
3031}
3132
32- fn status_info ( config : & Config , scheme : & str ) {
33+ fn status_info ( config : & Config , scheme : & str , id : Uid ) {
3334 let url = format ! ( "{}://{}" , scheme, config. parseable. address) . underlined ( ) ;
34- eprintln ! (
35- "
36- {}
37- {}
38- {}" ,
39- format!( "Parseable server started at: {}" , url) . bold( ) ,
40- format!( "Username: {}" , config. parseable. username) . bold( ) ,
41- format!( "Password: {}" , config. parseable. password) . bold( ) ,
42- ) ;
43-
4435 if config. is_default_creds ( ) {
45- warning_line ( ) ;
4636 eprintln ! (
4737 "
48- {}" ,
49- "Using default credentials for Parseable server" . red( )
50- )
38+ {}
39+ Running at: \" {}\"
40+ Credentials: {}
41+ Deployment UID: \" {}\" " ,
42+ "Parseable Server" . to_string( ) . bold( ) ,
43+ url,
44+ "\" Using default creds admin, admin. Please set credentials with P_USERNAME and P_PASSWORD.\" " . to_string( ) . red( ) ,
45+ id. to_string( )
46+ ) ;
47+ } else {
48+ eprintln ! (
49+ "
50+ {}
51+ Running at: \" {}\"
52+ Credentials: \" As set in P_USERNAME and P_PASSWORD environment variables\"
53+ Deployment UID: \" {}\" " ,
54+ "Parseable Server" . to_string( ) . bold( ) ,
55+ url,
56+ id. to_string( ) ,
57+ ) ;
5158 }
5259}
5360
5461fn storage_info ( config : & Config ) {
5562 eprintln ! (
5663 "
5764 {}
58- Mode: {}
59- Staging path : {}
60- Store path : {} " ,
61- "Storage:" . to_string( ) . blue ( ) . bold( ) ,
65+ Mode: \" {} \"
66+ Staging: \" {} \"
67+ Store: \" {} \" " ,
68+ "Storage:" . to_string( ) . cyan ( ) . bold( ) ,
6269 config. storage_name,
6370 config. staging_dir( ) . to_string_lossy( ) ,
6471 config. storage( ) . get_endpoint( ) ,
6572 )
6673}
6774
68- pub fn warning_line ( ) {
69- eprint ! (
70- "
71- {}" ,
72- "Warning:" . to_string( ) . red( ) . bold( ) ,
73- ) ;
74- }
75-
76- pub mod version {
75+ pub mod about {
7776 use chrono:: Duration ;
7877 use chrono_humanize:: { Accuracy , Tense } ;
7978 use crossterm:: style:: Stylize ;
8079 use std:: fmt;
8180
82- use crate :: utils:: { uid :: Uid , update} ;
81+ use crate :: utils:: update;
8382
8483 pub enum ParseableVersion {
8584 Version ( semver:: Version ) ,
@@ -95,29 +94,26 @@ pub mod version {
9594 }
9695 }
9796
98- pub fn print_version ( current_version : semver:: Version , commit_hash : String , id : Uid ) {
97+ pub fn print_version ( current_version : semver:: Version , commit_hash : String ) {
9998 eprint ! (
10099 "
101100 {}
102- Deployment ID: {}
103- Version: {}
104- Commit hash: {}
105- GitHub: https://github.com/parseablehq/parseable
106- Docs: https://www.parseable.io/docs/introduction" ,
101+ Version: \" {}\"
102+ Commit: \" {}\"
103+ Docs: \" https://www.parseable.io/docs/introduction\" " ,
107104 "About:" . to_string( ) . blue( ) . bold( ) ,
108- id. to_string( ) ,
109105 current_version,
110106 commit_hash
111107 ) ;
112108 }
113109
114- pub fn print ( id : Uid ) {
110+ pub fn print ( ) {
115111 // print current version
116112 let current = current ( ) ;
117113
118114 match current. 0 {
119115 ParseableVersion :: Version ( current_version) => {
120- print_version ( current_version. clone ( ) , current. 1 , id ) ;
116+ print_version ( current_version. clone ( ) , current. 1 ) ;
121117 // check for latest release, if it cannot be fetched then print error as warn and return
122118 let latest_release = match update:: get_latest ( ) {
123119 Ok ( latest_release) => latest_release,
0 commit comments