You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2019/11/27 14:05:34 UTC

[qpid-dispatch] branch eallen-DISPATCH-1385 updated (ad2f665 -> 3b8b56f)

This is an automated email from the ASF dual-hosted git repository.

eallen pushed a change to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


    from ad2f665  Fixed typo in config.json
     new 848a4b6  Added license text
     new 3b8b56f  removing unused files

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 console/react/public/app.js     | 171 ----------------------------------------
 console/react/public/index.html |  21 ++++-
 console/react/public/server.js  |   5 --
 3 files changed, 20 insertions(+), 177 deletions(-)
 delete mode 100644 console/react/public/app.js
 delete mode 100644 console/react/public/server.js


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 02/02: removing unused files

Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 3b8b56fc89ca86298f51a53ec92d330cf55c1684
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Wed Nov 27 09:05:20 2019 -0500

    removing unused files
---
 console/react/public/app.js    | 171 -----------------------------------------
 console/react/public/server.js |   5 --
 2 files changed, 176 deletions(-)

diff --git a/console/react/public/app.js b/console/react/public/app.js
deleted file mode 100644
index 0fa2c52..0000000
--- a/console/react/public/app.js
+++ /dev/null
@@ -1,171 +0,0 @@
-const express = require("express");
-const app = express();
-const path = require("path");
-const bodyParser = require("body-parser");
-
-app.use(bodyParser.json());
-app.use(bodyParser.urlencoded({ extended: false }));
-
-/**
- * API
- */
-// Not used at this time
-app.get("/api", function(req, res) {
-  console.log("GET request");
-  console.log(req.query);
-  let response = { message: "unknown get request" };
-  let query = req.query;
-  if (query.n && query.nn) {
-    // get the state of router with name n from network with name nn
-    response = { state: 1 };
-  }
-  res.status(200).send(response);
-});
-
-// handle a POST.
-app.post("/api", function(req, res) {
-  console.log("POST request received");
-  let status = 200;
-  let response = { message: "unable to parse request" };
-  // figure out what to do based on what is in data
-
-  // get the info that was passed in
-  let { what } = req.body;
-  if (what === "saveNetwork") {
-    response = saveNetwork(req.body);
-  } else if (what === "getState") {
-    response = getState(req.body);
-  } else {
-    response = {
-      status: 404,
-      response: { message: "Missing 'what' parameter in POST request" }
-    };
-    console.log(response.message);
-  }
-  if (response.status) {
-    status = response.status;
-    response = response.response;
-  }
-  res.status(status).send(response);
-});
-
-const edgeDeployment = body => {
-  // network is an object that has a nodes array, a links array, and a network name
-  // nodeName is the node.Name of the router we are requesting data for
-  const { router } = body;
-  const nodeName = router.Name;
-  console.log(`request was for edge-deployment info for ${nodeName}`);
-  return { deployment: `handle edge-deployment for ${nodeName}` };
-};
-
-const routerDeployment = body => {
-  console.log("request was for router deployment info");
-  let { router } = body;
-  // router is the object that contains the info entered about a router
-  // router should contain Name, State
-
-  // do some validation and construct the response
-  if (router && router.Name && router.Name !== "") {
-    // This is NOT really what we want to return. This is just an example.
-    const response = {
-      apiVersion: "interconnectedcloud.github.io/v1alpha1",
-      kind: "Interconnect",
-      metadata: {
-        name: "example-interconnect"
-      },
-      spec: {
-        deploymentPlan: {
-          image: "quay.io/interconnectedcloud/qdrouterd:1.7.0",
-          role: "interior",
-          size: 3,
-          placement: "Any"
-        }
-      }
-    };
-    return response;
-  }
-  return { status: 404, response: { message: "Unable to find router" } };
-};
-
-/*
-saveNetwork creates yaml that looks like the following:
-Router $Name inter-router.$PROJECT.$ROUTING_SUFFIX
-EdgeRouter $Name
-Connect $Name $Name
-# Console $Name console.$PROJECT.$ROUTING_SUFFIX
-Console PVT console.skuba.127.0.0.1.nip.io
-*/ const saveNetwork = body => {
-  console.log("request was to save current network");
-  const { network } = body;
-  const yaml = [];
-  let consoleCreated = false;
-  network.nodes.forEach(n => {
-    if (n.type === "interior") {
-      // namespace and suffix are optional
-      yaml.push(`Router ${n.Name} inter-router`);
-      // create a console for the 1st interior router
-      if (!consoleCreated) {
-        consoleCreated = true;
-        yaml.push(`Console ${n.Name} console`);
-      }
-    } else if (n.type === "edgeClass") {
-      if (n.rows) {
-        n.rows.forEach(r => {
-          yaml.push(`EdgeRouter ${r.name}`);
-        });
-      }
-    }
-  });
-  network.links.forEach(l => {
-    if (l.source.type === "interior" && l.target.type === "interior") {
-      yaml.push(`Connect ${l.source.Name} ${l.target.Name}`);
-    } else if (l.target.type === "edgeClass") {
-      // target is an edgeClass
-      // push a link for each edge router in the edgeclass
-      const edgeClass = l.target;
-      edgeClass.rows.forEach(r => {
-        yaml.push(`Connect ${r.name} ${l.source.Name}`);
-      });
-    }
-  });
-  console.log("Current network yaml:");
-  console.log(yaml.join("\\n"));
-  return {
-    yaml: yaml.join("\n")
-  };
-};
-
-const getState = body => {
-  const { router } = body;
-  let deployment;
-  let status = 200;
-  console.log("getState requested for");
-  let state = router.type === "edge" ? router.row.state : router.state;
-  // if the router is NEW, get the deployment yaml/text
-  if (state === 0) {
-    console.log(router);
-    deployment =
-      router.type === "edge" ? edgeDeployment(body) : routerDeployment(body);
-    if (deployment.status) {
-      status = deployment.status;
-      deployment = deployment.response;
-    }
-  }
-  // TODO: get the router state using the router info
-  return {
-    status: status,
-    response: { state: state, deployment: deployment }
-  };
-};
-
-/**
- * STATIC FILES
- */
-app.use("/", express.static("./"));
-
-// Default every route except the above to serve the index.html
-app.get("*", function(req, res) {
-  res.sendFile(path.join(__dirname + "/index.html"));
-});
-
-module.exports = app;
diff --git a/console/react/public/server.js b/console/react/public/server.js
deleted file mode 100644
index d186837..0000000
--- a/console/react/public/server.js
+++ /dev/null
@@ -1,5 +0,0 @@
-var app = require("./app");
-var port = 6060;
-app.listen(port, function() {
-  console.log("Express server listening on port " + port);
-});


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[qpid-dispatch] 01/02: Added license text

Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit 848a4b6577cad15bcb1013c69c534cf10e4e6b0f
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Wed Nov 27 09:04:53 2019 -0500

    Added license text
---
 console/react/public/index.html | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/console/react/public/index.html b/console/react/public/index.html
index 49d1072..aa39285 100644
--- a/console/react/public/index.html
+++ b/console/react/public/index.html
@@ -1,3 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
 <!DOCTYPE html>
 <html lang="en">
   <head>
@@ -19,7 +38,7 @@
       work correctly both with client-side routing and a non-root public URL.
       Learn how to configure a non-root public URL by running `npm run build`.
     -->
-    <title>Apache Qpid Dispatch Console</title>
+    <title></title>
   </head>
   <body>
     <noscript>You need to enable JavaScript to run this app.</noscript>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org