Settings and container ip and ports widget.

This commit is contained in:
Sean Li 2015-06-11 14:20:06 -07:00
parent 7375216f19
commit cad849b74e
5 changed files with 45 additions and 57 deletions

View File

@ -66,14 +66,14 @@ var ContainerHomePreview = React.createClass({
</div> </div>
); );
} else { } else {
var ports = _.map(_.pairs(this.props.ports), function (pair) { var ports = _.map(_.pairs(this.props.ports), pair => {
var key = pair[0]; var key = pair[0];
var val = pair[1]; var val = pair[1];
return ( return (
<div key={key} className="table-values"> <tr key={key}>
<span className="value-left">{key}</span><span className="icon icon-arrow-right"></span> <td>{key}</td>
<span className="value-right">{val.display}</span> <td>{val.display}</td>
</div> </tr>
); );
}); });
@ -87,13 +87,17 @@ var ContainerHomePreview = React.createClass({
</div> </div>
</div> </div>
<p>You can access this container using the following IP address and port:</p> <p>You can access this container using the following IP address and port:</p>
<div className="table ports"> <table className="table">
<div className="table-labels"> <thead>
<div className="label-left">DOCKER PORT</div> <tr>
<div className="label-right">MAC PORT</div> <th>DOCKER PORT</th>
</div> <th>MAC PORT</th>
{ports} </tr>
</div> </thead>
<tbody>
{ports}
</tbody>
</table>
</div> </div>
</div> </div>
); );

View File

@ -62,7 +62,7 @@ var ContainerSettingsPorts = React.createClass({
<div className="settings-panel"> <div className="settings-panel">
<div className="settings-section"> <div className="settings-section">
<h3>Configure Ports</h3> <h3>Configure Ports</h3>
<table className="table"> <table className="table ports">
<thead> <thead>
<tr> <tr>
<th>DOCKER PORT</th> <th>DOCKER PORT</th>

View File

@ -72,7 +72,7 @@ var ContainerSettingsVolumes = React.createClass({
<div className="settings-panel"> <div className="settings-panel">
<div className="settings-section"> <div className="settings-section">
<h3>Configure Volumes</h3> <h3>Configure Volumes</h3>
<table className="table"> <table className="table volumes">
<thead> <thead>
<tr> <tr>
<th>DOCKER FOLDER</th> <th>DOCKER FOLDER</th>

View File

@ -37,55 +37,32 @@
padding-bottom: 0px; padding-bottom: 0px;
} }
.table { .table {
padding-left: 20px; color: @gray-normal;
padding-right: 20px; font-size: 12px;
.icon-arrow-right { margin-left: 0.2rem;
color: #BBB; max-width: 300px;
font-size: 13px; tr {
margin: 0px 8px; &:first-child {
position: relative; td {
top: 2px; border: none;
flex: 0 auto;
min-width: 13px;
}
&.ports {
.table-labels {
margin-top: 20px;
flex: 1 auto;
display: flex;
font-size: 10px;
color: @gray-light;
.label-left {
flex: 0 auto;
min-width: 60px;
margin-right: 30px;
text-align: right;
}
.label-right {
flex: 1 auto;
display: inline-block;
} }
} }
.table-values { td {
flex: 1 auto; border-color: @color-divider;
display: flex; &.right {
flex-direction: row;
margin: 8px 0;
font-size: 12px;
.value-left {
text-align: right; text-align: right;
min-width: 70px;
flex: 0 auto;
padding: 0px;
}
.value-right {
flex: 1 auto;
-webkit-user-select: text;
max-width: 170px;
padding: 0px;
} }
} }
} }
th {
font-size: 10px;
color: @gray-lighter;
font-weight: 500;
border: none;
&.right {
text-align: right;
}
}
} }
.frame { .frame {
padding-top: 8rem; padding-top: 8rem;

View File

@ -23,6 +23,7 @@
outline: none; outline: none;
&.active { &.active {
li { li {
font-weight: 500;
border-bottom: 2px solid @brand-primary; border-bottom: 2px solid @brand-primary;
color: @gray-darkest; color: @gray-darkest;
} }
@ -110,6 +111,12 @@
} }
} }
.table { .table {
&.ports {
max-width: 500px;
}
&.volumes {
max-width: 100%;
}
color: @gray-normal; color: @gray-normal;
tr { tr {
&:first-child { &:first-child {