From 71ff9b9e0ef5582bddf501f7b737bd17ba2e19d5 Mon Sep 17 00:00:00 2001
From: Sujith H BB_NUMBER_THREADS
CVS_PROXY_HOST
CVS_PROXY_PORT
- DL_DIR
PARALLEL_MAKE
- SSTATE_DIR
SSTATE_MIRRORS
TMPDIR
Plus the following standard shell environment variables:
@@ -501,6 +544,61 @@ }); {% endif %} + {% if dl_dir_defined %} + + // change DL_DIR variable + $('#change-dl_dir-icon').click(function() { + $('#hintError-dl_dir').hide(); + // preset the edit value + var current_val = $("span#dl_dir").text().trim(); + if (current_val == "Not set") { + current_val=""; + $("#apply-change-dl_dir").attr("disabled","disabled"); + } + $("input#new-dl_dir").val(current_val); + + $('#change-dl_dir-icon, #dl_dir').hide(); + $("#change-dl_dir-form").slideDown(); + }); + + $('#cancel-change-dl_dir').click(function(){ + $("#change-dl_dir-form").slideUp(function() { + $('#dl_dir, #change-dl_dir-icon').show(); + }); + }); + + $("#new-dl_dir").on('input', function(){ + if ($(this).val().trim().length == 0) { + $("#apply-change-dl_dir").attr("disabled","disabled"); + } + else { + var input = $(this); + var re = /^\/([^ <>\\|":\.%\?\*]+)$/; + var invalidDir = re.test(input.val()); + console.log(invalidDir); + if ( invalidDir ) { + $('#validate-dl_dir').removeClass('control-group error'); + $("#apply-change-dl_dir").removeAttr("disabled"); + $('#hintError-dl_dir').hide(); + } else { + $('#validate-dl_dir').addClass('control-group error'); + $("#apply-change-dl_dir").attr("disabled","disabled"); + $('#hintError-dl_dir').show(); + } + } + }); + + $('#apply-change-dl_dir').click(function(){ + var value = $('#new-dl_dir').val().trim(); + postEditAjaxRequest({"configvarChange" : 'DL_DIR:'+value}); + $('#dl_dir').text(value); + $('#dl_dir').removeClass('muted'); + $("#change-dl_dir-form").slideUp(function () { + $('#dl_dir, #change-dl_dir-icon').show(); + }); + }); + + {% endif %} {% if fstypes_defined %} // change IMAGE_FSTYPES variable @@ -748,6 +846,62 @@ }); {% endif %} + {% if sstate_dir_defined %} + + // change SSTATE_DIR variable + $('#change-sstate_dir-icon').click(function() { + $('#hintError-sstate_dir').hide(); + // preset the edit value + var current_val = $("span#sstate_dir").text().trim(); + if (current_val == "Not set") { + current_val=""; + $("#apply-change-sstate_dir").attr("disabled","disabled"); + } + $("input#new-sstate_dir").val(current_val); + + $('#change-sstate_dir-icon, #sstate_dir').hide(); + $("#change-sstate_dir-form").slideDown(); + }); + + $('#cancel-change-sstate_dir').click(function(){ + $("#change-sstate_dir-form").slideUp(function() { + $('#sstate_dir, #change-sstate_dir-icon').show(); + }); + }); + + $("#new-sstate_dir").on('input', function(){ + if ($(this).val().trim().length == 0) { + $("#apply-change-sstate_dir").attr("disabled","disabled"); + } + else { + var input = $(this); + var re = /^\/([^ <>\\|":\.%\?\*]+)$/; + var invalidDir = re.test(input.val()); + console.log(invalidDir); + if ( invalidDir ) { + $('#validate-sstate_dir').removeClass('control-group error'); + $("#apply-change-sstate_dir").removeAttr("disabled"); + $('#hintError-sstate_dir').hide(); + } else { + $('#validate-sstate_dir').addClass('control-group error'); + $("#apply-change-sstate_dir").attr("disabled","disabled"); + $('#hintError-sstate_dir').show(); + } + } + }); + + $('#apply-change-sstate_dir').click(function(){ + var value = $('#new-sstate_dir').val().trim(); + postEditAjaxRequest({"configvarChange" : 'SSTATE_DIR:'+value}); + $('#sstate_dir').text(value); + $('#sstate_dir').removeClass('muted'); + $("#change-sstate_dir-form").slideUp(function () { + $('#sstate_dir, #change-sstate_dir-icon').show(); + }); + }); + + {% endif %} + // add new variable $("button#add-configvar-button").click( function (evt) { var variable = $("input#variable").val(); @@ -762,7 +916,7 @@ $(".save").attr("disabled","disabled"); // Reload page if admin-removed core managed value is manually added back in - if (0 <= " DISTRO IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES ".indexOf( " "+variable+" " )) { + if (0 <= " DISTRO DL_DIR IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES SSTATE_DIR ".indexOf( " "+variable+" " )) { // delayed reload to avoid race condition with postEditAjaxRequest do_reload=true; } -- cgit v1.2.3-54-g00ecf