99import type { Vpc , VpcFirewallRule , VpcSubnet } from '@oxide/api'
1010
1111import type { Json } from './json-type'
12- import { project } from './project'
12+ import { project , project2 } from './project'
1313
1414const time_created = new Date ( 2021 , 0 , 1 ) . toISOString ( )
1515const time_modified = new Date ( 2021 , 0 , 2 ) . toISOString ( )
@@ -28,6 +28,20 @@ export const vpc: Json<Vpc> = {
2828 time_modified,
2929}
3030
31+ export const vpc2 : Json < Vpc > = {
32+ id : 'e54078df-fe72-4673-b36c-a362e3b4e38b' ,
33+ name : 'mock-vpc-2' ,
34+ description : 'a fake vpc' ,
35+ dns_name : 'mock-vpc-2' ,
36+ project_id : project2 . id ,
37+ system_router_id : systemRouterId ,
38+ ipv6_prefix : 'fdf6:1818:b6e2::/48' ,
39+ time_created,
40+ time_modified,
41+ }
42+
43+ export const vpcs : Json < Vpc [ ] > = [ vpc , vpc2 ]
44+
3145export const vpcSubnet : Json < VpcSubnet > = {
3246 // this is supposed to be flattened into the top level. will fix in API
3347 id : 'd12bf934-d2bf-40e9-8596-bb42a7793749' ,
@@ -49,7 +63,7 @@ export const vpcSubnet2: Json<VpcSubnet> = {
4963 ipv4_block : '10.1.1.2/24' ,
5064}
5165
52- export const defaultFirewallRules : Json < VpcFirewallRule [ ] > = [
66+ export const firewallRules : Json < VpcFirewallRule [ ] > = [
5367 {
5468 id : 'b74aeea8-1201-4efd-b6ec-011f10a0b176' ,
5569 name : 'allow-internal-inbound' ,
@@ -117,4 +131,46 @@ export const defaultFirewallRules: Json<VpcFirewallRule[]> = [
117131 time_modified,
118132 vpc_id : vpc . id ,
119133 } ,
134+ // second mock VPC in other project, meant to test display with lots of
135+ // targets and filters
136+ {
137+ id : '097c849e-68c8-43f7-9ceb-b1855c51f178' ,
138+ name : 'lots-of-filters' ,
139+ status : 'enabled' ,
140+ direction : 'inbound' ,
141+ targets : [ { type : 'vpc' , value : 'default' } ] ,
142+ description : 'we just want to test with lots of filters' ,
143+ filters : {
144+ ports : [ '3389' , '45-89' ] ,
145+ protocols : [ 'TCP' ] ,
146+ hosts : [
147+ { type : 'instance' , value : 'hello-friend' } ,
148+ { type : 'subnet' , value : 'my-subnet' } ,
149+ { type : 'ip' , value : '148.38.89.5' } ,
150+ ] ,
151+ } ,
152+ action : 'allow' ,
153+ priority : 65534 ,
154+ time_created,
155+ time_modified,
156+ vpc_id : vpc2 . id ,
157+ } ,
158+ {
159+ id : '097c849e-68c8-43f7-9ceb-b1855c51f178' ,
160+ name : 'lots-of-targets' ,
161+ status : 'enabled' ,
162+ direction : 'inbound' ,
163+ targets : [
164+ { type : 'instance' , value : 'my-inst' } ,
165+ { type : 'ip' , value : '125.34.25.2' } ,
166+ { type : 'subnet' , value : 'subsubsub' } ,
167+ ] ,
168+ description : 'we just want to test with lots of targets' ,
169+ filters : { ports : [ '80' ] } ,
170+ action : 'allow' ,
171+ priority : 65534 ,
172+ time_created,
173+ time_modified,
174+ vpc_id : vpc2 . id ,
175+ } ,
120176]
0 commit comments