pywebexec 1.5.8__py3-none-any.whl → 1.5.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,6 @@ let outputInterval = null;
61
61
  let nextOutputLink = null;
62
62
  let fullOutput = '';
63
63
  let outputLength = 0;
64
- let title = null;
65
64
  let slider = null;
66
65
  let isPaused = false;
67
66
  const toggleButton = document.getElementById('toggleFetch');
@@ -73,6 +72,14 @@ function getTokenParam() {
73
72
  }
74
73
  const urlToken = getTokenParam();
75
74
 
75
+ function extractTitle(output) {
76
+ const titleindex = output.lastIndexOf('\x1b]0;');
77
+ if (titleindex < 0) return null;
78
+ const endindex = output.slice(titleindex+4).indexOf('\x07');
79
+ if (endindex < 0) return null;
80
+ return output.slice(titleindex+4, titleindex+4+endindex);
81
+ }
82
+
76
83
  async function fetchOutput(url) {
77
84
  if (isPaused) return;
78
85
  try {
@@ -102,11 +109,15 @@ async function fetchOutput(url) {
102
109
  }
103
110
  nextOutputLink = data.links.next;
104
111
  if (data.status != 'running') {
105
- title.innerText = `${data.status} ${title.innerText.split(' ').slice(1).join(' ')}`;
112
+ document.title = document.title.replace('[running]',`[${data.status}]`);
106
113
  clearInterval(outputInterval);
107
114
  toggleButton.style.display = 'none';
108
115
  } else {
109
116
  toggleButton.style.display = 'block';
117
+ const title = extractTitle(data.output);
118
+ if (title) {
119
+ document.title = `${title} - [running]`;
120
+ }
110
121
  }
111
122
  }
112
123
  } catch (error) {
@@ -130,7 +141,7 @@ async function viewOutput(command_id) {
130
141
  return;
131
142
  }
132
143
  const data = await response.json();
133
- title.innerText = `${data.status} ${data.command} ${data.params.join(' ')}`;
144
+ document.title = `${data.command} ${data.params.join(' ')} - [${data.status}]`;
134
145
  if (data.command == 'term')
135
146
  terminal.options.cursorInactiveStyle = 'outline';
136
147
  else
@@ -195,7 +206,6 @@ toggleButton.addEventListener('click', toggleFetchOutput);
195
206
 
196
207
  window.addEventListener('resize', adjustOutputHeight);
197
208
  window.addEventListener('load', () => {
198
- title = document.getElementById('outputTitle');
199
209
  slider = document.getElementById('outputSlider');
200
210
  slider.addEventListener('input', sliderUpdateOutput);
201
211
  const commandId = window.location.pathname.split('/').slice(-1)[0];
@@ -159,6 +159,14 @@ async function fetchCommands() {
159
159
  }
160
160
  }
161
161
 
162
+ function extractTitle(output) {
163
+ const titleindex = output.lastIndexOf('\x1b]0;');
164
+ if (titleindex < 0) return null;
165
+ const endindex = output.slice(titleindex+4).indexOf('\x07');
166
+ if (endindex < 0) return null;
167
+ return output.slice(titleindex+4, titleindex+4+endindex);
168
+ }
169
+
162
170
  async function fetchOutput(url) {
163
171
  if (isPaused) return;
164
172
  try {
@@ -190,6 +198,10 @@ async function fetchOutput(url) {
190
198
  toggleButton.style.display = 'none';
191
199
  } else {
192
200
  toggleButton.style.display = 'block';
201
+ /*const title = extractTitle(data.output);
202
+ if (title) {
203
+ document.title = title;
204
+ }*/
193
205
  }
194
206
  }
195
207
  } catch (error) {
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <link rel="icon" href="/static/images/favicon.svg" type="image/svg+xml">
6
- <title id="outputTitle">Command Output</title>
6
+ <title>Command Output</title>
7
7
  <link rel="stylesheet" href="/static/css/style.css">
8
8
  <link rel="stylesheet" href="/static/css/xterm.css">
9
9
  </head>
pywebexec/version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.5.8'
16
- __version_tuple__ = version_tuple = (1, 5, 8)
15
+ __version__ = version = '1.5.9'
16
+ __version_tuple__ = version_tuple = (1, 5, 9)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 1.5.8
3
+ Version: 1.5.9
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Home-page: https://github.com/joknarf/pywebexec
6
6
  Author: Franck Jouvanceau
@@ -1,6 +1,6 @@
1
1
  pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
2
  pywebexec/pywebexec.py,sha256=NmetF1ZQ7LsgmXDZwlwa2q05oXduVfh1AiOkKOu5HN8,28893
3
- pywebexec/version.py,sha256=bpyG2JPTJKDi28Mtx907aomd5KtqHfk_t3lAAZFZAGk,411
3
+ pywebexec/version.py,sha256=ylpxiWr4jebA2etznQR3gR_O42Lb5dOzM-BrUXQTJRA,411
4
4
  pywebexec/static/css/Consolas NF.ttf,sha256=DJEOzF0eqZ-kxu3Gs_VE8X0NJqiobBzmxWDGpdgGRxI,1313900
5
5
  pywebexec/static/css/style.css,sha256=OM-gJPLw0DcJwMgMXHDKc_9C87LYNu3bHssx_UtXi1Y,7273
6
6
  pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
@@ -18,8 +18,8 @@ pywebexec/static/images/resume.svg,sha256=99LP1Ya2JXakRCO9kW8JMuT_4a_CannF65Eiuw
18
18
  pywebexec/static/images/running.gif,sha256=iYuzQGkMxrakSIwt6gPieKCImGZoSAHmU5MUNZa7cpw,25696
19
19
  pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaOLQemmc,489
20
20
  pywebexec/static/js/commands.js,sha256=8JDb3Q55EJOYf2Q9Uy6qEuqAnn1oGjM0RndgQ4aOjqo,7725
21
- pywebexec/static/js/popup.js,sha256=xFO2ckFIXw9dEoVNsb-uLfAFq0CW5aCZ5ucnyNfXM9A,7464
22
- pywebexec/static/js/script.js,sha256=F9_blF91y9ieyki6aZFHU4cQ0_Y6RVSzL8dp1ejAcF0,15032
21
+ pywebexec/static/js/popup.js,sha256=8ttMa_aeH0yzTWiM1kzEfPwIR0YqlfesddaccJ1_5Fo,7838
22
+ pywebexec/static/js/script.js,sha256=hgQsO-U0WoiFJdSPb5TyBJxePC-CxYyMmQGZJ0e7PmA,15472
23
23
  pywebexec/static/js/xterm/LICENSE,sha256=EU1P4eXTull-_T9I80VuwnJXubB-zLzUl3xpEYj2T1M,1083
24
24
  pywebexec/static/js/xterm/addon-canvas.js,sha256=ez6QTVvsmLVNJmdJlM-ZQ5bErwlxAQ_9DUmDIptl2TM,94607
25
25
  pywebexec/static/js/xterm/addon-canvas.js.map,sha256=ECBA4B-BqUpdFeRzlsEWLSQnudnhLP-yPQJ8_hKquMo,379537
@@ -31,10 +31,10 @@ pywebexec/static/js/xterm/xterm.js,sha256=H5kaw7Syg-v5bmCuI6AKUnZd06Lkb6b92p8aqw
31
31
  pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCfN0U_OI6Zw,1118392
32
32
  pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  pywebexec/templates/index.html,sha256=XaT2IU7GcRj3iV-GmDPo8aghsYiUGxSH3kvPFzhaM2Y,2695
34
- pywebexec/templates/popup.html,sha256=NrOFx_Qy4wyYh14BiDD_WRnFURr_WvlvEu3cOGD5JO8,1319
35
- pywebexec-1.5.8.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
36
- pywebexec-1.5.8.dist-info/METADATA,sha256=4uirNpcA6_97b7TO9uYp9oD77el8lDAbbGZx9y91oOk,7801
37
- pywebexec-1.5.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
38
- pywebexec-1.5.8.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
39
- pywebexec-1.5.8.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
40
- pywebexec-1.5.8.dist-info/RECORD,,
34
+ pywebexec/templates/popup.html,sha256=CSNAVc4_aATG5oHX91BCOl30htMZpMxV4MJAwKXQ7i8,1302
35
+ pywebexec-1.5.9.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
36
+ pywebexec-1.5.9.dist-info/METADATA,sha256=53KDtj1as-Es3mPnbAKJ4_iXRYqhra7xZ6CN9AKlSqU,7801
37
+ pywebexec-1.5.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
38
+ pywebexec-1.5.9.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
39
+ pywebexec-1.5.9.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
40
+ pywebexec-1.5.9.dist-info/RECORD,,