Commit 56fcc208 authored by liuzheng712's avatar liuzheng712 Committed by i317280

feat: update

parent 6b6ce213
...@@ -38,7 +38,8 @@ export class CleftbarComponent implements OnInit { ...@@ -38,7 +38,8 @@ export class CleftbarComponent implements OnInit {
name: "ops-win", name: "ops-win",
uuid: "win-aasdf", uuid: "win-aasdf",
type: "rdp", type: "rdp",
token: "rdpxxx" token: "rdpxxx",
machine: "sss"
} }
], ],
}]; }];
......
...@@ -14,10 +14,13 @@ export class Term { ...@@ -14,10 +14,13 @@ export class Term {
socket: any; socket: any;
term: any; term: any;
} }
export class Rdp { export class Rdp {
machine: string; machine: string;
token: string; token: string;
client: any;
} }
export class View { export class View {
nick: string; nick: string;
type: string; type: string;
...@@ -29,6 +32,7 @@ export class View { ...@@ -29,6 +32,7 @@ export class View {
Term: Term; Term: Term;
} }
export let NavList: { export let NavList: {
List: Array<View>; List: Array<View>;
Active: number; Active: number;
......
...@@ -26,14 +26,23 @@ export class RdpComponent implements OnInit { ...@@ -26,14 +26,23 @@ export class RdpComponent implements OnInit {
Connect(host) { Connect(host) {
let id = NavList.List.length - 1; let id = NavList.List.length - 1;
let canvas = Mstsc.$("canvas-" + id);
canvas.style.display = 'inline';
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
NavList.List[id].nick = host.name; NavList.List[id].nick = host.name;
NavList.List[id].connected = true; NavList.List[id].connected = true;
NavList.List[id].edit = false; NavList.List[id].edit = false;
NavList.List[id].closed = false; NavList.List[id].closed = false;
NavList.List[id].type = "rdp"; NavList.List[id].type = "rdp";
NavList.List[id].Rdp = new Rdp; NavList.List[id].Rdp = new Rdp;
NavList.List[id].Rdp.token = "xxx"; NavList.List[id].Rdp.token = host.token;
NavList.List[id].Rdp.machine = "xxx"; NavList.List[id].Rdp.machine = host.machine;
NavList.List[id].Rdp.client = Mstsc.client.create(Mstsc.$("canvas-" + id));
NavList.List[id].Rdp.client.connect(host.token, "rdp/socket.io");
NavList.List.push(new View()); NavList.List.push(new View());
for (let m in NavList.List) { for (let m in NavList.List) {
...@@ -42,12 +51,7 @@ export class RdpComponent implements OnInit { ...@@ -42,12 +51,7 @@ export class RdpComponent implements OnInit {
NavList.List[id].hide = false; NavList.List[id].hide = false;
NavList.Active = id; NavList.Active = id;
let client = Mstsc.client.create(Mstsc.$("canvas-" + id));
let canvas = Mstsc.$("canvas-" + id);
canvas.style.display = 'inline';
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
client.connect("xxxx", "rdp/socket.io");
} }
static Disconnect(host) { static Disconnect(host) {
......
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