Skip to content

Commit 01efec6

Browse files
🔥 /update command fix, autoupdate available from CWT v2.0.0-beta.7
1 parent c27efaf commit 01efec6

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

classes/%WebTerminal.Engine.cls

+4-29
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ Method Update(version) As %Status
701701
set httprequest = ##class(%Net.HttpRequest).%New()
702702
set httprequest.Server = "intersystems-ru.github.io"
703703
do ..SendData("34", ..ConstClientOutputLocalized)
704-
do ..SendData("http://intersystems-ru.github.io/webterminal/files/WebTerminal-"
704+
do ..SendData(" http://intersystems-ru.github.io/webterminal/files/WebTerminal-"
705705
_ version _ ".xml ")
706706
do httprequest.Get("/webterminal/files/WebTerminal-" _ version _ ".xml")
707707
if (httprequest.HttpResponse.StatusCode '= 200) {
@@ -712,35 +712,10 @@ Method Update(version) As %Status
712712
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m")
713713
if ($isobject(httprequest.HttpResponse.Data)) {
714714
do ..SendData($C(13,10))
715-
set data = ""
716-
set path = ##class(%Library.File).SubDirectoryName(
717-
##class(%Library.File).ManagerDirectory(), "temp"
718-
)
719-
set filepath = ##class(%Library.File).SubDirectoryName(
720-
path, "terminal_update.temp.xml"
721-
)
722715
do ..SendData("35", ..ConstClientOutputLocalized)
723-
do ..SendData($C(13, 10))
724-
set file = ##class(%File).%New(filepath)
725-
do file.Open("W")
726-
do file.CopyFrom(httprequest.HttpResponse.Data)
727-
do file.Close()
728-
do ..SendData("36", ..ConstClientOutputLocalized)
729-
do ..SendData($C(13, 10))
730-
set error = 0
731-
do ..StartClearIO()
732-
do $System.OBJ.ImportDir(path, "terminal_update.temp.xml", "ckbud", .error, 1)
733-
do ..EndClearIO()
734-
if (error = 0) {
735-
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m" _ $C(13,10))
736-
} else {
737-
do ..SendData($C(27)_"[31mFAIL" _ $C(27) _ "[0m" _ $C(13,10))
738-
}
739-
do ..SendData("37", ..ConstClientOutputLocalized)
740-
if (##class(%Library.File).Delete(filepath) = 1) {
741-
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m" _ $C(13,10))
742-
} else {
743-
do ..SendData($C(27)_"[31mFAIL" _ $C(27) _ "[0m" _ $C(13,10))
716+
do $system.OBJ.LoadStream(httprequest.HttpResponse.Data,"",.error,.items)
717+
if (error) {
718+
do ..SendData($C(27)_"[31mFAILED" _ $C(27) _ "[0m" _ $C(13,10))
744719
quit $$$NOTOK
745720
}
746721
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"title": "Cache WEB Terminal",
44
"description": "Web-based terminal emulator for Caché administering.",
55
"author": "ZitRo",
6-
"version": "2.0.0-beta.6",
7-
"releaseNumber": "8",
6+
"version": "2.0.0-beta.7",
7+
"releaseNumber": "9",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/intersystems-ru/webterminal.git"

webSource/js/TerminalLocalization.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ var TerminalLocalization = function (TERMINAL) {
258258
ru: "Запрос"
259259
},
260260
35: {
261-
en: "Reading file...",
262-
ru: "Чтение файла..."
261+
en: "Updating terminal... Connection will be lost, so just reload terminal.",
262+
ru: "Обновление терминала... Соединение будет разорвано, потому просто перезагрузите терминал."
263263
},
264-
36: {
264+
36: { // free
265265
en: "Importing and compiling files...",
266266
ru: "Импортирование и компиляция файлов..."
267267
},
268-
37: {
268+
37: { // free
269269
en: "Clearing temporary files...",
270270
ru: "Очистка временных файлов..."
271271
},

0 commit comments

Comments
 (0)