Commit 0e3a18f9 authored by ibuler's avatar ibuler

[Update] 修复无法无密码连接remote app

parent 8ee3124e
...@@ -58,31 +58,31 @@ export class HttpService { ...@@ -58,31 +58,31 @@ export class HttpService {
return this.http.options(url, options); return this.http.options(url, options);
} }
report_browser() { reportBrowser() {
return this.http.post('/api/browser', JSON.stringify(Browser)); return this.http.post('/api/browser', JSON.stringify(Browser));
} }
check_login(user: any) { checkLogin(user: any) {
return this.http.post('/api/checklogin', user); return this.http.post('/api/checklogin', user);
} }
get_user_profile() { getUserProfile() {
return this.http.get('/api/users/v1/profile/'); return this.http.get('/api/users/v1/profile/');
} }
get_my_granted_nodes() { getMyGrantedNodes() {
return this.http.get<Array<Node>>('/api/perms/v1/user/nodes-assets/tree/?cache_policy=1'); return this.http.get<Array<Node>>('/api/perms/v1/user/nodes-assets/tree/?cache_policy=1');
} }
get_my_granted_remote_apps() { getMyGrantedRemoteApps() {
return this.http.get<Array<Node>>('/api/perms/v1/user/remote-apps/tree/'); return this.http.get<Array<Node>>('/api/perms/v1/user/remote-apps/tree/');
} }
refresh_my_granted_nodes() { refreshMyGrantedNodes() {
return this.http.get<Array<Node>>('/api/perms/v1/user/nodes-assets/tree/?cache_policy=2'); return this.http.get<Array<Node>>('/api/perms/v1/user/nodes-assets/tree/?cache_policy=2');
} }
get_guacamole_token(user_id: string, authToken: string) { getGuacamoleToken(user_id: string, authToken: string) {
const body = new HttpParams() const body = new HttpParams()
.set('username', user_id) .set('username', user_id)
.set('password', 'jumpserver') .set('password', 'jumpserver')
...@@ -100,18 +100,17 @@ export class HttpService { ...@@ -100,18 +100,17 @@ export class HttpService {
{headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')}); {headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')});
} }
guacamole_add_asset(user_id: string, asset_id: string, system_user_id: string, system_user_username?: string, system_user_password?: string) { guacamoleAddAsset(userId: string, assetId: string, systemUserId: string, systemUserUsername?: string, systemUserPassword?: string) {
let params = new HttpParams() let params = new HttpParams()
.set('user_id', user_id) .set('user_id', userId)
.set('asset_id', asset_id) .set('asset_id', assetId)
.set('system_user_id', system_user_id) .set('system_user_id', systemUserId)
.set('token', DataStore.guacamole_token); .set('token', DataStore.guacamole_token);
let body = new HttpParams(); let body = new HttpParams();
if (system_user_username) { if (systemUserUsername && systemUserPassword) {
body = body.set('username', system_user_username); systemUserUsername = btoa(systemUserUsername);
} systemUserPassword = btoa(systemUserPassword);
if (system_user_password) { body = body.set('username', systemUserUsername).set('password', systemUserPassword);
body = body.set('password', system_user_password);
} }
const solution = localStorage.getItem('rdpSolution') || 'Auto'; const solution = localStorage.getItem('rdpSolution') || 'Auto';
if (solution !== 'Auto') { if (solution !== 'Auto') {
...@@ -130,17 +129,16 @@ export class HttpService { ...@@ -130,17 +129,16 @@ export class HttpService {
); );
} }
guacamole_add_remote_app(user_id: string, remote_app_id: string, system_user_username?: string, system_user_password?: string) { guacamoleAddRemoteApp(userId: string, remoteAppId: string, systemUserUsername?: string, systemUserPassword?: string) {
let params = new HttpParams() let params = new HttpParams()
.set('user_id', user_id) .set('user_id', userId)
.set('remote_app_id', remote_app_id) .set('remote_app_id', remoteAppId)
.set('token', DataStore.guacamole_token); .set('token', DataStore.guacamole_token);
let body = new HttpParams(); let body = new HttpParams();
if (system_user_username) { if (systemUserUsername && systemUserPassword) {
body = body.set('username', system_user_username); systemUserUsername = btoa(systemUserUsername);
} systemUserPassword = btoa(systemUserPassword);
if (system_user_password) { body = body.set('username', systemUserUsername).set('password', systemUserPassword);
body = body.set('password', system_user_password);
} }
const solution = localStorage.getItem('rdpSolution') || 'Auto'; const solution = localStorage.getItem('rdpSolution') || 'Auto';
if (solution !== 'Auto') { if (solution !== 'Auto') {
...@@ -159,7 +157,7 @@ export class HttpService { ...@@ -159,7 +157,7 @@ export class HttpService {
); );
} }
guacamole_token_add_asset(assetToken: string, token: string) { guacamoleTokenAddAsset(assetToken: string, token: string) {
let params = new HttpParams() let params = new HttpParams()
.set('asset_token', assetToken) .set('asset_token', assetToken)
.set('token', token); .set('token', token);
...@@ -184,7 +182,7 @@ export class HttpService { ...@@ -184,7 +182,7 @@ export class HttpService {
return this.http.get('/api/search', {params: params}); return this.http.get('/api/search', {params: params});
} }
get_replay(token: string) { getReplay(token: string) {
return this.http.get('/api/terminal/v1/sessions/' + token + '/replay'); return this.http.get('/api/terminal/v1/sessions/' + token + '/replay');
} }
...@@ -192,11 +190,11 @@ export class HttpService { ...@@ -192,11 +190,11 @@ export class HttpService {
// return this.http.get('/api/terminal/v2/sessions/' + token + '/replay'); // return this.http.get('/api/terminal/v2/sessions/' + token + '/replay');
// } // }
get_replay_data(src: string) { getReplayData(src: string) {
return this.http.get(src); return this.http.get(src);
} }
get_user_id_from_token(token: string) { getUserIdFromToken(token: string) {
const params = new HttpParams() const params = new HttpParams()
.set('user-only', '1') .set('user-only', '1')
.set('token', token); .set('token', token);
...@@ -299,10 +297,10 @@ export class AppService implements OnInit { ...@@ -299,10 +297,10 @@ export class AppService implements OnInit {
this._logger.level = 0; this._logger.level = 0;
} }
if (environment.production) { // if (environment.production) {
this._logger.level = 2; this._logger.level = 2;
this.checklogin(); this.checklogin();
} // }
if (this._cookie.get('lang')) { if (this._cookie.get('lang')) {
this.lang = this._cookie.get('lang'); this.lang = this._cookie.get('lang');
...@@ -345,7 +343,7 @@ export class AppService implements OnInit { ...@@ -345,7 +343,7 @@ export class AppService implements OnInit {
} }
// jQuery('angular2').show(); // jQuery('angular2').show();
} else { } else {
this._http.get_user_profile() this._http.getUserProfile()
.subscribe( .subscribe(
data => { data => {
User.id = data['id']; User.id = data['id'];
...@@ -373,18 +371,6 @@ export class AppService implements OnInit { ...@@ -373,18 +371,6 @@ export class AppService implements OnInit {
document.location.pathname + document.location.search; document.location.pathname + document.location.search;
// this._router.navigate(['login']); // this._router.navigate(['login']);
}, },
// () => {
// if (User.logined) {
// if (document.location.pathname === '/login') {
// this._router.navigate(['']);
// } else {
// this._router.navigate([document.location.pathname]);
// }
// } else {
// this._router.navigate(['login']);
// }
// jQuery('angular2').show();
// }
); );
} }
} }
...@@ -395,7 +381,7 @@ export class AppService implements OnInit { ...@@ -395,7 +381,7 @@ export class AppService implements OnInit {
} }
browser() { browser() {
this._http.report_browser(); this._http.reportBrowser();
} }
getQueryString(name) { getQueryString(name) {
...@@ -406,124 +392,6 @@ export class AppService implements OnInit { ...@@ -406,124 +392,6 @@ export class AppService implements OnInit {
} }
return null; return null;
} }
//
//
// HideLeft() {
// DataStore.leftbarhide = true;
//
// DataStore.Nav.map(function (value, i) {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'HideLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'ShowLeftManager',
// 'click': 'ShowLeft',
// 'name': 'Show left manager'
// };
// }
// }
// });
//
// }
//
// ShowLeft() {
// DataStore.leftbarhide = false;
//
// DataStore.Nav.map(function (value, i) {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'ShowLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'HideLeftManager',
// 'click': 'HideLeft',
// 'name': 'Hide left manager'
// };
// }
// }
// });
//
//
// }
//
// setMyinfo(user:User) {
// // Update data store
// this._dataStore.user = user;
// this._logger.log("service.ts:AppService,setMyinfo");
// this._logger.debug(user);
// // Push the new list of todos into the Observable stream
// // this._dataObserver.next(user);
// // this.myinfo$ = new Observable(observer => this._dataObserver = observer).share()
// }
//
// getMyinfo() {
// this._logger.log('service.ts:AppService,getMyinfo');
// return this.http.get('/api/userprofile')
// .map(res => res.json())
// .subscribe(response => {
// DataStore.user = response;
// // this._logger.warn(this._dataStore.user);
// // this._logger.warn(DataStore.user)
// });
// }
//
// getUser(id: string) {
// this._logger.log('service.ts:AppService,getUser');
// return this.http.get('/api/userprofile')
// .map(res => res.json());
// }
//
// gettest() {
// this._logger.log('service.ts:AppService,gettest');
// this.http.get('/api/userprofile')
// .map(res => res.json())
// .subscribe(res => {
// return res;
// });
// }
//
// getGrouplist() {
// this._logger.log('service.ts:AppService,getGrouplist');
// return this.http.get('/api/grouplist')
// .map(res => res.json());
// }
//
// getUserlist(id: string) {
// this._logger.log('service.ts:AppService,getUserlist');
// if (id)
// return this.http.get('/api/userlist/' + id)
// .map(res => res.json());
// else
// return this.http.get('/api/userlist')
// .map(res => res.json());
// }
//
// delGroup(id) {
//
// }
//
//
// copy() {
// var clipboard = new Clipboard('#Copy');
//
// clipboard.on('success', function (e) {
// console.info('Action:', e.action);
// console.info('Text:', e.text);
// console.info('Trigger:', e.trigger);
//
// e.clearSelection();
// });
// console.log('ffff');
// console.log(window.getSelection().toString());
//
// var copy = new Clipboard('#Copy', {
// text: function () {
// return window.getSelection().toString();
// }
// });
// copy.on('success', function (e) {
// layer.alert('Lucky Copyed!');
// });
//
// }
} }
@Injectable() @Injectable()
......
...@@ -51,7 +51,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -51,7 +51,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
const zTreeObj = $.fn.zTree.getZTreeObj('ztree'); const zTreeObj = $.fn.zTree.getZTreeObj('ztree');
zTreeObj.expandNode(treeNode); zTreeObj.expandNode(treeNode);
} else { } else {
this._http.get_user_profile().subscribe(); this._http.getUserProfile().subscribe();
this.Connect(treeNode); this.Connect(treeNode);
} }
} }
...@@ -66,7 +66,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -66,7 +66,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
} }
getGrantedAssetsNodes() { getGrantedAssetsNodes() {
this._http.get_my_granted_nodes() this._http.getMyGrantedNodes()
.subscribe(response => { .subscribe(response => {
this.Data = [...response, ...this.Data]; this.Data = [...response, ...this.Data];
this.draw(); this.draw();
...@@ -74,7 +74,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -74,7 +74,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
} }
refreshGrantedAssetsNodes() { refreshGrantedAssetsNodes() {
this._http.refresh_my_granted_nodes() this._http.refreshMyGrantedNodes()
.subscribe(response => { .subscribe(response => {
this.Data = [...response, ...this.Data]; this.Data = [...response, ...this.Data];
this.draw(); this.draw();
...@@ -82,7 +82,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -82,7 +82,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
} }
getGrantedRemoteApps() { getGrantedRemoteApps() {
this._http.get_my_granted_remote_apps() this._http.getMyGrantedRemoteApps()
.subscribe(response => { .subscribe(response => {
if (response.length > 1) { if (response.length > 1) {
this.Data = [...this.Data, ...response]; this.Data = [...this.Data, ...response];
...@@ -209,35 +209,35 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -209,35 +209,35 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
} }
connectAsset(node) { connectAsset(node) {
const system_users = node.meta.system_users; const systemUsers = node.meta.system_users;
const host = node.meta.asset; const host = node.meta.asset;
let user: any; let user: any;
if (system_users.length > 1) { if (systemUsers.length > 1) {
user = this.checkPriority(system_users); user = this.checkPriority(systemUsers);
if (user) { if (user) {
this.login(host, user); return this.manualSetUserAuthLoginIfNeed(host, user, this.login);
} else { } else {
const dialogRef = this._dialog.open(AssetTreeDialogComponent, { const dialogRef = this._dialog.open(AssetTreeDialogComponent, {
height: '200px', height: '200px',
width: '300px', width: '300px',
data: {users: system_users} data: {users: systemUsers}
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (result) { if (result) {
for (const i of system_users) { for (const i of systemUsers) {
if (i.id.toString() === result.toString()) { if (i.id.toString() === result.toString()) {
user = i; user = i;
break; break;
} }
} }
this.login(host, user); return this.manualSetUserAuthLoginIfNeed(host, user, this.login);
} }
}); });
} }
} else if (system_users.length === 1) { } else if (systemUsers.length === 1) {
user = system_users[0]; user = systemUsers[0];
this.login(host, user); this.manualSetUserAuthLoginIfNeed(host, user, this.login);
} else { } else {
alert('该主机没有授权登录用户'); alert('该主机没有授权登录用户');
} }
...@@ -245,14 +245,11 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -245,14 +245,11 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
connectRemoteApp(node) { connectRemoteApp(node) {
const user = node.meta.user; const user = node.meta.user;
return this.loginRemoteApp(node, user); return this.manualSetUserAuthLoginIfNeed(node, user, this.loginRemoteApp);
} }
loginRemoteApp(node, user) { loginRemoteApp(node, user) {
const id = NavList.List.length - 1; const id = NavList.List.length - 1;
if (user.login_mode === 'manual' && !user.password && user.protocol === 'rdp') {
return this.manualSetUserAuthLogin(node, user, this.loginRemoteApp);
}
if (node) { if (node) {
NavList.List[id].nick = node.name; NavList.List[id].nick = node.name;
NavList.List[id].connected = true; NavList.List[id].connected = true;
...@@ -288,28 +285,32 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -288,28 +285,32 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
this.Connect(host); this.Connect(host);
} }
manualSetUserAuthLogin(host, user, callback) { manualSetUserAuthLoginIfNeed(host, user, callback) {
if (user.login_mode !== 'manual') {
return callback(host, user);
}
user = Object.assign({}, user); user = Object.assign({}, user);
const dialogRef = this._dialog.open(ManualPasswordDialogComponent, { const dialogRef = this._dialog.open(ManualPasswordDialogComponent, {
height: '250px', height: '250px',
width: '400px', width: '500px',
data: {username: user.username} data: {username: user.username}
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (!result) { if (!result) {
return;
}
if (result.skip) {
return callback(host, user); return callback(host, user);
} }
user.username = btoa(result.username); user.username = result.username;
user.password = btoa(result.password); user.password = result.password;
return callback(host, user); return callback(host, user);
}); });
} }
login(host, user) { login(host, user) {
const id = NavList.List.length - 1; const id = NavList.List.length - 1;
if (user.login_mode === 'manual' && !user.password && user.protocol === 'rdp') {
return this.manualSetUserAuthLogin(host, user, this.login);
}
if (user) { if (user) {
NavList.List[id].nick = host.hostname; NavList.List[id].nick = host.hostname;
NavList.List[id].connected = true; NavList.List[id].connected = true;
...@@ -460,6 +461,16 @@ export class ManualPasswordDialogComponent implements OnInit { ...@@ -460,6 +461,16 @@ export class ManualPasswordDialogComponent implements OnInit {
} }
onSkip() {
this.data.skip = true;
this.dialogRef.close(this.data);
}
onSkipAll() {
this.data.skipAll = true;
this.dialogRef.close(this.data);
}
onNoClick() { onNoClick() {
this.dialogRef.close(); this.dialogRef.close();
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
</mat-form-field> </mat-form-field>
<div style="float: right"> <div style="float: right">
<button mat-raised-button (click)="onSkip()" >{{"Skip"|trans}}</button>
<button mat-raised-button (click)="onNoClick()" >{{"Cancel"|trans}}</button> <button mat-raised-button (click)="onNoClick()" >{{"Cancel"|trans}}</button>
<button mat-raised-button color="primary" [type]="'submit'" [mat-dialog-close]="data" >{{"Confirm"|trans}}</button> <button mat-raised-button color="primary" [type]="'submit'" [mat-dialog-close]="data" >{{"Confirm"|trans}}</button>
</div> </div>
......
...@@ -13,7 +13,7 @@ import {ElementIframeComponent} from './iframe/iframe.component'; ...@@ -13,7 +13,7 @@ import {ElementIframeComponent} from './iframe/iframe.component';
import {ElementDialogAlertComponent} from './dialog/dialog.service'; import {ElementDialogAlertComponent} from './dialog/dialog.service';
import {ElementGuacamoleComponent} from './guacamole/guacamole.component'; import {ElementGuacamoleComponent} from './guacamole/guacamole.component';
import {ElementSshTermComponent} from './ssh-term/ssh-term.component'; import {ElementSshTermComponent} from './ssh-term/ssh-term.component';
import {AssetTreeDialogComponent, ElementAssetTreeComponent, ManualPasswordDialogComponent} from './asset-tree/asset-tree.component'; import {ElementAssetTreeComponent, AssetTreeDialogComponent, ManualPasswordDialogComponent} from './asset-tree/asset-tree.component';
import {RDPSolutionDialogComponent, FontDialogComponent} from './nav/nav.component'; import {RDPSolutionDialogComponent, FontDialogComponent} from './nav/nav.component';
export const ElementComponents = [ export const ElementComponents = [
......
<!--<iframe #rdp [src]="trust('https://inews.gtimg.com/newsapp_bt/0/3460971429/1000')" width="100%" height="100%" (mouseenter)="active()"></iframe>--> <!--<iframe #rdp [src]="trust('https://inews.gtimg.com/newsapp_bt/0/3460971429/1000')" width="100%" height="100%" (mouseenter)="active()"></iframe>-->
<iframe *ngIf="target" #rdp [src]="trust(target)" width="100%" height="100%" (mouseenter)="active()"></iframe> <iframe #rdpRef *ngIf="target" [src]="trust(target)" width="100%" height="100%" (mouseenter)="active()"></iframe>
...@@ -17,7 +17,7 @@ export class ElementGuacamoleComponent implements OnInit { ...@@ -17,7 +17,7 @@ export class ElementGuacamoleComponent implements OnInit {
@Input() remoteAppId: string; @Input() remoteAppId: string;
@Input() target: string; @Input() target: string;
@Input() index: number; @Input() index: number;
@ViewChild('rdp') el: ElementRef; @ViewChild('rdpRef') el: ElementRef;
registered = false; registered = false;
constructor(private sanitizer: DomSanitizer, constructor(private sanitizer: DomSanitizer,
...@@ -29,15 +29,17 @@ export class ElementGuacamoleComponent implements OnInit { ...@@ -29,15 +29,17 @@ export class ElementGuacamoleComponent implements OnInit {
registerHost() { registerHost() {
let action: any; let action: any;
if (this.remoteAppId) { if (this.remoteAppId) {
action = this._http.guacamole_add_remote_app(User.id, this.remoteAppId, this.sysUser.username, this.sysUser.password); action = this._http.guacamoleAddRemoteApp(User.id, this.remoteAppId, this.sysUser.username, this.sysUser.password);
} else { } else {
action = this._http.guacamole_add_asset(User.id, this.host.id, this.sysUser.id, this.sysUser.username, this.sysUser.password); action = this._http.guacamoleAddAsset(User.id, this.host.id, this.sysUser.id, this.sysUser.username, this.sysUser.password);
} }
action.subscribe( action.subscribe(
data => { data => {
const base = data.result; const base = data.result;
this.target = document.location.origin + '/guacamole/#/client/' + base + '?token=' + DataStore.guacamole_token; this.target = document.location.origin + '/guacamole/#/client/' + base + '?token=' + DataStore.guacamole_token;
NavList.List[this.index].Rdp = this.el.nativeElement; setTimeout(() => {
NavList.List[this.index].Rdp = this.el.nativeElement;
}, 500);
}, },
error => { error => {
if (!this.registered) { if (!this.registered) {
...@@ -52,7 +54,7 @@ export class ElementGuacamoleComponent implements OnInit { ...@@ -52,7 +54,7 @@ export class ElementGuacamoleComponent implements OnInit {
const now = new Date(); const now = new Date();
const nowTime = now.getTime() / 1000; const nowTime = now.getTime() / 1000;
this.registered = true; this.registered = true;
this._http.get_guacamole_token(User.id, '').subscribe( this._http.getGuacamoleToken(User.id, '').subscribe(
data => { data => {
// /guacamole/client will redirect to http://guacamole/#/client // /guacamole/client will redirect to http://guacamole/#/client
DataStore.guacamole_token = data['authToken']; DataStore.guacamole_token = data['authToken'];
......
...@@ -33,7 +33,7 @@ export class PagesConnectComponent implements OnInit { ...@@ -33,7 +33,7 @@ export class PagesConnectComponent implements OnInit {
jQuery('body').css('background-color', '#1f1b1b'); jQuery('body').css('background-color', '#1f1b1b');
if (this.system === 'windows') { if (this.system === 'windows') {
if (!this.userid) { if (!this.userid) {
this._http.get_user_id_from_token(this.token) this._http.getUserIdFromToken(this.token)
.subscribe( .subscribe(
data => { data => {
this._localStorage.set('user-' + this.token, data['user']); this._localStorage.set('user-' + this.token, data['user']);
...@@ -49,7 +49,7 @@ export class PagesConnectComponent implements OnInit { ...@@ -49,7 +49,7 @@ export class PagesConnectComponent implements OnInit {
getAuthToken() { getAuthToken() {
if (!this.authToken) { if (!this.authToken) {
this._http.get_guacamole_token(this.userid, this.token).subscribe( this._http.getGuacamoleToken(this.userid, this.token).subscribe(
data => { data => {
if (data['authToken']) { if (data['authToken']) {
this._localStorage.set('authToken-' + this.token, data['authToken']); this._localStorage.set('authToken-' + this.token, data['authToken']);
...@@ -65,7 +65,7 @@ export class PagesConnectComponent implements OnInit { ...@@ -65,7 +65,7 @@ export class PagesConnectComponent implements OnInit {
getBase() { getBase() {
if (!this.base) { if (!this.base) {
this._http.guacamole_token_add_asset(this.token, this.authToken).subscribe( this._http.guacamoleTokenAddAsset(this.token, this.authToken).subscribe(
data => { data => {
if (data['result']) { if (data['result']) {
this._localStorage.set('base-' + this.token, data['result']); this._localStorage.set('base-' + this.token, data['result']);
......
...@@ -16,4 +16,3 @@ ...@@ -16,4 +16,3 @@
<p> Version <strong>{{version}}</strong></p> <p> Version <strong>{{version}}</strong></p>
</div> </div>
</div> </div>
<!--<elements-server-menu></elements-server-menu>-->
...@@ -44,7 +44,7 @@ export class PagesLoginComponent implements OnInit { ...@@ -44,7 +44,7 @@ export class PagesLoginComponent implements OnInit {
DataStore.error['login'] = ''; DataStore.error['login'] = '';
this._logger.log(User); this._logger.log(User);
if (User.username.length > 0 && User.password.length > 6 && User.password.length < 100) { if (User.username.length > 0 && User.password.length > 6 && User.password.length < 100) {
this._http.check_login(JSON.stringify(User)) this._http.checkLogin(JSON.stringify(User))
.subscribe( .subscribe(
data => { data => {
User.logined = data['logined']; User.logined = data['logined'];
......
...@@ -86,7 +86,7 @@ export class JsonComponent implements OnInit { ...@@ -86,7 +86,7 @@ export class JsonComponent implements OnInit {
} }
}); });
if (this.replay.src !== 'READY') { if (this.replay.src !== 'READY') {
this._http.get_replay_data(this.replay.src) this._http.getReplayData(this.replay.src)
.subscribe( .subscribe(
data => { data => {
this.replayData = data; this.replayData = data;
......
...@@ -24,7 +24,7 @@ export class PagesReplayComponent implements OnInit { ...@@ -24,7 +24,7 @@ export class PagesReplayComponent implements OnInit {
.subscribe(params => { .subscribe(params => {
token = params['token']; token = params['token'];
}); });
this._http.get_replay(token) this._http.getReplay(token)
.subscribe( .subscribe(
data => { data => {
this.replay.type = data['type']; this.replay.type = data['type'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment