gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-webui] 03/04: All changes - fixes, features, rename


From: gnunet
Subject: [GNUnet-SVN] [gnunet-webui] 03/04: All changes - fixes, features, renames
Date: Tue, 14 Aug 2018 01:03:11 +0200

This is an automated email from the git hooks/post-receive script.

phil pushed a commit to branch master
in repository gnunet-webui.

commit 835a110f4e1b800788e643d2040c9760a60549a6
Author: Phil <address@hidden>
AuthorDate: Mon Aug 13 03:04:04 2018 +0200

    All changes - fixes, features, renames
---
 angular.json                                       |   3 +-
 src/app/api.service.ts                             | 148 +++++++++++++++------
 src/app/app-routing.module.ts                      |   4 +-
 src/app/app.component.html                         |  17 +--
 src/app/app.component.ts                           |   2 +-
 src/app/app.module.ts                              |   4 +-
 .../create-identity/create-identity.component.html |   4 +-
 .../create-identity/create-identity.component.ts   |  16 ++-
 src/app/gns-record.ts                              |   4 +-
 src/app/identity-page/identity-page.component.html |  39 +++---
 src/app/identity-page/identity-page.component.ts   |  39 ++++--
 src/app/messages.service.ts                        |  11 +-
 .../namestore-page/namestore-page.component.html   |   2 +-
 src/app/{gns-record.ts => peerinfo-address.ts}     |  12 +-
 src/app/peerinfo-page/peerinfo-page.component.html |  12 ++
 .../peerinfo-page.component.spec.ts}               |   0
 .../peerinfo-page.component.ts}                    |  26 +++-
 ...tore-page.component.ts => peerinfo-response.ts} |  24 +---
 .../peerstore-page/peerstore-page.component.html   |   3 -
 src/app/rest-apis/rest-apis.component.ts           |   2 +-
 src/favicon.png                                    | Bin 0 -> 1467 bytes
 src/gnunet-anonymous-logo.png                      | Bin 0 -> 30620 bytes
 src/index.html                                     |   3 +-
 src/scss/base/_body.scss                           |   6 +
 src/scss/components/_button.scss                   |   4 +-
 src/scss/components/_circle.scss                   |   1 +
 src/scss/components/_footer.scss                   |   5 +-
 src/scss/components/_header.scss                   |   5 +-
 src/scss/components/_input.scss                    |   2 +-
 src/scss/components/_link.scss                     |   2 +-
 src/scss/components/_spinner.scss                  |   1 +
 src/scss/main.scss                                 |   2 +-
 src/scss/settings/_baseline.scss                   |   1 +
 src/scss/settings/_colors.scss                     |   6 +-
 src/scss/settings/_core.scss                       |   6 +-
 src/scss/settings/_spacing.scss                    |   1 +
 src/scss/utilities/_margin.scss                    |   2 +-
 37 files changed, 268 insertions(+), 151 deletions(-)

diff --git a/angular.json b/angular.json
index 29b717b..72e5e02 100644
--- a/angular.json
+++ b/angular.json
@@ -23,7 +23,8 @@
             "polyfills": "src/polyfills.ts",
             "tsConfig": "src/tsconfig.app.json",
             "assets": [
-              "src/favicon.ico",
+              "src/favicon.png",
+              "src/gnunet-anonymous-logo.png",
               "src/assets"
             ],
             "styles": [
diff --git a/src/app/api.service.ts b/src/app/api.service.ts
index 21a0269..f2b90bb 100644
--- a/src/app/api.service.ts
+++ b/src/app/api.service.ts
@@ -27,6 +27,7 @@ import { Injectable } from '@angular/core';
 import { Observable, of } from 'rxjs';
 import { RestAPI } from './rest-api';
 import { GNSRecord } from './gns-record';
+import { PeerinfoResponse } from './peerinfo-response';
 import { IdentityAPI } from './identity-api';
 import { catchError, map, tap } from 'rxjs/operators';
 import { MessagesService } from './messages.service';
@@ -40,83 +41,144 @@ export class ApiService {
   private identityURL = this.restURL+'identity';
   private gnsURL = this.restURL+'gns';
   private namestoreURL = this.restURL+'namestore';
+  private peerinfoURL = this.restURL+'peerinfo';
 
   constructor(private http: HttpClient,
               private messages:MessagesService) { }
 
-  getIdentities (): Observable<IdentityAPI[]>{
-    return this.http.get<IdentityAPI[]>(this.identityURL)
+  getIdentityAll (): Observable<IdentityAPI[]>{
+    return this.http.get<IdentityAPI[]>(this.identityURL+'/all')
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('getIdentities', []))
+      catchError(this.handleError('IdentityGETall', []))
     );
   }
 
-  createIdentity (json: any): Observable<any>{
-    this.messages.dismissError();
-    const options = {headers: {'Content-Type': 'application/json'}};
-    return this.http.post(this.identityURL, json, options)
+  getIdentityName (name: string): Observable<IdentityAPI>{
+    return this.http.get<IdentityAPI>(this.identityURL+'/name/'+name)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('createIdentity', []))
+      catchError(this.handleError<any>('IdentityGETname', {}))
     );
   }
 
-  deleteIdentity (id: string): Observable<any>{
-    this.messages.dismissError();
-    return this.http.delete(this.identityURL+'?pubkey='+id)
+  getIdentitySubsystem (subsystem_name: string): Observable<IdentityAPI>{
+    return 
this.http.get<IdentityAPI>(this.identityURL+'/subsystem/'+subsystem_name)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('deleteIdentity', []))
+      catchError(this.handleError<any>('IdentityGETsubsystem', {}))
     );
   }
 
