diff --git a/src/components/RedirectCreator.svelte b/src/components/RedirectCreator.svelte
index ec602a4..4827935 100644
--- a/src/components/RedirectCreator.svelte
+++ b/src/components/RedirectCreator.svelte
@@ -4,19 +4,22 @@
import Flags from "./Flags.svelte";
const dispatch = createEventDispatcher();
- let redirect: Redirect = {src: "", dst: "", flags: 0, active: true};
+ let redirect: Redirect = {src: "", dst: "", desc: "", flags: 0, active: true};
+
+ const descCols = 50;
|
|
|
+ |
|
|
@@ -23,6 +26,7 @@
{redirect.client.src} |
|
|
+ |
|
{#if !noSPair(redirect)}
diff --git a/src/components/RouteCreator.svelte b/src/components/RouteCreator.svelte
index 0c09b74..c26397b 100644
--- a/src/components/RouteCreator.svelte
+++ b/src/components/RouteCreator.svelte
@@ -4,19 +4,22 @@
import Flags from "./Flags.svelte";
const dispatch = createEventDispatcher();
- let route: Route = {src: "", dst: "", flags: 0, active: true};
+ let route: Route = {src: "", dst: "", desc: "", flags: 0, active: true};
+
+ const descCols = 50;
|
|
|
|
+ |
|
{
dispatch("make", route);
- route = {src: "", dst: "", flags: 0, active: true};
+ route = {src: "", dst: "", desc: "", flags: 0, active: true};
}}
>
Create
diff --git a/src/components/RouteRow.svelte b/src/components/RouteRow.svelte
index ea7a05b..ceaec41 100644
--- a/src/components/RouteRow.svelte
+++ b/src/components/RouteRow.svelte
@@ -8,6 +8,8 @@
function resetRoute(): any {
route.client = JSON.parse(JSON.stringify(route.server));
}
+
+ const descCols = 50;
{#if noCPair(route)}
@@ -15,6 +17,7 @@
{route.server.src} |
|
|
+ |
|
resetRoute()}>Restore |
|
@@ -23,6 +26,7 @@
{route.client.src} |
|
|
+ |
|
{#if !noSPair(route)}
@@ -65,4 +69,8 @@
td input[type="text"] {
padding: 4px;
}
+
+ .desc textarea {
+ resize: none;
+ }
diff --git a/src/types/target.ts b/src/types/target.ts
index dbdb84c..af78106 100644
--- a/src/types/target.ts
+++ b/src/types/target.ts
@@ -1,6 +1,7 @@
export interface Route {
src: string;
dst: string;
+ desc: string;
flags: number;
active: boolean;
}
@@ -8,18 +9,19 @@ export interface Route {
export interface Redirect {
src: string;
dst: string;
+ desc: string;
flags: number;
active: boolean;
}
export function routeEqual(a: Route, b: Route): boolean {
if (b == null) return false;
- return a.src === b.src && a.dst === b.dst && a.flags === b.flags && a.active === b.active;
+ return a.src === b.src && a.dst === b.dst && a.desc === b.desc && a.flags === b.flags && a.active === b.active;
}
export function redirectEqual(a: Redirect, b: Redirect): boolean {
if (b == null) return false;
- return a.src === b.src && a.dst === b.dst && a.flags === b.flags && a.active === b.active;
+ return a.src === b.src && a.dst === b.dst && a.desc === b.desc && a.flags === b.flags && a.active === b.active;
}
export const routeKeys = [
diff --git a/src/views/VioletView.svelte b/src/views/VioletView.svelte
index c476655..72907d1 100644
--- a/src/views/VioletView.svelte
+++ b/src/views/VioletView.svelte
@@ -82,6 +82,7 @@
| Source |
Destination |
Flags |
+ Description |
Active |
Option |
@@ -119,6 +120,7 @@
Source |
Destination |
Flags |
+ Description |
Active |
Option |
diff --git a/test-server/main.go b/test-server/main.go
index 4c8737e..7630ede 100644
--- a/test-server/main.go
+++ b/test-server/main.go
@@ -109,24 +109,28 @@ func apiServer(verify mjwt.Verifier) {
{
"src": "example.com",
"dst": "127.0.0.1:8080",
+ "desc": "This is a test description",
"flags": 181,
"active": true,
},
{
"src": "test.example.com",
"dst": "127.0.0.1:8081",
+ "desc": "This is a test description",
"flags": 17,
"active": true,
},
{
"src": "example.org/hello",
"dst": "127.0.0.1:8082",
+ "desc": "This is a test description",
"flags": 16,
"active": true,
},
{
"src": "test.example.org/hello",
"dst": "127.0.0.1:8083",
+ "desc": "This is a test description",
"flags": 15,
"active": true,
},
@@ -137,24 +141,28 @@ func apiServer(verify mjwt.Verifier) {
{
"src": "example.org",
"dst": "127.0.0.1:8084",
+ "desc": "This is a test description",
"flags": 181,
"active": true,
},
{
"src": "test.example.org",
"dst": "127.0.0.1:8085",
+ "desc": "This is a test description",
"flags": 17,
"active": true,
},
{
"src": "example.org/hello",
"dst": "127.0.0.1:8086",
+ "desc": "This is a test description",
"flags": 16,
"active": true,
},
{
"src": "test.example.org/hello",
"dst": "127.0.0.1:8087",
+ "desc": "This is a test description",
"flags": 15,
"active": true,
},