Revision 339712cb

b/ui/templates/list.html
334 334
    ]
335 335
});
336 336

  
337
// basic functions executed on page load
337 338
if (images.length == 0) {
338 339
    // populate image list
339 340
    update_images();
......
345 346
// set the label of the multiple buttons 
346 347
$('div.confirm_multiple button.yes').text('Confirm');
347 348
$('div.confirm_multiple button.no').text('Cancel');
348

  
349 349
// reposition multiple confirmation box on window resize
350 350
$(window).resize(function(){
351 351
    if (this.innerHeight - 200 < $('#machinesview').height())
......
353 353
    else
354 354
        $('.confirm_multiple').removeClass('fixed');
355 355
});
356

  
357 356
// start updating vm list
358 357
update_vms(UPDATE_INTERVAL);
359 358

  
b/ui/templates/machines.html
166 166
	</div>
167 167
</form>
168 168

  
169
<!-- notification after wizard completion -->
169
<!-- base notification for error/success reporting -->
170 170
<a id="notification" rel="#error-success" href="#"></a>
171 171

  
172 172
<div class="modal" id="error-success">
......
174 174
    <div><p>{% trans "More details about the result"%}</p></div>
175 175
</div>
176 176

  
177
<!-- confirmation before executing an action -->
178
<a id="confirmation" rel="#yes-no" href="#"></a>
179 177

  
180
<div class="modal" id="yes-no">
181
    <h3>{% trans "You are about to xxx machine yyy" %}</h3>
182
    <p>{% trans "Are you sure you want to proceed?" %}</p>
183
    <button>{% trans "Yes" %}</button>
184
	<button>{% trans "No" %}</button>
178
<a id="meta-editor-1" rel="#editor-1" href="#"></a>
179

  
180
<div class="modal" id="editor-1">
181
    <h3>
182
        <label>{% trans "Metadata for machine:" %}<label>
183
        <span></span>
184
    </h3>
185
    <hr class="topruler" />
186
    <div class="meta-list">
187
        <ul>
188
            <li class="meta-template">
189
                <label>{% trans "Metadata key" %}</label>
190
                <button type="button" class="remove">{% trans "remove x" %}</button>
191
                <hr class="meta-separator">
192
                <p>{% trans "Metadata value" %}</p>
193
                <button type="button" class="edit">{% trans "edit" %}</button>
194
            </li>
195
        </ul>
196
    </div>
197
    <button type="button" class="create">{% trans "Create New+" %}</button>
198
    <hr class="bottomruler" /> 
199
</div>
200

  
201
<a id="meta-editor-2" rel="#editor-2" href="#"></a>
202

  
203
<div class="modal" id="editor-2">
204
    <h3>
205
        <label>{% trans "Metadata for machine:" %}<label>
206
        <span></span>
207
    </h3>
208
    <hr class="topruler" />
209
    <hr class="fatruler" />
210
    <label class="meta-key">{% trans "Key:" %}</label>
211
    <input type="text" maxlength="15" class="key" value="max 15 characters"/>
212
    <hr class="meta-separator">
213
    <label class="meta-value">{% trans "Value:" %}</label>
214
    <input type="text" maxlength="150" class="value" value="max 150 characters"/>
215
    <button type="button" class="cancel">{% trans "Cancel" %}</button>
216
    <button type="button" class="save">{% trans "Save" %}</button>
217
    <hr class="bottomruler" /> 
185 218
</div>
186 219

  
187 220
<div id="machinesview"></div>
......
222 255
    return false;
223 256
});
224 257

  
225

  
226 258
// switch to standard view
227 259
$("a#standard").click(function(){
228 260
    standard_view();
b/ui/templates/standard.html
27 27
            <h5>{% trans "IP: " %}<span class="public">node.public_ip</span></h5>
28 28
        </a>
29 29
        <h5 class="settings">
30
            {% trans "Show:" %} <a href="#">{% trans "disks" %}</a> | <a href="#">{% trans "networks" %}</a> | <a href="#">{% trans "group" %}</a>
30
            {% trans "Show:" %} 
31
            <a href="#">{% trans "disks" %}</a> | 
32
            <a href="#">{% trans "networks" %}</a> | 
33
            <a href="#">{% trans "group" %}</a> | 
34
            <a class="show-metadata" href="#">{% trans "metadata" %}</a>
31 35
        </h5>
32

  
33 36
        <div class="confirm_single">
34 37
            <button class="yes">{% trans "Confirm" %}</button>
35 38
            <button class="no">{% trans "Cancel" %}</button>
......
42 45
        </div>
43 46
        <div class="separator"></div>
44 47
    </div>
45

  
46 48
    <div class="running"></div>
47 49
    <div id="mini" class="separator"></div>
48 50
    <div class="terminated"></div>
49 51
</div>
50 52

  
51 53
<script>
52
    
54

  
55
// intercept metadata click
56
$("a.show-metadata").live('click', function() {
57
    // get server name and server ID
58
    var serverID = $(this).parent().parent().attr("id");
59
    var serverName = $(this).parent().prevAll("a.name").find("span.name").text();
60
    // set server name in box's title
61
    $("a#meta-editor-1 span").text(serverName);
62
    var triggers = $("a#meta-editor-1").overlay({
63
        // some mask tweaks suitable for modal dialogs
64
        mask: {
65
            color: '#ebecff',
66
            opacity: '0.9'
67
        },
68
        top: 'center',
69
        closeOnClick: false,
70
        oneInstance: false,
71
        load: false,
72
        onClose: function(){
73
            // With partial refresh working properly,
74
            // it is no longer necessary to refresh the whole page
75
            // choose_view();
76
        }
77
    });
78
    $("a#meta-editor-1").data('overlay').load();
79
    return false; 
80
});
81

  
53 82
// intercept reboot click 
54 83
$("div.actions a.action-reboot").live('click', function(){
55 84
    var serverID = $(this).parent().parent().attr("id");
......
340 369
    $('#'+serverID+ ' .action_error .action').text(action);
341 370
    $('#'+serverID+ ' .action_error .code').text(status);
342 371
    $('#'+serverID+ ' .action_error .message').text(responseText);
343
    $('#'+serverID+ ' .action_error').show();
344
    
372
    $('#'+serverID+ ' .action_error').show();    
345 373
}
346 374

  
375
// basic functions executed on page load
347 376
if (images.length == 0) {
348 377
    // populate image list
349 378
    update_images();
......
355 384
// set the label of the multiple buttons 
356 385
$('div.confirm_multiple button.yes').text('Confirm All');
357 386
$('div.confirm_multiple button.no').text('Cancel All');
358

  
359 387
// reposition multiple confirmation box on window resize
360 388
$(window).resize(function(){
361 389
    if (this.innerHeight - 220 < $('#machinesview').height())
......
363 391
    else
364 392
        $('.confirm_multiple').removeClass('fixed');
365 393
});
366

  
367 394
// start updating vm list
368 395
update_vms(UPDATE_INTERVAL);
369 396
</script>

Also available in: Unified diff