+  postIdentity (name: string): Observable<any>{
+    const options = {headers: {'Content-Type': 'application/json'}};
+    return this.http.post(this.identityURL, {'name':name}, options)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('IdentityPOST', []))
+    );
+  }
 
-  changeIdentity (json: any): Observable<any>{
-    this.messages.dismissError();
+  putIdentityName (name:string, newname:string): Observable<any>{
     const options = {headers: {'Content-Type': 'application/json'}};
-    return this.http.put(this.identityURL, json, options)
+    return this.http.put(this.identityURL+'/name/'+name, {'newname':newname}, 
options)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('changeIdentity', []))
+      catchError(this.handleError('IdentityPUTname', []))
     );
   }
 
-  assignIdentity (json: any): Observable<any>{
-    this.messages.dismissError();
+  putIdentitySubsystem (name:string, subsystem_name:string): Observable<any>{
     const options = {headers: {'Content-Type': 'application/json'}};
-    return this.http.put(this.identityURL, json, options)
+    return this.http.put(this.identityURL+'/subsystem/'+name, 
{'subsystem':subsystem_name}, options)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('changeIdentity', []))
+      catchError(this.handleError('IdentityPUTsubsystem', []))
     );
   }
 
-  searchNameSystem (url: string): Observable<any>{
-    this.messages.dismissError();
-    return this.http.get(this.gnsURL+'/'+url)
+  deleteIdentityName (name: string): Observable <any> {
+    return this.http.delete(this.identityURL+'/name/'+name)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('searchNameSystem', []))
+      catchError(this.handleError('IdentityDELETEname', []))
     );
   }
 
-  getGNSRecords (): Observable<GNSRecord[]>{
-    this.messages.dismissError();
+  getNamestore (): Observable<GNSRecord[]>{
     return this.http.get<GNSRecord[]>(this.namestoreURL)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('getGNSRecords', []))
+      catchError(this.handleError('NamestoreGET', []))
+    );
+  }
+
+  getNamestoreName (name: string): Observable<GNSRecord[]>{
+    return this.http.get<GNSRecord[]>(this.namestoreURL+'/'+name)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('NamestoreGETname', []))
     );
   }
 
-  addGNSRecord (gns_record: GNSRecord): Observable<any>{
-    this.messages.dismissError();
+  postNamestore (gns_record: GNSRecord): Observable<any>{
     const options = {headers: {'Content-Type': 'application/json'}};
-    return this.http.post(this.namestoreURL, gns_record, options)
+    return this.http.post<any>(this.namestoreURL, gns_record, options)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('NamestorePOST', []))
+    );
+  }
+
+  postNamestoreName (gns_record: GNSRecord, name: string): Observable<any>{
+    const options = {headers: {'Content-Type': 'application/json'}};
+    return this.http.post<any>(this.namestoreURL+'/'+name, gns_record, options)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('NamestorePOSTname', []))
+    );
+  }
+
+  deleteNamestore (record_name: string): Observable <any> {
+    return this.http.delete(this.namestoreURL+'?record_name='+record_name)
     .pipe(
       tap(json => this.handleJSON(json)),
-      catchError(this.handleError('addGNSRecord', []))
+      catchError(this.handleError('NamestoreDELETE', []))
+    );
+  }
+
+  deleteNamestoreName (name: string, record_name: string): Observable <any> {
+    return 
this.http.delete(this.namestoreURL+'/'+name+'?record_name='+record_name)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('NamestoreDELETEname', []))
+    );
+  }
+
+  getGNSlookup (lookup: string, record_type: string): Observable<GNSRecord[]>{
+    if(record_type)
+    {
+      return 
this.http.get<GNSRecord[]>(this.gnsURL+'/'+lookup+'?record_type='+record_type)
+      .pipe(
+        tap(json => this.handleJSON(json)),
+        catchError(this.handleError('GnsGET', []))
+      );
+    }
+    else
+    {
+      return this.http.get<GNSRecord[]>(this.gnsURL+'/'+lookup)
+      .pipe(
+        tap(json => this.handleJSON(json)),
+        catchError(this.handleError('NamestoreGETname', []))
+      );
+    }
+  }
+
+  getPeerinfo (): Observable<PeerinfoResponse[]>{
+    return this.http.get<PeerinfoResponse[]>(this.peerinfoURL)
+    .pipe(
+      tap(json => this.handleJSON(json)),
+      catchError(this.handleError('PeerinfoGET', []))
     );
   }
 
