xref: /OK3568_Linux_fs/yocto/bitbake/lib/toaster/toastergui/templates/importlayer.html (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun{% extends project_specific|yesno:"baseprojectspecificpage.html,base.html" %}
2*4882a593Smuzhiyun{% load projecttags %}
3*4882a593Smuzhiyun{% load humanize %}
4*4882a593Smuzhiyun{% load static %}
5*4882a593Smuzhiyun{% block title %} Import layer - {{project.name}} - Toaster {% endblock %}
6*4882a593Smuzhiyun{% block pagecontent %}
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun<div class="row">
9*4882a593Smuzhiyun  {% include project_specific|yesno:"project_specific_topbar.html,projecttopbar.html" %}
10*4882a593Smuzhiyun  {% if project and project.release %}
11*4882a593Smuzhiyun  <script src="{% static 'js/layerDepsModal.js' %}"></script>
12*4882a593Smuzhiyun  <script src="{% static 'js/importlayer.js' %}"></script>
13*4882a593Smuzhiyun  <script>
14*4882a593Smuzhiyun  $(document).ready(function (){
15*4882a593Smuzhiyun    var ctx = {
16*4882a593Smuzhiyun      xhrLayerUrl : "{% url 'xhr_layer' project.id %}",
17*4882a593Smuzhiyun      xhrGitRevTypeAheadUrl : "{% url 'xhr_gitrevtypeahead' %}",
18*4882a593Smuzhiyun    };
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    try {
21*4882a593Smuzhiyun      importLayerPageInit(ctx);
22*4882a593Smuzhiyun    } catch (e) {
23*4882a593Smuzhiyun      document.write("Sorry, An error has occurred loading this page");
24*4882a593Smuzhiyun      console.warn(e);
25*4882a593Smuzhiyun    }
26*4882a593Smuzhiyun  });
27*4882a593Smuzhiyun  </script>
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun  <form class="col-md-11">
30*4882a593Smuzhiyun    <span class="help-block">The layer you are importing must be compatible with <strong>{{project.release.description}}</strong>, which is the release you are using in this project.</span>
31*4882a593Smuzhiyun    <div class="alert alert-error" id="import-error" style="display:none">
32*4882a593Smuzhiyun      <button type="button" class="close" data-dismiss="alert">&times;</button>
33*4882a593Smuzhiyun      <h3>&nbsp;</h3>
34*4882a593Smuzhiyun      <p></p>
35*4882a593Smuzhiyun      <ul></ul>
36*4882a593Smuzhiyun    </div>
37*4882a593Smuzhiyun    <fieldset>
38*4882a593Smuzhiyun      <div class="form-group" id="layer-name-ctrl">
39*4882a593Smuzhiyun        <label class="control-label" for="import-layer-name">
40*4882a593Smuzhiyun          Layer name
41*4882a593Smuzhiyun          <span class="glyphicon glyphicon-question-sign get-help" title="Something like 'meta-mylayer'. Your layer name must be unique and can only include letters, numbers and dashes"></span>
42*4882a593Smuzhiyun        </label>
43*4882a593Smuzhiyun        <input class="form-control" id="import-layer-name" type="text" required autofocus data-autocomplete="off" data-provide="typeahead">
44*4882a593Smuzhiyun        <span class="help-block" style="display: none;" id="invalid-layer-name-hint">A valid layer name can only include letters, numbers and dashes</span>
45*4882a593Smuzhiyun        <span class="help-inline" style="display: none;" id="duplicated-layer-name-hint"></span>
46*4882a593Smuzhiyun      </div>
47*4882a593Smuzhiyun    </fieldset>
48*4882a593Smuzhiyun    <div id="duplicate-layer-info" style="display:none">
49*4882a593Smuzhiyun      <div class="alert alert-warning">
50*4882a593Smuzhiyun        <h3>A layer called <a href="" class="dup-layer-link"><span class="dup-layer-name"></span></a> already exists</h3>
51*4882a593Smuzhiyun        <p>Layer names must be unqiue. Please use a different layer name.</p>
52*4882a593Smuzhiyun        <dl id="git-layer-dup" style="display:none;">
53*4882a593Smuzhiyun          <dt>
54*4882a593Smuzhiyun          The <span class="dup-layer-name"></span> repository url is
55*4882a593Smuzhiyun          </dt>
56*4882a593Smuzhiyun          <dd>
57*4882a593Smuzhiyun          <span id="dup-layer-vcs-url"></span>
58*4882a593Smuzhiyun          </dd>
59*4882a593Smuzhiyun          <dt>
60*4882a593Smuzhiyun          The <span class="dup-layer-name"></span> revision is
61*4882a593Smuzhiyun          </dt>
62*4882a593Smuzhiyun          <dd>
63*4882a593Smuzhiyun          <span id="dup-layer-revision"></span>
64*4882a593Smuzhiyun          </dd>
65*4882a593Smuzhiyun        </dl>
66*4882a593Smuzhiyun	<dl id="local-layer-dup" style="display:none;">
67*4882a593Smuzhiyun	  <dt>
68*4882a593Smuzhiyun	    The <span class="dup-layer-name"></span> directory is
69*4882a593Smuzhiyun	  </dt>
70*4882a593Smuzhiyun	  <dd>
71*4882a593Smuzhiyun	    <span id="dup-local-source-dir-name"></span>
72*4882a593Smuzhiyun	  </dd>
73*4882a593Smuzhiyun	</dl>
74*4882a593Smuzhiyun        <p><a href="" class="dup-layer-link">View the <span class="dup-layer-name"></span> layer information</a></p>
75*4882a593Smuzhiyun      </div>
76*4882a593Smuzhiyun    </div>
77*4882a593Smuzhiyun    <fieldset class="fields-apart-from-layer-name" id="repo-select">
78*4882a593Smuzhiyun      <legend class="radioLegend">Where is the layer source code?</legend>
79*4882a593Smuzhiyun      <div class="radio">
80*4882a593Smuzhiyun	<label>
81*4882a593Smuzhiyun          <input type="radio" id="git-repo-radio" name="repo" value="git" checked="checked">
82*4882a593Smuzhiyun	  In a <strong>Git repository</strong>
83*4882a593Smuzhiyun	</label>
84*4882a593Smuzhiyun	<p class="help-block radio-help">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p>
85*4882a593Smuzhiyun      </div>
86*4882a593Smuzhiyun      <div class="radio">
87*4882a593Smuzhiyun	<label>
88*4882a593Smuzhiyun          <input type="radio" id="local-dir-radio" name="repo" value="local">
89*4882a593Smuzhiyun	  In a <strong>directory</strong>
90*4882a593Smuzhiyun	</label>
91*4882a593Smuzhiyun	<p class="help-block radio-help">Use this option for quick layer development, by simply providing the path to the layer source code.</p>
92*4882a593Smuzhiyun      </div>
93*4882a593Smuzhiyun    </fieldset>
94*4882a593Smuzhiyun    <fieldset class="fields-apart-from-layer-name" id="git-repo">
95*4882a593Smuzhiyun      <legend>Git repository information</legend>
96*4882a593Smuzhiyun      <div class="form-group">
97*4882a593Smuzhiyun        <label for="layer-git-repo-url">
98*4882a593Smuzhiyun          Git repository URL
99*4882a593Smuzhiyun          <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
100*4882a593Smuzhiyun        </label>
101*4882a593Smuzhiyun        <input type="text" id="layer-git-repo-url" class="form-control" required>
102*4882a593Smuzhiyun      </div>
103*4882a593Smuzhiyun      <div class="form-group">
104*4882a593Smuzhiyun        <label for="layer-subdir">
105*4882a593Smuzhiyun          Repository subdirectory
106*4882a593Smuzhiyun          <span class="text-muted">(optional)</span>
107*4882a593Smuzhiyun          <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
108*4882a593Smuzhiyun        </label>
109*4882a593Smuzhiyun        <input type="text" class="form-control" id="layer-subdir">
110*4882a593Smuzhiyun      </div>
111*4882a593Smuzhiyun      <div class="form-group" id="layer-revision-ctrl">
112*4882a593Smuzhiyun        <label for="layer-git-ref">
113*4882a593Smuzhiyun          Git revision
114*4882a593Smuzhiyun          <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
115*4882a593Smuzhiyun        </label>
116*4882a593Smuzhiyun        <span style="display: block">
117*4882a593Smuzhiyun        <input type="text" class="form-control" id="layer-git-ref" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" required>
118*4882a593Smuzhiyun        </span>
119*4882a593Smuzhiyun        <span class="help-block has-error" style="display:none;" id="invalid-layer-revision-hint">The "HEAD" branch is reserved (only allowed for the "Local Yocto Project" layers)</span>
120*4882a593Smuzhiyun      </div>
121*4882a593Smuzhiyun    </fieldset>
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun    <fieldset class="fields-apart-from-layer-name" id="local-dir" style="display:none;">
124*4882a593Smuzhiyun      <legend>Layer directory information</legend>
125*4882a593Smuzhiyun      <div class="form-group">
126*4882a593Smuzhiyun        <label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label>
127*4882a593Smuzhiyun        <input type="text" class="form-control" id="local-dir-path" required/>
128*4882a593Smuzhiyun        <p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p>
129*4882a593Smuzhiyun        <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
130*4882a593Smuzhiyun      </div>
131*4882a593Smuzhiyun    </fieldset>
132*4882a593Smuzhiyun
133*4882a593Smuzhiyun    <fieldset class="fields-apart-from-layer-name">
134*4882a593Smuzhiyun      <legend>
135*4882a593Smuzhiyun        Layer dependencies
136*4882a593Smuzhiyun        <small class="text-muted">(optional)</small>
137*4882a593Smuzhiyun        <span class="glyphicon glyphicon-question-sign get-help heading-help" title="Other layers this layer depends upon"></span>
138*4882a593Smuzhiyun      </legend>
139*4882a593Smuzhiyun      <ul class="list-unstyled lead" id="layer-deps-list">
140*4882a593Smuzhiyun      </ul>
141*4882a593Smuzhiyun      <div class="form-inline">
142*4882a593Smuzhiyun        <div class="form-group">
143*4882a593Smuzhiyun          <input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" placeholder="Type a layer name" id="layer-dependency" class="form-control">
144*4882a593Smuzhiyun        </div>
145*4882a593Smuzhiyun        <button class="btn btn-default" id="add-layer-dependency-btn">
146*4882a593Smuzhiyun          Add layer
147*4882a593Smuzhiyun        </button>
148*4882a593Smuzhiyun        <span class="help-inline">You can only add layers Toaster knows about</span>
149*4882a593Smuzhiyun    </fieldset>
150*4882a593Smuzhiyun    <div class="top-air fields-apart-from-layer-name" id="form-actions">
151*4882a593Smuzhiyun      <button class="btn btn-primary btn-lg" data-toggle="modal" id="import-and-add-btn" data-target="#dependencies-message" disabled>Import and add to project</button>
152*4882a593Smuzhiyun      <span class="help-inline" id="import-git-layer-and-add-hint" style="vertical-align: middle;">To import a layer you need to enter a layer name, a Git repository URL and a Git revision (branch, tag or commit)</span>
153*4882a593Smuzhiyun      <span class="help-inline" id="import-local-dir-and-add-hint" style="vertical-align: middle;display:none;">To import a layer you need to enter a layer name and the absolute path to the layer directory</span>
154*4882a593Smuzhiyun    </div>
155*4882a593Smuzhiyun  </div>
156*4882a593Smuzhiyun</form>
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun  {% else %} {#project and project release#}
159*4882a593Smuzhiyun  <div class="page-header">
160*4882a593Smuzhiyun    <h1>Import layer</h1>
161*4882a593Smuzhiyun  </div>
162*4882a593Smuzhiyun  <div class="alert alert-info" id="import-error" >
163*4882a593Smuzhiyun    <h3>Unsupported project type</h3>
164*4882a593Smuzhiyun    <p>This project does not support importing layers.</p>
165*4882a593Smuzhiyun    <ul></ul>
166*4882a593Smuzhiyun  </div>
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun  {% endif %}
169*4882a593Smuzhiyun</div>
170*4882a593Smuzhiyun{% endblock %}
171