Machine cleanup/polling, hide mobile menu on page change

This commit is contained in:
Vincent Fiduccia 2016-03-03 17:45:24 -07:00
parent 05684c937a
commit fb8dc6d6e4
5 changed files with 36 additions and 22 deletions

View File

@ -1,25 +1,22 @@
{{top-errors errors=errors}}
<h2>Add Custom Machine Driver</h2>
<p class="help-block">You can add your own custom Dynamic Machine Drivers here. *Each driver is required to have a name and driver URI.</p>
<h2>Add Machine Driver</h2>
<div class="row">
<div class="form-group col-sm-12 col-md-5">
<label for="">Name*</label>
{{input class="form-control input-sm r-mr5" value=originalModel.name }}
</div>
<div class="form-group col-sm-12 col-md-5">
<label for="">Driver URI*</label>
{{input class="form-control input-sm r-mr5" value=originalModel.uri }}
<span class="help-block">The URL to download the machine driver for Linux/amd64.</span>
</div>
<div class="form-group">
<label>Name*</label>
{{input class="form-control" value=originalModel.name }}
</div>
<div class="row">
<div class="form-group col-sm-12 col-md-10">
<label for="">MD5 Checksum</label>
{{input class="form-control input-sm r-mr5" value=originalModel.md5 }}
<span class="help-block">The expected MD5 for the downloaded driver.</span>
</div>
<div class="form-group">
<label>Download URL*</label>
{{input class="form-control" value=originalModel.uri }}
<span class="help-block">The URL to download the machine driver binary 64-bit Linux.</span>
</div>
<div class="form-group">
<label>MD5 Checksum</label>
{{input class="form-control" value=originalModel.md5 }}
<span class="help-block">Optional: Verify that the downloaded driver matches the expected checksum.</span>
</div>
{{partial "save-cancel"}}

View File

@ -97,8 +97,19 @@ export default Ember.Component.extend({
didInsertElement() {
// Hide the Firefox focus ring
this.$().on('click', 'A', function(){
this.$().on('click', 'A', function(event){
$(this).blur();
let $tgt = $(event.target);
// Close the small-screen nav after clicking on a bottom-row item
if ( $tgt.parents('#navbar').length )
{
event.preventDefault();
$('#navbar').one('hidden.bs.collapse', () => {
$tgt.trigger('click');
}).collapse('hide');
}
});

View File

@ -145,14 +145,14 @@
</ul>
</li>
{{/if}}
<li>
{{#link-to "applications-tab" projectId id="applications-tab"}}Applications{{/link-to}}
<ul class="hidden-md hidden-lg">
{{partial 'tabs/applications-tab'}}
</ul>
</li>
<li>
{{#link-to "infrastructure-tab" projectId id="infrastructure-tab"}}Infrastructure{{/link-to}}
<ul class="hidden-md hidden-lg">

View File

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="{{content-for 'baseAssets'}}assets/images/logos/favicon.ico">
<title>Loading&hellip;</title>
<!-- {{content-for 'version'}} -->

View File

@ -1,8 +1,9 @@
import Ember from 'ember';
import C from 'ui/utils/constants';
import Resource from 'ember-api-store/models/resource';
import PolledResource from 'ui/mixins/cattle-polled-resource';
var machineDriver = Resource.extend({
var machineDriver = Resource.extend(PolledResource, {
type: 'machineDriver',
displayURI: Ember.computed('uri', function() {
let uri = this.get('uri');
@ -42,6 +43,10 @@ var machineDriver = Resource.extend({
});
machineDriver.reopenClass({
// Drivers don't get pushed by /subscribe WS, so refresh more often
pollTransitioningDelay: 1000,
pollTransitioningInterval: 5000,
headers: {
[C.HEADER.PROJECT]: undefined, // Requests for projects use the user's scope, not the project
},