You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/08/11 21:23:02 UTC
[incubator-streampipes] 01/03: [STREAMPIPES-193] Migrate login
module to Angular
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch STREAMPIPES-193
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit fdc9bddb89ec875bfd6ec3e8b788f0e29449a79d
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Mon Aug 10 21:29:28 2020 +0200
[STREAMPIPES-193] Migrate login module to Angular
---
ui/deployment/app.module.mst | 2 -
ui/deployment/appng5.module.mst | 5 +
ui/deployment/state.config.mst | 17 +-
.../login.module.ts => core-v2/core.module.ts} | 39 ++--
ui/src/app/core/working.state.config.ts | 210 ---------------------
.../login/components/login/login.component.html | 79 ++++++++
.../login/login.component.ts} | 60 +++---
.../login/components/setup/setup.component.html | 155 +++++++++++++++
.../setup/setup.component.ts} | 61 +++---
.../startup/startup.component.html} | 17 +-
.../startup/startup.component.ts} | 34 ++--
ui/src/app/login/login.module.ts | 71 +++++--
ui/src/app/login/register.controller.ts | 80 --------
.../{login.module.ts => services/login.service.ts} | 29 +--
ui/src/app/services/auth.service.ts | 28 +--
ui/src/app/services/rest-api.service.ts | 8 -
ui/src/app/services/services.module.ts | 2 +-
ui/src/assets/templates/login.html | 70 -------
ui/src/assets/templates/setup.html | 149 ---------------
19 files changed, 433 insertions(+), 683 deletions(-)
diff --git a/ui/deployment/app.module.mst b/ui/deployment/app.module.mst
index 4b2f3e1..13a4a31 100644
--- a/ui/deployment/app.module.mst
+++ b/ui/deployment/app.module.mst
@@ -29,7 +29,6 @@ import spServices from './services/services.module';
import spCore from './core/core.module';
import spLayout from './layout/layout.module';
-import spLogin from './login/login.module';
import { SpButtonDirective } from "./core/button/button.directive";
import mdThemingProviderConfig from "./core/md-theming-provider.config";
import rootScopeDelegate from "./core/root-scope-delegate.decorator";
@@ -47,7 +46,6 @@ export const Ng1AppModule = angular
spServices,
spCore,
spLayout,
- spLogin,
'ui.router',
'ui.router.upgrade',
'ngAnimate',
diff --git a/ui/deployment/appng5.module.mst b/ui/deployment/appng5.module.mst
index 2943252..16b00ba 100644
--- a/ui/deployment/appng5.module.mst
+++ b/ui/deployment/appng5.module.mst
@@ -31,12 +31,15 @@ import { FormsModule } from '@angular/forms';
import { CustomMaterialModule } from './CustomMaterial/custom-material.module';
import { AuthStatusService } from './services/auth-status.service';
+import { CoreModule } from './core-v2/core.module';
+import { LoginModule } from './login/login.module';
import { HomeModule } from './home/home.module';
import { InfoModule } from './info/info.module';
import { AppAssetMonitoringModule } from "./app-asset-monitoring/app-asset-monitoring.module";
import { PipelineDetailsModule } from './pipeline-details/pipeline-details.module';
import { AppTransportMonitoringModule } from "./app-transport-monitoring/app-transport-monitoring.module";
import { NotificationCountService } from "./services/notification-count-service";
+import {AuthService} from "./services/auth.service";
{{#modulesActive}}
{{#ng5}}
@@ -62,6 +65,7 @@ import { NotificationModule } from './notifications/notifications.module';
HttpClientModule,
FormsModule,
UIRouterUpgradeModule.forRoot(),
+ LoginModule,
HomeModule,
ConfigurationModule,
InfoModule,
@@ -78,6 +82,7 @@ import { NotificationModule } from './notifications/notifications.module';
],
providers: [
AuthStatusService,
+ AuthService,
{
provide: '$stateParams',
useFactory: ($injector: any) => $injector.get('$stateParams'),
diff --git a/ui/deployment/state.config.mst b/ui/deployment/state.config.mst
index 292736c..5d5a5b0 100644
--- a/ui/deployment/state.config.mst
+++ b/ui/deployment/state.config.mst
@@ -24,6 +24,9 @@ import { {{{ng5_component}}} } from '{{{ng5_componentPath}}}';
{{/modulesActive}}
import { HomeComponent } from '../home/home.component';
import { InfoComponent } from '../info/info.component';
+import { LoginComponent } from '../login/components/login/login.component';
+import { SetupComponent } from '../login/components/setup/setup.component';
+import { StartupComponent } from '../login/components/startup/startup.component';
import { AppContainerComponent } from '../app-container/app-container.component';
import { StandaloneDashboardComponent } from "../dashboard/components/standalone/standalone-dashboard.component";
import { NotificationsComponent } from "../notifications/notifications.component";
@@ -74,7 +77,7 @@ export default function stateConfig($stateProvider, $urlRouterProvider) {
params: {target: null},
views: {
'container': {
- templateUrl: '../../assets/templates/login.html'
+ component: LoginComponent
}
}
})
@@ -83,7 +86,7 @@ export default function stateConfig($stateProvider, $urlRouterProvider) {
params: {target: null},
views: {
'container': {
- template: require('../login/startup/startup.html')
+ component: StartupComponent
}
}
})
@@ -104,19 +107,11 @@ export default function stateConfig($stateProvider, $urlRouterProvider) {
}
}
})
- .state('register', {
- url: '/register',
- views: {
- 'container': {
- templateUrl: '../../assets/templates/register.html'
- }
- }
- })
.state('setup', {
url: '/setup',
views: {
'container': {
- templateUrl: '../../assets/templates/setup.html'
+ component: SetupComponent
}
}
})
diff --git a/ui/src/app/login/login.module.ts b/ui/src/app/core-v2/core.module.ts
similarity index 56%
copy from ui/src/app/login/login.module.ts
copy to ui/src/app/core-v2/core.module.ts
index 40d2bae..691e536 100644
--- a/ui/src/app/login/login.module.ts
+++ b/ui/src/app/core-v2/core.module.ts
@@ -16,18 +16,31 @@
*
*/
-import * as angular from 'angular';
+import {NgModule} from '@angular/core';
+import {MatGridListModule} from '@angular/material/grid-list';
+import {MatIconModule} from '@angular/material/icon';
+import {FlexLayoutModule} from '@angular/flex-layout';
+import {CommonModule} from '@angular/common';
-import spServices from '../services/services.module'
+@NgModule({
+ imports: [
+ CommonModule,
+ FlexLayoutModule,
+ MatGridListModule,
+ MatIconModule
+ ],
+ declarations: [
-import {RegisterCtrl} from './register.controller'
-import {LoginCtrl} from './login.controller'
-import {SetupCtrl} from './setup.controller'
-import {StartupCtrl} from "./startup/startup.controller";
-
-export default angular.module('sp.login', [spServices])
- .controller('RegisterCtrl', RegisterCtrl)
- .controller('LoginCtrl', LoginCtrl)
- .controller('SetupCtrl', SetupCtrl)
- .controller('StartupCtrl', StartupCtrl)
- .name;
+ ],
+ providers: [
+ {
+ provide: 'AuthStatusService',
+ useFactory: ($injector: any) => $injector.get('AuthStatusService'),
+ deps: ['$injector'],
+ },
+ ],
+ entryComponents: [
+ ]
+})
+export class CoreModule {
+}
\ No newline at end of file
diff --git a/ui/src/app/core/working.state.config.ts b/ui/src/app/core/working.state.config.ts
deleted file mode 100644
index 3c2ed5a..0000000
--- a/ui/src/app/core/working.state.config.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- *
- */
-
-import {HomeComponent} from '../home/home.component';
-import {ConfigurationComponent} from '../configuration/configuration.component';
-import {AppContainerComponent} from '../app-container/app-container.component';
-import {ConnectComponent} from '../connect/connect.component';
-
-export default function stateConfig($stateProvider, $urlRouterProvider) {
- // $urlRouterProvider.otherwise( function($injector, $location) {
- // var $state = $injector.get("$state");
- // $state.go("streampipes");
- // });
-
- $urlRouterProvider.otherwise('/streampipes');
-
- var spNavbar = {
- templateUrl: '../../assets/templates/navbar.html',
- controller: 'AppCtrl',
- };
-
- var spIconBar = {
- templateUrl: '../../assets/templates/iconbar.html',
- controller: 'AppCtrl',
- };
-
- var container = {
- templateUrl: '../../assets/templates/streampipes.html',
- controller: 'AppCtrl',
- };
-
- $stateProvider
- .state('streampipes', {
- url: '/streampipes',
- views: {
- container: container,
- 'spNavbar@streampipes': spNavbar,
- 'spIconBar@streampipes': spIconBar,
- 'spMain@streampipes': {
- component: HomeComponent,
- },
- },
- resolve: {
- authData: function (AuthService) {
- return AuthService.authenticate();
- },
- },
- })
- .state('streampipes.pipelineDetails', {
- url: '/pipelines/:pipeline/details',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../pipeline-details/pipeline-details.html',
- controller: 'PipelineDetailsCtrl',
- },
- },
- })
- .state('login', {
- url: '/login/:target?session',
- params: { target: null },
- views: {
- container: {
- templateUrl: '../../assets/templates/login.html',
- controller: 'LoginCtrl',
- },
- },
- })
- /*
- .state('streampipes.applinks', {
- url: '/applinks',
- views: {
- "spMain@streampipes": {
- templateUrl: 'app/applinks/applinks.tmpl.html',
- controller: 'AppLinksCtrl'
- }
- }
- })
- */
- .state('register', {
- url: '/register',
- views: {
- container: {
- templateUrl: '../../assets/templates/register.html',
- controller: 'RegisterCtrl',
- },
- },
- })
- .state('setup', {
- url: '/setup',
- views: {
- container: {
- templateUrl: '../../assets/templates/setup.html',
- controller: 'SetupCtrl',
- },
- },
- })
- .state('streampipes.error', {
- url: '/error',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../../assets/templates/error.html',
- controller: 'SetupCtrl',
- },
- },
- })
- .state('streampipes.notifications', {
- url: '/notifications',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../notifications/notifications.component.html',
- controller: 'NotificationsCtrl',
- },
- },
- })
- .state('streampipes.editor', {
- url: '/editor/:pipeline',
- params: { pipeline: null },
- views: {
- 'spMain@streampipes': {
- templateUrl: '../editor/editor.html',
- controller: 'EditorCtrl',
- },
- },
- })
- .state('streampipes.pipelines', {
- url: '/pipelines/:pipeline',
- params: { pipeline: null },
- views: {
- 'spMain@streampipes': {
- templateUrl: '../pipelines/pipelines.html',
- controller: 'PipelineCtrl',
- },
- },
- })
- .state('streampipes.dashboard', {
- url: '/dashboard',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../dashboard/dashboard.html',
- controller: 'DashboardCtrl',
- },
- },
- })
- .state('streampipes.sensors', {
- url: '',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../sensors/sensors.html',
- controller: 'SensorsCtrl',
- },
- },
- })
- .state('streampipes.add', {
- url: '/add',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../add/add.html',
- controller: 'AddCtrl',
- },
- },
- })
- .state('streampipes.myelements', {
- url: '/myelements',
- views: {
- 'spMain@streampipes': {
- templateUrl: '../myelements/myelements.html',
- controller: 'MyElementsCtrl',
- },
- },
- })
- .state('streampipes.configuration', {
- url: '/configuration',
- views: {
- 'spMain@streampipes': {
- component: ConfigurationComponent,
- },
- },
- })
- .state('streampipes.appcontainer', {
- url: '/appcontainer',
- views: {
- 'spMain@streampipes': {
- component: AppContainerComponent,
- },
- },
- })
- .state('streampipes.connect', {
- url: '/connect',
- views: {
- 'spMain@streampipes': {
- component: ConnectComponent,
- },
- },
- });
-}
diff --git a/ui/src/app/login/components/login/login.component.html b/ui/src/app/login/components/login/login.component.html
new file mode 100644
index 0000000..806b2bd
--- /dev/null
+++ b/ui/src/app/login/components/login/login.component.html
@@ -0,0 +1,79 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You 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.
+ ~
+ -->
+
+<div class="md-padding full-background sp-fade" fxLayout="row" fxLayoutAlign="center center"
+ style="min-height:100vh !important;">
+ <div fxFlex="40" fxLayout="column" fxLayoutAlign="center center">
+ <mat-card class="card-100-center box-shadow-login" style="padding:20px;position:relative;top:-25px;">
+ <div fxFlex="100" fxLayout="column">
+ <div fxLayout="row" fxFlex="60" fxLayoutAlign="center center"
+ style="margin-left:auto;margin-right:auto;">
+ <div fxFlex="60" fxLayoutAlign="center center" fxLayout="row"
+ style="color:white;width:100%;"><img
+ alt="icon" src="../../../../assets/img/login/logo.png" style="width:100%;">
+ </div>
+ </div>
+ <div fxFlex="100" fxLayout="column" fxLayoutAlign="center start">
+ <h1>Login</h1>
+ </div>
+ <div fxFlex="100" fxLayout="column">
+ <form #loginForm="ngForm" fxFlex="100" fxLayout="column">
+ <div fxFlex="100" fxLayout="column">
+ <mat-form-field fxFlex>
+ <mat-label>Email</mat-label>
+ <input [(ngModel)]="credentials.username" matInput type="email" name="username" class="sp" required/>
+ </mat-form-field>
+ <mat-form-field fxFlex>
+ <mat-label>Password</mat-label>
+ <input [(ngModel)]="credentials.password" matInput name="password" type="password" class="sp" required/>
+ </mat-form-field>
+ <mat-checkbox [(ngModel)]="credentials.rememberMe" name="rememberMe" class="sp" color="primary">Remember Me</mat-checkbox>
+ <!-- <md-input-container class="sp"><label class="sp">Email</label> <input-->
+ <!-- type="email" class="sp" ng-model="ctrl.credentials.username" required>-->
+ <!-- </md-input-container>-->
+ <!-- <md-input-container class="sp" flex><label>Password</label>-->
+ <!-- <input type="password" ng-model="ctrl.credentials.password" required>-->
+ <!-- </md-input-container>-->
+ <!-- <md-input-container flex>-->
+ <!-- <md-checkbox-->
+ <!-- ng-model="ctrl.credentials.rememberMe"> Remember me-->
+ <!-- </md-checkbox>-->
+ <!-- </md-input-container>-->
+ </div>
+ <div class="form-actions" style="margin-top:20px;">
+ <button mat-button mat-raised-button color="primary" (click)="logIn()"
+ [disabled]="!loginForm.form.valid || loading">Login
+ </button>
+ <mat-spinner [mode]="'indeterminate'" color="primary"
+ *ngIf="loading"></mat-spinner>
+ <div class="md-warn" *ngIf="authenticationFailed">
+ <h4>The password you entered is incorrect. Please try again.</h4>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </mat-card>
+ <div fxFlex="100" fxLayout="column" fxLayoutAlign="center center">
+ <button mat-button mat-raised-button color="primary" (click)="openDocumentation()"
+ style="min-width:0px;padding-left:20px;padding-right:20px;font-size:18px;">
+ View Docs
+ </button>
+ </div>
+ </div>
+</div>
diff --git a/ui/src/app/login/login.controller.ts b/ui/src/app/login/components/login/login.component.ts
similarity index 60%
rename from ui/src/app/login/login.controller.ts
rename to ui/src/app/login/components/login/login.component.ts
index ae9e616..320f024 100644
--- a/ui/src/app/login/login.controller.ts
+++ b/ui/src/app/login/components/login/login.component.ts
@@ -16,53 +16,47 @@
*
*/
-import {ShepherdService} from "../services/tour/shepherd.service";
+import {ShepherdService} from "../../../services/tour/shepherd.service";
+import {Component, Inject} from "@angular/core";
+import {RestApi} from "../../../services/rest-api.service";
+import {AuthStatusService} from "../../../services/auth-status.service";
+import {FormGroup} from "@angular/forms";
+import {LoginService} from "../../services/login.service";
-export class LoginCtrl {
+@Component({
+ selector: 'login',
+ templateUrl: './login.component.html'
+})
+export class LoginComponent {
- $timeout: any;
- $log: any;
- $location: any;
- $state: any;
- $stateParams: any;
- $window: any;
- RestApi: any;
- AuthStatusService: any;
loading: any;
authenticationFailed: any;
credentials: any;
- ShepherdService: ShepherdService;
-
- constructor($timeout, $log, $location, $state, $stateParams, RestApi, $window, AuthStatusService, ShepherdService) {
- this.$timeout = $timeout;
- this.$log = $log;
- this.$location = $location;
- this.$state = $state;
- this.$stateParams = $stateParams;
- this.$window = $window;
- this.RestApi = RestApi;
- this.AuthStatusService = AuthStatusService;
-
- this.ShepherdService = ShepherdService;
+ constructor(private loginService: LoginService,
+ @Inject('$stateParams') private $stateParams,
+ @Inject("$state") private $state: any,
+ private AuthStatusService: AuthStatusService,
+ private ShepherdService: ShepherdService) {
this.loading = false;
this.authenticationFailed = false;
+ this.credentials = {};
}
openDocumentation(){
- this.$window.open('https://streampipes.apache.org/docs', '_blank');
+ window.open('https://streampipes.apache.org/docs', '_blank');
};
logIn() {
this.authenticationFailed = false;
this.loading = true;
- this.RestApi.login(this.credentials)
- .then(response => { // success
+ this.loginService.login(this.credentials)
+ .subscribe(response => { // success
this.loading = false;
- if (response.data.success) {
- this.AuthStatusService.username = response.data.info.authc.principal.username;
- this.AuthStatusService.email = response.data.info.authc.principal.email;
- this.AuthStatusService.token = response.data.token;
+ if (response.success) {
+ this.AuthStatusService.username = response.info.authc.principal.username;
+ this.AuthStatusService.email = response.info.authc.principal.email;
+ this.AuthStatusService.token = response.token;
this.AuthStatusService.authenticated = true;
this.$state.go("streampipes");
}
@@ -80,8 +74,6 @@ export class LoginCtrl {
};
setSheperdServiceDelay() {
- this.ShepherdService.setTimeWaitMillies(100);
+ //this.ShepherdService.setTimeWaitMillies(100);
}
-};
-
-LoginCtrl.$inject = ['$timeout', '$log', '$location', '$state', '$stateParams', 'RestApi', '$window', 'AuthStatusService', 'ShepherdService'];
+};
\ No newline at end of file
diff --git a/ui/src/app/login/components/setup/setup.component.html b/ui/src/app/login/components/setup/setup.component.html
new file mode 100644
index 0000000..55497c7
--- /dev/null
+++ b/ui/src/app/login/components/setup/setup.component.html
@@ -0,0 +1,155 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You 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.
+ ~
+ -->
+
+<div class="md-padding full-background" fxLayout="row" fxLayoutAlign="center center"
+ style="min-height:100vh !important;">
+ <div fxFlex="40" fxLayout="column" fxLayoutAlign="center center">
+ <mat-card class="card-100-center box-shadow-login" style="padding:20px;overflow-y:auto;height:80vh;">
+ <div fxFlex="100" fxLayout="column">
+ <div fxLayout="row" fxLayoutAlign="center center" style="margin-left:auto;margin-right:auto;margin-bottom:20px;">
+ <div fxFlex="60" fxLayoutAlign="center center" fxLayout="row"
+ style="color:white;"><img
+ style="margin-top:40px;width:400px;" alt="icon" src="../../../../assets/img/login/logo.png">
+ </div>
+ </div>
+ <form #setupForm="ngForm" >
+ <mat-card-title>
+ <div fxFlex="100" fxLayout="column">
+
+ <h1>Welcome!</h1>
+ <h4>The setup of the system might take a minute. Create a user and you are ready to
+ go!</h4>
+ </div>
+ </mat-card-title>
+ <div *ngIf="!installationRunning">
+ <h3>Initial User</h3>
+ <div fxLayout="column">
+ <mat-form-field fxFlex>
+ <mat-label>Email</mat-label>
+ <input [(ngModel)]="setup.adminEmail" matInput type="email" name="email" class="sp" required/>
+ </mat-form-field>
+ <mat-form-field fxFlex>
+ <mat-label>Password</mat-label>
+ <input [(ngModel)]="setup.adminPassword" matInput type="password" name="password" class="sp" required/>
+ </mat-form-field>
+ <mat-checkbox color="primary" [(ngModel)]="setup.installPipelineElements" name="install"><span>Also install available data streams, processors and sinks.</span></mat-checkbox>
+<!-- <md-input-container flex>-->
+<!-- <label>Email</label>-->
+<!-- <input name="email" type="email" ng-model="ctrl.setup.adminEmail" required>-->
+<!-- <span ng-show="ctrl.setupForm.email.$touched && ctrl.setupForm.email.$error.required">The email field can't be blank.</span>-->
+<!-- <span ng-show="ctrl.setupForm.email.$error.email">This is not a valid email.</span>-->
+<!-- </md-input-container>-->
+<!-- <md-input-container flex>-->
+<!-- <label>Password</label>-->
+<!-- <input name="password" type="password" ng-model="ctrl.setup.adminPassword" required>-->
+<!-- <span ng-show="ctrl.setupForm.password.$touched && ctrl.setupForm.password.$error.required">The password field can't be blank.</span>-->
+<!-- </md-input-container>-->
+ </div>
+<!-- <md-checkbox ng-model="ctrl.setup.installPipelineElements" aria-label="Install pipeline elements">-->
+<!-- Also install available data streams, processors and sinks.-->
+<!-- </md-checkbox>-->
+
+ </div>
+ <div>
+ <div *ngIf="showAdvancedSettings && !installationRunning">
+ <div fxFlex fxLayout="column">
+ <h3>Advanced Settings</h3>
+ <div fxLayout="row">
+ <mat-form-field fxFlex="45" fxLayoutAlign="start center">
+ <mat-label>CouchDB Host</mat-label>
+ <input [(ngModel)]="setup.couchDbHost" matInput name="couchDbHost" class="sp"/>
+ </mat-form-field>
+ <mat-form-field fxFlex="45" fxLayoutAlign="end center">
+ <mat-label>JMS Host</mat-label>
+ <input [(ngModel)]="setup.jmsHost" matInput name="jmsHost" class="sp"/>
+ </mat-form-field>
+ </div>
+ <div fxLayout="row">
+ <mat-form-field fxFlex="45" fxLayoutAlign="start center">
+ <mat-label>Kafka Host</mat-label>
+ <input [(ngModel)]="setup.kafkaHost" matInput name="kafkaHost" class="sp"/>
+ </mat-form-field>
+ <mat-form-field fxFlex="45" fxLayoutAlign="end center">
+ <mat-label>Zookeeper Host</mat-label>
+ <input [(ngModel)]="setup.zookeeperHost" matInput name="zookeeperHost" class="sp"/>
+ </mat-form-field>
+<!-- <md-input-container flex>-->
+<!-- <label>Kafka Host</label>-->
+<!-- <input name="kafkaHost" ng-model="ctrl.setup.kafkaHost">-->
+<!-- </md-input-container>-->
+<!-- <md-input-container flex>-->
+<!-- <label>Zookeeper Host</label>-->
+<!-- <input name="zookeeperHost" ng-model="ctrl.setup.zookeeperHost">-->
+<!-- </md-input-container>-->
+ </div>
+ </div>
+ </div>
+ <div *ngIf="installationRunning">
+ <h3>Installation Results</h3>
+ <div *ngFor="let msg of installationResults">
+ <div fxFlex fxLayout="row" style="width:80%" class="center center">
+ <div fxFlex="80" style="width:50%"><h4>{{msg.properties.notifications[0].title}}</h4></div>
+ <div fxFlex="20" style="width:50%">
+ <mat-icon class="md-accent" style="width: 36px; height: 36px"
+ *ngIf="msg.properties.success">done</mat-icon>
+ <mat-icon class="md-accent" style="width: 36px; height: 36px"
+ *ngIf="!(msg.properties.success)">error</mat-icon>
+ </div>
+ </div>
+ </div>
+ <div fxFlex fxLayout style="width:80%" class="center center" *ngIf="nextTaskTitle != ''">
+ <div fxFlex="80" style="width:50%"><h4>{{nextTaskTitle}}</h4></div>
+ <div fxFlex="20" style="width:50%">
+ <mat-spinner class="md-accent" [mode]="'indeterminate'"
+ *ngIf="loading"></mat-spinner>
+ </div>
+ </div>
+ <div *ngIf="installationFinished">
+ <h3><a class="md-accent">
+ <mat-icon style="width: 36px; height: 36px">arrow_forward</mat-icon>
+ Go to login page</a></h3>
+ </div>
+ </div>
+ <mat-divider></mat-divider>
+ <mat-card-actions fxLayout="row" fxLayoutAlign="end center" *ngIf="!installationRunning">
+ <div fxFlex fxLayout="column">
+
+ <div fxLayout="row">
+ <button mat-button mat-raised-button color="primary"
+ [disabled]="!(parentForm.valid) || loading || installationFinished"
+ (click)="configure(0)">Install
+ </button>
+ <button mat-button mat-raised-button class="mat-basic" *ngIf="!showAdvancedSettings"
+ (click)="showAdvancedSettings = !showAdvancedSettings"
+ [disabled]="installationFinished">Show Advanced Settings
+ </button>
+ <button mat-button mat-raised-button class="mat-basic" *ngIf="showAdvancedSettings"
+ (click)="showAdvancedSettings = !showAdvancedSettings"
+ [disabled]="installationFinished">Hide Advanced Settings
+ </button>
+ </div>
+
+ </div>
+ </mat-card-actions>
+ </div>
+ </form>
+ </div>
+ </mat-card>
+ </div>
+</div>
+
diff --git a/ui/src/app/login/setup.controller.ts b/ui/src/app/login/components/setup/setup.component.ts
similarity index 71%
rename from ui/src/app/login/setup.controller.ts
rename to ui/src/app/login/components/setup/setup.component.ts
index 4a27f32..b1a9f6f 100644
--- a/ui/src/app/login/setup.controller.ts
+++ b/ui/src/app/login/components/setup/setup.component.ts
@@ -16,25 +16,39 @@
*
*/
-export class SetupCtrl {
+import {Component} from "@angular/core";
+import {RestApi} from "../../../services/rest-api.service";
+import {FormGroup} from "@angular/forms";
+import {LoginService} from "../../services/login.service";
+
+@Component({
+ selector: 'setup',
+ templateUrl: './setup.component.html'
+})
+export class SetupComponent {
- $location: any;
- RestApi: any;
- $mdToast:any;
installationFinished: any;
installationSuccessful: any;
installationResults: any;
loading: any;
showAdvancedSettings: any;
- setup: any;
+ setup: any = {
+ couchDbHost: '',
+ kafkaHost: '',
+ zookeeperHost: '',
+ jmsHost: '',
+ adminEmail: '',
+ adminPassword: '',
+ installPipelineElements: true
+ };
setupForm: any;
installationRunning: any;
nextTaskTitle: any;
- constructor($location, RestApi, $mdToast) {
- this.$location = $location;
- this.RestApi = RestApi;
- this.$mdToast = $mdToast;
+ parentForm: FormGroup = new FormGroup({});
+
+ constructor(private loginService: LoginService,
+ private RestApi: RestApi) {
this.installationFinished = false;
this.installationSuccessful = false;
@@ -42,22 +56,13 @@ export class SetupCtrl {
this.loading = false;
this.showAdvancedSettings = false;
- this.setup = {
- couchDbHost: '',
- kafkaHost: '',
- zookeeperHost: '',
- jmsHost: '',
- adminEmail: '',
- adminPassword: '',
- installPipelineElements: true
- };
+ this.setup
}
configure(currentInstallationStep) {
this.installationRunning = true;
this.loading = true;
- this.RestApi.setupInstall(this.setup, currentInstallationStep).then(msg => {
- let data = msg.data;
+ this.loginService.setupInstall(this.setup, currentInstallationStep).subscribe(data => {
this.installationResults = this.installationResults.concat(data.statusMessages);
this.nextTaskTitle = data.nextTaskTitle;
let nextInstallationStep = currentInstallationStep + 1;
@@ -80,12 +85,12 @@ export class SetupCtrl {
}
showToast(string) {
- this.$mdToast.show(
- this.$mdToast.simple()
- .content(string)
- .position("right")
- .hideDelay(3000)
- );
+ // this.$mdToast.show(
+ // this.$mdToast.simple()
+ // .content(string)
+ // .position("right")
+ // .hideDelay(3000)
+ // );
};
addPod(podUrls) {
@@ -96,6 +101,4 @@ export class SetupCtrl {
removePod(podUrls, index) {
podUrls.splice(index, 1);
}
-};
-
-SetupCtrl.$inject = ['$location', 'RestApi', '$mdToast'];
+}
diff --git a/ui/src/app/login/startup/startup.html b/ui/src/app/login/components/startup/startup.component.html
similarity index 65%
rename from ui/src/app/login/startup/startup.html
rename to ui/src/app/login/components/startup/startup.component.html
index ea1f27e..885739c 100644
--- a/ui/src/app/login/startup/startup.html
+++ b/ui/src/app/login/components/startup/startup.component.html
@@ -16,22 +16,21 @@
~
-->
-<div class="md-padding sp-fade" layout-xs="column" layout="row" layout-align="center center"
- style="min-height:100vh !important; background:white;" ng-controller="StartupCtrl as ctrl">
- <div flex="80" layout="column" layout-align="center center" style="display:flex;">
- <img src="/assets/img/sp/sp-logo-center-color.png" style="max-width:500px;"/>
+<div class="md-padding sp-fade" fxLayout="row" fxLayoutAlign="center center"
+ style="min-height:100vh !important; background:white;">
+ <div fxFlex="80" fxLayout="column" fxLayoutAlign="center center" style="display:flex;">
+ <img src="../../../../assets/img/sp/sp-logo-center-color.png" style="max-width:500px;"/>
- <div flex="100">
+ <div fxFlex="100">
<h2>Welcome!</h2>
</div>
- <div flex="100">
+ <div fxFlex="100">
<h4 style="text-align:center;">Please wait while StreamPipes is starting up.</h4>
<h5 style="text-align:center;"><i>On some systems, initial startup might take a few minutes. We'll automatically forward you once StreamPipes is ready.</i></h5>
</div>
- <div flex="100" layout-align="center center">
- <md-progress-linear style="margin-top:10px;width:800px;" class="md-accent" md-mode="determinate" value="{{ctrl.progress}}"></md-progress-linear>
-
+ <div fxFlex="100" fxLayoutAlign="center center">
+ <mat-progress-bar style="margin-top:10px;width:800px;" class="md-accent" [mode]="'determinate'" value="{{progress}}"></mat-progress-bar>
</div>
</div>
diff --git a/ui/src/app/login/startup/startup.controller.ts b/ui/src/app/login/components/startup/startup.component.ts
similarity index 69%
rename from ui/src/app/login/startup/startup.controller.ts
rename to ui/src/app/login/components/startup/startup.component.ts
index ec54467..48d293c 100644
--- a/ui/src/app/login/startup/startup.controller.ts
+++ b/ui/src/app/login/components/startup/startup.component.ts
@@ -16,30 +16,27 @@
*
*/
-import {AuthService} from "../../services/auth.service";
-import {AuthStatusService} from "../../services/auth-status.service";
+import {AuthService} from "../../../services/auth.service";
+import {AuthStatusService} from "../../../services/auth-status.service";
+import {Component, Inject, OnInit} from "@angular/core";
-export class StartupCtrl {
-
- AuthService: AuthService;
- AuthStatusService: AuthStatusService;
- $state: any;
- $timeout: any;
+@Component({
+ selector: 'startup',
+ templateUrl: './startup.component.html'
+})
+export class StartupComponent implements OnInit {
progress: number = 0;
currentStep = 0;
maxLoadingTimeInSeconds = 300;
loadingIntervalInSeconds = 1;
- constructor(AuthService, AuthStatusService, $state, $timeout) {
- this.AuthService = AuthService;
- this.AuthStatusService = AuthStatusService;
- this.$state = $state;
- this.$timeout = $timeout;
-
+ constructor(private AuthService: AuthService,
+ private AuthStatusService: AuthStatusService,
+ @Inject("$state") private $state: any) {
}
- $onInit() {
+ ngOnInit() {
this.checkStatus();
}
@@ -50,12 +47,9 @@ export class StartupCtrl {
}, () => {
this.currentStep += this.loadingIntervalInSeconds;
this.progress = (this.currentStep / this.maxLoadingTimeInSeconds) * 100;
- this.$timeout(() => {
+ setTimeout(() => {
this.checkStatus();
}, this.loadingIntervalInSeconds*1000);
});
}
-
-}
-
-StartupCtrl.$inject = ['AuthService', 'AuthStatusService', '$state', '$timeout'];
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/ui/src/app/login/login.module.ts b/ui/src/app/login/login.module.ts
index 40d2bae..50989ad 100644
--- a/ui/src/app/login/login.module.ts
+++ b/ui/src/app/login/login.module.ts
@@ -16,18 +16,61 @@
*
*/
-import * as angular from 'angular';
+import {NgModule} from '@angular/core';
+import {MatGridListModule} from '@angular/material/grid-list';
+import {MatIconModule} from '@angular/material/icon';
+import {FlexLayoutModule} from '@angular/flex-layout';
+import {CommonModule} from '@angular/common';
+import {LoginComponent} from "./components/login/login.component";
+import {SetupComponent} from "./components/setup/setup.component";
+import {MatCardModule} from "@angular/material/card";
+import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
+import {MatButtonModule} from "@angular/material/button";
+import {MatCheckboxModule} from "@angular/material/checkbox";
+import {MatFormFieldModule} from "@angular/material/form-field";
+import {FormsModule, ReactiveFormsModule} from "@angular/forms";
+import {MatInputModule} from "@angular/material/input";
+import {StartupComponent} from './components/startup/startup.component';
+import {MatDividerModule} from "@angular/material/divider";
+import {MatProgressBarModule} from "@angular/material/progress-bar";
+import {LoginService} from "./services/login.service";
-import spServices from '../services/services.module'
-
-import {RegisterCtrl} from './register.controller'
-import {LoginCtrl} from './login.controller'
-import {SetupCtrl} from './setup.controller'
-import {StartupCtrl} from "./startup/startup.controller";
-
-export default angular.module('sp.login', [spServices])
- .controller('RegisterCtrl', RegisterCtrl)
- .controller('LoginCtrl', LoginCtrl)
- .controller('SetupCtrl', SetupCtrl)
- .controller('StartupCtrl', StartupCtrl)
- .name;
+@NgModule({
+ imports: [
+ CommonModule,
+ FlexLayoutModule,
+ FormsModule,
+ MatButtonModule,
+ MatCardModule,
+ MatDividerModule,
+ MatGridListModule,
+ MatIconModule,
+ MatInputModule,
+ MatProgressSpinnerModule,
+ MatCheckboxModule,
+ MatFormFieldModule,
+ ReactiveFormsModule,
+ MatProgressBarModule,
+ ],
+ declarations: [
+ LoginComponent,
+ SetupComponent,
+ StartupComponent,
+ ],
+ providers: [
+ LoginService,
+ {
+ provide: 'AuthStatusService',
+ useFactory: ($injector: any) => $injector.get('AuthStatusService'),
+ deps: ['$injector'],
+ },
+ {
+ provide: 'RestApi',
+ useFactory: ($injector: any) => $injector.get('RestApi'),
+ deps: ['$injector'],
+ },
+ ],
+ entryComponents: []
+})
+export class LoginModule {
+}
diff --git a/ui/src/app/login/register.controller.ts b/ui/src/app/login/register.controller.ts
deleted file mode 100644
index 35f1b45..0000000
--- a/ui/src/app/login/register.controller.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- *
- */
-
-export class RegisterCtrl {
-
- RestApi: any;
- loading: any;
- registrationFailed: any;
- registrationSuccess: any;
- errorMessage: any;
- roles: any;
- selectedRole: any;
- password: any;
- email: any;
-
- constructor(RestApi) {
- this.RestApi = RestApi;
-
- this.loading = false;
- this.registrationFailed = false;
- this.registrationSuccess = false;
- this.errorMessage = "";
-
- this.roles = [{"name": "System Administrator", "internalName": "SYSTEM_ADMINISTRATOR"},
- {"name": "Manager", "internalName": "MANAGER"},
- {"name": "Operator", "internalName": "OPERATOR"},
- {"name": "Business Analyst", "internalName": "BUSINESS_ANALYST"},
- {"name": "Demo User", "internalName": "USER_DEMO"}];
-
- this.selectedRole = this.roles[0].internalName;
- }
-
-
- register() {
- var payload = {};
- payload['password'] = this.password;
- payload['email'] = this.email;
- payload['role'] = this.selectedRole;
- this.loading = true;
- this.registrationFailed = false;
- this.registrationSuccess = false;
- this.errorMessage = "";
-
- this.RestApi.register(payload)
- .then(response => {
- this.loading = false;
- if (response.data.success) {
- this.registrationSuccess = true;
- }
- else {
- this.registrationFailed = true;
- this.errorMessage = response.data.notifications[0].title;
- }
-
- }, response => { // error
-
- this.loading = false;
- this.registrationFailed = true;
- }
- )
- };
-}
-;
-
-//RegisterCtrl.$inject = ['RestApi'];
\ No newline at end of file
diff --git a/ui/src/app/login/login.module.ts b/ui/src/app/login/services/login.service.ts
similarity index 53%
copy from ui/src/app/login/login.module.ts
copy to ui/src/app/login/services/login.service.ts
index 40d2bae..006cb1b 100644
--- a/ui/src/app/login/login.module.ts
+++ b/ui/src/app/login/services/login.service.ts
@@ -16,18 +16,23 @@
*
*/
-import * as angular from 'angular';
+import {Injectable} from "@angular/core";
+import {HttpClient} from "@angular/common/http";
+import {PlatformServicesCommons} from "../../platform-services/apis/commons.service";
+import {Observable} from "rxjs";
-import spServices from '../services/services.module'
+@Injectable()
+export class LoginService {
-import {RegisterCtrl} from './register.controller'
-import {LoginCtrl} from './login.controller'
-import {SetupCtrl} from './setup.controller'
-import {StartupCtrl} from "./startup/startup.controller";
+ constructor(private http: HttpClient,
+ private platformServicesCommons: PlatformServicesCommons) {
+ }
-export default angular.module('sp.login', [spServices])
- .controller('RegisterCtrl', RegisterCtrl)
- .controller('LoginCtrl', LoginCtrl)
- .controller('SetupCtrl', SetupCtrl)
- .controller('StartupCtrl', StartupCtrl)
- .name;
+ login(credentials): Observable<any> {
+ return this.http.post(this.platformServicesCommons.unauthenticatedBasePath + "/admin/login", credentials);
+ }
+
+ setupInstall(setup, installationStep): Observable<any> {
+ return this.http.post(this.platformServicesCommons.unauthenticatedBasePath + "/setup/install/" +installationStep, setup);
+ }
+}
\ No newline at end of file
diff --git a/ui/src/app/services/auth.service.ts b/ui/src/app/services/auth.service.ts
index cfd7e02..7a4a0e9 100644
--- a/ui/src/app/services/auth.service.ts
+++ b/ui/src/app/services/auth.service.ts
@@ -18,21 +18,13 @@
import {RestApi} from "./rest-api.service";
import {AuthStatusService} from "./auth-status.service";
+import {Inject, Injectable} from "@angular/core";
+@Injectable()
export class AuthService {
- AuthStatusService: AuthStatusService;
- $rootScope: any;
- $location: any;
- $state: any;
- RestApi: RestApi;
-
- constructor($rootScope, $location, $state, RestApi, AuthStatusService) {
- this.AuthStatusService = AuthStatusService;
- this.$rootScope = $rootScope;
- this.$location = $location;
- this.$state = $state;
- this.RestApi = RestApi;
+ constructor(@Inject("RestApi") private RestApi: RestApi,
+ @Inject("AuthStatusService") private AuthStatusService: AuthStatusService) {
}
checkConfiguration() {
@@ -40,7 +32,8 @@ export class AuthService {
if (response.data.configured) {
this.AuthStatusService.configured = true;
- this.$rootScope.appConfig = response.data.appConfig;
+ // TODO
+ //this.$rootScope.appConfig = response.data.appConfig;
} else {
this.AuthStatusService.configured = false;
}
@@ -54,16 +47,9 @@ export class AuthService {
this.AuthStatusService.email = response.data.info.authc.principal.email;
this.AuthStatusService.authenticated = true;
this.AuthStatusService.token = response.data.token;
-
- // this.RestApi.getNotifications()
- // .then(notifications => {
- // this.$rootScope.unreadNotifications = notifications.data;
- // });
} else {
this.AuthStatusService.authenticated = false;
}
})
}
-}
-
-AuthService.$inject = ['$rootScope', '$location', '$state', 'RestApi', 'AuthStatusService'];
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts
index bb7f856..a6b3fae 100644
--- a/ui/src/app/services/rest-api.service.ts
+++ b/ui/src/app/services/rest-api.service.ts
@@ -467,10 +467,6 @@ export class RestApi {
return this.$http.get(this.getServerUrl() + "/admin/authc");
}
- login(credentials) {
- return this.$http.post(this.getServerUrl() + "/admin/login", credentials);
- }
-
loginSso(credentials, componentId, sessionId) {
return this.$http.post(this.getServerUrl() + "/admin/login/" +componentId +"?session=" +sessionId, credentials);
}
@@ -479,10 +475,6 @@ export class RestApi {
return this.$http.get(this.getServerUrl() + "/admin/logout");
}
- setupInstall(setup, installationStep) {
- return this.$http.post(this.getServerUrl() + "/setup/install/" +installationStep, setup);
- }
-
register(payload) {
return this.$http.post(this.getServerUrl() +"/admin/register", payload);
}
diff --git a/ui/src/app/services/services.module.ts b/ui/src/app/services/services.module.ts
index dbb2bcb..197aea2 100644
--- a/ui/src/app/services/services.module.ts
+++ b/ui/src/app/services/services.module.ts
@@ -54,7 +54,7 @@ import {NotificationCountService} from "./notification-count-service";
export default angular.module('sp.services', [spConstants])
.service('ImageChecker', ImageChecker)
- .service('AuthService', AuthService)
+ .service('AuthService', downgradeInjectable(AuthService))
.service('ElementIconText', ElementIconText)
.service('InitTooltips', InitTooltips)
.service('RestApi', RestApi)
diff --git a/ui/src/assets/templates/login.html b/ui/src/assets/templates/login.html
deleted file mode 100644
index 87d2b72..0000000
--- a/ui/src/assets/templates/login.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- ~
- -->
-
-<div class="md-padding full-background sp-fade" layout-xs="column" layout="row" layout-align="center center"
- style="min-height:100vh !important;" ng-controller="LoginCtrl as ctrl">
- <div flex="40" layout-align="center center">
-
- <md-card class="card-100-center box-shadow-login" style="padding:20px;position:relative;top:-25px;">
- <div layout="column" flex="60" layout-align="center center" style="margin-left:auto;margin-right:auto;">
- <div flex="60" layout-align="center center" layout="row"
- style="color:white;"><img
- alt="icon" src="assets/img/login/logo.png">
- </div>
- </div>
- <div flex layout-align="center center"><h1>Login</h1></div>
- <div flex-sm="100" layout="column">
- <form name="ctrl.loginForm" ng-submit="ctrl.logIn()" role="form">
- <div flex layout="column">
- <md-input-container class="sp"><label class="sp">Email</label> <input
- type="email" class="sp" ng-model="ctrl.credentials.username" required></md-input-container>
- <md-input-container class="sp" flex><label>Password</label>
- <input type="password" ng-model="ctrl.credentials.password" required>
- </md-input-container>
- <md-input-container flex>
- <md-checkbox
- ng-model="ctrl.credentials.rememberMe"> Remember me
- </md-checkbox>
- </md-input-container>
- </div>
- <div class="form-actions">
- <sp-button sp-button-blue type="submit"
- ng-disabled="ctrl.loginForm.$pristine || ctrl.loginForm.$invalid || ctrl.loading">Login
- </sp-button>
- <md-progress-circular style="margin-top:10px;" class="md-accent" md-mode="indeterminate"
- ng-show="ctrl.loading"></md-progress-circular>
- <div class="md-warn" ng-show="ctrl.authenticationFailed">
- <h4>The password you entered is incorrect. Please try again.</h4>
- </div>
- </div>
- </form>
- <!--<a ui-sref="register">Create new account</a>-->
- </div>
- </md-card>
- <div flex="100" layout="column" layout-align="center center">
- <sp-button sp-button-blue ng-click="ctrl.openDocumentation()" class="md-accent md-raised"
- style="min-width:0px;padding-left:20px;padding-right:20px;font-size:18px;">
- View Docs
- </sp-button>
- </div>
-
-
- <a id="shepherd-delay" style="display: none;" ng-click="ctrl.setSheperdServiceDelay()"> </a>
- </div>
-
-</div>
diff --git a/ui/src/assets/templates/setup.html b/ui/src/assets/templates/setup.html
deleted file mode 100644
index 7b979c3..0000000
--- a/ui/src/assets/templates/setup.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- ~
- -->
-
-<div class="md-padding full-background" layout-xs="column" layout="row" layout-align="center center"
- style="min-height:100vh !important;" ng-controller="SetupCtrl as ctrl">
- <div flex="60" layout-align="center center">
- <!--<div layout="column" flex="60" layout-align="center center" style="position:relative;top:-25px;margin-left:auto;margin-right:auto;">-->
- <!--<div flex="60" layout-align="center center" layout="row"-->
- <!--style="padding:20px;color:white;" class="sp-darkblue"><img-->
- <!--alt="icon" src="assets/img/login/logo.png">-->
- <!--</div>-->
- <!--</div>-->
- <md-card class="card-100-center box-shadow-login" style="padding:20px;overflow-y:auto;height:80vh;">
- <div layout="column" flex="60" layout-align="center center" style="margin-left:auto;margin-right:auto;margin-bottom:20px;">
- <div flex="60" layout-align="center center" layout="row"
- style="color:white;"><img
- style="margin-top:40px;width:400px;" alt="icon" src="assets/img/login/logo.png">
- </div>
- </div>
- <form name="ctrl.setupForm" role="form">
- <md-card-title>
- <div flex="100" layout="column">
-
- <h1>Welcome!</h1>
- <h4>The setup of the system might take a minute. Create a user and you are ready to
- go!</h4>
- </div>
- </md-card-title>
- <div ng-show="!ctrl.installationRunning">
-
-
- <h3>Initial User</h3>
- <div layout layout-sm="column">
- <md-input-container flex>
- <label>Email</label>
- <input name="email" type="email" ng-model="ctrl.setup.adminEmail" required>
- <span ng-show="ctrl.setupForm.email.$touched && ctrl.setupForm.email.$error.required">The email field can't be blank.</span>
- <span ng-show="ctrl.setupForm.email.$error.email">This is not a valid email.</span>
- </md-input-container>
- <md-input-container flex>
- <label>Password</label>
- <input name="password" type="password" ng-model="ctrl.setup.adminPassword" required>
- <span ng-show="ctrl.setupForm.password.$touched && ctrl.setupForm.password.$error.required">The password field can't be blank.</span>
- </md-input-container>
- </div>
- <md-checkbox ng-model="ctrl.setup.installPipelineElements" aria-label="Install pipeline elements">
- Also install available data streams, processors and sinks.
- </md-checkbox>
-
- </div>
- <md-divider/>
- <div>
- <div ng-show="ctrl.showAdvancedSettings && !ctrl.installationRunning">
- <div flex layout="column">
- <h3>Advanced Settings</h3>
- <div layout layout-sm="column">
- <md-input-container flex>
- <label>CouchDB Host</label>
- <input name="couchDbHost" ng-model="ctrl.setup.couchDbHost">
- </md-input-container>
- <md-input-container flex>
- <label>JMS Host</label>
- <input name="jmsHost" ng-model="ctrl.setup.jmsHost">
- </md-input-container>
- </div>
- <div layout layout-sm="column">
- <md-input-container flex>
- <label>Kafka Host</label>
- <input name="kafkaHost" ng-model="ctrl.setup.kafkaHost">
- </md-input-container>
- <md-input-container flex>
- <label>Zookeeper Host</label>
- <input name="zookeeperHost" ng-model="ctrl.setup.zookeeperHost">
- </md-input-container>
- </div>
- </div>
- </div>
- <div ng-show="ctrl.installationRunning">
- <h3>Installation Results</h3>
- <div ng-repeat="msg in ctrl.installationResults">
- <div flex layout layout-sm="row" style="width:80%" class="center center">
- <div flex="80" style="width:50%"><h4>{{msg.properties.notifications[0].title}}</h4></div>
- <div flex="20" style="width:50%">
- <md-icon md-svg-icon="action:ic_done_24px" aria-label="Action"
- class="md-accent" style="width: 36px; height: 36px"
- ng-show="msg.properties.success"></md-icon>
- <md-icon md-svg-icon="alert:ic_error_24px" aria-label="Action"
- class="md-accent" style="width: 36px; height: 36px"
- ng-show="!(msg.properties.success)"></md-icon>
- </div>
- </div>
- </div>
- <div flex layout layout-sm="row" style="width:80%" class="center center" ng-if="ctrl.nextTaskTitle != ''">
- <div flex="80" style="width:50%"><h4>{{ctrl.nextTaskTitle}}</h4></div>
- <div flex="20" style="width:50%">
- <md-progress-circular class="md-accent" md-mode="indeterminate"
- ng-show="ctrl.loading"></md-progress-circular>
- </div>
- </div>
- <div ng-show="ctrl.installationFinished">
- <h3><a ui-sref="login" class="md-accent">
- <md-icon md-svg-icon="navigation:ic_arrow_forward_24px" aria-label="Action"
- class="md-accent" style="width: 36px; height: 36px"></md-icon>
- Go to login page</a></h3>
- </div>
- </div>
-
- <md-card-actions layout="row" layout-align="center" ng-show="!ctrl.installationRunning">
- <div flex layout="column">
-
- <div layout layout-sm="column">
- <sp-button sp-button-blue type="submit"
- ng-disabled="!(ctrl.setupForm.$valid) || ctrl.loading || ctrl.installationFinished"
- ng-click="ctrl.configure(0)">Install
- </sp-button>
- <sp-button sp-button-gray ng-show="!ctrl.showAdvancedSettings"
- ng-click="ctrl.showAdvancedSettings = !ctrl.showAdvancedSettings"
- ng-disabled="ctrl.installationFinished">Show Advanced Settings
- </sp-button>
- <sp-button sp-button-gray ng-show="ctrl.showAdvancedSettings"
- ng-click="ctrl.showAdvancedSettings = !ctrl.showAdvancedSettings"
- ng-disabled="ctrl.installationFinished">Hide Advanced Settings
- </sp-button>
- </div>
-
- </div>
- </md-card-actions>
-
- </div>
- </form>
- </md-card>
- </div>
-</div>
-