From 8f24384bd0e85bb17f6d190b07b2dd1fbfd9cb15 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 4 Aug 2018 01:24:42 +1000 Subject: [PATCH] Add update functionality :P --- src/rest.rs | 2 +- static/index.html | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/rest.rs b/src/rest.rs index e87935c..6cf581c 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -17,7 +17,7 @@ use hyper::{self, Error as HyperError, Get, Post, StatusCode}; use url::form_urlencoded; use std::collections::HashMap; -use std::net::{SocketAddr}; +use std::net::SocketAddr; use std::process::exit; use std::sync::mpsc::channel; use std::sync::Arc; diff --git a/static/index.html b/static/index.html index 3710d7f..2717110 100644 --- a/static/index.html +++ b/static/index.html @@ -42,7 +42,7 @@

- + Update

@@ -175,8 +175,9 @@ })); }, "install": function() { - this.select_packages = false; this.is_installing = true; + this.modify_install = false; + this.select_packages = false; var results = {}; @@ -261,24 +262,24 @@ app.install_location = e.install_path; // Copy over installed packages - for (var x = 0; x < config.length; x++) { - config[x].default = false; - config[x].installed = false; + for (var x = 0; x < app.config.packages.length; x++) { + app.config.packages[x].default = false; + app.config.packages[x].installed = false; } for (var i = 0; i < packages.length; i++) { // Find this config package - for (var x = 0; x < config.length; x++) { - if (config[x].name === packages[i].name) { - config[x].default = true; - config[x].installed = true; + for (var x = 0; x < app.config.packages.length; x++) { + if (app.config.packages[x].name === packages[i].name) { + app.config.packages[x].default = true; + app.config.packages[x].installed = true; } } } } else { - for (var x = 0; x < config.length; x++) { - config[x].installed = false; + for (var x = 0; x < app.config.packages.length; x++) { + app.config.packages[x].installed = false; } ajax("/api/default-path", function(e) {