|
@@ -77,6 +77,15 @@
|
|
<p>Restart ArozOS using the launcher or apply manual update files overwrite to finish the update process.</p>
|
|
<p>Restart ArozOS using the launcher or apply manual update files overwrite to finish the update process.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div id="pending" class="ui icon green message" style="display:none;">
|
|
|
|
+ <i class="green clock icon"></i>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div class="header" id="downloadStatusText">
|
|
|
|
+ Update Pending
|
|
|
|
+ </div>
|
|
|
|
+ <p>Restart ArozOS using the launcher or apply manual update files overwrite to finish the update process.</p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div id="failed" class="ui icon red message" style="display:none;">
|
|
<div id="failed" class="ui icon red message" style="display:none;">
|
|
<i class="red remove icon"></i>
|
|
<i class="red remove icon"></i>
|
|
<div class="content">
|
|
<div class="content">
|
|
@@ -96,6 +105,12 @@
|
|
<button class="ui button" onclick="restartLater();">Restart Later</button>
|
|
<button class="ui button" onclick="restartLater();">Restart Later</button>
|
|
</div>
|
|
</div>
|
|
<!-- End of Status Messages -->
|
|
<!-- End of Status Messages -->
|
|
|
|
+ <div class="vendorupdate">
|
|
|
|
+ <h4>Update from <span class="vendorName">Vendor</span> (<i class="yellow star icon"></i> Recommended)</h4>
|
|
|
|
+ <p>Update from <span class="vendorName">your vendor</span> based on the system update configuration that ship with this machine</p>
|
|
|
|
+ <button class="ui blue button updateBtn" onclick="updateViaVendor();"><i class="cloud upload icon"></i> Update from Vendor</button>
|
|
|
|
+ <div class="ui divider"></div>
|
|
|
|
+ </div>
|
|
<h4>Update via Download</h4>
|
|
<h4>Update via Download</h4>
|
|
<p>Binary Executable Download URL</p>
|
|
<p>Binary Executable Download URL</p>
|
|
<div class="ui fluid input">
|
|
<div class="ui fluid input">
|
|
@@ -156,7 +171,74 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
|
|
+ var useVendorUpdate = false;
|
|
|
|
+ var vendorUpdateBinaryURL = "";
|
|
|
|
+ var vendorUpdateWebpackURL = "";
|
|
|
|
+
|
|
$(".accordion").accordion();
|
|
$(".accordion").accordion();
|
|
|
|
+ initVendorUpdateInfo();
|
|
|
|
+ checkPendingUpdates();
|
|
|
|
+
|
|
|
|
+ function checkPendingUpdates(){
|
|
|
|
+ $.get("../../system/update/checkpending", function(data){
|
|
|
|
+ if (data == true){
|
|
|
|
+ //There is a pending update.
|
|
|
|
+ hideAllStatus();
|
|
|
|
+ $("#pending").slideDown('fast');
|
|
|
|
+ $.get("/system/update/restart", function(data){
|
|
|
|
+ if (data.error !== undefined){
|
|
|
|
+ //No launcher
|
|
|
|
+ }else{
|
|
|
|
+ $("#launcherName").text(data);
|
|
|
|
+ $("#restartPanel").show();
|
|
|
|
+ }
|
|
|
|
+ console.log("Launcher check: ", data);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function initVendorUpdateInfo(){
|
|
|
|
+ $.get("../../system/update/platform", function(data){
|
|
|
|
+ console.log(data);
|
|
|
|
+ if (data.error !== undefined){
|
|
|
|
+ //No vendor update modes
|
|
|
|
+ $(".vendorupdate").hide();
|
|
|
|
+ }else{
|
|
|
|
+ if (data.Config.binary[data.OS] && data.Config.binary[data.OS][data.ARCH]){
|
|
|
|
+ //This update target exists
|
|
|
|
+ vendorUpdateBinaryURL = data.Config.binary[data.OS][data.ARCH];
|
|
|
|
+ }
|
|
|
|
+ vendorUpdateWebpackURL = data.Config.webpack;
|
|
|
|
+ $(".vendorName").text(data.Config.vendor);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function updateViaVendor(){
|
|
|
|
+ let binaryDownloadURL = vendorUpdateBinaryURL;
|
|
|
|
+ let webpackDownloadURL = vendorUpdateWebpackURL;
|
|
|
|
+ if (binaryDownloadURL == "" || webpackDownloadURL == ""){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ //Check space need
|
|
|
|
+ $("#checking").slideDown("fast");
|
|
|
|
+ $("#warning").slideUp("fast");
|
|
|
|
+ useVendorUpdate = true;
|
|
|
|
+ $.get(`/system/update/checksize?webpack=${webpackDownloadURL}&binary=${binaryDownloadURL}`, function(data){
|
|
|
|
+ if (data.error != undefined){
|
|
|
|
+ cancelUpdateStatus();
|
|
|
|
+ alert("Update failed: " + data.error)
|
|
|
|
+ }else{
|
|
|
|
+ let totalDownloadBytes = data[0] + data[1];
|
|
|
|
+ $("#spaceEst").text(ao_module_utils.formatBytes(totalDownloadBytes, 2));
|
|
|
|
+ $("#confirmDownload").slideDown("fast");
|
|
|
|
+ $("#checking").slideUp("fast");
|
|
|
|
+ console.log(data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
function updateViaURL(){
|
|
function updateViaURL(){
|
|
let binaryDownloadURL = $("#burl").val().trim();
|
|
let binaryDownloadURL = $("#burl").val().trim();
|
|
@@ -186,6 +268,13 @@
|
|
function confirmURLUpdate(){
|
|
function confirmURLUpdate(){
|
|
let binaryDownloadURL = $("#burl").val().trim();
|
|
let binaryDownloadURL = $("#burl").val().trim();
|
|
let webpackDownloadURL = $("#wurl").val().trim();
|
|
let webpackDownloadURL = $("#wurl").val().trim();
|
|
|
|
+
|
|
|
|
+ if (useVendorUpdate){
|
|
|
|
+ //Use vendor link for update. Replace the download target with vendor update links
|
|
|
|
+ useVendorUpdate = false;
|
|
|
|
+ binaryDownloadURL = vendorUpdateBinaryURL;
|
|
|
|
+ webpackDownloadURL = vendorUpdateWebpackURL;
|
|
|
|
+ }
|
|
if (binaryDownloadURL == "" || webpackDownloadURL == ""){
|
|
if (binaryDownloadURL == "" || webpackDownloadURL == ""){
|
|
alert("Invalid or Empty URL given");
|
|
alert("Invalid or Empty URL given");
|
|
return
|
|
return
|