This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathdeadcode.txt
174 lines (166 loc) · 7.68 KB
/
deadcode.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
workerAsync(fsWorker, "uploadFile", {
password,
path,
fileKey,
destination,
data
}, ({sent}) => {
messageActions.message({style: "success", text: "File uploaded."})
fsApi.reloadFileTree(untilLastPathSegment(path))
})
fsWorker.addEventListener("message", ({data}) => {
console.log(data)
let message = data as WorkerMessage<any>
if (message.type == "progress") {
console.log("We get progres")
fileSystemActions.downloadProgress(message.content)
}
})
workerAsync(fsWorker, "requestFile", {
password,
location: fullPath,
localLocation: location
}, (result) => {
fileSystemActions.downloadComplete(result)
//downloadBlobURL(byteArraysToBlobURL([result]), fileName)
})
let message: WorkerMessage<FileSystemInfo.Data> = {
type: "downloadData",
content: data
}
fsWorker.postMessage(message)
<div className="row" ref={ref => this.headerBar = ref} style={{position: "fixed", zIndex: 2}}>
<div className="col-xs-12">
<div style={{width: 200, float: "left"}}>
<ButtonToolbar>
<ButtonGroup justified>
<ButtonGroup>
<Button onClick={fileSystemActions.goBack}>
<Glyphicon glyph="arrow-left" />
</Button>
</ButtonGroup>
<ButtonGroup>
<Button onClick={fileSystemActions.goForward}>
<Glyphicon glyph="arrow-right" />
</Button>
</ButtonGroup>
<ButtonGroup>
<Button bsStyle="primary" onClick={() => this.upload.click()}>
<Glyphicon glyph="export" />
</Button>
</ButtonGroup>
<ButtonGroup>
<Button bsStyle="primary" onClick={() => this.refresh(this.state.tree.RootFolder.Name)}>
<Glyphicon glyph="refresh" />
</Button>
</ButtonGroup>
</ButtonGroup>
</ButtonToolbar>
</div>
<div style={{marginLeft: 220}}>
<EntryBox
ref={box => this.box = box}
onConfirmation={this.openFolder}
defaultValue={tree.RootFolder.Name}
glyph="chevron-right" />
</div>
{/*
<UploadList uploads={{
"ass": {
path: "ass",
uploaded: 100,
total: 200
}}} /> */}
<UploadList uploads={uploads} />
<EntryBox onConfirmation={fsApi.search} glyph="chevron-right" />
{/*
<Input type="text" onChange={(e) => {
this.setState({searchQuery: (e.target as HTMLInputElement).value})
}}/> */}
</div>
</div>
<IconMedia src="/img/icon/pc.svg" size={[40, 75]} alt="PC">
<h4 className="media-heading">Operating System</h4>
{os.name} {os.architecture}, version {os.version}
<br />
build {os.build}
</IconMedia>
<IconMedia src="/img/icon/microchip.svg" size={[60, 75]} alt="chip">
<h4 className="media-heading">CPU</h4>
{cpu.cpuName} running at {cpu.speedMhz} Mhz
<br />
{cpu.cores} cores and {cpu.threads} threads
<br />
{stats.cpuTemps.map((temp, i) => {
return <span key={i}>
{i == stats.cpuTemps.length - 1 ? " Package: " : " "}
<Temperature>{temp.toFixed(1)}</Temperature>
</span>
})}
</IconMedia>
<IconMedia src="/img/icon/motherboard.svg" size={[60, 67]} alt="motherboard">
<h4 className="media-heading">Motherboard</h4>
{stats.motherBoard} <br />
BIOS from {stats.biosInfo.biosManufacturer} <br />
{stats.biosInfo.biosCaption}
</IconMedia>
<IconMedia src="/img/icon/routers.svg" size={[60, 58]} alt="routers">
<h4 className="media-heading">Network</h4>
Public IP address is {network.publicIp}
<br />
Internal IP address is {network.internalIp}
<br />
MAC address is {network.macAddress}
</IconMedia>
<IconMedia src="/img/icon/videocard.svg" size={[60, 55]} alt="GPU">
<h4 className="media-heading">{gpu.gpus.length > 1 ? "GPUs" : "GPU"}</h4>
{gpu.gpus.map((gpu, i) => {
return (
<p key={gpu.Name}>
{gpu.Name} <br />
Driver version {gpu.DriverVersion} <br />
<span
className={"label label-" + (gpu.Status == "OK" ? "success" : "danger")}>
{gpu.Status}
</span>
<span className="label label-default">
{GpuAvailability[gpu.Availability]}
</span>
<Temperature>{gpu.Temperature}</Temperature>
</p>
)
})}
</IconMedia>
<IconMedia src="/img/icon/sdd.svg" size={[60, 55]} alt="drive">
<h4 className="media-heading">Drives</h4>
{stats.drives.map((drive, i) => {
return (
<div key={drive.RootDirectory}>
{drive.VolumeLabel.length > 0 ? drive.VolumeLabel : "No label"}, {drive.RootDirectory}
<br />
<Bar
value={100 - ((drive.FreeSpace/drive.TotalSize)*100)}
style={{width: "100%"}}
color={true}/>
{bytesToSize(drive.FreeSpace)} free of {bytesToSize(drive.TotalSize)}
</div>
)
})}
</IconMedia>
<li>
<a style={{cursor: "pointer"}} onClick={() => {
dialogEvents.dialog({
title: "Disconnect?",
body: <p>Are you sure you want to disconnect?</p>,
buttons: [
{bsStyle: "primary", children: "Yes", onClick: socket.disconnect},
{bsStyle: "default", children: "No"}
]
})
}}>
<Glyphicon glyph="log-out" />
<span className="tab-label"> Disconnect</span>
</a>
</li>