@@ -118,6 +118,18 @@ return view.extend({
118118 } ) ;
119119 o . depends ( "dnsmasq_config_update_option" , "+" ) ;
120120 o . retain = true ;
121+ o . renderFrame = function ( section_id , in_table , option_index , nodes ) {
122+ var frame = form . Value . prototype . renderFrame . apply ( this , arguments ) ;
123+ if ( frame && frame . querySelector ) {
124+ var label = frame . querySelector ( "label.cbi-value-title" ) ;
125+ if ( label ) {
126+ var div = E ( "div" , { class : label . className } ) ;
127+ while ( label . firstChild ) div . appendChild ( label . firstChild ) ;
128+ label . parentNode . replaceChild ( div , label ) ;
129+ }
130+ }
131+ return frame ;
132+ } ;
121133 }
122134
123135 o = s . taboption (
@@ -383,6 +395,7 @@ return view.extend({
383395 var _provider ;
384396 _provider = s . option ( form . ListValue , "_provider" , _ ( "Provider" ) ) ;
385397 _provider . modalonly = true ;
398+ _provider . forcewrite = true ;
386399 _provider . cfgvalue = function ( section_id ) {
387400 let resolver = this . map . data . get (
388401 this . map . config ,
@@ -459,15 +472,6 @@ return view.extend({
459472 L . uci . unset ( pkg . Name , section_id , "resolver_url" ) ;
460473 L . uci . unset ( pkg . Name , section_id , "bootstrap_dns" ) ;
461474 } ;
462- _provider . save = function ( section_id ) {
463- if ( this . isActive ( section_id ) ) {
464- var fval = this . formvalue ( section_id ) ;
465- if ( fval != null && fval !== '' ) {
466- return this . write ( section_id , fval ) ;
467- }
468- }
469- return this . remove ( section_id ) ;
470- } ;
471475
472476 function createProviderWidget ( s , i , prov ) {
473477 if (
@@ -489,6 +493,18 @@ return view.extend({
489493 _paramList . value ( val , descr ) ;
490494 } ) ;
491495 _paramList . depends ( "_provider" , prov . template ) ;
496+ _paramList . cfgvalue = function ( section_id ) {
497+ let resolver = this . map . data . get (
498+ this . map . config ,
499+ section_id ,
500+ "resolver_url"
501+ ) ;
502+ if ( resolver === undefined || resolver === null )
503+ return prov . params . option . default || null ;
504+ let regexp = pkg . templateToRegexp ( prov . template ) ;
505+ let match = resolver . match ( regexp ) ;
506+ return ( match && match [ 1 ] ) || prov . params . option . default || null ;
507+ } ;
492508 _paramList . write = function ( section_id , formvalue ) { } ;
493509 _paramList . remove = function ( section_id , formvalue ) { } ;
494510 } else if ( prov . params . option . type === "text" ) {
0 commit comments