提交 ea7086d2 编写于 作者: A Atanas Mirchev

Merge branch 'master' into stdio_refactoring

{
"rules": {
// Disable undefined variable checking. Extern files often use global variables.
"no-undef": 0,
// Disable unused variable checking. Extern functions always have unused variables.
"no-unused-vars": 0,
}
}
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview Externs for Angular $resource service. They are missing from the original externs.
* TODO(bryk): Contribute this file to Angular externs.
*
* @externs
*/
/**
* @typedef {function(string):!angular.Resource}
*/
angular.$resource;
/**
* @constructor
* @template T
*/
angular.Resource = function() {};
/**
* @param {!T} data
* @param {function(!T)=} opt_callback
* @param {function(!angular.$http.Response)=} opt_errback
*/
angular.Resource.prototype.save = function(data, opt_callback, opt_errback) {};
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview Externs for backend API and model objects. This should be kept in sync with the
* backend code.
*
* Guidelines:
* - Model JSONs should have the same name as backend structs.
*
* @externs
*/
const backendApi = {};
/**
* @typedef {{
* appName: string,
* containerImage: string
* }}
*/
backendApi.DeployAppConfig;
......@@ -20,15 +20,43 @@
*/
export default class DeployController {
/**
* @param {!angular.$timeout} $timeout
* @param {!angular.$resource} $resource
* @param {!angular.$log} $log
* @ngInject
*/
constructor($timeout) {
/** @export {number} */
this.testValue = 7;
constructor($resource, $log) {
/** @export {string} */
this.appName = '';
$timeout(() => {
this.testValue = 8;
}, 4000);
/** @export {string} */
this.containerImage = '';
/** @private {!angular.Resource<!backendApi.DeployAppConfig>} */
this.resource_ = $resource('/api/deploy');
/** @private {!angular.$log} */
this.log_ = $log;
}
/**
* Deploys the application based on the sate of the controller.
*
* @export
*/
deploy() {
/** @type {!backendApi.DeployAppConfig} */
let deployAppConfig = {
appName: this.appName,
containerImage: this.containerImage,
};
this.resource_.save(
deployAppConfig,
(savedConfig) => {
this.log_.info('Succesfully deployed application: ', savedConfig);
},
(err) => {
this.log_.error('Error deployng application:', err);
});
}
}
......@@ -17,6 +17,17 @@ limitations under the License.
<div layout="column" layout-padding layout-align="center center">
<md-whiteframe class="kd-deploy-whiteframe md-whiteframe-5dp" flex flex-gt-md>
<h3 class="md-headline">Deploy a Containerized App</h3>
<span>Lorem ipsum...</span>
<form name="userForm">
<md-input-container class="md-block">
<label>App name</label>
<input ng-model="ctrl.appName">
</md-input-container>
<md-input-container class="md-block">
<label>Container Image</label>
<input ng-model="ctrl.containerImage">
</md-input-container>
<md-button href class="md-raised md-primary" ng-click="ctrl.deploy()">Submit</md-button>
<md-button class="md-raised" ui-sref="zero">Cancel</md-button>
</form>
</md-whiteframe>
</div>
......@@ -17,6 +17,6 @@ limitations under the License.
<div layout="vertical" layout-fill>
<header>
Zero state page. <a ui-sref="servicelist">Go to services page</a> or
<a ui-sref="deploy">deploy and app</a>.
<a ui-sref="deploy">deploy an app</a>.
</header>
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册