From d4431d3d200a77f7abfa00e5adc848c633597352 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Tue, 28 Jun 2022 02:10:17 +1000
Subject: Convert server code to CGI script

Also adjust server-client API, for clarity/consistency
---
 src/App.vue | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index b0aa328..e17acfc 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -312,9 +312,9 @@ export default defineComponent({
 			// Check if data for node-to-expand exists, getting from server if needed
 			let tolNode = this.tolMap.get(layoutNode.name)!;
 			if (!this.tolMap.has(tolNode.children[0])){
-				let urlParams = 'name=' + encodeURIComponent(layoutNode.name);
-				urlParams += this.uiOpts.useReducedTree ? '&tree=reduced' : '';
-				let responseObj: {[x: string]: TolNode} = await getServerResponse('/data/node', urlParams);
+				let urlParams = 'type=node&name=' + encodeURIComponent(layoutNode.name);
+				urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+				let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 				if (responseObj == null){
 					return false;
 				}
@@ -406,9 +406,9 @@ export default defineComponent({
 			// Check if data for node-to-expand exists, getting from server if needed
 			let tolNode = this.tolMap.get(layoutNode.name)!;
 			if (!this.tolMap.has(tolNode.children[0])){
-				let urlParams = 'name=' + encodeURIComponent(layoutNode.name);
-				urlParams += this.uiOpts.useReducedTree ? '&tree=reduced' : '';
-				let responseObj: {[x: string]: TolNode} = await getServerResponse('/data/node', urlParams);
+				let urlParams = 'type=node&name=' + encodeURIComponent(layoutNode.name);
+				urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+				let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 				if (responseObj == null){
 					return false;
 				}
@@ -865,8 +865,9 @@ export default defineComponent({
 		// For initialisation
 		async initTreeFromServer(){
 			// Query server
-			let urlParams = this.uiOpts.useReducedTree ? '?tree=reduced' : '';
-			let responseObj: {[x: string]: TolNode} = await getServerResponse('/data/node', urlParams);
+			let urlParams = 'type=node';
+			urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : '';
+			let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams);
 			if (responseObj == null){
 				return;
 			}
-- 
cgit v1.2.3

