@@ -159,17 +159,59 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Result<(
159159 let input = vec ! [ app. input. clone( ) ] ;
160160 let get_list = spider:: get_the_key ( input. clone ( ) ) ;
161161 if let Ok ( list) = get_list {
162+ let mut storge: String = String :: new ( ) ;
163+ storge. push ( '[' ) ;
164+ storge. push ( '\n' ) ;
162165 if !list[ 0 ] . is_empty ( ) {
163166 app. messages = list[ 0 ] . clone ( ) ;
164167 app. stateoflist = true ;
165168 app. state . select ( Some ( 0 ) ) ;
166169 app. index = Some ( 0 ) ;
167170 for alist in & list[ 0 ] {
168- app. informations
169- . push ( spider:: Information :: new ( alist. to_string ( ) ) ) ;
171+ let information = spider:: Information :: new ( alist. to_string ( ) ) ;
172+ app. informations . push ( information. clone ( ) ) ;
173+ storge. push_str (
174+ format ! (
175+ "{{
176+ \" func\" :{},
177+ \" url\" :\" {}\" ,
178+ \" add\" :{},
179+ \" aid\" :{},
180+ \" host\" :{},
181+ \" id\" :{},
182+ \" net\" :{},
183+ \" path\" :{},
184+ \" port\" :{},
185+ \" ps\" :{},
186+ \" tls\" :{},
187+ \" type\" :{}
188+ }},\n " ,
189+ information. clone( ) . func,
190+ information. clone( ) . urls,
191+ information. clone( ) . add,
192+ information. clone( ) . aid,
193+ information. clone( ) . host,
194+ information. clone( ) . id,
195+ information. clone( ) . net,
196+ information. clone( ) . path,
197+ information. clone( ) . port,
198+ information. clone( ) . ps,
199+ information. clone( ) . tls,
200+ information. clone( ) . typpe
201+ )
202+ . as_str ( ) ,
203+ ) ;
170204 }
171205 }
206+ storge. pop ( ) ;
207+ storge. pop ( ) ;
208+ storge. push ( '\n' ) ;
209+ storge. push ( ']' ) ;
210+ if let Err ( err) = utils:: create_json_file ( storge) {
211+ panic ! ( "err {}" , err) ;
212+ } ;
172213 }
214+
173215 //app.messages.push(app.input.drain(..).collect());
174216 }
175217 KeyCode :: Char ( c) => {
0 commit comments