@@ -130,24 +192,26 @@ export class ApiService {
   */
   private handleError<T> (operation = 'operation', result?: T) {
     return (error: any): Observable<T> => {
-
-      //console.error(error); // log to console instead
-
-      if((operation == 'createIdentity') && (error.status == '409'))
+      result.error = true;
+      if((operation == 'IdentityPOST') && (error.status == '409'))
+      {
+        this.messages.pushError('Identity already exists');
+      }
+      if((operation == 'IdentityDELETEname') && (error.status == '404'))
       {
-        this.messages.pushError('Cannot create identity. Identity already 
exists.');
+        this.messages.pushError('Identity not found');
       }
-      if((operation == 'changeIdentity') && (error.status == '404'))
+      if((operation == 'IdentityPUTname') && (error.status == '409'))
       {
-        this.messages.pushError('Cannot rename identity. Identity not found.');
+        this.messages.pushError('Identity already exists');
       }
-      if((operation == 'changeIdentity') && (error.status == '409'))
+      if((operation == 'IdentityPUTsubsystem'))
       {
-        this.messages.pushError('Cannot rename identity. Identity with this 
name already exists.');
+        this.messages.pushError('Adding subsystem failed');
       }
-      if((operation == 'deleteIdentity') && (error.status == '404'))
+      if((operation == 'IdentityDELETEname') && (error.status == '404'))
       {
-        this.messages.pushError('Cannot delete identity. Identity not found.');
+        this.messages.pushError('Identity not found');
       }
 
       if((error.statusText == 'Unknown Error'))
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index e8e156d..6c0a987 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -30,7 +30,7 @@ import { filter } from 'rxjs/operators';
 import { RestApisComponent } from './rest-apis/rest-apis.component';
 import { MainPageComponent } from './main-page/main-page.component';
 import { IdentityPageComponent } from 
'./identity-page/identity-page.component';
-import { PeerstorePageComponent } from 
'./peerstore-page/peerstore-page.component';
+import { PeerinfoPageComponent } from 
'./peerinfo-page/peerinfo-page.component';
 import { NamestorePageComponent } from 
'./namestore-page/namestore-page.component';
 import { ErrorPageComponent } from './error-page/error-page.component';
 
@@ -40,7 +40,7 @@ const routes: Routes = [
   { path: '', component: MainPageComponent },
   { path: 'apis', component: RestApisComponent },
   { path: 'identity', component: IdentityPageComponent },
-  { path: 'peerstore', component: PeerstorePageComponent },
+  { path: 'peerinfo', component: PeerinfoPageComponent },
   { path: 'namestore', component: NamestorePageComponent },
   { path: '**', component: ErrorPageComponent }
 ];
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 81e9ed7..20d71f6 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -3,13 +3,13 @@
   <div class="o-container o-container--size-small">
     <div class="o-media o-media--middle">
       <div class="o-media__fixed">
-        <img class="u-align-middle" 
src="https://gnunet.org/sites/default/files/transparent_0_0.png"; width="40px">
+        <img class="u-align-middle" src="gnunet-anonymous-logo.png" 
width="45px">
         &nbsp;<span class="o-type-22 u-align-middle">GNUnet Web UI</span>
       </div>
       <div class="o-media__fluid u-text-right">
         <nav>
-          <ul class="o-list o-list--inline o-list--gutter-x4">
-            <li class="o-list__item" *ngFor="let item of this.menu">
+          <ul class="o-list o-list--inline">
+            <li class="o-list__item u-mh-x2" *ngFor="let item of this.menu">
               <div [ngClass]="{'c-link--underline': item.id === active}">
                 <a routerLink="{{item.link}}" class="c-link">{{item.name}}</a>
               </div>
@@ -32,17 +32,10 @@
     <div class="o-container o-container--size-small">
       <div class="o-media o-media--middle">
         <div class="o-media__fixed">
-          <ul class="o-list o-list--inline o-list--gutter-x4">
-            <li class="o-list__item">
-              <a routerLink="/" class="c-link">Impressum</a>
-            </li>
-            <li class="o-list__item">
-              <a href="https://gnunet.org/git/gnunet-rest-api.git/"; 
class="c-link">Documentation</a>
-            </li>
-          </ul>
+          <a href="https://gnunet.org/git/gnunet-rest-api.git/"; 
class="c-link">Documentation</a>
         </div>
         <div class="o-media__fluid u-text-right">
-          Placeholder
+          <p><i class="fa fa-copyright" aria-hidden="true"></i> 2018 GNUnet 
e.V - GNU AGPL v3.0</p>
         </div>
       </div>
     </div>
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 5ee4946..ed2521e 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -42,7 +42,7 @@ export class AppComponent {
     {id:0, name: 'Main', link: ''},
     {id:1, name: 'Identities', link: 'identity'},
     {id:2, name: 'Names', link: 'namestore'},
-    {id:3, name: 'Peers', link: 'peerstore'},
+    {id:3, name: 'Peers', link: 'peerinfo'},
   ];
 
   constructor(private router: Router) {
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index e88a0d6..a841841 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -36,7 +36,7 @@ import { CreateIdentityComponent } from 
'./create-identity/create-identity.compo
 import { MyFilterPipe } from './filter.pipe';
 import { ErrorMessageComponent } from 
'./error-message/error-message.component';
 import { NamestorePageComponent } from 
'./namestore-page/namestore-page.component';
-import { PeerstorePageComponent } from 
'./peerstore-page/peerstore-page.component';
+import { PeerinfoPageComponent } from 
'./peerinfo-page/peerinfo-page.component';
 import { ErrorPageComponent } from './error-page/error-page.component';
 
 @NgModule({
@@ -49,7 +49,7 @@ import { ErrorPageComponent } from 
'./error-page/error-page.component';
     MyFilterPipe,
     ErrorMessageComponent,
     NamestorePageComponent,
-    PeerstorePageComponent,
+    PeerinfoPageComponent,
     ErrorPageComponent
   ],
   imports: [
diff --git a/src/app/create-identity/create-identity.component.html 
b/src/app/create-identity/create-identity.component.html
index e1bfa3d..faa6f01 100644
--- a/src/app/create-identity/create-identity.component.html
+++ b/src/app/create-identity/create-identity.component.html
@@ -1,8 +1,8 @@
 <div class="c-card c-card--no-padding u-p-x3">
-  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Create new identity</h1>
+  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Create New Identity</h1>
   <div class="o-list o-list--inline">
     <p class="u-color-grey">Identity Name:</p>
-    <input [(ngModel)]="this.input_text" type="text" class="o-list__item 
c-input" placeholder="e.g. Testname, ..."/>
+    <input [(ngModel)]="this.input_text" type="text" class="o-list__item 
c-input u-mb-x1 address@hidden" placeholder="e.g. Testname, ..."/>
     <a class="o-list__item c-button" (click)="onClick()"><i class="fa 
fa-plus"></i></a>
     <div *ngIf="!is_free" class="o-list__item c-spinner"></div>
   </div>
diff --git a/src/app/create-identity/create-identity.component.ts 
b/src/app/create-identity/create-identity.component.ts
index 61224a0..37b1c12 100644
--- a/src/app/create-identity/create-identity.component.ts
+++ b/src/app/create-identity/create-identity.component.ts
@@ -35,7 +35,6 @@ import { MessagesService } from '../messages.service';
 export class CreateIdentityComponent implements OnInit {
 
   input_text: string = '';
-  private json: any = {'name':''};
   is_free:boolean = true;
 
   constructor(private apiService: ApiService,
@@ -47,16 +46,21 @@ export class CreateIdentityComponent implements OnInit {
 
   onClick() {
     if (this.input_text != "" && this.is_free){
+      this.message.dismissAll();
       this.is_free = false;
-      this.json.name = this.input_text;
-      this.input_text = '';
-      this.apiService.createIdentity(this.json).subscribe(test => {
-        this.message.pushSuccess('Created new identity');
+      this.apiService.postIdentity(this.input_text).subscribe(test => {
+        if (test)
+        {
+          if(!test.error)
+            this.message.pushSuccess('Create successful');
+        }
+        if (!test)
+          this.message.pushSuccess('Create successful');
         this.identity.getAPIs();
         this.is_free = true;
       });
     } else {
-      this.message.pushError('Missing input. Define name of new object');
+      this.message.pushError('Missing input. Define name of new identity');
     }
   }
 
diff --git a/src/app/gns-record.ts b/src/app/gns-record.ts
index 3c29ce4..58701e7 100644
--- a/src/app/gns-record.ts
+++ b/src/app/gns-record.ts
@@ -23,8 +23,8 @@
  */
 export class GNSRecord {
   value: string;
-  type: string;
+  record_type: string;
   expiration_time: string;
   flag: number;
-  label: string;
+  record_name: string;
 }
diff --git a/src/app/identity-page/identity-page.component.html 
b/src/app/identity-page/identity-page.component.html
index b137591..5e8c6f0 100644
--- a/src/app/identity-page/identity-page.component.html
+++ b/src/app/identity-page/identity-page.component.html
@@ -1,12 +1,12 @@
 <div *ngIf="is_displayed">
   <div class="o-grid">
-    <create-identity-component class="o-grid__col 
u-1/2"></create-identity-component>
-    <div class="o-grid__col u-1/2">
+    <create-identity-component class="o-grid__col u-2/address@hidden 
u-1/address@hidden u-mb-x1"></create-identity-component>
+    <div class="o-grid__col u-2/address@hidden u-1/address@hidden u-mb-x1">
       <div class="c-card c-card--no-padding u-p-x3">
         <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Search</h1>
         <div class="">
           <p class="u-color-grey">Search Input:</p>
-          <input #myInput class="c-input u-2/2" placeholder="e.g. Name, ID, 
..." [(ngModel)]="name" (input)="filterItem(myInput.value)"/>
+          <input #myInput class="c-input u-2/2" placeholder="for name or 
public key" [(ngModel)]="name" (input)="filterItem(myInput.value)"/>
         </div>
       </div>
     </div>
@@ -18,24 +18,27 @@
   <div class="u-mv-x1" *ngFor="let identity of filteredItems">
     <div class="c-card c-card--no-padding u-p-x1">
       <div class="o-grid">
-        <div class="o-grid__col u-1/12"><div class="c-circle" 
[ngStyle]="{'background-color': 
returnHSL(identity.pubkey+identity.name)}">{{identity.name | slice:0:1 | 
uppercase}}</div></div>
-        <div class="o-grid__col u-8/12">
-          <p class="u-color-grey">Public Key: <span 
class="">{{identity.pubkey}}</span></p>
-          <span class="o-type-20">{{identity.name}}</span>
+        <div class="o-grid__col u-1/address@hidden u-1/1"><div 
class="c-circle" [ngStyle]="{'background-color': 
returnHSL(identity.pubkey+identity.name)}">{{identity.name | slice:0:1 | 
uppercase}}</div></div>
+        <div class="o-grid__col u-8/address@hidden u-1/1">
+          <p class="u-color-grey address@hidden u-text-center">Public Key: 
<span class="">{{identity.pubkey}}</span></p>
+          <p class="o-type-20 address@hidden 
u-text-center">{{identity.name}}</p>
+        </div>
+        <div class="o-grid__col o-list o-list--inline u-3/address@hidden u-1/1 
u-text-center">
+          <div class="o-list__item u-mh-x1"><p 
class="u-color-grey">Rename</p><a class="c-button c-button--rename" 
(click)="onClickRename(identity)"><i class="fa fa-pencil"></i></a></div>
+          <div class="o-list__item u-mh-x1"><p 
class="u-color-grey">Subsystem</p><a class="c-button c-button--rename" 
(click)="onClickAddSubsystem(identity)"><i class="fa fa-plus"></i></a></div>
+          <div class="o-list__item u-mh-x1"><p 
class="u-color-grey">Delete</p><a class="c-button c-button--danger" 
(click)="onClickDelete(identity)"><i class="fa fa-trash"></i></a></div>
         </div>
-        <div class="o-grid__col u-1/12"><p class="u-color-grey">Rename</p><a 
class="c-button c-button--rename" (click)="onClickRename(identity)"><i 
class="fa fa-pencil"></i></a></div>
-        <div class="o-grid__col u-1/12"><p 
class="u-color-grey">Subsystem</p><a class="c-button c-button--rename" 
(click)="onClickAddSubsystem(identity)"><i class="fa fa-plus"></i></a></div>
-        <div class="o-grid__col u-1/12"><p class="u-color-grey">Delete</p><a 
class="c-button c-button--danger" (click)="onClickDelete(identity)"><i 
class="fa fa-trash"></i></a></div>
       </div>
     </div>
   </div>
   </div>
 
 <div class="c-card u-p-x3 u-mt-x2" *ngIf="this.rename">
-  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Rename</h1>
-  <div class="u-color-grey u-pb-x1">Public Key: 
<span>{{changeIdentity.pubkey}}</span></div>
+  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Rename Identity</h1>
+  <div class="u-color-grey u-pb-x1"><p>Public Key: 
<span>{{changeIdentity.pubkey}}</span></p></div>
+  <div class="u-color-grey u-pb-x1">Current Name: 
<span>{{changeIdentity.name}}</span></div>
   <div>
-    <span class="u-mr-x2"><span class="u-mr-x3">Name: </span><input 
class="c-input" placeholder="Change Name" 
[(ngModel)]="changeIdentity.name"/></span>
+    <span class="u-mr-x2"><span class="u-mr-x3">Name: </span><input 
class="c-input" placeholder="Change Name" [(ngModel)]="newname"/></span>
     <a class="c-button" (click)="onRename(changeIdentity)">Save</a>
     <a class="c-button c-button--outline u-m-x2" (click)="onReset()">Cancel</a>
   </div>
@@ -43,22 +46,22 @@
 
 <div class="c-card u-p-x3 u-mt-x2" *ngIf="this.addsubsystem">
   <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Add Subsystem</h1>
-  <div class="u-color-grey">Public Key: 
<span>{{changeIdentity.pubkey}}</span></div>
+  <div class="u-color-grey"><p>Public Key: 
<span>{{changeIdentity.pubkey}}</span></p></div>
   <div class="u-color-grey">Name: <span>{{changeIdentity.name}}</span></div>
   <span class="u-mr-x2">
     <span class="u-mr-x3">Subsystem: </span>
     <input class="c-input" placeholder="e.g. namestore, ..." 
[(ngModel)]="newsubsystem"/>
   </span>
-  <a class="c-button" (click)="onAddSubsystem(changeIdentity.pubkey)">Add</a>
+  <a class="c-button" (click)="onAddSubsystem(changeIdentity.name)">Add</a>
   <a class="c-button c-button--outline u-m-x2" (click)="onReset()">Cancel</a>
 </div>
 
 <div class="c-card u-p-x3 u-mt-x2" *ngIf="this.delete">
-  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Delete</h1>
-  <div >Public Key: <span>{{changeIdentity.pubkey}}</span></div>
+  <h1 class="o-type-22 u-pb-x1 u-color-primary-light" >Delete Identity</h1>
+  <div ><p>Public Key: <span>{{changeIdentity.pubkey}}</span></p></div>
   <div >Name: <span>{{changeIdentity.name}}</span></div>
   <div>
-    <a class="c-button" (click)="onDelete(changeIdentity.pubkey)">Delete</a>
+    <a class="c-button" (click)="onDelete(changeIdentity.name)">Delete</a>
     <a class="c-button c-button--outline u-m-x2" (click)="onReset()">Cancel</a>
   </div>
 </div>
diff --git a/src/app/identity-page/identity-page.component.ts 
b/src/app/identity-page/identity-page.component.ts
index b6c2dcc..90fa943 100644
--- a/src/app/identity-page/identity-page.component.ts
+++ b/src/app/identity-page/identity-page.component.ts
@@ -40,6 +40,7 @@ export class IdentityPageComponent implements OnInit {
   delete: boolean = false;
   addsubsystem: boolean = false;
   changeIdentity: IdentityAPI;
+  newname:string;
   json: any;
   is_displayed: boolean = true;
   request: boolean = false;
@@ -49,7 +50,7 @@ export class IdentityPageComponent implements OnInit {
 
   getAPIs(): void {
     this.request = true;
-    this.apiService.getIdentities().subscribe(data => {
+    this.apiService.getIdentityAll().subscribe(data => {
       this.identities = data;
       this.request = false;
       this.assignCopy();
@@ -75,6 +76,7 @@ export class IdentityPageComponent implements OnInit {
   }
 
   onClickRename(identity: IdentityAPI){
+    this.message.dismissAll();
     this.is_displayed = false;
     this.rename = true;
     this.changeIdentity = Object.assign({},identity);
@@ -85,9 +87,13 @@ export class IdentityPageComponent implements OnInit {
     this.request = true;
     this.onReset();
     this.filteredItems = [];
-    this.json = {'newname':identity.name,'pubkey':identity.pubkey};
-    this.apiService.changeIdentity(this.json).subscribe(data => {
-      this.message.pushSuccess('Rename was successful.');
+    this.apiService.putIdentityName(identity.name,this.newname).subscribe(data 
=> {
+      this.newname = "";
+      if (data)
+        if(!data.error)
+          this.message.pushSuccess('Rename successful');
+      if (!data)
+        this.message.pushSuccess('Rename successful');
       this.getAPIs();
     });
   }
@@ -100,36 +106,47 @@ export class IdentityPageComponent implements OnInit {
   }
 
   onClickDelete(identity: IdentityAPI){
+    this.message.dismissAll();
     this.is_displayed = false;
     this.delete = true;
     this.changeIdentity = Object.assign({},identity);
   }
 
-  onDelete(id:string){
+  onDelete(name:string){
     this.request = true;
     this.onReset();
     this.filteredItems = [];
-    this.apiService.deleteIdentity(id).subscribe(data => {
-      this.message.pushSuccess('Delete was successful.');
+    this.apiService.deleteIdentityName(name).subscribe(data => {
+      if (data)
+      {
+        if(!data.error)
+          this.message.pushSuccess('Delete successful');
+      }
+      if (!data)
+        this.message.pushSuccess('Delete successful');
       this.getAPIs();
     });
   }
 
 
   onClickAddSubsystem(identity: IdentityAPI){
+    this.message.dismissAll();
     this.is_displayed = false;
     this.addsubsystem = true;
     this.changeIdentity = Object.assign({},identity);
   }
 
-  onAddSubsystem(pubkey:string){
+  onAddSubsystem(name:string){
     this.request = true;
     this.onReset();
     this.filteredItems = [];
-    this.json = {'subsystem':this.newsubsystem,'pubkey':pubkey};
-    this.apiService.assignIdentity(this.json).subscribe(data => {
+    
this.apiService.putIdentitySubsystem(name,this.newsubsystem).subscribe(data => {
       this.newsubsystem = "";
-      this.message.pushSuccess('Subsystem was successfully added.');
+      if (data)
+        if(!data.error)
+          this.message.pushSuccess('Add subsystem successful');
+      if (!data)
+        this.message.pushSuccess('Add subsystem successful');
       this.getAPIs();
     });
   }
diff --git a/src/app/messages.service.ts b/src/app/messages.service.ts
index d366550..b03e26e 100644
--- a/src/app/messages.service.ts
+++ b/src/app/messages.service.ts
@@ -11,14 +11,14 @@
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Affero General Public License for more details.
-  
+
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
 /**
  * @author Philippe Buschmann
  * @file src/app/messages.service.ts
- * @brief 
+ * @brief
  *
  */
 
@@ -83,4 +83,11 @@ export class MessagesService {
   dismissInformation(){
     this.info='';
   }
+
+  dismissAll(){
+    this.error='';
+    this.warning='';
+    this.info='';
+    this.success='';
+  }
 }
diff --git a/src/app/namestore-page/namestore-page.component.html 
b/src/app/namestore-page/namestore-page.component.html
index 21686c8..f5773c9 100644
--- a/src/app/namestore-page/namestore-page.component.html
+++ b/src/app/namestore-page/namestore-page.component.html
@@ -36,7 +36,7 @@
 
 <div class="c-card u-mv-x2">
   <h1 class="o-type-22 u-color-primary">Add new Namestore entry</h1>
-  <div class="o-list ">
+  <div class="o-list">
     <div class="o-list__item">
       <p class="u-color-grey">Label:</p>
       <input class="c-input" placeholder="Label" 
[(ngModel)]="gns_record.label" name="label" />
diff --git a/src/app/gns-record.ts b/src/app/peerinfo-address.ts
similarity index 83%
copy from src/app/gns-record.ts
copy to src/app/peerinfo-address.ts
index 3c29ce4..7ef2f18 100644
--- a/src/app/gns-record.ts
+++ b/src/app/peerinfo-address.ts
@@ -17,14 +17,10 @@
    */
 /**
  * @author Philippe Buschmann
- * @file src/app/gns_record.ts
+ * @file src/app/peerinfo-address.ts
  * @brief
- *
  */
-export class GNSRecord {
-  value: string;
-  type: string;
-  expiration_time: string;
-  flag: number;
-  label: string;
+export class PeerinfoAddress {
+  address: string;
+  expires: string;
 }
diff --git a/src/app/peerinfo-page/peerinfo-page.component.html 
b/src/app/peerinfo-page/peerinfo-page.component.html
new file mode 100644
index 0000000..3d890b4
--- /dev/null
+++ b/src/app/peerinfo-page/peerinfo-page.component.html
@@ -0,0 +1,12 @@
+
+<h1 class="o-type-35 c-card">Peerinfo</h1>
+<div class="c-card u-mv-x1" *ngFor="let item of peerinfo">
+  <p class="u-color-grey">Peer:</p>
+  <p class="o-type-22 u-mb-x2">{{item.peer}}</p>
+  <div class="o-list o-list--inline" *ngFor="let address of item.array">
+    <p class="o-list__item u-color-grey">Expires: </p>
+    <p class="o-list__item u-mr-x3">{{address.expires}}</p>
+    <p class="o-list__item u-color-grey">Address:</p>
+    <p class="o-list__item">{{address.address}}</p>
+  </div>
+</div>
diff --git a/src/app/peerstore-page/peerstore-page.component.spec.ts 
b/src/app/peerinfo-page/peerinfo-page.component.spec.ts
similarity index 100%
rename from src/app/peerstore-page/peerstore-page.component.spec.ts
rename to src/app/peerinfo-page/peerinfo-page.component.spec.ts
diff --git a/src/app/peerstore-page/peerstore-page.component.ts 
b/src/app/peerinfo-page/peerinfo-page.component.ts
similarity index 63%
copy from src/app/peerstore-page/peerstore-page.component.ts
copy to src/app/peerinfo-page/peerinfo-page.component.ts
index 2af569b..3da7b9b 100644
--- a/src/app/peerstore-page/peerstore-page.component.ts
+++ b/src/app/peerinfo-page/peerinfo-page.component.ts
@@ -11,28 +11,42 @@
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Affero General Public License for more details.
-  
+
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
 /**
  * @author Philippe Buschmann
  * @file src/app/peerstore-page/peerstore-page.component.ts
- * @brief 
+ * @brief
  *
  */
 
 import { Component, OnInit } from '@angular/core';
+import { PeerinfoResponse } from './../peerinfo-response';
+import { ApiService } from '../api.service';
 
 @Component({
-  selector: 'app-peerstore-page',
-  templateUrl: './peerstore-page.component.html'
+  selector: 'app-peerinfo-page',
+  templateUrl: './peerinfo-page.component.html'
 })
-export class PeerstorePageComponent implements OnInit {
+export class PeerinfoPageComponent implements OnInit {
+
+  request: boolean = false;
+  peerinfo: PeerinfoResponse[];
 
-  constructor() { }
+  constructor(private apiService:ApiService) { }
 
   ngOnInit() {
+    this.request = true;
+    this.apiService.getPeerinfo().subscribe(data => {
+      this.peerinfo = data;
+      this.request = false;
+    });
+  }
+
+  getPeerInfo(){
+
   }
 
 }
diff --git a/src/app/peerstore-page/peerstore-page.component.ts 
b/src/app/peerinfo-response.ts
similarity index 70%
rename from src/app/peerstore-page/peerstore-page.component.ts
rename to src/app/peerinfo-response.ts
index 2af569b..fe80655 100644
--- a/src/app/peerstore-page/peerstore-page.component.ts
+++ b/src/app/peerinfo-response.ts
@@ -11,28 +11,18 @@
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Affero General Public License for more details.
-  
+
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
 /**
  * @author Philippe Buschmann
- * @file src/app/peerstore-page/peerstore-page.component.ts
- * @brief 
- *
+ * @file src/app/peerinfo-response.ts
+ * @brief
  */
+import { PeerinfoAddress } from './peerinfo-address';
 
-import { Component, OnInit } from '@angular/core';
-
address@hidden({
-  selector: 'app-peerstore-page',
-  templateUrl: './peerstore-page.component.html'
-})
-export class PeerstorePageComponent implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {
-  }
-
+export class PeerinfoResponse {
+  peer: string;
+  array: PeerinfoAddress[];
 }
diff --git a/src/app/peerstore-page/peerstore-page.component.html 
b/src/app/peerstore-page/peerstore-page.component.html
deleted file mode 100644
index 8bdd960..0000000
--- a/src/app/peerstore-page/peerstore-page.component.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<p>
-  peerstore-page works!
-</p>
diff --git a/src/app/rest-apis/rest-apis.component.ts 
b/src/app/rest-apis/rest-apis.component.ts
index 72ff3bf..824d89d 100644
--- a/src/app/rest-apis/rest-apis.component.ts
+++ b/src/app/rest-apis/rest-apis.component.ts
@@ -34,7 +34,7 @@ export class RestApisComponent implements OnInit {
   apis: RestAPI[] = [
     {name: 'Manage Identities', desc: 'Create new identities, edit their names 
and delete them!', link: 'identity'},
     {name: 'Maintain Names', desc: 'Do things!', link: 'namestore'},
-    {name: 'Handle Peers', desc: 'Do things!', link: 'peerstore'},
+    {name: 'Handle Peers', desc: 'Do things!', link: 'peerinfo'},
   ];
 
   constructor(private apiService: ApiService) { }
diff --git a/src/favicon.png b/src/favicon.png
new file mode 100644
index 0000000..b214792
Binary files /dev/null and b/src/favicon.png differ
diff --git a/src/gnunet-anonymous-logo.png b/src/gnunet-anonymous-logo.png
new file mode 100644
index 0000000..26fcf3b
Binary files /dev/null and b/src/gnunet-anonymous-logo.png differ
diff --git a/src/index.html b/src/index.html
index 99158cd..f8f6540 100644
--- a/src/index.html
+++ b/src/index.html
@@ -5,7 +5,8 @@
   <title>Gnunet Web UI</title>
   <base href="/">
   <meta name="viewport" content="width=device-width, initial-scale=1">
-  <link rel="icon" type="image/x-icon" href="favicon.ico">
+  <link rel="icon" type="image/png" href="favicon.png"/>
+  <link rel="tag" type="text/css"/>
 </head>
 <body>
   <app-root></app-root>
diff --git a/src/scss/base/_body.scss b/src/scss/base/_body.scss
index 0b35cf5..bb5e8c7 100644
--- a/src/scss/base/_body.scss
+++ b/src/scss/base/_body.scss
@@ -5,6 +5,12 @@ body {
   height: 100%;
 }
 
+p {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
 option {
   outline: none;
 }
diff --git a/src/scss/components/_button.scss b/src/scss/components/_button.scss
index 8f3e4fa..5fc3f90 100644
--- a/src/scss/components/_button.scss
+++ b/src/scss/components/_button.scss
@@ -1,5 +1,5 @@
-$button-padding : $baseline-x2 $baseline-x4;
-$button-bgcolor : $color-primary;
+$button-padding : $baseline-x2+1px $baseline-x4+1px;
+$button-bgcolor : $color-primary-button;
 $button-bgcolor-hover : darken($button-bgcolor, 10%);
 $button-color : $color-white;
 $button-radius : 3px;
diff --git a/src/scss/components/_circle.scss b/src/scss/components/_circle.scss
index 733cadf..6775e89 100644
--- a/src/scss/components/_circle.scss
+++ b/src/scss/components/_circle.scss
@@ -10,4 +10,5 @@ $circle-diameter: 70px;
   line-height: $circle-diameter;
   text-align: center;
   vertical-align: middle;
+  margin: auto;
 }
diff --git a/src/scss/components/_footer.scss b/src/scss/components/_footer.scss
index bbd3ffc..9686ea4 100644
--- a/src/scss/components/_footer.scss
+++ b/src/scss/components/_footer.scss
@@ -4,8 +4,9 @@ $footer-height: 50px;
   bottom: 0px;
   height: $footer-height;
   width: 100%;
-  background-color: $color-grey-light;
-  border-top: solid 1px $color-grey;
+  color: $color-contrary;
+  background-color: $color-primary;
+  //border-top: solid 1px $color-grey;
   position: fixed;
 }
 
diff --git a/src/scss/components/_header.scss b/src/scss/components/_header.scss
index 0192252..39affdc 100644
--- a/src/scss/components/_header.scss
+++ b/src/scss/components/_header.scss
@@ -2,7 +2,8 @@
   top:0px;
   position: sticky;
   width: 100%;
-  background-color: $color-grey-light;
-  border-bottom: solid 1px $color-grey;
+  background-color: $color-primary;
+  color: $color-contrary;
+  //border-bottom: solid 1px $color-grey;
   //color: $color-contrary;
 }
diff --git a/src/scss/components/_input.scss b/src/scss/components/_input.scss
index 347e98c..10bd435 100644
--- a/src/scss/components/_input.scss
+++ b/src/scss/components/_input.scss
@@ -1,5 +1,5 @@
 $input-padding : $baseline-x2 $baseline-x4 $baseline-x2 $baseline;
-$input-bgcolor-hover : darken($color-blue, 10%);
+$input-bgcolor-hover : $color-primary-button;
 $input-bgcolor : $color-white;
 $input-radius : 3px;
 $input-border-color: darken($color-grey-light, 5%);
diff --git a/src/scss/components/_link.scss b/src/scss/components/_link.scss
index 6c3a64a..122cd0c 100644
--- a/src/scss/components/_link.scss
+++ b/src/scss/components/_link.scss
@@ -17,5 +17,5 @@
 }
 
 .c-link--underline{
-  border-bottom: 3px solid $color-primary;
+  border-bottom: 3px solid;
 }
diff --git a/src/scss/components/_spinner.scss 
b/src/scss/components/_spinner.scss
index b05af1c..f3122ac 100644
--- a/src/scss/components/_spinner.scss
+++ b/src/scss/components/_spinner.scss
@@ -7,6 +7,7 @@
     animation: spin 1s linear infinite;
     top: 1000px;
     display: inline-block;
+    margin: auto;
 }
 
 @keyframes spin {
diff --git a/src/scss/main.scss b/src/scss/main.scss
index 2f2234a..910b8fc 100644
--- a/src/scss/main.scss
+++ b/src/scss/main.scss
@@ -37,7 +37,7 @@
 @import 'components/modal';
 @import 'components/triangle';
 
-//@import 'utilities/align-items';
address@hidden 'utilities/align-items';
 @import 'utilities/align';
 @import 'utilities/bgcolor';
 //@import 'utilities/clearfix';
diff --git a/src/scss/settings/_baseline.scss b/src/scss/settings/_baseline.scss
index 2855a88..42f9dea 100644
--- a/src/scss/settings/_baseline.scss
+++ b/src/scss/settings/_baseline.scss
@@ -1,5 +1,6 @@
 $baseline: 7px;
 
+$baseline-x0: 0px;
 $baseline-x2: $baseline * 2;
 $baseline-x3: $baseline * 3;
 $baseline-x4: $baseline * 4;
diff --git a/src/scss/settings/_colors.scss b/src/scss/settings/_colors.scss
index b154393..6751e3f 100644
--- a/src/scss/settings/_colors.scss
+++ b/src/scss/settings/_colors.scss
@@ -26,8 +26,10 @@ $info-color: #0c5460;
 $info-bgcolor: #d1ecf1;
 $info-border-color: #bee5eb;
 
-$color-primary: $color-blue;
-$color-primary-light: lighten($color-primary, 10%);
+$color-primary: #333333;
+$color-primary-light: #333333;
+$color-primary-button: darken(#6bbae4,10%);
+//$color-contrary: #9d9d9d;
 $color-contrary: $color-white;
 $color-secondary: $color-primary-light;
 $color-secondary-light: $color-grey-light;
diff --git a/src/scss/settings/_core.scss b/src/scss/settings/_core.scss
index f034f1a..9075189 100644
--- a/src/scss/settings/_core.scss
+++ b/src/scss/settings/_core.scss
@@ -66,7 +66,11 @@ $iota-global-rtl: false;
  */
 
 $iota-global-breakpoints: (
-  sm  : "screen and ( min-width: 768px )"
+  xs  : "screen and ( min-width: 640px )",
+  sm  : "screen and ( min-width: 768px )",
+  md  : "screen and ( min-width: 1024px )",
+  lg  : "screen and ( min-width: 1200px )"
+
 );
 
 
diff --git a/src/scss/settings/_spacing.scss b/src/scss/settings/_spacing.scss
index 6628663..8e637ff 100644
--- a/src/scss/settings/_spacing.scss
+++ b/src/scss/settings/_spacing.scss
@@ -1,6 +1,7 @@
 $spacing-default: $baseline;
 
 $spacing-extra: (
+  -x0 : $baseline-x0,
   -x1 : $baseline,
   -x2 : $baseline-x2,
   -x3 : $baseline-x3,
diff --git a/src/scss/utilities/_margin.scss b/src/scss/utilities/_margin.scss
index d4753d5..9bff58e 100644
--- a/src/scss/utilities/_margin.scss
+++ b/src/scss/utilities/_margin.scss
@@ -23,7 +23,7 @@ $iota-utils-margin-extra: $spacing-extra;
  * Type: Boolean
  */
 
-$iota-utils-margin-res: false;
+$iota-utils-margin-res: true;
 
 
 /**

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]