Procházet zdrojové kódy

added login, welcome, signup pages

David Thornley před 6 roky
rodič
revize
f344266474

+ 5
- 0
zlg/package-lock.json Zobrazit soubor

@@ -168,6 +168,11 @@
168 168
       "resolved": "https://registry.npmjs.org/@types/socket.io-client/-/socket.io-client-1.4.32.tgz",
169 169
       "integrity": "sha512-Vs55Kq8F+OWvy1RLA31rT+cAyemzgm0EWNeax6BWF8H7QiiOYMJIdcwSDdm5LVgfEkoepsWkS+40+WNb7BUMbg=="
170 170
     },
171
+    "@types/sockjs-client": {
172
+      "version": "1.1.0",
173
+      "resolved": "https://registry.npmjs.org/@types/sockjs-client/-/sockjs-client-1.1.0.tgz",
174
+      "integrity": "sha512-F3gD7AakaPGzzdTmvN8HYxlNL+vTnMykYSUoukRTRGUntH4lwjxG5wx3ZwdYBTA3sTo4duxHY+rRZMbIEBxhRQ=="
175
+    },
171 176
     "abbrev": {
172 177
       "version": "1.1.1",
173 178
       "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",

+ 1
- 0
zlg/package.json Zobrazit soubor

@@ -24,6 +24,7 @@
24 24
     "@ionic-native/splash-screen": "~4.10.0",
25 25
     "@ionic-native/status-bar": "~4.10.0",
26 26
     "@ionic/storage": "2.1.3",
27
+    "@types/sockjs-client": "^1.1.0",
27 28
     "ionic-angular": "3.9.2",
28 29
     "ionicons": "3.0.0",
29 30
     "ng-socket-io": "^0.2.4",

+ 2
- 2
zlg/src/app/app.component.ts Zobrazit soubor

@@ -3,12 +3,12 @@ import { Platform } from 'ionic-angular';
3 3
 import { StatusBar } from '@ionic-native/status-bar';
4 4
 import { SplashScreen } from '@ionic-native/splash-screen';
5 5
 
6
-import { HomePage } from '../pages/home/home';
6
+import { Welcome } from '../pages/welcome/welcome';
7 7
 @Component({
8 8
   templateUrl: 'app.html'
9 9
 })
10 10
 export class MyApp {
11
-  rootPage:any = HomePage;
11
+  rootPage:any = Welcome;
12 12
 
13 13
   constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
14 14
     platform.ready().then(() => {

+ 11
- 2
zlg/src/app/app.module.ts Zobrazit soubor

@@ -10,13 +10,19 @@ const config: SocketIoConfig = { url: 'http://localhost:8080/vault-socket', opti
10 10
 
11 11
 
12 12
 import { MyApp } from './app.component';
13
+import { Welcome } from '../pages/welcome/welcome'
14
+import { Login } from '../pages/login/login'
15
+import { Signup } from '../pages/signup/signup'
13 16
 import { HomePage } from '../pages/home/home';
14 17
 import { WebsocketProvider } from '../providers/websocket/websocket';
15 18
 
16 19
 @NgModule({
17 20
   declarations: [
18 21
     MyApp,
19
-    HomePage
22
+    HomePage,
23
+    Welcome,
24
+    Login,
25
+    Signup
20 26
   ],
21 27
   imports: [
22 28
     BrowserModule,
@@ -26,7 +32,10 @@ import { WebsocketProvider } from '../providers/websocket/websocket';
26 32
   bootstrap: [IonicApp],
27 33
   entryComponents: [
28 34
     MyApp,
29
-    HomePage
35
+    HomePage,
36
+    Welcome,
37
+    Login,
38
+    Signup
30 39
   ],
31 40
   providers: [
32 41
     StatusBar,

binární
zlg/src/assets/img/welcome.png Zobrazit soubor


+ 17
- 0
zlg/src/pages/login/login.html Zobrazit soubor

@@ -0,0 +1,17 @@
1
+<ion-content padding>
2
+  <ion-list>
3
+  
4
+    <ion-item>
5
+      <ion-label fixed>Username</ion-label>
6
+      <ion-input type="text" value=""></ion-input>
7
+    </ion-item>
8
+  
9
+    <ion-item>
10
+      <ion-label fixed>Password</ion-label>
11
+      <ion-input type="password"></ion-input>
12
+    </ion-item>
13
+  
14
+    <button ion-button block color="primary" (click)="login()">Login</button>
15
+  
16
+  </ion-list>
17
+  </ion-content>

+ 17
- 0
zlg/src/pages/login/login.module.ts Zobrazit soubor

@@ -0,0 +1,17 @@
1
+
2
+import { NgModule } from '@angular/core';
3
+import { IonicPageModule } from 'ionic-angular';
4
+import { Login } from './login';
5
+
6
+@NgModule({
7
+  declarations: [
8
+    Login,
9
+  ],
10
+  imports: [
11
+    IonicPageModule.forChild(Login),
12
+  ],
13
+  exports: [
14
+    Login
15
+  ]
16
+})
17
+export class LoginModule {}

+ 3
- 0
zlg/src/pages/login/login.scss Zobrazit soubor

@@ -0,0 +1,3 @@
1
+page-login {
2
+
3
+}

+ 29
- 0
zlg/src/pages/login/login.ts Zobrazit soubor

@@ -0,0 +1,29 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+import { HomePage } from '../home/home';
4
+/**
5
+ * Generated class for the Login page.
6
+ *
7
+ * See http://ionicframework.com/docs/components/#navigation for more info
8
+ * on Ionic pages and navigation.
9
+ */
10
+@IonicPage()
11
+@Component({
12
+  selector: 'page-login',
13
+  templateUrl: 'login.html',
14
+})
15
+export class Login {
16
+
17
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
18
+  }
19
+
20
+  ionViewDidLoad() {
21
+    console.log('ionViewDidLoad Login');
22
+  }
23
+
24
+  login(){
25
+    //Api connections
26
+    this.navCtrl.push(HomePage);
27
+    }
28
+
29
+}

+ 22
- 0
zlg/src/pages/signup/signup.html Zobrazit soubor

@@ -0,0 +1,22 @@
1
+<ion-content padding>
2
+  <ion-list>
3
+   <br />
4
+    <ion-item>
5
+      <ion-label fixed>Username</ion-label>
6
+      <ion-input type="text" value=""></ion-input>
7
+    </ion-item>
8
+  
9
+    <ion-item>
10
+      <ion-label fixed>Password</ion-label>
11
+      <ion-input type="password"></ion-input>
12
+    </ion-item>
13
+
14
+    <ion-item>
15
+        <ion-label fixed>Email</ion-label>
16
+        <ion-input type="text" value=""></ion-input>
17
+      </ion-item>
18
+  
19
+    <button ion-button block color="primary" (click)="signup()">Signup</button>
20
+  
21
+  </ion-list>
22
+  </ion-content>

+ 16
- 0
zlg/src/pages/signup/signup.module.ts Zobrazit soubor

@@ -0,0 +1,16 @@
1
+import { NgModule } from '@angular/core';
2
+import { IonicPageModule } from 'ionic-angular';
3
+import { Signup } from './signup';
4
+
5
+@NgModule({
6
+  declarations: [
7
+    Signup,
8
+  ],
9
+  imports: [
10
+    IonicPageModule.forChild(Signup),
11
+  ],
12
+  exports: [
13
+    Signup
14
+  ]
15
+})
16
+export class SignupModule {}

+ 3
- 0
zlg/src/pages/signup/signup.scss Zobrazit soubor

@@ -0,0 +1,3 @@
1
+page-signup {
2
+
3
+}

+ 30
- 0
zlg/src/pages/signup/signup.ts Zobrazit soubor

@@ -0,0 +1,30 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+import { HomePage } from '../home/home';
4
+
5
+/**
6
+ * Generated class for the Signup page.
7
+ *
8
+ * See http://ionicframework.com/docs/components/#navigation for more info
9
+ * on Ionic pages and navigation.
10
+ */
11
+@IonicPage()
12
+@Component({
13
+  selector: 'page-signup',
14
+  templateUrl: 'signup.html',
15
+})
16
+export class Signup {
17
+
18
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+  }
20
+
21
+  ionViewDidLoad() {
22
+    console.log('ionViewDidLoad Signup');
23
+  }
24
+
25
+  signup(){
26
+  //Api connections
27
+  this.navCtrl.push(HomePage);
28
+  }
29
+
30
+}

+ 9
- 0
zlg/src/pages/welcome/welcome.html Zobrazit soubor

@@ -0,0 +1,9 @@
1
+
2
+
3
+<ion-content padding="true" style="background: url(../assets/img/welcome.png) no-repeat center;background-size:cover;vertical-align: middle;" id="welcome">
4
+
5
+  <h1> Welcome to the Vault </h1>
6
+  
7
+  <button ion-button block class="marginTop" (click)="signup()">Signup</button>
8
+  <button ion-button block color="lightprimary" (click)="login()">Login</button>
9
+  </ion-content>

+ 16
- 0
zlg/src/pages/welcome/welcome.module.ts Zobrazit soubor

@@ -0,0 +1,16 @@
1
+import { NgModule } from '@angular/core';
2
+import { IonicPageModule } from 'ionic-angular';
3
+import { Welcome } from './welcome';
4
+
5
+@NgModule({
6
+  declarations: [
7
+    Welcome,
8
+  ],
9
+  imports: [
10
+    IonicPageModule.forChild(Welcome),
11
+  ],
12
+  exports: [
13
+    Welcome
14
+  ]
15
+})
16
+export class WelcomeModule {}

+ 4
- 0
zlg/src/pages/welcome/welcome.scss Zobrazit soubor

@@ -0,0 +1,4 @@
1
+page-welcome {
2
+   text-align: center;
3
+   color: red;
4
+}

+ 34
- 0
zlg/src/pages/welcome/welcome.ts Zobrazit soubor

@@ -0,0 +1,34 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+
4
+import { Login } from '../login/login';
5
+import { Signup } from '../signup/signup';
6
+/**
7
+ * Generated class for the Welcome page.
8
+ *
9
+ * See http://ionicframework.com/docs/components/#navigation for more info
10
+ * on Ionic pages and navigation.
11
+ */
12
+@IonicPage()
13
+@Component({
14
+  selector: 'page-welcome',
15
+  templateUrl: 'welcome.html',
16
+})
17
+export class Welcome {
18
+
19
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
20
+  }
21
+
22
+  ionViewDidLoad() {
23
+    console.log('ionViewDidLoad Welcome');
24
+  }
25
+
26
+  login(){
27
+   this.navCtrl.push(Login);
28
+  }
29
+
30
+  signup(){
31
+   this.navCtrl.push(Signup, {}, {animate:false});
32
+  }
33
+
34
+}