From 551fbe163b90cc1f318612c167fbdfe738dd7132 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Fri, 1 Jul 2022 19:28:12 +1000
Subject: Generate 3 reduced trees, keeping the original, and serve only those

Generate a 'trimmed' reduced tree instead of changing the original.
Generate an 'images-only' reduced tree, and use it as the default.
Combine 'picked' reduced tree code with that of other reduced trees.
Adapt server API to allow selecting between more than 2 trees.
Add client setting for selecting between 3 trees.
---
 src/App.vue | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index f54cb31..13da971 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -326,7 +326,7 @@ export default defineComponent({
 			let tolNode = this.tolMap.get(layoutNode.name)!;
 			if (!this.tolMap.has(tolNode.children[0])){
 				let urlParams = 'type=node&name=' + encodeURIComponent(layoutNode.name);
-				urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+				urlParams += '&tree=' + this.uiOpts.tree;
 				let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 				if (responseObj == null){
 					return false;
@@ -421,7 +421,7 @@ export default defineComponent({
 			let tolNode = this.tolMap.get(layoutNode.name)!;
 			if (!this.tolMap.has(tolNode.children[0])){
 				let urlParams = 'type=node&name=' + encodeURIComponent(layoutNode.name);
-				urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+				urlParams += '&tree=' + this.uiOpts.tree;
 				let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 				if (responseObj == null){
 					return false;
@@ -490,7 +490,7 @@ export default defineComponent({
 			}
 			// Query server for tol-node info
 			let urlParams = 'type=info&name=' + encodeURIComponent(nodeName);
-			urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+			urlParams += '&tree=' + this.uiOpts.tree;
 			let responseObj: InfoResponse = await getServerResponse(urlParams);
 			if (responseObj == null){
 				return;
@@ -819,7 +819,7 @@ export default defineComponent({
 						//Note: Using JSON.stringify here to roughly deep-compare values
 						if (item == null && JSON.stringify(this.uiOpts[prop]) != JSON.stringify(uiOpts[prop])){
 							this.uiOpts[prop] = uiOpts[prop];
-							if (prop == 'useReducedTree'){
+							if (prop == 'tree'){
 								changedTree = true;
 							}
 						}
@@ -875,7 +875,7 @@ export default defineComponent({
 		async initTreeFromServer(){
 			// Query server
 			let urlParams = 'type=node';
-			urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+			urlParams += '&tree=' + this.uiOpts.tree;
 			let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 			if (responseObj == null){
 				return;
-- 
cgit v1.2.3

