-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathWebTerminal-0.85-dev.xml
More file actions
4033 lines (3458 loc) · 121 KB
/
Copy pathWebTerminal-0.85-dev.xml
File metadata and controls
4033 lines (3458 loc) · 121 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="%WebTerminal.Engine">
<Description>
This class represents the core of web terminal.
All operations with opened WebSocket placed here.
CLASS USES GLOBAL ^%WebTerminal.Engine.AuthorizationKey for client
authorization.
(Maybe there can be something better then using this global)</Description>
<Super>%CSP.WebSocket,%Library.Routine,%CSP.REST</Super>
<TimeCreated>63047,60359.445979</TimeCreated>
<Property name="lastClientId">
<Description>
Last joined client id</Description>
<Type>%Numeric</Type>
<InitialExpression>0</InitialExpression>
</Property>
<Property name="ConstServerActionExecute">
<Type>%Char</Type>
<InitialExpression>$c(1)</InitialExpression>
</Property>
<Property name="ConstServerActionExecuteSQL">
<Type>%Char</Type>
<InitialExpression>$c(2)</InitialExpression>
</Property>
<Property name="ConstServerActionGenerateAutocomplete">
<Type>%Char</Type>
<InitialExpression>$c(3)</InitialExpression>
</Property>
<Property name="ConstClientEnterClearIO">
<Type>%Char</Type>
<InitialExpression>$c(1)</InitialExpression>
</Property>
<Property name="ConstClientExitClearIO">
<Type>%Char</Type>
<InitialExpression>$c(2)</InitialExpression>
</Property>
<Property name="ConstClientOutputMessage">
<Type>%Char</Type>
<InitialExpression>$c(3)</InitialExpression>
</Property>
<Property name="ConstClientChangeNamespace">
<Type>%Char</Type>
<InitialExpression>$c(4)</InitialExpression>
</Property>
<Property name="ConstClientLoadAutocomplete">
<Type>%Char</Type>
<InitialExpression>$c(5)</InitialExpression>
</Property>
<Property name="ConstClientReadString">
<Type>%Char</Type>
<InitialExpression>$c(6)</InitialExpression>
</Property>
<Property name="ConstClientReadChar">
<Type>%Char</Type>
<InitialExpression>$c(7)</InitialExpression>
</Property>
<Property name="CurrentNamespace">
<Type>%String</Type>
</Property>
<Property name="InitialZName">
<Type>%String</Type>
</Property>
<Property name="ExperimentalAutocompleteOn">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>
<Method name="redirects">
<Description>
Public point entries, using when redirecting i/o</Description>
<Internal>1</Internal>
<Private>1</Private>
<ProcedureBlock>0</ProcedureBlock>
<Implementation><![CDATA[
readFromSocket(len,timeout,sharedConnection)
set sc = ""
Set $ZTrap="ReadError"
If len<1 Set len=32656
If (sharedConnection = 1) {
Set data=..ReadAsync(.len, .sc, timeout)
Try { Set data1=$zconvert(data,"I","UTF8") } Catch { Set data1=data }
Set len=$Length(data1)
Quit data1
}
If ..BytesAvailable Goto ReadData
Set ..BytesAvailable=0,..AtEnd=0
Read header#5:timeout
If $Test=0 {
Set len=0
Set sc=$$$ERROR($$$CSPWebSocketTimeout,"WebSocket Read Operation timed-out")
Set ..AtEnd=1
Quit ""
}
Set type=$Extract(header,5)
If type=9 {
Set len=0
Set sc=$$$ERROR($$$CSPWebSocketClosed,"WebSocket Closed by the Client")
Set ..AtEnd=1
Quit ""
}
Set header=$Extract(header, 1, 4)
Set size=$ZLA(header)-1 If size<0 Set size=0
Set ..BytesAvailable=size
ReadData
If ..BytesAvailable > len {
Set size=len
Set ..BytesAvailable=..BytesAvailable-len
}
else {
Set size=..BytesAvailable
Set ..BytesAvailable=0
}
If '..BytesAvailable Set ..AtEnd=1
If size=0 Set len=0,sc=$$$OK Quit ""
Read data#size
Set len=size
Set sc=$$$OK
Try { Set data1=$zconvert(data,"I","UTF8") } Catch { Set data1=data }
Set len=$Length(data1)
Quit data1
ReadError
#; No interrupts during cleanup or error processing
$$$SetExternalInterrupts(0)
Set $ZTrap="ReadHalt"
Hang 5
Close 0
ReadHalt
Halt
PrepareOutput(data)
Try { Set data1=$zconvert(data,"O","UTF8") } Catch { Set data1=data }
quit data1
PrepareInput(data)
Try { Set data1=$zconvert(data,"I","UTF8") } Catch { Set data1=data }
quit data1
//////////////////////////////////////////////
wstr(s)
set rd = ##class(%Device).ReDirectIO($$$NO)
//do ..Write(s)
w $$PrepareOutput(s),*-3
do ##class(%Device).ReDirectIO(rd)
quit
wchr(c)
set rd = ##class(%Device).ReDirectIO($$$NO)
w $$PrepareOutput($c(s)),*-3
//do ..Write($c(c))
do ##class(%Device).ReDirectIO(rd)
quit
wnl
set rd = ##class(%Device).ReDirectIO($$$NO)
//do ..Write($c(13,10))
w $c(13,10),*-3
do ##class(%Device).ReDirectIO(rd)
quit
wff
set rd = ##class(%Device).ReDirectIO($$$NO)
w $c(12),*-3
//do ..Write($c(12))
do ##class(%Device).ReDirectIO(rd)
quit
wtab(s)
set rd = ##class(%Device).ReDirectIO($$$NO)
w $$PrepareOutput($j("",s-$x)),*-3
//do ..Write($j("",s-$x))
do ##class(%Device).ReDirectIO(rd)
quit
rstr(len = 32656,timeout = 86400)
set rd=##class(%Device).ReDirectIO($$$NO)
w $c(6),*-3 // ..ConstClientReadString
read header#5:timeout
read data:timeout
set data = $$PrepareInput($EXTRACT(data,1,len))
do ##class(%Device).ReDirectIO(rd)
quit data
rchr(timeout = 86400)
set rd=##class(%Device).ReDirectIO($$$NO)
w $c(7),*-3 // ..ConstClientReadChar
read header#5:timeout
read data:timeout
set data = $$PrepareInput($ASCII($EXTRACT(data,1,1)))
do ##class(%Device).ReDirectIO(rd)
quit data
]]></Implementation>
</Method>
<Method name="OnPreServer">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[ quit $$$OK
]]></Implementation>
</Method>
<Method name="Debug">
<ClassMethod>1</ClassMethod>
<FormalSpec>data:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[ set ^debug($I(^debug)) = $ZTIMESTAMP _ ": " _ data
]]></Implementation>
</Method>
<Method name="OnPostServer">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[ quit $$$OK
]]></Implementation>
</Method>
<Method name="GetJSAutocompleteFilePath">
<FormalSpec>namespace:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
set data = ##class(%Library.File).ManagerDirectory()
set data = ##class(%Library.File).ParentDirectoryName(data)
set data = data _ "CSP\sys\webTerminal\js\autocomplete\" _
$REPLACE(namespace,"%","_") _ ".js" // UNIX?
quit data
]]></Implementation>
</Method>
<Method name="WriteToFile">
<FormalSpec>filename:%String,data:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set file=##class(%File).%New(filename)
do file.Open("WSN")
do file.WriteLine(data)
do file.Close()
]]></Implementation>
</Method>
<Method name="GenerateAutocompleteFile">
<FormalSpec>namespace:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
set filename = ..GetJSAutocompleteFilePath($NAMESPACE)
do ..StartClearIO()
if ('##class(%SYS.Namespace).Exists($REPLACE(namespace,"_","%"))) {
do ..EndClearIO()
do ..SendData("Wrong namespace name: " _ namespace)
quit $$$NOTOK
}
set namespace = $REPLACE(namespace,"%","_")
if (##class(%File).Exists(filename)) {
do ..EndClearIO()
do ..SendData(namespace, ..ConstClientLoadAutocomplete)
quit $$$OK
} elseif ('##class(%File).DirectoryExists(##class(%File).GetDirectory(filename))) {
// try to create missed directory
set result = ##class(%File).CreateDirectoryChain(##class(%File).GetDirectory(filename))
if (result '= 1) {
do ..EndClearIO()
do ..SendData("Autocomplete fail: can't create directory js/autocomplete.")
quit $$$OK
}
set filename = ..GetJSAutocompleteFilePath(namespace)
}
do ..SendData("Generating language file for " _ namespace _ ", pleace, wait.")
// write empty file in case of other terminal applications may require it
do ..WriteToFile(filename,"{}")
// get all classes names
set result = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:Summary")
do result.Execute()
/*
The next COULD BE IMPROVED FOR SPEED, I beleive.
Generates compressed JSON string of type:
{
"%ClassName1": {
"methodName": 0,
"propertyName": 0,
"parameterName": 0,
...
},
"ClassName2": {
...
}
}
*/
// final data generation
set data = "{"
set first = ""
while (result.Next()) { // forming autocomplete for each class
set className = result.Data("Name")
set data = data _ first _ """" _ className _ """:{"
if (first = "") set first = ","
set cdefs = ##class(%Dictionary.ClassDefinition).%OpenId(className)
set countMethods = cdefs.Methods.Count()
set countParameters = cdefs.Parameters.Count()
set countProperties = cdefs.Properties.Count()
set total = countMethods + countParameters + countProperties
set current = 0
for i=1:1:countMethods {
set current = current + 1
set data = data _ """" _cdefs.Methods.GetAt(i).Name _ """:0"
if (current'=total) set data = data _ ","
}
for i=1:1:countProperties {
set current = current + 1
set data = data _ """" _cdefs.Properties.GetAt(i).Name _ """:0"
if (current'=total) set data = data _ ","
}
for i=1:1:countParameters {
set current = current + 1
set data = data _ """" _cdefs.Parameters.GetAt(i).Name _ """:0"
if (current'=total) set data = data _ ","
}
set data = data _ "}"
}
set data = data _ "}"
do ..WriteToFile(filename,data)
do ..SendData($c(10)_"Language file for " _ namespace _ " classes created.")
do ..EndClearIO()
do ..SendData(namespace,..ConstClientLoadAutocomplete)
quit $$$OK
]]></Implementation>
</Method>
<Method name="GenerateAuthKey">
<Description>
Generating new authorization key</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
set temp = $SYSTEM.Util.CreateGUID()
set ^%WebTerminal.Engine.AuthorizationKey = temp
]]></Implementation>
</Method>
<Method name="GetAuthKey">
<Description>
Returns key for client authorization.
If the key is empty, generates new key value.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
if ($get(^%WebTerminal.Engine.AuthorizationKey) = "") {
Do ..GenerateAuthKey()
}
quit ^%WebTerminal.Engine.AuthorizationKey
]]></Implementation>
</Method>
<Method name="SendData">
<Description>
Function sends data derectly to server with specified action</Description>
<FormalSpec>query:%String="",action:%String=""</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
if (action = "") { set action = ..ConstClientOutputMessage }
do ..Write(action _ query) // using CTWPv3
]]></Implementation>
</Method>
<Method name="ExecuteSQL">
<FormalSpec>query:%String=""</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set io = $io
use io::("^" _ ..InitialZName)
do ..StartClearIO()
do ##class(%Device).ReDirectIO($$$YES)
set tStatement = ##class(%SQL.Statement).%New()
set qStatus = tStatement.%Prepare(query)
if qStatus'=1 {
write "SQL prepare error: ",$System.Status.DisplayError(qStatus)
} else {
set rset = tStatement.%Execute()
do rset.%Display()
}
do ##class(%Device).ReDirectIO($$$NO)
do ..EndClearIO()
use io
quit $$$OK
]]></Implementation>
</Method>
<Method name="ClientAlertNamespace">
<Description>
Sends to client new namespace if last was changed</Description>
<Implementation><![CDATA[
if (..CurrentNamespace '= $Znspace) { // change client namespace
set ..CurrentNamespace = $Znspace
do ..SendData(..CurrentNamespace,..ConstClientChangeNamespace)
}
]]></Implementation>
</Method>
<Method name="StartClearIO">
<Description>
Starts clear I/O mode</Description>
<Implementation><![CDATA[ do ..Write(..ConstClientEnterClearIO)
]]></Implementation>
</Method>
<Method name="EndClearIO">
<Description>
Ends clear I/O mode</Description>
<Implementation><![CDATA[ do ..SendData("exit",..ConstClientExitClearIO)
]]></Implementation>
</Method>
<Method name="ExecuteCommand">
<Description>
The heart of terminal application</Description>
<FormalSpec>query:%String=""</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
if (query = "") quit $$$OK
#dim exception as %Exception.AbstractException
set value = $Replace(query,$CHAR(10)," ")
do ..StartClearIO() // execute session start
set $ZERROR = ""
set io = $io
use io::("^" _ ..InitialZName)
USE io:(::"+T")
do ##class(%Device).ReDirectIO($$$YES)
try { xecute value } catch exception {
set $ZERROR = exception.DisplayString()
}
do ##class(%Device).ReDirectIO($$$NO)
use io:(::"-T")
if ($ZERROR '= "") {
do ..SendData($ZERROR)
}
do ..EndClearIO() // execute session end
do ..ClientAlertNamespace()
quit $$$OK
]]></Implementation>
</Method>
<Method name="RequireAuthorization">
<Description>
This method holds process and expects only one package from
the client - it includes authorization key.</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set key = ..Read(,.status) // wait for package
set realKey = ..GetAuthKey() // remember current auth key
do ..GenerateAuthKey() // generate new auth key
if (key = realKey) {
quit $$$OK
}
quit $$$NOTOK
]]></Implementation>
</Method>
<Method name="ClientLoop">
<Description><![CDATA[
Main method for every new client.
Authorization process description:
1. Client requests cache server page called "WebTerminal.csp";
2. Server return this page with ClassMethod GetAuthKey() value;
3. After client receives page, it performs websocket connection;
to same web-resource, but with next URL changes:
"http://" -> "ws://", "WebTerminal.csp" -> "Webterminal.Engine.cls";
4. After connection established, client sends his AuthKey to server
and removes it locally (because it needed only one time);
5. Server compares again received key with ..GetAuthKey() value and
grants permission, if keys are equal.
>> As a result - there is no way to autorize via websocket without
accessing WebTerminal.csp.
Method description:
First, method requires from client
a key, which will be compared with ..GetAuthKey() (global). If
succeeded, method sets "authorized" flag to true and changes global
key with ..GenerateAuthKey() for the next client.]]></Description>
<FormalSpec>clientID:%Numeric</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
kill // clear junk vars
for {
set data = ..Read(,.status)
if $$$ISERR(status) {
do ..Debug($$$CSPWebSocketClosed)
do ..SendData("Error occured while reading data.",
..ConstClientOutputMessage)
quit:($$$GETERRORCODE(status)=$$$CSPWebSocketClosed)
}
set action = $EXTRACT(data, 1, 1)
set data = $EXTRACT(data, 2, *)
if (action = ..ConstServerActionExecute) { // autorized
do ..ExecuteCommand(data)
} elseif (action = ..ConstServerActionExecuteSQL) { // sql
do ..ExecuteSQL(data)
} elseif (action = ..ConstServerActionGenerateAutocomplete) {
do ..GenerateAutocompleteFile(data)
} else { // something scary
do ..SendData("Unrecognised action: " _ action)
}
}
]]></Implementation>
</Method>
<Method name="Server">
<Description>
New connection established</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set ..lastClientId = ..lastClientId + 1
if ($$$ISOK(..RequireAuthorization())) {
set ..InitialZName = $Zname
do ..SendData("Terminal remote ready. Welcome.")
zn "%SYS"
set ..CurrentNamespace = $Znspace
do ..SendData(..CurrentNamespace,..ConstClientChangeNamespace)
do ..ClientLoop(..lastClientId)
} else {
do ..SendData("Welcome, mr. Hacker!")
do ..EndServer()
}
do ..SendData("Terminal session ended. Goodbye.")
quit $$$OK
]]></Implementation>
</Method>
</Class>
<CSP name="WebTerminal/css/base.css" application="/csp/sys/" default="1"><![CDATA[
html {
position: relative;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
body {
padding: 20px;
margin: 0;
color: white;
font-family: FreeMono, monospace;
font-size: 16px;
background: url("../img/back.png") black;
}
.hidden { display: none; }
.center { text-align: center; }
.bold { font-weight: 900; }
.noMargin { margin: 0 }
.noPadding { padding: 0 }
table {
padding: 0;
border: 0;
background: none;
}
tr, td {
padding: 2px;
margin: 0;
border: 0;
border-spacing: 0;
}
terminal-base tr, td {
padding: 0 6px 6px 6px;
margin: 0;
border: 0;
border-spacing: 0;
}
.noAnimations {
transition: none !important;
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
}]]></CSP>
<CSP name="WebTerminal/css/extra.css" application="/csp/sys/" default="1"><![CDATA[
@-webkit-keyframes blinker {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@-o-keyframes blinker {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@-moz-keyframes blinker {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@keyframes blinker {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@keyframes waiting {
0% { color: orange; }
50% { color: white; }
100% { color: orange; }
}
@-moz-keyframes waiting {
0% { color: orange; }
50% { color: white; }
100% { color: orange; }
}
@-o-keyframes waiting {
0% { color: orange; }
50% { color: white; }
100% { color: orange; }
}
@-webkit-keyframes waiting {
0% { color: orange; }
50% { color: white; }
100% { color: orange; }
}
#caret {
position: relative;
display: inline-block;
width: 0;
vertical-align: bottom;
overflow: visible;
animation: blinker infinite 1s;
-webkit-animation: blinker infinite 1s;
-o-animation: blinker infinite 1s;
-moz-animation: blinker infinite 1s;
}
#caret:after {
content: "_";
}
.waiting {
animation: waiting infinite 1s;
-webkit-animation: waiting infinite 1s;
-o-animation: waiting infinite 1s;
-moz-animation: waiting infinite 1s;
}
.animated01 {
transition: all 0.1s ease-out;
-moz-transition: all 0.1s ease-out;
-o-transition: all 0.1s ease-out;
-webkit-transition: all 0.1s ease-out;
}]]></CSP>
<CSP name="WebTerminal/css/terminal.css" application="/csp/sys/" default="1"><![CDATA[
.terminal-base {
position: relative;
}
.terminal-output-block {
position: relative;
overflow: hidden;
display: block;
}
.terminal-inputContainer {
position: relative;
overflow: hidden;
}
.terminal-outputContainer {
position: relative;
overflow: hidden;
}
.terminal-message-body {
position: relative;
overflow: hidden;
}
.terminal-output-body {
white-space: pre;
word-wrap: break-word;
}
.terminal-message-head {
display: inline-block;
float: left;
}
.terminal-message-head:after {
content: " >";
margin-right: 10px;
}
.terminal-input-visible {
min-height: 1em;
white-space: pre;
word-wrap: break-word;
}
/* fix white-space when \n is last */
.terminal-input-visible:after {
content: " ";
}
/* textarea block */
.terminal-input-hidden {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: none;
outline: none;
text-decoration: none;
overflow: hidden;
background: none;
font: inherit;
color: rgba(0,0,0,0);
resize: none;
word-wrap: break-word;
white-space: pre;
}
.terminal-suggestion {
color: gray;
}
/* control panel */
#terminal-control-panel {
position: fixed;
left: 0;
top: -100%;
width: 100%;
height: 100%;
z-index: 1000;
background: rgba(40,40,40,0.95);
color: white;
transition: top 0.2s ease;
-webkit-transition: top 0.2s ease;
-o-transition: top 0.2s ease;
-moz-transition: top 0.2s ease;
}
.terminal-control-content {
position: relative;
margin: 20px;
}
#terminal-control-table {
width: 100%;
}
#terminal-control-table > tbody > tr > td:first-child {
color: #dadada;
font-size: 1.3em;
font-weight: 900;
padding-right: 20px;
white-space: nowrap;
padding-bottom: 20px;
}
#terminal-control-table > tbody > tr:first-child {
height: 50px;
}
#terminal-control-table > tbody > tr > td:last-child {
padding: 0;
vertical-align: top;
}]]></CSP>
<CSP name="WebTerminal/css/theme-default.css" application="/csp/sys/" default="1"><![CDATA[
.syntax-write, .syntax-w, .syntax-do, .syntax-set, .syntax-s, .syntax-quit, .syntax-kill,
.syntax-close, .syntax-zw, .syntax-zwrite, .syntax-break, .syntax-catch, .syntax-read
.syntax-continue, .syntax-goto, .syntax-halt, .syntax-hang, .syntax-job, .syntax-kill,
.syntax-lock, .syntax-merge, .syntax-new, .syntax-open, .syntax-return, .syntax-tcommit,
.syntax-throw, .syntax-trollback, .syntax-tstart, .syntax-use, .syntax-view, .syntax-xecute,
.syntax-zkill, .syntax-znspace, .syntax-ztrap, .syntax-zzdump, .syntax-zzwrite, .syntax-d,
.syntax-zn, .syntax-h, .syntax-read, .syntax-r
{ color: #29cfe9; font-weight: 900; }
.syntax-for, .syntax-while, .syntax-if, .syntax-else, .syntax-elseif, .syntax-try,
.syntax-catch
{ color: #ff00fe; }
.syntax-help, .syntax-clear, .syntax-connect, .syntax-disconnect, .syntax-define, .syntax-siege
{ color: #e2dc00; }
.syntax-select, .syntax-from, .syntax-where, .syntax-join, .syntax-into
{ color: #f34800; }
/* Syntax highlighter styles. Required: parser.js */
.syntax-_digit { color: #00ff89; } /* 6006 */
.syntax-_symbol { color: #82fffa; } /* +*-/=,!_'#?\ */
.syntax-_bracket { color: #82fffa; } /* {}[]() */
.syntax-_string { color: #26e500; } /* "test" */
.syntax-_function { color: #9291ff; } /* $LENGTH */
.syntax-_userFunction { color: #cea3ff; } /* $$MY */
.syntax-_macro { color: #cb64ff; } /* $$$test */
.syntax-_sysMacro { color: #ff00fe; } /* ##test */
.syntax-_classProp { color: #0091ff; } /* ..test */
.syntax-_global { color: #ff5156; } /* ^test */
.syntax-_other { color: #82fffa; } /* html-escaped symbols, unrecognised */
.warning { color: #ffa500 }
.hint { color: #84C200 }
.error { color: #ff0000 }
.info { color: #fffd7c }
.executed { color: #34ff00 }
.complete { color: #a9ff30 }]]></CSP>
<CSP name="WebTerminal/css/theme-studio.css" application="/csp/sys/" default="1"><![CDATA[
body {
background: white;
color: black;
}
.syntax-write, .syntax-w, .syntax-do, .syntax-set, .syntax-s, .syntax-quit, .syntax-kill,
.syntax-close, .syntax-zw, .syntax-zwrite, .syntax-break, .syntax-catch, .syntax-read
.syntax-continue, .syntax-goto, .syntax-halt, .syntax-hang, .syntax-job, .syntax-kill,
.syntax-lock, .syntax-merge, .syntax-new, .syntax-open, .syntax-return, .syntax-tcommit,
.syntax-throw, .syntax-trollback, .syntax-tstart, .syntax-use, .syntax-view, .syntax-xecute,
.syntax-zkill, .syntax-znspace, .syntax-ztrap, .syntax-zzdump, .syntax-zzwrite, .syntax-d,
.syntax-zn, .syntax-h, .syntax-read, .syntax-r
{ color: #0000ff; font-weight: 900; }
.syntax-for, .syntax-while, .syntax-if, .syntax-else, .syntax-elseif, .syntax-try,
.syntax-catch
{ color: #0000ff; }
.syntax-help, .syntax-clear, .syntax-connect, .syntax-disconnect, .syntax-define, .syntax-siege
{ color: #e2dc00; }
.syntax-select, .syntax-from, .syntax-where, .syntax-join, .syntax-into
{ color: #000000; }
/* Syntax highlighter styles. Required: parser.js */
.syntax-_digit { color: #000000; } /* 6006 */
.syntax-_symbol { color: #000000; } /* +*-/=,!_'#?\ */
.syntax-_bracket { color: #000000; } /* {}[]() */
.syntax-_string { color: #008000; } /* "test" */
.syntax-_function { color: #0000ff; } /* $LENGTH */
.syntax-_userFunction { color: #0000ff; } /* $$MY */
.syntax-_macro { color: #0000ff; } /* $$$test */
.syntax-_sysMacro { color: #0000ff; } /* ##test */
.syntax-_classProp { color: #0000ff; } /* ..test */
.syntax-_global { color: #000000; } /* ^test */
.syntax-_other { color: #000000; } /* html-escaped symbols, unrecognised */
.warning { color: #a56800 }
.hint { color: #127a00 }
.error { color: #ff0000 }
.info { color: #fffd7c }
.executed { color: #127a00 }
.complete { color: #127a00 }
]]></CSP>
<CSPBase64 name="WebTerminal/favicon.ico" application="/csp/sys/" default="1">
AAABAAEAEBAAAAAAAABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA
AAAAAAD///8BAAAABQAAABEAAAAJAAAAAwAAAAMAAAAD////Af///wH///8B////Af///wH///8B
////Af///wH///8B////AQAAAAcAAAAVLyoiXzcxJa09NijfPjcp4YiHhcWbm5ypioqLhWtrbF8v
Ly85AAAAIQAAAAP///8B////AXt7fBGFhYZHiomLRXFua0FEPzNPOjMkY1dSSceqqqr/vLy9/7a2
t/+vr7D/kZGS4wAAABkAAAAbAAAAFf///wGXlZKPq6qg57GtlK2vqIqjsaySt6+qlcOvr5/1t7es
/76+t//GxsT/zMzM98fIyIW8vLxDwcHBKY6Njg////8BioZ8j5aTjpkUERGjHRIS4SIVFM8oGRa9
Mh8ZrUc0KatfTT2tdWROsYZ1XauciHGVt6aQl7uwnp/GxLPRuLi2gYyIfo+XlJCZCQgIzQAAAP8A
AAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8IBgX/Eg8O5bOwpXuOi4CPmZaSmQgI
B80AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wICAfGqqKB3kY2C
j5yZlJkIBwfNAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8FBATt
paKcd5SQhY+em5eZCAcHzQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wUFBf8a
Ghr/Li0s65+dl3WXk4iPop+amQgHB80AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AQEB/xIS
Ev8mJib/MjIy/zk3NumamJJ1m5eMj6WinZkHBwfPXV1d/wcHB/9PT0//V1dX/0tLS/8AAAD/BQUF
/xkZGf8nJyf/MjIy/zw8PP9CPz3nlJKNdZ+bj5GopZ+ZBwcHz25ubv+qqqr/ODg4/zg4OP8pKSn/
CAgI/xwcHP8oKCj/MzMz/zw8PP9DQ0P/SENB55COiXOin5KRq6iimQcHBs9gYGD/m5ub/wAAAP8A
AAD/DQ0N/x0dHf8oKCj/MzMz/z09Pf9DQ0P/R0dH/0pFQ+WMioVzpaGUkaunoZ8ICAjPc3Nz/wcH
B/0GBgb1FBMT7x4eHecqKSfhNTMx3T89OttIRUHZT0xH2VVSTNtwbWTflZOQibKwrYe4tanplpGC
s4uDcamblIOto52Ot6Gcj7+fmo69nZmNs5qWi6mVkombjoyFjYaFgH9/f3xxfXx9Y3t8fi+npqYb
sbKyU7m4uE2/v787srKxKY+OjxdtbW0H////Af///wH///8B////Af///wH///8B////Af///wH/
//8B//8AAPA/AAD8DwAAAA8AAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAA
AAAADwAA//8AAA==
</CSPBase64>
<CSPBase64 name="WebTerminal/img/back.png" application="/csp/sys/" default="1">
iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB
NmlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarY6xSsNQFEDPi6LiUCsEcXB4kygotupgxqQt
RRCs1SHJ1qShSmkSXl7VfoSjWwcXd7/AyVFwUPwC/0Bx6uAQIYODCJ7p3MPlcsGo2HWnYZRhEGvV
bjrS9Xw5+8QMUwDQCbPUbrUOAOIkjvjB5ysC4HnTrjsN/sZ8mCoNTIDtbpSFICpA/0KnGsQYMIN+
qkHcAaY6addAPAClXu4vQCnI/Q0oKdfzQXwAZs/1fDDmADPIfQUwdXSpAWpJOlJnvVMtq5ZlSbub
BJE8HmU6GmRyPw4TlSaqo6MukP8HwGK+2G46cq1qWXvr/DOu58vc3o8QgFh6LFpBOFTn3yqMnd/n
4sZ4GQ5vYXpStN0ruNmAheuirVahvAX34y/Axk/96FpPYgAAACBjSFJNAAB6JQAAgIMAAPn/AACA
6AAAUggAARVYAAA6lwAAF2/XWh+QAAAAGElEQVR42mJQVlJkQAZQPoQCAAAA//8DABISATPXp3mc
AAAAAElFTkSuQmCC
</CSPBase64>
<CSP name="WebTerminal/index.csp" application="/csp/sys/" default="1"><![CDATA[
<!DOCTYPE html>
<html>
<head>
<title>Remote Caché terminal</title>