本文整理汇总了TypeScript中core/application/applicationModel.builder.ApplicationModelBuilder.createApplication方法的典型用法代码示例。如果您正苦于以下问题:TypeScript builder.ApplicationModelBuilder.createApplication方法的具体用法?TypeScript builder.ApplicationModelBuilder.createApplication怎么用?TypeScript builder.ApplicationModelBuilder.createApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/application/applicationModel.builder.ApplicationModelBuilder
的用法示例。
在下文中一共展示了builder.ApplicationModelBuilder.createApplication方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(mock.inject(($httpBackend: IHttpBackendService, _API_: Api, _clusterFilterModel_: ClusterFilterModel,
_clusterService_: ClusterService, applicationModelBuilder: ApplicationModelBuilder) => {
$http = $httpBackend;
API = _API_;
clusterService = _clusterService_;
clusterFilterModel = _clusterFilterModel_;
application = applicationModelBuilder.createApplication(
'app',
{key: 'serverGroups'},
{key: 'runningExecutions'},
{key: 'runningTasks'}
);
application.getDataSource('serverGroups').data = [
{name: 'the-target', account: 'not-the-target', region: 'us-east-1'},
{name: 'the-target', account: 'test', region: 'not-the-target'},
{name: 'the-target', account: 'test', region: 'us-east-1'},
{name: 'not-the-target', account: 'test', region: 'us-east-1'},
{name: 'the-source', account: 'test', region: 'us-east-1'}
];
}));
示例2: beforeEach
beforeEach(function() {
app = modelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true });
app.getDataSource('loadBalancers').data = [
{
name: 'elb-1',
region: 'us-east-1',
account: 'test',
vpcName: '',
serverGroups: [],
instanceCounts: { down: 0, starting: 0, outOfService: 0 },
usages: {},
},
{
name: 'elb-1',
region: 'us-west-1',
account: 'test',
vpcName: 'main',
serverGroups: [],
instanceCounts: { down: 0, starting: 0, outOfService: 0 },
usages: {},
},
{
name: 'elb-2',
region: 'us-east-1',
account: 'prod',
vpcName: '',
serverGroups: [],
instanceCounts: { down: 0, starting: 0, outOfService: 0 },
usages: {},
},
];
resultJson = [
{ heading: 'us-east-1', loadBalancer: app.loadBalancers.data[0], serverGroups: [] },
{ heading: 'us-west-1', loadBalancer: app.loadBalancers.data[1], serverGroups: [] },
{ heading: 'us-east-1', loadBalancer: app.loadBalancers.data[2], serverGroups: [] },
];
LoadBalancerState.filterModel.asFilterModel.clearFilters();
});
示例3:
(
$httpBackend: IHttpBackendService,
_clusterService_: ClusterService,
applicationModelBuilder: ApplicationModelBuilder,
) => {
$http = $httpBackend;
clusterService = _clusterService_;
application = applicationModelBuilder.createApplication(
'app',
{ key: 'serverGroups' },
{ key: 'runningExecutions' },
{ key: 'runningTasks' },
);
application.getDataSource('serverGroups').data = [
{ name: 'the-target', account: 'not-the-target', region: 'us-east-1' },
{ name: 'the-target', account: 'test', region: 'not-the-target' },
{ name: 'the-target', account: 'test', region: 'us-east-1' },
{ name: 'not-the-target', account: 'test', region: 'us-east-1' },
{ name: 'the-source', account: 'test', region: 'us-east-1' },
];
},
示例4: postTask
function postTask(serverGroupCommand: IServerGroupCommand): ITaskCommand {
let submitted: ITaskCommand = {};
$httpBackend
.expectPOST(`${API.baseUrl}/applications/app/tasks`, (body: string) => {
submitted = JSON.parse(body) as ITaskCommand;
return true;
})
.respond(200, { ref: '/1' });
const application: TestApplication = applicationModelBuilder.createApplication(
'app',
ApplicationDataSourceRegistry.getDataSources(),
) as TestApplication;
application.tasks = {
refresh: noop,
};
$httpBackend.expectGET(API.baseUrl + '/tasks/1').respond({});
serverGroupWriter.cloneServerGroup(serverGroupCommand, application);
$httpBackend.flush();
return submitted;
}
示例5: beforeEach
beforeEach(mock.inject((serverGroupWarningMessageService: ServerGroupWarningMessageService,
_applicationModelBuilder_: ApplicationModelBuilder) => {
service = serverGroupWarningMessageService;
applicationModelBuilder = _applicationModelBuilder_;
app = applicationModelBuilder.createApplication('app');
}));
示例6: configureApplication
function configureApplication() {
applicationDataSourceRegistry.registerDataSource({key: 'serverGroups'});
application = applicationModelBuilder.createApplication(applicationDataSourceRegistry.getDataSources());
application.refresh();
$scope.$digest();
}
示例7:
mock.inject((_applicationModelBuilder_: ApplicationModelBuilder) => {
applicationModelBuilder = _applicationModelBuilder_;
app = applicationModelBuilder.createApplication('app');
}),