|
@@ -43,15 +43,47 @@ def index():
|
43
|
43
|
# r'''
|
44
|
44
|
@app.route('/shared_libs/<path:path>')
|
45
|
45
|
def send_report2(path):
|
|
46
|
+ p("?????")
|
|
47
|
+ # p("?????")
|
46
|
48
|
return flask.send_file('../js_client/jquery-3.5.1.min.js')
|
47
|
49
|
|
|
50
|
+@app.route('/viewsrc2/<path:path>')
|
|
51
|
+def view_src2(path):
|
|
52
|
+ p(">>>>>>>>>>>>>>>>>>>>????????",path)
|
|
53
|
+ # return flask.send_from_directory('templates', path)
|
|
54
|
+ # open()
|
|
55
|
+
|
|
56
|
+ with open(r"../js_client/" + path, "r") as file:
|
|
57
|
+ ftxt = file.read()
|
|
58
|
+ # r["is_template"] = is_template_ftxt(ftxt)
|
|
59
|
+
|
|
60
|
+ # ret= flask.send_from_directory(r"../js_client", path)
|
|
61
|
+ # p("view_src",type(ret),ret)
|
|
62
|
+
|
|
63
|
+ return "<plaintext>" + ftxt + "</plaintext>"
|
|
64
|
+ return "<xmp>" + ftxt + "</xmp>"
|
|
65
|
+ return "<code>" + ftxt + "</code>"
|
|
66
|
+ return "<pre><code>" + ftxt + "</code></pre>"
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
48
|
70
|
@app.route('/<path:path>')
|
49
|
71
|
def send_report(path):
|
|
72
|
+ p("????,...",path)
|
50
|
73
|
# return flask.send_from_directory('templates', path)
|
51
|
74
|
return flask.send_from_directory(r"../js_client", path)
|
52
|
75
|
return flask.send_from_directory('./', path)
|
53
|
76
|
# '''
|
54
|
77
|
|
|
78
|
+@app.route('/viewsrc/<path:path>')
|
|
79
|
+def view_src(path):
|
|
80
|
+ p(">>>>>>>>>>>>>>>>>>>>????????")
|
|
81
|
+ # return flask.send_from_directory('templates', path)
|
|
82
|
+ ret= flask.send_from_directory(r"../js_client", path)
|
|
83
|
+ p("view_src",ret)
|
|
84
|
+ return ret
|
|
85
|
+
|
|
86
|
+
|
55
|
87
|
|
56
|
88
|
@sock.route('/echo')
|
57
|
89
|
def echo(sock):
|
|
@@ -70,6 +102,7 @@ def echo_all(sock):
|
70
|
102
|
gmod.gx.send_to_channel("echo_all",data,"sender")
|
71
|
103
|
|
72
|
104
|
|
|
105
|
+
|
73
|
106
|
# @sock.route('/echo_c1')
|
74
|
107
|
# def echo_coll(sock):
|
75
|
108
|
# p("echo_coll app")
|
|
@@ -101,9 +134,9 @@ for en in dir(app):
|
101
|
134
|
print("~",en)
|
102
|
135
|
'''
|
103
|
136
|
|
|
137
|
+import inspect
|
104
|
138
|
|
105
|
|
-
|
106
|
|
-
|
|
139
|
+p(inspect.getsource(app.route))
|
107
|
140
|
|
108
|
141
|
|
109
|
142
|
|
|
@@ -121,10 +154,12 @@ def list_directory():
|
121
|
154
|
# Create an HTML string with the list of items as links
|
122
|
155
|
html_content = "<h1>Contents of the Directory</h1><ul>"
|
123
|
156
|
html_links = ""
|
|
157
|
+ html_src_links = ""
|
124
|
158
|
other_links = ""
|
125
|
159
|
for item in items:
|
126
|
160
|
p([item])
|
127
|
161
|
if "html" in item:
|
|
162
|
+ html_src_links += f"<li><a href='viewsrc2/{item}'>src:{item}</a></li>"
|
128
|
163
|
html_links += f"<li><a href='{item}'>{item}</a></li>"
|
129
|
164
|
else:
|
130
|
165
|
other_links += f"<li><a href='{item}'>{item}</a></li>"
|
|
@@ -132,6 +167,11 @@ def list_directory():
|
132
|
167
|
html_content+=html_links
|
133
|
168
|
html_content+="<br>"
|
134
|
169
|
html_content+=other_links
|
|
170
|
+ html_content+="<br>"
|
|
171
|
+ html_content+="VIEW SRC: its actually < pre >"
|
|
172
|
+ html_content+="<br>"
|
|
173
|
+ html_content+="<br>"
|
|
174
|
+ html_content+=html_src_links
|
135
|
175
|
html_content += "</ul>"
|
136
|
176
|
|
137
|
177
|
# Return the HTML content directly
|
|
@@ -155,7 +195,8 @@ if __name__ == '__main__':
|
155
|
195
|
pass
|
156
|
196
|
# socketio.run(app, debug=True)
|
157
|
197
|
# app.run(debug=True,host='0.0.0.0')
|
158
|
|
- app.run(debug=True,host='0.0.0.0')
|
|
198
|
+ # app.run(debug=True,host='0.0.0.0',port="5001")
|
|
199
|
+ app.run(debug=True,host='0.0.0.0',port="5000")
|
159
|
200
|
# sock.run(app,host='0.0.0.0', debug=True,allow_unsafe_werkzeug=True)
|
160
|
201
|
|
161
|
202
|
|