Parcourir la source

Updated some buggy code in update function

AY Windows Host il y a 3 ans
Parent
commit
7f4e323adb
3 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 2 1
      mod/updates/internal.go
  2. 2 2
      system/update.json
  3. 1 0
      web/SystemAO/updates/index.html

+ 2 - 1
mod/updates/internal.go

@@ -4,6 +4,7 @@ import (
 	"archive/tar"
 	"compress/gzip"
 	"crypto/sha1"
+	"encoding/hex"
 	"errors"
 	"io"
 	"net/http"
@@ -115,7 +116,7 @@ func getSHA1Hash(filename string) (string, error) {
 	if _, err := io.Copy(h, f); err != nil {
 		return "", err
 	}
-	return string(h.Sum(nil)), nil
+	return hex.EncodeToString(h.Sum(nil)), nil
 }
 
 func readCheckSumFile(fileContent string, filename string, checksum string) bool {

+ 2 - 2
system/update.json

@@ -2,7 +2,7 @@
     "Vendor": "ArozOS Github",
     "binary": {
         "windows": {
-            "amd64": "https://github.com/tobychui/arozos/releases/latest/download/arozos_windows_amd64.exe",
+            "amd64": "https://jenkins.alanyeung.co/job/arozos/lastSuccessfulBuild/artifact/arozos_windows_amd64.exe",
             "arm": "",
             "arm64": "",
             "i386": ""
@@ -25,6 +25,6 @@
             "i386": ""
         }
     },
-    "webpack": "https://github.com/tobychui/arozos/releases/latest/download/web.tar.gz",
+    "webpack": "https://jenkins.alanyeung.co/job/arozos/lastSuccessfulBuild/artifact/web.tar.gz",
     "checksum": "https://jenkins.alanyeung.co/job/arozos/lastSuccessfulBuild/artifact/arozos_file_checksum.sha1"
 }

+ 1 - 0
web/SystemAO/updates/index.html

@@ -310,6 +310,7 @@
                     hideAllStatus();
                     $("#failed").slideDown();
                     $("#failedErrorMessage").text(status.error);
+                    $(".updateBtn").removeClass("disabled");
                     isFailed = true
                 } else {
                     //Progressing