File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5757 < input type = "hidden" id = "node-input-bandhidden" />
5858 < / d i v >
5959
60-
6160 < div class = "form-row" >
6261 < label for = "node-input-continuous" > < i class = "fa fa-audio-o" > </ i > Continuous</ label >
6362 < input type = "checkbox" id = "node-input-continuous" > </ input >
212211 // Retrieve the available models from the server, if data is returned, then
213212 // can enable the dynamic selection fields.
214213 function getModels ( haveCredentials ) {
214+ console . log ( 'Fetching models' ) ;
215215 var u = $ ( '#node-input-username' ) . val ( ) ;
216216 var p = $ ( '#node-input-password' ) . val ( ) ;
217217
218218 $ . getJSON ( '/watson-speech-to-text/models/' , { un : u , pwd : p } ) . done ( function ( data ) {
219+ console . log ( 'Models have been retrieved' ) ;
219220 if ( data . error ) {
220221 $ ( 'label#node-label-message' ) . parent ( ) . show ( ) ;
221222 $ ( 'label#node-label-message' ) . text ( data . error ) ;
283284 // This is the on edit prepare function, which will be invoked everytime the dialog
284285 // is shown.
285286 function oneditprepare ( ) {
287+ console . log ( 'In oneditprepare' ) ;
286288 hideEverything ( ) ;
287289 restoreFromHidden ( ) ;
288290 handlersUI ( ) ;
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ module.exports = function (RED) {
5959
6060 // API used by widget to fetch available models
6161 RED . httpAdmin . get ( '/watson-speech-to-text/models' , function ( req , res ) {
62+ console . log ( 'Insde request to fetch models' ) ;
63+ console . log ( 'Checking bound credentials username / password' , username , password ) ;
6264 var stt = watson . speech_to_text ( {
6365 username : username ? username : req . query . un ,
6466 password : password ? password : req . query . pwd ,
@@ -68,8 +70,10 @@ module.exports = function (RED) {
6870
6971 stt . getModels ( { } , function ( err , models ) {
7072 if ( err ) {
73+ console . log ( 'Error fetching models ' , err ) ;
7174 res . json ( err ) ;
7275 } else {
76+ console . log ( 'Models returned' ) ;
7377 res . json ( models ) ;
7478 }
7579 } ) ;
You can’t perform that action at this time.
0 commit comments