Commit 49fad463 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

enable/disable route moved to max-dev bundle

parent 71c59305
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -78,11 +78,11 @@ function max-dev:index() as element(){
                                                    type="checkbox" 
                                                    checked="checked" 
                                                    title="désactiver le bundle" 
                                                    onclick="fetch('/setbundle?enabled=' + this.checked + '&amp;bundle={$name}').then(() => window.location.reload(true));"/></li>
                                                    onclick="fetch('/bundles/max-dev/setbundle?enabled=' + this.checked + '&amp;bundle={$name}').then(() => window.location.reload(true));"/></li>
                                    else <li>{$name} <input 
                                                    type="checkbox" 
                                                    title="activer le bundle" 
                                                    onclick="fetch('/setbundle?enabled=' + this.checked + '&amp;bundle={$name}').then(() => window.location.reload(true));"/></li>                                
                                                    onclick="fetch('/bundles/max-dev/setbundle?enabled=' + this.checked + '&amp;bundle={$name}').then(() => window.location.reload(true));"/></li>                                
                    }
                </ul>
            </section>
@@ -161,3 +161,17 @@ declare %private function max-dev:route-list() as element(){
    return $maxRoutes

};




declare %rest:path("/bundles/max-dev/setbundle")
%rest:query-param("bundle","{$bundle}")
%rest:query-param("enabled","{$enabled}")
function max-dev:set-bundle-enabled($bundle as xs:string, $enabled as xs:boolean) as empty-sequence(){
    let $ignorePath := utils:get-bundles-path() || $bundle || '/.ignore'
    return 
        if($enabled)
            then file:delete($ignorePath)
        else file:write($ignorePath, '')  
};
 No newline at end of file
+0 −15
Original line number Diff line number Diff line
@@ -149,21 +149,6 @@ function routes:sources-export($indent as xs:string) as item()+{
};





declare %rest:path("/setbundle")
%rest:query-param("bundle","{$bundle}")
%rest:query-param("enabled","{$enabled}")
function routes:set-bundle-enabled($bundle as xs:string, $enabled as xs:boolean) as empty-sequence(){
    let $ignorePath := utils:get-bundles-path() || $bundle || '/.ignore'
    return 
        if($enabled)
            then file:delete($ignorePath)
        else file:write($ignorePath, '')  
};


(:~
 : Returns a static file.
 : @param  $filepath  file or unknown path