From f2b0682385557fef008bd509d8821654bdef578d Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 4 Apr 2022 11:09:49 +0200 Subject: [PATCH] More boilerplating --- angular/src/components/add-edit.component.ts | 4 ++ common/src/types/item-types.ts | 52 ++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/angular/src/components/add-edit.component.ts b/angular/src/components/add-edit.component.ts index 3728cdc4..1db15a60 100644 --- a/angular/src/components/add-edit.component.ts +++ b/angular/src/components/add-edit.component.ts @@ -152,6 +152,10 @@ export class AddEditComponent implements OnInit { await this.init(); } + get customType() { + return this.cipher.type > CipherType.Identity; + } + async init() { if (this.ownershipOptions.length) { this.ownershipOptions = []; diff --git a/common/src/types/item-types.ts b/common/src/types/item-types.ts index 5ece8200..0079d33c 100644 --- a/common/src/types/item-types.ts +++ b/common/src/types/item-types.ts @@ -6,26 +6,32 @@ export const ItemTypeSchemas = { description: "WirelessNetworkDesc", properties: [ { + id: "ssid", name: "Network Name/SSID", type: "string", }, { + id: "wirelessSecurity", name: "Wireless Security", type: "string", }, { + id: "username", name: "Username", type: "string", }, { + id: "password", name: "Password", type: "string", }, { + id: "mode", name: "Mode", type: "string", }, { + id: "ip", name: "Server/IP Address", type: "string", }, @@ -33,6 +39,52 @@ export const ItemTypeSchemas = { }, }; +export const ItemTypeForms = { + [CipherType.WirelessNetwork]: [ + { + type: "section", + title: "General", + items: [ + { + id: "ssid", + type: "textfield", + }, + { + id: "wirelessSecurity", + type: "dropdown", + options: [ + "None", + "WEP", + "WPA", + "WPA2/WPA3", + "WPA3", + "WPA Enterprise", + "WPA2 Enterprise", + "WPA3 Enterprise", + ], + }, + { + id: "username", + type: "textfield", + }, + { + id: "password", + type: "password", + }, + { + id: "mode", + type: "dropdown", + options: ["Automatic", "EAP-TLS"], + }, + { + id: "ip", + type: "textfield", + }, + ], + }, + ], +}; + /* Network Name/SSID: (open text) Wireless Security: (single-choice):