From 08672ba0f0927fa7e43577e3f94aca8a2762ffd9 Mon Sep 17 00:00:00 2001 From: Senyoret1 <34079003+Senyoret1@users.noreply.github.com> Date: Sat, 27 Jun 2020 16:26:09 -0400 Subject: [PATCH 1/8] Initial changes for the dark theme --- .../skywire-manager-src/src/app/app.module.ts | 2 + .../layout/button/button.component.html | 1 - .../layout/button/button.component.ts | 1 - .../menu-button/menu-button.component.html | 11 ++++ .../menu-button/menu-button.component.scss | 47 ++++++++++++++++++ .../menu-button/menu-button.component.spec.ts | 25 ++++++++++ .../menu-button/menu-button.component.ts | 38 ++++++++++++++ .../layout/sidenav/sidenav.component.html | 14 ++++-- .../layout/sidenav/sidenav.component.scss | 29 ++++------- .../layout/tab-bar/tab-bar.component.scss | 1 + .../node-app-button.component.scss | 2 +- .../components/pages/node/node.component.html | 24 ++++----- .../components/pages/node/node.component.scss | 24 +++++++++ .../src/assets/img/background-pattern.png | Bin 0 -> 960 bytes .../src/assets/img/icon-separator.png | Bin 0 -> 1072 bytes .../src/assets/scss/_backgrounds.scss | 15 ++++-- .../src/assets/scss/_variables.scss | 9 +++- static/skywire-manager-src/src/index.html | 23 +++++---- static/skywire-manager-src/src/styles.scss | 8 +++ 19 files changed, 217 insertions(+), 57 deletions(-) create mode 100644 static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.html create mode 100644 static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.scss create mode 100644 static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.spec.ts create mode 100644 static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.ts create mode 100644 static/skywire-manager-src/src/assets/img/background-pattern.png create mode 100644 static/skywire-manager-src/src/assets/img/icon-separator.png diff --git a/static/skywire-manager-src/src/app/app.module.ts b/static/skywire-manager-src/src/app/app.module.ts index 43958695a5..6139a6c12a 100644 --- a/static/skywire-manager-src/src/app/app.module.ts +++ b/static/skywire-manager-src/src/app/app.module.ts @@ -104,6 +104,7 @@ import { SkysocksSettingsComponent } from './components/pages/node/apps/node-app import { SkysocksClientSettingsComponent } from './components/pages/node/apps/node-apps/skysocks-client-settings/skysocks-client-settings.component'; +import { MenuButtonComponent } from './components/layout/sidenav/menu-button/menu-button.component'; const globalRippleConfig: RippleGlobalOptions = { disabled: true, @@ -185,6 +186,7 @@ const globalRippleConfig: RippleGlobalOptions = { TerminalComponent, SkysocksSettingsComponent, SkysocksClientSettingsComponent, + MenuButtonComponent, ], entryComponents: [ ConfigurationComponent, diff --git a/static/skywire-manager-src/src/app/components/layout/button/button.component.html b/static/skywire-manager-src/src/app/components/layout/button/button.component.html index d41767f041..634aaa995b 100644 --- a/static/skywire-manager-src/src/app/components/layout/button/button.component.html +++ b/static/skywire-manager-src/src/app/components/layout/button/button.component.html @@ -2,7 +2,6 @@ done error_outline - {{ icon }} diff --git a/static/skywire-manager-src/src/app/components/layout/button/button.component.ts b/static/skywire-manager-src/src/app/components/layout/button/button.component.ts index 5bf8869131..5f1979c81a 100644 --- a/static/skywire-manager-src/src/app/components/layout/button/button.component.ts +++ b/static/skywire-manager-src/src/app/components/layout/button/button.component.ts @@ -20,7 +20,6 @@ export class ButtonComponent implements OnDestroy { // Should be be 'mat-button' or 'mat-raised-button'. @Input() type = 'mat-button'; @Input() disabled = false; - @Input() icon: string; // Must be one of the colors defined on the default theme. @Input() color = ''; @Input() loadingSize = 24; diff --git a/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.html b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.html new file mode 100644 index 0000000000..c45f264bb0 --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.html @@ -0,0 +1,11 @@ +
+ +
diff --git a/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.scss b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.scss new file mode 100644 index 0000000000..16b29d5d51 --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.scss @@ -0,0 +1,47 @@ +@import 'variables'; +@import 'utilities/utilities'; +@import 'text'; + +:host { + width: 100%; + display: block; +} + +.external-border { + height: 1px; + background-color: $separator; + margin: 0 15px; +} + +.enabled { + opacity: 1; + @extend .cursor-pointer; + + &:hover { + background-color: rgba(255, 255, 255, 0.01) !important; + box-shadow: inset 0 0 55px 0 rgba(75, 101, 137, 0.20); + } +} + +button { + width: 100%; + color: $white; + background-color: transparent !important; + border: 0; + text-align: left; + height: 55px; + font-size: $font-size-sm; + display: flex; + align-items: center; + opacity: 0.35; + + .separator { + margin: 0 10px; + } + + mat-icon { + display: inline-block; + margin-left: 25px; + opacity: 0.75; + } +} diff --git a/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.spec.ts b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.spec.ts new file mode 100644 index 0000000000..f1d563dee7 --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MenuButtonComponent } from './menu-button.component'; + +describe('MenuButtonComponent', () => { + let component: MenuButtonComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MenuButtonComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MenuButtonComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.ts b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.ts new file mode 100644 index 0000000000..65bb6d45fb --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/sidenav/menu-button/menu-button.component.ts @@ -0,0 +1,38 @@ +import { Component, EventEmitter, Input, Output, OnDestroy } from '@angular/core'; + +/** + * Buttons shown in the left menu. + */ +@Component({ + selector: 'app-menu-button', + templateUrl: './menu-button.component.html', + styleUrls: ['./menu-button.component.scss'] +}) +export class MenuButtonComponent implements OnDestroy { + @Input() disabled = false; + @Input() icon: string; + @Input() text: string; + // If true, only the separator at the top will be shown. If false, only the separator at + // the bottom will be shown. + @Input() showUpperSeparator = false; + // Click event. + @Output() action = new EventEmitter(); + + ngOnDestroy() { + this.action.complete(); + } + + click() { + if (!this.disabled) { + this.action.emit(); + } + } + + showEnabled() { + this.disabled = false; + } + + showDisabled() { + this.disabled = true; + } +} diff --git a/static/skywire-manager-src/src/app/components/layout/sidenav/sidenav.component.html b/static/skywire-manager-src/src/app/components/layout/sidenav/sidenav.component.html index 243e399361..0133934465 100644 --- a/static/skywire-manager-src/src/app/components/layout/sidenav/sidenav.component.html +++ b/static/skywire-manager-src/src/app/components/layout/sidenav/sidenav.component.html @@ -8,6 +8,7 @@ @@ -48,7 +49,7 @@
-
-
-
- - +
+
+
+ + +
+
+ +
+
-
- -
-
diff --git a/static/skywire-manager-src/src/app/components/pages/node/node.component.scss b/static/skywire-manager-src/src/app/components/pages/node/node.component.scss index 3ac52dce1f..223b7be7da 100644 --- a/static/skywire-manager-src/src/app/components/pages/node/node.component.scss +++ b/static/skywire-manager-src/src/app/components/pages/node/node.component.scss @@ -1,4 +1,5 @@ @import "variables"; +@import "bootstrap_overrides"; .not-found-label { align-items: center; @@ -13,3 +14,26 @@ margin-right: 3px; } } + +.main-area { + width: 100%; + padding: 0 $additional-margin; + + @media (min-width: map-get($grid-breakpoints, lg)) { + width: 71%; + float: left; + } +} + +.right-bar { + width: 27%; + float: right; + padding-right: $additional-margin; + display: none; + + @media (min-width: map-get($grid-breakpoints, lg)) { + display: block; + width: 27%; + float: right; + } +} diff --git a/static/skywire-manager-src/src/assets/img/background-pattern.png b/static/skywire-manager-src/src/assets/img/background-pattern.png new file mode 100644 index 0000000000000000000000000000000000000000..15f8183323a17ec8b1c655eac6fe8992bb66d096 GIT binary patch literal 960 zcmaJ=%a77P9IjcT8` zAG~<=A26<$y_o31tMTN?n^!ePoU)YlAU2uKBj5M^9`ntUR&#$Vb0fnr%vR$-Z_{}* z8Jm~r|MbeqQ#xHIwJtfteKIja#FQOuA<*#50cs=DnLd1niVU-H+wF8o*La}X*yGFu z!^K`e*$h)G#er#$5CIk%xW2}Id;OLLuA{L>1%o$&DjK>6vk)E5njL#KvK5Cd-3P^3 zr2-xzCWyUbKT>0jUFfQGog70JEFfg0v1dtjjTWfl5PD5LP3(myFlcH zJmdu^g=RnSpnhi*Vz?1MznwD6c{EY0++1TR?0`q8pYv|%td11NBOQc?;ujQ>MD zZ-tIX8=dF-PvNLD4G?Uj2#-UXUR-}C2^FZ-5Savr9gL6DF1Ci4;An^gP^~Vy2JRfW zzJn*x?t)_&YQv9+>D#EGYb;gaT-Q-`MbRZWCs$;d7lc~5B1@ty*UM5((_iJ9p+uN;MmE=t|YEAuBrT6#`N{A|0 literal 0 HcmV?d00001 diff --git a/static/skywire-manager-src/src/assets/img/icon-separator.png b/static/skywire-manager-src/src/assets/img/icon-separator.png new file mode 100644 index 0000000000000000000000000000000000000000..ae65938b82114e68ad87bcdead6925b941a4b02c GIT binary patch literal 1072 zcmaJ=TSyd97@q8+nLcC$WjzeDVH)mSb{*FpTxEA>S2r5dbxY|%9A}R1U^8c$Ikw{k zAFPOwAoMM|fsnm)Au`JKM6;O0a}gffi#Fl^aMR5tJnclWPSg&2QAV}^5msRjAQQUW2a-Tm2ahd+ zdV*MAp`|)er*uG2piav!hIVulvk9WU(J^JEA0V;^^l3(jdO!PsA~iKcb?_1^nNg6| znujdVKGc#@hWeGDN;Ni+^^SlAbbw^i(T^Io;Do5Gu7KC>F+-7A2fl789L*qq1DH5!C;VKeT>iN#R#uGXdv0~8n!2=AOc&lG!tpiAYDbd2M(YRg){wK zf^M$K8un_NaKji!HW`j)-I8)ZN%}uj*VoWCN`gQ6{!`da4Vr*S0virk3ck2rj~mJq zq85-5v{Dcr&2_Og4H2}{&?KYLY}d%j4$V+u#;(e8BuPjZHj)hmB*YMfRcK99g*X?k zi^RhBM~-U8{p%7B*zt@GN1zk<+$n}E}xg{+CevQWD!`}aiGR6 zsFT^U1ucIrzPx&?Ts40#{=8fUC&Rdx``2aXjc@DwJ*+eyYKBv zLJX&zry~=Oi|5&rm_A*!{ zyj=He&Qm@g`_#R;W3j5dZ!+M-r$-8J@7>ez<5Va;w_!-CoV~a5`DCi=(ZMd<8uo~4nBW!eE0QRW&6L*)_$p+I`q&#_HA - - - Skywire Manager - - - - - - - - + + + Skywire Manager + + + + + + +
+ + diff --git a/static/skywire-manager-src/src/styles.scss b/static/skywire-manager-src/src/styles.scss index cd199ca92d..2196341659 100644 --- a/static/skywire-manager-src/src/styles.scss +++ b/static/skywire-manager-src/src/styles.scss @@ -81,3 +81,11 @@ button:focus { .mat-snack-bar-container { max-width: 90vw !important; } + +.transparent-button { + opacity: 0.5; + + &:hover { + opacity: 1; + } +} From 4959e773d338fcfac265ff47dc75f6b0fa65e0de Mon Sep 17 00:00:00 2001 From: Senyoret1 <34079003+Senyoret1@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:55:10 -0400 Subject: [PATCH 2/8] Additional changes for the main parts of the dark theme --- .../lang-button/lang-button.component.html | 2 +- .../layout/line-chart/line-chart.component.ts | 4 +- .../layout/paginator/paginator.component.html | 2 +- .../layout/paginator/paginator.component.scss | 9 ++- .../refresh-button.component.html | 2 +- .../refresh-button.component.scss | 2 +- .../menu-button/menu-button.component.scss | 4 +- .../layout/tab-bar/tab-bar.component.html | 2 +- .../layout/tab-bar/tab-bar.component.scss | 23 +++++--- .../view-all-link.component.scss | 5 +- .../pages/node-list/node-list.component.html | 32 ++++++----- .../pages/node-list/node-list.component.scss | 56 ++----------------- .../node-apps-list.component.html | 29 +++++----- .../node-apps-list.component.scss | 12 ---- .../pages/node/charts/charts.component.html | 4 +- .../node-info-content.component.html | 2 +- .../node-info-content.component.scss | 5 +- .../components/pages/node/node.component.html | 4 +- .../components/pages/node/node.component.scss | 9 ++- .../route-list/route-list.component.html | 21 +++---- .../route-list/route-list.component.scss | 12 ---- .../transport-list.component.html | 25 +++++---- .../transport-list.component.scss | 12 ---- .../src/assets/scss/_backgrounds.scss | 24 +++++++- .../src/assets/scss/_responsive_tables.scss | 46 +++++++++------ .../src/assets/scss/_variables.scss | 6 +- .../src/assets/scss/utilities/_utilities.scss | 16 ++++++ static/skywire-manager-src/src/styles.scss | 8 --- 28 files changed, 175 insertions(+), 203 deletions(-) diff --git a/static/skywire-manager-src/src/app/components/layout/lang-button/lang-button.component.html b/static/skywire-manager-src/src/app/components/layout/lang-button/lang-button.component.html index a940411ffe..ae4adbf909 100644 --- a/static/skywire-manager-src/src/app/components/layout/lang-button/lang-button.component.html +++ b/static/skywire-manager-src/src/app/components/layout/lang-button/lang-button.component.html @@ -1,6 +1,6 @@
-
+
-
- + + {{ sortingArrow }} @@ -67,26 +67,26 @@ (copyEvent)="onCopyToClipboardClicked()" mat-icon-button [matTooltip]="'nodes.copy-key' | translate" - class="grey-button-background" + class="big-action-button transparent-button" > - filter_none + filter_none