11/**
22 * @license
3- * Copyright (c) 2021, Oracle and/or its affiliates.
3+ * Copyright (c) 2021, 2022, Oracle and/or its affiliates.
44 * Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
55 */
66'use strict' ;
77
88define ( [ 'accUtils' , 'knockout' , 'utils/observable-properties' , 'utils/i18n' , 'ojs/ojarraydataprovider' , 'models/wkt-project' ,
99 'utils/wkt-logger' , 'ojs/ojknockout' , 'ojs/ojinputtext' , 'ojs/ojlabel' , 'ojs/ojbutton' , 'ojs/ojdialog' , 'ojs/ojformlayout' ,
10- 'ojs/ojswitch' , 'ojs/ojselectsingle' , 'ojs/ojvalidationgroup' ] ,
10+ 'ojs/ojswitch' , 'ojs/ojselectsingle' , 'ojs/ojvalidationgroup' , 'ojs/ojinputnumber' ] ,
1111function ( accUtils , ko , utils , i18n , ArrayDataProvider , project , wktLogger ) {
1212 function UserSettingsDialogModel ( payload ) {
1313
@@ -46,6 +46,8 @@ function(accUtils, ko, utils, i18n, ArrayDataProvider, project, wktLogger) {
4646 this . consoleLogLevel = ko . observable ( payload . defaults . level ) ;
4747 this . fileLogLevel = ko . observable ( payload . defaults . level ) ;
4848 this . fileLogDir = ko . observable ( payload . defaults . logDir ) ;
49+ this . connectivityTestTimeoutSeconds = ko . observable ( payload . defaults . connectivityTestTimeoutMilliseconds / 1000 ) ;
50+ this . internalConnectivityTestTimeoutMilliseconds = ko . observable ( payload . defaults . connectivityTestTimeoutMilliseconds ) ;
4951 this . skipQuickstart = ko . observable ( false ) ;
5052
5153 this . loadUserSettings = ( ) => {
@@ -74,6 +76,14 @@ function(accUtils, ko, utils, i18n, ArrayDataProvider, project, wktLogger) {
7476 }
7577 }
7678
79+ if ( 'connectivityTestTimeoutMilliseconds' in this . userSettings ) {
80+ let timeoutSecs = this . userSettings . connectivityTestTimeoutMilliseconds / 1000 ;
81+ if ( timeoutSecs < 1 ) {
82+ timeoutSecs = 1 ;
83+ }
84+ this . connectivityTestTimeoutSeconds ( timeoutSecs ) ;
85+ }
86+
7787 if ( 'skipQuickstartAtStartup' in this . userSettings ) {
7888 this . skipQuickstart ( this . userSettings . skipQuickstartAtStartup ) ;
7989 }
@@ -91,6 +101,11 @@ function(accUtils, ko, utils, i18n, ArrayDataProvider, project, wktLogger) {
91101 this . _storeSetting ( 'logging.file.level' , this . fileLogLevel , payload . defaults . level ) ;
92102 this . _storeSetting ( 'logging.file.logDir' , this . fileLogDir , payload . defaults . level ) ;
93103 this . _storeSetting ( 'logging.console.level' , this . consoleLogLevel , payload . defaults . level ) ;
104+ if ( this . connectivityTestTimeoutSeconds ( ) >= 0 ) {
105+ this . internalConnectivityTestTimeoutMilliseconds ( this . connectivityTestTimeoutSeconds ( ) * 1000 ) ;
106+ this . _storeSetting ( 'connectivityTestTimeoutMilliseconds' ,
107+ this . internalConnectivityTestTimeoutMilliseconds , payload . defaults . connectivityTestTimeoutMilliseconds ) ;
108+ }
94109 this . _storeSetting ( 'skipQuickstartAtStartup' , this . skipQuickstart , false ) ;
95110 } ;
96111
0 commit comments