8
8
</ head >
9
9
< body >
10
10
< h3 class ="m-3 "> Pyarmor Sandbox</ h3 >
11
+ < button class ="btn btn-light btn-sm mx-3 zh "> 中文</ button >
11
12
12
13
< div class ="p-3 ">
13
14
< div class ="form-floating mb-3 ">
14
15
< input type ="text "
15
16
class ="form-control "
16
17
id ="scriptName "
17
- placeholder ="foo.py ">
18
+ value ="foo.py ">
18
19
< label for ="scriptName "> Script Name</ label >
19
20
</ div >
20
21
< div class ="form-floating mb-3 ">
@@ -41,29 +42,144 @@ <h3 class="m-3">Pyarmor Sandbox</h3>
41
42
Enable Freethreading
42
43
</ label >
43
44
</ div >
44
- < div class ="mb-3 " role ="group ">
45
+ < div class ="build-action-group mb-3 " role ="group ">
45
46
< button type ="button "
47
+ data-bs-toggle ="modal "
48
+ data-bs-target ="#resultModal "
49
+ data-bs-whatever ="rft "
46
50
class ="btn btn-light ">
47
51
Build RFT Script
48
52
</ button >
49
53
< button type ="button "
54
+ data-bs-toggle ="modal "
55
+ data-bs-target ="#resultModal "
56
+ data-bs-whatever ="mini "
50
57
class ="btn btn-light ">
51
58
Build Mini Script
52
59
</ button >
53
60
< button type ="button "
61
+ data-bs-toggle ="modal "
62
+ data-bs-target ="#resultModal "
63
+ data-bs-whatever ="mini-rft "
54
64
class ="btn btn-light ">
55
65
Build Mini+RFT Script
56
66
</ button >
57
67
</ div >
58
68
< div class ="form-floating mb-3 ">
59
69
< textarea class ="form-control "
60
- placeholder ="Leave a comment here "
61
70
id ="scriptContent "
62
- style ="height: 30rem "> </ textarea >
71
+ max-length ="8096 "
72
+ min-length ="1 "
73
+ style ="height: 30rem "> print('Hello world!')</ textarea >
63
74
< label for ="scriptContent "> Script(maximum 8K)</ label >
64
75
</ div >
65
76
</ div >
66
77
78
+ < div class ="modal fade "
79
+ id ="resultModal "
80
+ tabindex ="-1 "
81
+ aria-labelledby ="resultModalLabel "
82
+ aria-hidden ="true ">
83
+ < div class ="modal-dialog ">
84
+ < div class ="modal-content ">
85
+ < div class ="modal-header ">
86
+ < h1 class ="modal-title fs-5 "
87
+ id ="resultModalLabel "> Building</ h1 >
88
+ < button type ="button "
89
+ class ="btn-close "
90
+ data-bs-dismiss ="modal "
91
+ aria-label ="Close "> </ button >
92
+ </ div >
93
+ < div class ="modal-body ">
94
+ < div class ="alert alert-primary d-flex align-items-center "
95
+ role ="alert ">
96
+ < div class ="spinner-border text-primary " role ="status ">
97
+ < span class ="visually-hidden "> Running ...</ span >
98
+ </ div >
99
+ < div class ="px-3 ">
100
+ It's building, please waiting for
101
+ < span id ="worktime " class ="px-2 "> 0</ span > seconds
102
+ </ div >
103
+ </ div >
104
+ < div class ="alert alert-primary d-flex align-items-center d-none "
105
+ role ="alert ">
106
+ Failed to generate the obfuscated scripts:
107
+ < span id ="errmsg " class ="px-2 "> </ span >
108
+ </ div >
109
+ < div class ="alert alert-primary d-none "
110
+ role ="alert ">
111
+ < p > The obfuscated script has been generated successfully
112
+ < a href ="# "
113
+ download ="foo.py "
114
+ class ="btn btn-info "> click here to download</ a >
115
+ </ p >
116
+ < hr >
117
+ < p >
118
+ Before run mini-script, please install this prerequsite < pre > pip install pyarmor.mini</ pre >
119
+ </ p >
120
+ </ div >
121
+ </ div >
122
+ < div class ="modal-footer ">
123
+ < button type ="button "
124
+ class ="btn btn-outline-secondary "
125
+ data-bs-dismiss ="modal ">
126
+ Close
127
+ </ button >
128
+ </ div >
129
+ </ div >
130
+ </ div >
131
+ </ div >
132
+
133
+ < div class ="modal fade "
134
+ id ="confirmModal "
135
+ aria-hidden ="true "
136
+ aria-labelledby ="comfirmModalToggleLabel "
137
+ tabindex ="-1 ">
138
+ < div class ="modal-dialog modal-dialog-centered ">
139
+ < div class ="modal-content ">
140
+ < div class ="modal-header ">
141
+ < h1 class ="modal-title fs-5 "
142
+ id ="confirmModalToggleLabel "> Confirmation</ h1 >
143
+ < button type ="button "
144
+ class ="btn-close "
145
+ data-bs-dismiss ="modal "
146
+ aria-label ="Close "> </ button >
147
+ </ div >
148
+ < div class ="modal-body ">
149
+ < div class ="alert alert-primary d-flex align-items-center "
150
+ role ="alert ">
151
+ It's generating obfuscated scripts now, are you sure to abort?
152
+ </ div >
153
+ </ div >
154
+ < div class ="modal-footer ">
155
+ < button class ="btn btn-light "
156
+ data-bs-target ="#resultModal "
157
+ data-bs-toggle ="modal ">
158
+ Still waiting
159
+ </ button >
160
+ < button type ="button "
161
+ class ="btn btn-light "
162
+ data-bs-dismiss ="modal "
163
+ aria-label ="Close ">
164
+ Abort and quit
165
+ </ button >
166
+ </ div >
167
+ </ div >
168
+ </ div >
169
+ </ div >
170
+
67
171
< script src ="../../assets/bootstrap-5.3.3/bootstrap.bundle.min.js "> </ script >
172
+ < script >
173
+ const msgdata = {
174
+ empty_script : "no content in script " ,
175
+ }
176
+ window . addEventListener ( "DOMContentLoaded" , ( ) => {
177
+ document . querySelector ( "button.zh" ) . addEventListener ( "click" , ( e ) => {
178
+ window . location . replace ( window . location . href . replace ( "/en/" , "/zh/" ) )
179
+ } )
180
+ } )
181
+ </ script >
182
+ < script src ="../client.js "> </ script >
183
+
68
184
</ body >
69
185
</ html >
0 commit comments