summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith H <sujith.h@gmail.com>2016-04-06 17:46:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:10:30 +0100
commit71ff9b9e0ef5582bddf501f7b737bd17ba2e19d5 (patch)
treebbcf27e3d6f5a00292bf5ceb50aa643ca70708bf
parent705d44fc0d82bbe9723a9eafc7c440d974be0857 (diff)
downloadpoky-71ff9b9e0ef5582bddf501f7b737bd17ba2e19d5.tar.gz
bitbake: toaster: update projectconf.html for DL_DIR and SSTATE_DIR
Modified the projectconf.html to include DL_DIR and SSTATE_DIR. Updated the script section in the html to handle the changes made by the user on DL_DIR and SSTATE_DIR. Included validation check for the folder names. [YOCTO #8422] (Bitbake rev: bd9f8973d4c9c0722874a058466b1b911112500e) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/templates/projectconf.html160
1 files changed, 157 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html
index 08223daa5b..27a898b657 100644
--- a/bitbake/lib/toaster/toastergui/templates/projectconf.html
+++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -31,6 +31,28 @@
31 </dd> 31 </dd>
32 {% endif %} 32 {% endif %}
33 33
34 {% if dl_dir_defined %}
35 <dt>
36 <span class="js-config-var-name js-config-var-managed-name">DL_DIR</span>
37 <i class="icon-question-sign get-help" title="Absolute path to the directory used to store downloads required for your builds. By default, Toaster projects share the same downloads directory.<br /><a href='http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-DL_DIR' target='_blank'>Read more in the manual</a>"></i>
38 </dt>
39 <dd class="lead">
40 <span id="dl_dir"{% if dl_dir %}{%else%} class="muted"{%endif%}>{% if dl_dir %}{{dl_dir}}{%else%}Not set{%endif%}</span>
41 <i class="icon-pencil" id="change-dl_dir-icon"></i>
42 <form id="change-dl_dir-form" style="display:none;">
43 <div class="row-fluid">
44 <span class="help-block span4">To set DL_DIR type the absolute path of the download folder.</span>
45 </div>
46 <div class="input-append" id="validate-dl_dir">
47 <input type="text" class="input-xlarge" id="new-dl_dir" placeholder="Type absolute path of the DL_DIR folder">
48 <button id="apply-change-dl_dir" class="btn" type="button">Save</button>
49 <button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button>
50 </br><span class="help-block error" id="hintError-dl_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></span>
51 </div>
52 </form>
53 </dd>
54 {% endif %}
55
34 {% if fstypes_defined %} 56 {% if fstypes_defined %}
35 <dt> 57 <dt>
36 <span class="js-config-var-name js-config-var-managed-name">IMAGE_FSTYPES</span> 58 <span class="js-config-var-name js-config-var-managed-name">IMAGE_FSTYPES</span>
@@ -107,6 +129,29 @@
107 </form> 129 </form>
108 </dd> 130 </dd>
109 {% endif %} 131 {% endif %}
132
133 {% if sstate_dir_defined %}
134 <dt>
135 <span class="js-config-var-name js-config-var-managed-name">SSTATE_DIR</span>
136 <i class="icon-question-sign get-help" title="Absolute path to the directory used to store shared state cache files. These files are reused across the builds, which makes the builds faster. By default, Toaster projects share the same cache directory.<br /><a href='http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-SSTATE_DIR' target='_blank'>Read more in the manual</a>"></i>
137 </dt>
138 <dd class="lead">
139 <span id="sstate_dir"{% if sstate_dir %}{%else%} class="muted"{%endif%}>{% if sstate_dir %}{{sstate_dir}}{%else%}Not set{%endif%}</span>
140 <i class="icon-pencil" id="change-sstate_dir-icon"></i>
141 <form id="change-sstate_dir-form" style="display:none;">
142 <div class="row-fluid">
143 <span class="help-block span4">To set SSTATE_DIR type the absolute path of the download folder.</span>
144 </div>
145 <div class="input-append" id="validate-sstate_dir">
146 <input type="text" class="input-xlarge" id="new-sstate_dir" placeholder="Type absolute path of the SSTATE_DIR folder">
147 <span class="error">A valid directory name required</span>
148 <button id="apply-change-sstate_dir" class="btn" type="button">Save</button>
149 <button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button>
150 </br><p class="help-block error" id="hintError-sstate_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></span>
151 </div>
152 </form>
153 </dd>
154 {% endif %}
110 </dl> 155 </dl>
111 156
112 <!-- <ul class="unstyled configuration-list" id="configvar-list"> --> 157 <!-- <ul class="unstyled configuration-list" id="configvar-list"> -->
@@ -156,9 +201,7 @@
156 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-BB_NUMBER_THREADS" target="_blank">BB_NUMBER_THREADS</a></code> 201 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-BB_NUMBER_THREADS" target="_blank">BB_NUMBER_THREADS</a></code>
157 <code>CVS_PROXY_HOST</code> 202 <code>CVS_PROXY_HOST</code>
158 <code>CVS_PROXY_PORT</code> 203 <code>CVS_PROXY_PORT</code>
159 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-DL_DIR" target="_blank">DL_DIR</a></code>
160 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code> 204 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code>
161 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SSTATE_DIR" target="_blank">SSTATE_DIR</a></code>
162 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SSTATE_MIRRORS" target="_blank">SSTATE_MIRRORS</a></code> 205 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-SSTATE_MIRRORS" target="_blank">SSTATE_MIRRORS</a></code>
163 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-TMPDIR" target="_blank">TMPDIR</a></code></p> 206 <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-TMPDIR" target="_blank">TMPDIR</a></code></p>
164 <p>Plus the following standard shell environment variables:</p> 207 <p>Plus the following standard shell environment variables:</p>
@@ -501,6 +544,61 @@
501 }); 544 });
502 {% endif %} 545 {% endif %}
503 546
547 {% if dl_dir_defined %}
548
549 // change DL_DIR variable
550 $('#change-dl_dir-icon').click(function() {
551 $('#hintError-dl_dir').hide();
552 // preset the edit value
553 var current_val = $("span#dl_dir").text().trim();
554 if (current_val == "Not set") {
555 current_val="";
556 $("#apply-change-dl_dir").attr("disabled","disabled");
557 }
558 $("input#new-dl_dir").val(current_val);
559
560 $('#change-dl_dir-icon, #dl_dir').hide();
561 $("#change-dl_dir-form").slideDown();
562 });
563
564 $('#cancel-change-dl_dir').click(function(){
565 $("#change-dl_dir-form").slideUp(function() {
566 $('#dl_dir, #change-dl_dir-icon').show();
567 });
568 });
569
570 $("#new-dl_dir").on('input', function(){
571 if ($(this).val().trim().length == 0) {
572 $("#apply-change-dl_dir").attr("disabled","disabled");
573 }
574 else {
575 var input = $(this);
576 var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
577 var invalidDir = re.test(input.val());
578 console.log(invalidDir);
579 if ( invalidDir ) {
580 $('#validate-dl_dir').removeClass('control-group error');
581 $("#apply-change-dl_dir").removeAttr("disabled");
582 $('#hintError-dl_dir').hide();
583 } else {
584 $('#validate-dl_dir').addClass('control-group error');
585 $("#apply-change-dl_dir").attr("disabled","disabled");
586 $('#hintError-dl_dir').show();
587 }
588 }
589 });
590
591 $('#apply-change-dl_dir').click(function(){
592 var value = $('#new-dl_dir').val().trim();
593 postEditAjaxRequest({"configvarChange" : 'DL_DIR:'+value});
594 $('#dl_dir').text(value);
595 $('#dl_dir').removeClass('muted');
596 $("#change-dl_dir-form").slideUp(function () {
597 $('#dl_dir, #change-dl_dir-icon').show();
598 });
599 });
600
601 {% endif %}
504 602
505 {% if fstypes_defined %} 603 {% if fstypes_defined %}
506 // change IMAGE_FSTYPES variable 604 // change IMAGE_FSTYPES variable
@@ -748,6 +846,62 @@
748 }); 846 });
749 {% endif %} 847 {% endif %}
750 848
849 {% if sstate_dir_defined %}
850
851 // change SSTATE_DIR variable
852 $('#change-sstate_dir-icon').click(function() {
853 $('#hintError-sstate_dir').hide();
854 // preset the edit value
855 var current_val = $("span#sstate_dir").text().trim();
856 if (current_val == "Not set") {
857 current_val="";
858 $("#apply-change-sstate_dir").attr("disabled","disabled");
859 }
860 $("input#new-sstate_dir").val(current_val);
861
862 $('#change-sstate_dir-icon, #sstate_dir').hide();
863 $("#change-sstate_dir-form").slideDown();
864 });
865
866 $('#cancel-change-sstate_dir').click(function(){
867 $("#change-sstate_dir-form").slideUp(function() {
868 $('#sstate_dir, #change-sstate_dir-icon').show();
869 });
870 });
871
872 $("#new-sstate_dir").on('input', function(){
873 if ($(this).val().trim().length == 0) {
874 $("#apply-change-sstate_dir").attr("disabled","disabled");
875 }
876 else {
877 var input = $(this);
878 var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
879 var invalidDir = re.test(input.val());
880 console.log(invalidDir);
881 if ( invalidDir ) {
882 $('#validate-sstate_dir').removeClass('control-group error');
883 $("#apply-change-sstate_dir").removeAttr("disabled");
884 $('#hintError-sstate_dir').hide();
885 } else {
886 $('#validate-sstate_dir').addClass('control-group error');
887 $("#apply-change-sstate_dir").attr("disabled","disabled");
888 $('#hintError-sstate_dir').show();
889 }
890 }
891 });
892
893 $('#apply-change-sstate_dir').click(function(){
894 var value = $('#new-sstate_dir').val().trim();
895 postEditAjaxRequest({"configvarChange" : 'SSTATE_DIR:'+value});
896 $('#sstate_dir').text(value);
897 $('#sstate_dir').removeClass('muted');
898 $("#change-sstate_dir-form").slideUp(function () {
899 $('#sstate_dir, #change-sstate_dir-icon').show();
900 });
901 });
902
903 {% endif %}
904
751 // add new variable 905 // add new variable
752 $("button#add-configvar-button").click( function (evt) { 906 $("button#add-configvar-button").click( function (evt) {
753 var variable = $("input#variable").val(); 907 var variable = $("input#variable").val();
@@ -762,7 +916,7 @@
762 $(".save").attr("disabled","disabled"); 916 $(".save").attr("disabled","disabled");
763 917
764 // Reload page if admin-removed core managed value is manually added back in 918 // Reload page if admin-removed core managed value is manually added back in
765 if (0 <= " DISTRO IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES ".indexOf( " "+variable+" " )) { 919 if (0 <= " DISTRO DL_DIR IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES SSTATE_DIR ".indexOf( " "+variable+" " )) {
766 // delayed reload to avoid race condition with postEditAjaxRequest 920 // delayed reload to avoid race condition with postEditAjaxRequest
767 do_reload=true; 921 do_reload=true;
768 } 922 }