Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/cloud-foundry/api/service/service.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @function all
* @memberof cloud-foundry.api.service
* @description Retrieve all the services from cloud foundry.
* @returns {promise}
* @returns {promise} a promise object
* @public
*/
all: function () {
Expand All @@ -50,7 +50,7 @@
* @memberof cloud-foundry.api.service
* @description Retrieve summary of service with given app id
* @param {string} guid - the service id
* @returns {promise}
* @returns {promise} a promise object
* @public
*/
summary: function (guid) {
Expand Down
66 changes: 66 additions & 0 deletions src/plugins/cloud-foundry/cloud-foundry.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,73 @@
@import "view/applications/applications";

// TODO may need to move these rule out to helio-ui-theme
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still new styles on notification coming, I'd like to refactor them out once get them done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

.action-bar {
height: $hpe-unit-space * 3;
line-height: $hpe-unit-space * 3;
vertical-align: middle;
margin-top: $hpe-unit-space;
padding-left: $hpe-unit-space;
padding-right: $hpe-unit-space;

.action-target-name {
display: inline-block;
font-size: $hpe-unit-space - 3px;
margin-left: $hpe-unit-space * .75;
}

.action-target-state {
color: $brand-primary;
display: inline-block;
font-size: $hpe-unit-space + 3px;
}

.btn {
margin-left: $hpe-unit-space / 3;
}
}

table.table {
> thead > tr > th,
> tbody > tr:not([table-inline-message]) > td,
> tfoot > tr > td {

.icon-link {
color: $text-color;
text-decoration: none;

&:hover,
&:active {
color: $link-color;
text-decoration: none;
}
}

.helion-icon {
line-height: 0;
font-size: $hpe-unit-space;
vertical-align: middle;
}
}
}

.action-header {

&.panel-heading {
line-height: 1;
padding-top: $hpe-unit-space * 1.1;
padding-bottom: $hpe-unit-space * .5;
}

.btn {
line-height: 1;
text-transform: capitalize;

* {
line-height: 0;
}

.helion-icon {
margin-right: $hpe-unit-space / 3
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
* @memberof cloud-foundry.model.application
* @description get summary of an application at the model layer
* @param {string} guid - the application id
* @returns {promise}
* @returns {promise} a promise object
* @public
*/
getAppSummary: function (guid) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<div class="action-bar app-actions-bar panel panel-default col-md-12">
{{ appCtrl.model.application.summary.state }}
{{ appCtrl.model.application.summary.name }}
<span class="action-target-state">
<i class="helion-icon helion-icon-Checkmark"></i>
</span>
<span class="action-target-name">{{ appCtrl.model.application.summary.name }}</span>

<div class="pull-right">
<span class="btn-group">
<button class="btn btn-default btn-info" translate>
<button class="btn btn-default btn-info"
translate
ng-click="appCtrl.restart()">
Restart
</button>
<button class="btn btn-default btn-info" translate>
<button class="btn btn-default btn-info"
translate
ng-click="appCtrl.stop()">
Stop
</button>
</span>
<button class="btn btn-default" translate>
<button class="btn btn-default"
translate
ng-click="appCtrl.launch()">
Launch App
</button>
</div>
Expand All @@ -30,4 +38,8 @@
</li>
</ul>

<div ui-view class="col-md-9"></div>
<div class="col-md-9 application-details">
<div ui-view class="row">

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
angular.extend(ApplicationController.prototype, {
init: function () {
this.model.getAppSummary(this.id);
},

launch: function () {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going away in the next PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unknown. this was based on seans work as of yesterday

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait, I see it removed here: https://github.com/hpcloud/stratos-ui/pull/154

this.model.launch(this.id);
},

restart: function () {
this.model.restart(this.id);
},

stop: function () {
this.model.stop(this.id);
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "summary/summary";
Original file line number Diff line number Diff line change
@@ -1,50 +1,129 @@
<div class="panel panel-default">
<h5>Summary</h5>
<ul>
<li>
memory: {{ appCtrl.model.application.summary.memory }}
</li>

<li>
running_instances: {{ appCtrl.model.application.summary.running_instances }} / {{ appCtrl.model.application.summary.instances }}
</li>

<li>
disk_quota: {{ appCtrl.model.application.summary.disk_quota }}
</li>

<li>
buildpack: {{ appCtrl.model.application.summary.buildpack }}
</li>

</ul>
</div>
<div class="panel panel-default summary">
<div class="panel-heading action-header">
<span translate>Summary</span>
<a class="btn btn-link">
<i class="helion-icon helion-icon-Right_Arrow"></i>
<span translate>Edit</span>
</a>
</div>

<div class="panel panel-default">
<h5>Services</h5>
<ul>
<li ng-repeat="service in appCtrl.model.application.summary.services">
{{ service }}
</li>
</ul>
</div>
<div class="row data-body">
<div class="col-md-6">
<dl class="dl-horizontal">
<dt translate>MEMORY UTILIZATION</dt>
<dd class="pull-right">0 / {{ appCtrl.model.application.summary.memory }} <span translate>MB</span></dd>

<dt translate>INSTANCES</dt>
<dd class="pull-right">{{ appCtrl.model.application.summary.running_instances }} / {{ appCtrl.model.application.summary.instances }}</dd>

<dt translate>DISK QUOTA</dt>
<dd class="pull-right">0 / {{ appCtrl.model.application.summary.disk_quota }} <span translate>MB</span></dd>

<dt translate>STATE</dt>
<dd class="pull-right"></dd>

<dt translate>MODIFIED</dt>
<dd class="pull-right"></dd>
</dl>
</div>
<div class="col-md-6">
<dl class="dl-horizontal">
<dt translate>BUILDPACK</dt>
<dd class="pull-right">{{ appCtrl.model.application.summary.buildpack }}</dd>

<div class="panel panel-default">
<h5>Routes</h5>
<ul>
<li ng-repeat="route in appCtrl.model.application.summary.routes">
{{ route }}
</li>
</ul>
<dt translate>CF TARGET</dt>
<dd class="pull-right"></dd>

<dt translate>CF LOGIN</dt>
<dd class="pull-right"></dd>
</dl>
</div>
</div>
</div>

<div>
<div class="action-header">
<span translate>Service Instances</span>
<a class="btn btn-link">
<i class="helion-icon helion-icon-Right_Arrow"></i>
<span translate>Add service</span>
</a>
</div>
<div class="panel panel-default">
<table class="table">
<thead>
<tr>
<th translate>Name</th>
<th translate>Service</th>
<th translate>Plan</th>
<th translate>ENV.VARIABLES</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="service in appCtrl.model.application.summary.services">
<td>{{ service.name }}</td>
<td>{{ service.service_plan.service.label }}</td>
<td>{{ service.service_plan.name }}</td>
<td>
<a class="icon-link" href="http://yahoo.com" target="_blank"><i class="helion-icon helion-icon-Share"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div>
<div class="action-header">
<span translate>Routes</span>
<a class="btn btn-link">
<i class="helion-icon helion-icon-Right_Arrow"></i>
<span translate>Add routes</span>
</a>
</div>
<div class="panel panel-default">
<table class="table">
<thead>
<tr>
<th translate>Route</th>
<th translate>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="route in appCtrl.model.application.summary.routes">
<td>{{ route.host + '.' + route.domain.name + '/' + route.path }}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="panel panel-default">
<h5>Instances</h5>
<ul>
<li ng-repeat="instance in appCtrl.model.application.summary.instances">
{{ instance }}
</li>
</ul>
<div>
<div class="action-header">
<span translate>Instances</span>
<a class="btn btn-link">
<i class="helion-icon helion-icon-Right_Arrow"></i>
<span translate>Add instances</span>
</a>
</div>
<div class="panel panel-default">
<table class="table">
<thead>
<tr>
<th translate>Index</th>
<th translate>Status</th>
<th></th>
</tr>
</tr>
</thead>
<tbody>
<tr ng-repeat="instance in appCtrl.model.application.summary.running_instances">
<td>{{ $index }}</td>
<td>{{ instance.name }}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.application-details .summary .data-body {
padding: $hpe-unit-space * .75 $hpe-unit-space;

.dl-horizontal > * {
margin-bottom: $hpe-unit-space * .5;
margin-left: auto;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "application/application";
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
};
}

ApplicationGalleryCardController.$inject = ['$state'];
ApplicationGalleryCardController.$inject = [
'$state'
];

function ApplicationGalleryCardController($state) {
this.$state = $state;
this.cardData = {
title: this.app.entity.name,
status: {
description: this.app.entity.state === 'STARTED' ? '' : this.app.entity.state,
classes: this.app.entity.state === 'STARTED' ? '' : 'warning'
}
title: this.app.entity.name
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<gallery-card card-data="applicationGalleryCardCtrl.cardData"
on-card-click="applicationGalleryCardCtrl.goToApp()">
<strong>GUID</strong>: {{applicationGalleryCardCtrl.app.metadata.guid}}
<br/>
<strong>Created</strong>: <span am-time-ago="applicationGalleryCardCtrl.app.metadata.created_at"></span>
<br/>
<strong>Updated</strong>: <span am-time-ago="applicationGalleryCardCtrl.app.metadata.updated_at"></span>
<br/>
<strong>Allocated Memory</strong>: {{applicationGalleryCardCtrl.app.entity.memory}} MB
<br/>
<strong>Allocated Disk Space</strong>: {{applicationGalleryCardCtrl.app.entity.disk_quota}} MB
<br/>
<strong>App Instances</strong>: {{applicationGalleryCardCtrl.app.entity.instances}}
<dl class="dl-horizontal">
<dt>Memory Utilization</dt>
<dd>{{applicationGalleryCardCtrl.app.entity.memory}} MB</dd>
<dt>Instances</dt>
<dd>{{applicationGalleryCardCtrl.app.entity.instances}}</dd>
<dt>Disk Quota</dt>
<dd>{{applicationGalleryCardCtrl.app.entity.disk_quota}}</dd>
<dt>State</dt>
<dd>{{applicationGalleryCardCtrl.app.entity.state}}</dd>
<dt>Modified</dt>
<dd>{{applicationGalleryCardCtrl.app.metadata.updated_at | date : 'M/d/yy h:mm:ss a'}}</dd>
</dl>
</gallery-card>