Skip to content

Commit

Permalink
Merge pull request #680 from jumpserver/dev
Browse files Browse the repository at this point in the history
v2.26.0-rc1
  • Loading branch information
BaiJiangJie committed Sep 8, 2022
2 parents 023a83d + 3773395 commit 8462203
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"jvectormap": "1.2.2",
"lodash": "^4.17.15",
"lodash": "^4.17.21",
"material-design-icons": "^3.0.1",
"materialize-css": "^0.100.2",
"ng2-charts": "^1.5.0",
Expand Down
9 changes: 9 additions & 0 deletions src/app/elements/iframe/iframe.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export class ElementIframeComponent implements OnInit, AfterViewInit, OnDestroy
case 'CLOSE':
this.view.connected = false;
break;
case 'CONNECTED':
this.view.connected = true;
break;
case 'CLICK':
document.body.click();
break;
Expand Down Expand Up @@ -86,6 +89,12 @@ export class ElementIframeComponent implements OnInit, AfterViewInit, OnDestroy
}

reconnect() {
// @ts-ignore
if (typeof (this.iframeWindow.Reconnect) === 'function') {
// @ts-ignore
this.iframeWindow.Reconnect();
return;
}
const url = this.src;
this.src = 'about:blank';
setTimeout(() => {
Expand Down
4 changes: 3 additions & 1 deletion src/app/elements/nav/nav.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div class="nav">
<ul class="nav-main">
<li style="padding-right: 10px">
<a><img src="" id="left-logo" height="26px"/></a>
<a style="display: inline-block; padding-top: 1px;">
<img src="" id="left-logo" height="26px" (click)="onJumpUi()" />
</a>
</li>
<li *ngFor="let v of navs" [ngClass]="{'dropdown': v.children}" >
<a>{{v.name|translate}}</a>
Expand Down
4 changes: 4 additions & 0 deletions src/app/elements/nav/nav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ export class ElementNavComponent implements OnInit {
},
];
}

onJumpUi() {
window.open('/ui/', '_blank');
}
}


Expand Down
17 changes: 14 additions & 3 deletions src/app/pages/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {I18nService} from '@app/services';
import {Component, HostListener} from '@angular/core';
import {I18nService, ViewService} from '@app/services';

@Component({
selector: 'app-root',
Expand All @@ -8,7 +8,18 @@ import {I18nService} from '@app/services';
})

export class AppComponent {
constructor(_i18n: I18nService) {
constructor(_i18n: I18nService,
public viewSrv: ViewService
) {}
@HostListener('window:keydown', ['$event'])
onKeyPress($event: KeyboardEvent) {
const condition = this.viewSrv.viewList.length > 1 && $event.shiftKey;
if (condition && $event.keyCode === 37) {
this.viewSrv.switchView('left');
}
if (condition && $event.keyCode === 39) {
this.viewSrv.switchView('right');
}
}
}

5 changes: 5 additions & 0 deletions src/app/pages/monitor/monitor.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
display: inline-block;
}

.nav li > p {
margin-bottom: -8px;
}

li p {
color: #f0f0f1;
font-family: Roboto,sans-serif;
Expand All @@ -30,6 +34,7 @@ li p {
text-decoration: none;
padding: 2px 15px;
height: 30px;
margin: 0;
}

iframe {
Expand Down
20 changes: 20 additions & 0 deletions src/app/services/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,24 @@ export class ViewService {
const index = this.viewList.indexOf(view);
this.viewList.splice(index, 1);
}

switchView(direction: ('left' | 'right')) {
const viewList = this.viewList;
const viewListLength = viewList.length;
for (let i = 0; i < viewListLength; i++) {
const current: View = viewList[i];
if (current.id === this.currentView.id) {
let nextView: View, nextViewLength: number;
const next: number = direction === 'left' ? i - 1 : i + 1;
if (direction === 'left') {
nextViewLength = next < 0 ? viewListLength - 1 : next;
} else {
nextViewLength = next >= viewListLength ? 0 : next;
}
nextView = viewList[nextViewLength];
if (nextView) { this.activeView(nextView); }
break;
}
}
}
}
31 changes: 20 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,13 @@
resolved "https://registry.npmmirror.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==

"@ztree/ztree_v3@^3.5.48":
version "3.5.48"
resolved "https://registry.npmmirror.com/@ztree/ztree_v3/-/ztree_v3-3.5.48.tgz#ceb020e362f9c97c24a49d46d4b0cb91a57379ba"
integrity sha512-4dSA1g26T3j/O3I89+r/Palg+a+xwMGRS1etZoggnCGBPoOrwW8VGA3zitJCK/Yd7eEMX+LfKTRJjEGiWpoN3w==
dependencies:
jquery ">=1.4.4"

JSONStream@^1.3.4:
version "1.3.5"
resolved "https://registry.npmmirror.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
Expand Down Expand Up @@ -1511,7 +1518,7 @@ ajv@6.12.3:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.5.0:
ajv@^6.1.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
Expand Down Expand Up @@ -1950,11 +1957,6 @@ bonjour@^3.5.0:
multicast-dns "^6.0.1"
multicast-dns-service-types "^1.1.0"

bootstrap@^4.3.1:
version "4.6.1"
resolved "https://registry.npmmirror.com/bootstrap/-/bootstrap-4.6.1.tgz#bc25380c2c14192374e8dec07cf01b2742d222a2"
integrity sha512-0dj+VgI9Ecom+rvvpNZ4MUZJz8dcX7WCX+eTID9+/8HgOkv3dsRzi8BGeZJCQU6flWQVYxwTQnEZFrmJSEO7og==

boxen@^5.0.1:
version "5.1.2"
resolved "https://registry.npmmirror.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50"
Expand Down Expand Up @@ -4938,7 +4940,7 @@ jest-worker@^26.0.0:
merge-stream "^2.0.0"
supports-color "^7.0.0"

jquery@^3.4.1:
jquery@>=1.4.4, jquery@^3.4.1:
version "3.6.0"
resolved "https://registry.npmmirror.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470"
integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==
Expand Down Expand Up @@ -5751,10 +5753,12 @@ ngx-clipboard@^12.2.1:
ngx-window-token "^2.0.0"
tslib "^1.9.0"

ngx-cookie-service@^2.3.0:
version "2.4.0"
resolved "https://registry.npmmirror.com/ngx-cookie-service/-/ngx-cookie-service-2.4.0.tgz#293de6d393220f8fe5712a4c9f724042404e6971"
integrity sha512-uR/6mCQ1t+XY5G1/irqRhoEddx1PPtmz7JHM/2nn5yQmicnj+n48x8C2PMxwaYDHKRh7QPQ9G5scR36Mmdz09A==
ngx-cookie-service@^12.0.3:
version "12.0.3"
resolved "https://registry.npmmirror.com/ngx-cookie-service/-/ngx-cookie-service-12.0.3.tgz#eb2fc73b40dcc5ef8282eb78e82986afc299537f"
integrity sha512-F5xJBTrrreI2DERGOrO6U+L7s031HxTER+3Z4gDCwxdTl4AXmtWddMxxQVw7KflOLZ4InYEs6FjQsXmKU4HsJg==
dependencies:
tslib "^2.0.0"

ngx-infinite-scroll@^10.0.1:
version "10.0.1"
Expand Down Expand Up @@ -8158,6 +8162,11 @@ tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.npmmirror.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.0.0, tslib@^2.4.0:
version "2.4.0"
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

tslint@~5.11.0:
version "5.11.0"
resolved "https://registry.npmmirror.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
Expand Down

0 comments on commit 8462203

Please sign in to comment.