Skip to content

Commit

Permalink
🔥 /update command fix, autoupdate available from CWT v2.0.0-beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Apr 30, 2015
1 parent c27efaf commit 01efec6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 35 deletions.
33 changes: 4 additions & 29 deletions classes/%WebTerminal.Engine.cls
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Method Update(version) As %Status
set httprequest = ##class(%Net.HttpRequest).%New()
set httprequest.Server = "intersystems-ru.github.io"
do ..SendData("34", ..ConstClientOutputLocalized)
do ..SendData("http://intersystems-ru.github.io/webterminal/files/WebTerminal-"
do ..SendData(" http://intersystems-ru.github.io/webterminal/files/WebTerminal-"
_ version _ ".xml ")
do httprequest.Get("/webterminal/files/WebTerminal-" _ version _ ".xml")
if (httprequest.HttpResponse.StatusCode '= 200) {
Expand All @@ -712,35 +712,10 @@ Method Update(version) As %Status
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m")
if ($isobject(httprequest.HttpResponse.Data)) {
do ..SendData($C(13,10))
set data = ""
set path = ##class(%Library.File).SubDirectoryName(
##class(%Library.File).ManagerDirectory(), "temp"
)
set filepath = ##class(%Library.File).SubDirectoryName(
path, "terminal_update.temp.xml"
)
do ..SendData("35", ..ConstClientOutputLocalized)
do ..SendData($C(13, 10))
set file = ##class(%File).%New(filepath)
do file.Open("W")
do file.CopyFrom(httprequest.HttpResponse.Data)
do file.Close()
do ..SendData("36", ..ConstClientOutputLocalized)
do ..SendData($C(13, 10))
set error = 0
do ..StartClearIO()
do $System.OBJ.ImportDir(path, "terminal_update.temp.xml", "ckbud", .error, 1)
do ..EndClearIO()
if (error = 0) {
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m" _ $C(13,10))
} else {
do ..SendData($C(27)_"[31mFAIL" _ $C(27) _ "[0m" _ $C(13,10))
}
do ..SendData("37", ..ConstClientOutputLocalized)
if (##class(%Library.File).Delete(filepath) = 1) {
do ..SendData($C(27)_"[32mOK" _ $C(27) _ "[0m" _ $C(13,10))
} else {
do ..SendData($C(27)_"[31mFAIL" _ $C(27) _ "[0m" _ $C(13,10))
do $system.OBJ.LoadStream(httprequest.HttpResponse.Data,"",.error,.items)
if (error) {
do ..SendData($C(27)_"[31mFAILED" _ $C(27) _ "[0m" _ $C(13,10))
quit $$$NOTOK
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"title": "Cache WEB Terminal",
"description": "Web-based terminal emulator for Caché administering.",
"author": "ZitRo",
"version": "2.0.0-beta.6",
"releaseNumber": "8",
"version": "2.0.0-beta.7",
"releaseNumber": "9",
"repository": {
"type": "git",
"url": "https://github.com/intersystems-ru/webterminal.git"
Expand Down
8 changes: 4 additions & 4 deletions webSource/js/TerminalLocalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ var TerminalLocalization = function (TERMINAL) {
ru: "Запрос"
},
35: {
en: "Reading file...",
ru: "Чтение файла..."
en: "Updating terminal... Connection will be lost, so just reload terminal.",
ru: "Обновление терминала... Соединение будет разорвано, потому просто перезагрузите терминал."
},
36: {
36: { // free
en: "Importing and compiling files...",
ru: "Импортирование и компиляция файлов..."
},
37: {
37: { // free
en: "Clearing temporary files...",
ru: "Очистка временных файлов..."
},
Expand Down

0 comments on commit 01efec6

Please sign in to comment.