From 765966aa723f38b1569250291bdb5b554b3304f7 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Wed, 5 Aug 2026 14:35:54 +0200 Subject: [PATCH 01/21] feat: billing options --- .../theme/components/legacy/ServiceDesk.vue | 71 ++- docs/public/cfg/service_desk.yml | 487 +++++++++++++++--- 2 files changed, 481 insertions(+), 77 deletions(-) diff --git a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue index 8493065e52..077b8e5cf4 100644 --- a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue +++ b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue @@ -40,6 +40,8 @@ const sendClicked = ref(false) const finalizeClicked = ref(false) const panel = ref(0) +const clientType = ref("") + // Computed properties const messageSubject = computed(() => { return subjectTemplate.value ? wrap(subjectTemplate.value) : null @@ -50,7 +52,7 @@ const messageBody = computed(() => { }) const formFilled = computed(() => { - return props.fields.every((item) => (formData.value[item.key] || item.optional ? true : false)) + return props.fields.filter((item) => item.type === undefined || item.type === clientType.value).every((item) => (formData.value[item.key] || item.optional ? true : false)) }) const encodedSubject = computed(() => { @@ -106,7 +108,14 @@ const activateSendButtons = () => { } const submit = () => { - panel.value = 2 + panel.value = 3 + if (props.template) { + if (clientType.value === "ntnu-internal") { + bodyTemplate.value = props.template.body + } else { + bodyTemplate.value = props.template.body_external + } + } setTimeout(activateSendButtons, 1200) } @@ -178,7 +187,6 @@ onMounted(() => { panel.value = 0 loadingEmailButtons.value = true subjectTemplate.value = props.template ? props.template.subject : null - bodyTemplate.value = props.template ? props.template.body : null var formFields = [] for (const item of props.fields) { @@ -247,6 +255,41 @@ onMounted(() => { + + + NTNU or External + + + + + + + + + + + Continue + + + + + Form @@ -259,7 +302,7 @@ onMounted(() => { { @focus="$event.target.select()" @update:model-value="setValue($event, item.key)" /> + + diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index 416ddd7b79..08e823b41f 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -17,8 +17,18 @@ general_contact_request: fields: [ { label: "Request topic", key: "topic", field: "textfield" }, - { label: "Lab (Optional)", key: "lab_name", field: "textfield", optional: true }, - { label: "Data Space (Optional)", key: "data_space", field: "textfield", optional: true }, + { + label: "Lab (Optional)", + key: "lab_name", + field: "textfield", + optional: true, + }, + { + label: "Data Space (Optional)", + key: "data_space", + field: "textfield", + optional: true, + }, ] requirements: [ @@ -177,7 +187,7 @@ request_new_lab: --- lab_name="{lab_name}" --- - + We would like to start with the following machine type and storage resources for our home machine: --- @@ -187,6 +197,46 @@ request_new_lab: scratch_gb={scratch_volume} --- + Billing information: + --- + account_information_k_sted="{account_information_k_sted}" + account_information_p_number="{account_information_p_number}" + --- + + Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: + + https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user + + I am looking forward to receive an email verification stating that the lab is up and running. + + + Best regards, + body_external: | + Hi HUNT Cloud team, + + I would like to request a new lab. + + I have attached a signed lab agreement to this email for the following lab: + + --- + lab_name="{lab_name}" + --- + + We would like to start with the following machine type and storage resources for our home machine: + + --- + machine_type="{machine_type}" + archive_gb={archive_volume} + work_gb={work_volume} + scratch_gb={scratch_volume} + --- + + Billing information: + --- + billing_information_peppol_bis="{billing_information_peppol_bis}" + billing_information_reference_number="{billing_information_reference_number}" + --- + Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user @@ -205,12 +255,12 @@ request_new_lab: autocapitalize: "off", field: "textfield", }, -# { label: "Data space name", -# key: "data_space", -# pattern: "[-a-z0-9]{3,}", -# hint: "Data space name should include only letters a-z, 0-9, or dot.", -# field: "textfield" -# }, + # { label: "Data space name", + # key: "data_space", + # pattern: "[-a-z0-9]{3,}", + # hint: "Data space name should include only letters a-z, 0-9, or dot.", + # field: "textfield" + # }, { label: "Machine type (c1 is default)", key: "machine_type", @@ -218,7 +268,10 @@ request_new_lab: field: "autocompleteone", options: [ - { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, + { + type: "subheader", + text: "B - Series machine types: 2 GB of RAM per CPU core", + }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -228,7 +281,10 @@ request_new_lab: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, + { + type: "subheader", + text: "C - Series machine types: 4 GB of RAM per CPU core", + }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -238,7 +294,10 @@ request_new_lab: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, + { + type: "subheader", + text: "D - Series machine types: 8 GB of RAM per CPU core", + }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -248,7 +307,10 @@ request_new_lab: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, + { + type: "subheader", + text: "E - Series machine types: 16 GB of RAM per CPU core", + }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -291,6 +353,34 @@ request_new_lab: field: "number", default: 300, }, + { + label: "Account Informatin: K.STED", + key: "account_information_k_sted", + autocapitalize: "off", + field: "textfield", + type: "ntnu-internal", + }, + { + label: "Account Informatin: P.NUMBER", + key: "account_information_p_number", + autocapitalize: "off", + field: "textfield", + type: "ntnu-internal", + }, + { + label: "Billing Informatin: PEPPOL BIS", + key: "billing_information_peppol_bis", + autocapitalize: "off", + field: "textfield", + type: "external", + }, + { + label: "Billing Informatin: REFERENCE NUMBER", + key: "billing_information_reference_number", + autocapitalize: "off", + field: "textfield", + type: "external", + }, ] requirements: [ @@ -395,7 +485,11 @@ request_external_import_kista: autocapitalize: "off", field: "textfield", }, - { label: "External organization", key: "external_organization", field: "textfield" }, + { + label: "External organization", + key: "external_organization", + field: "textfield", + }, { label: "Public IPv4 address of external organization (only if outside of NTNU)", key: "ipaddress", @@ -446,7 +540,11 @@ request_external_export_kista: autocapitalize: "off", field: "textfield", }, - { label: "External organization", key: "external_organization", field: "textfield" }, + { + label: "External organization", + key: "external_organization", + field: "textfield", + }, { label: "Public IPv4 address of external organization (only if outside of NTNU)", key: "ipaddress", @@ -540,13 +638,28 @@ update_data_space_administrator_role: autocapitalize: "off", field: "textfield", }, - { label: "Role", key: "role", field: "selectone", options: ["Compliance", "Data", "Technical", "Knowledge", "Financial"] }, + { + label: "Role", + key: "role", + field: "selectone", + options: ["Compliance", "Data", "Technical", "Knowledge", "Financial"], + }, { label: "Name and Surname", key: "name", field: "textfield" }, { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { label: "Email", key: "email", pattern: "[^@]+@[^@]+\\.[^@]+", field: "textfield" }, - { label: "Phone number", key: "phone", pattern: "[0-9+]{3,}", field: "textfield" }, + { + label: "Email", + key: "email", + pattern: "[^@]+@[^@]+\\.[^@]+", + field: "textfield", + }, + { + label: "Phone number", + key: "phone", + pattern: "[0-9+]{3,}", + field: "textfield", + }, ] requirements: [ @@ -777,12 +890,14 @@ request_lab_transfer: "Cost: Included in your data space subscription.", "We care about your privacy. Read our privacy statement (link here) to learn how we process your personal data when you send us a request.", ] - attachments: ["Required: Signed lab transfer order (.pdf)", "Optional: Signed invoice profile (.pdf)"] + attachments: + [ + "Required: Signed lab transfer order (.pdf)", + "Optional: Signed invoice profile (.pdf)", + ] ### Data Controller Orders - - request_organizational_access: title: "Request organizational access to HUNT Cloud" template: @@ -798,7 +913,15 @@ request_organizational_access: Best regards, - fields: [{ label: "Organization", key: "organization", autocapitalize: "off", field: "textfield" }] + fields: + [ + { + label: "Organization", + key: "organization", + autocapitalize: "off", + field: "textfield", + }, + ] requirements: [ "Who can order: Representatives for the organizational unit that request access.", @@ -810,7 +933,6 @@ request_organizational_access: ] attachments: [HUNT Cloud organizational access request form (.pdf)] - ### Lab orders request_access_new_user: @@ -831,7 +953,12 @@ request_access_new_user: fields: [ - { label: "Name of user", key: "username", autocapitalize: "off", field: "textfield" }, + { + label: "Name of user", + key: "username", + autocapitalize: "off", + field: "textfield", + }, { label: "Lab name", key: "lab_name", @@ -926,7 +1053,12 @@ reactivate_lab_user: autocapitalize: "off", field: "textfield", }, - { label: "Name of user", key: "username", autocapitalize: "off", field: "textfield" }, + { + label: "Name of user", + key: "username", + autocapitalize: "off", + field: "textfield", + }, ] requirements: [ @@ -1037,7 +1169,10 @@ request_machine_size_update: field: "autocompleteone", options: [ - { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, + { + type: "subheader", + text: "B - Series machine types: 2 GB of RAM per CPU core", + }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1047,7 +1182,10 @@ request_machine_size_update: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, + { + type: "subheader", + text: "C - Series machine types: 4 GB of RAM per CPU core", + }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1057,7 +1195,10 @@ request_machine_size_update: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, + { + type: "subheader", + text: "D - Series machine types: 8 GB of RAM per CPU core", + }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1067,7 +1208,10 @@ request_machine_size_update: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, + { + type: "subheader", + text: "E - Series machine types: 16 GB of RAM per CPU core", + }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1087,7 +1231,10 @@ request_machine_size_update: field: "autocompleteone", options: [ - { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, + { + type: "subheader", + text: "B - Series machine types: 2 GB of RAM per CPU core", + }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1097,7 +1244,10 @@ request_machine_size_update: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, + { + type: "subheader", + text: "C - Series machine types: 4 GB of RAM per CPU core", + }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1107,7 +1257,10 @@ request_machine_size_update: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, + { + type: "subheader", + text: "D - Series machine types: 8 GB of RAM per CPU core", + }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1117,7 +1270,10 @@ request_machine_size_update: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, + { + type: "subheader", + text: "E - Series machine types: 16 GB of RAM per CPU core", + }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1180,7 +1336,10 @@ request_new_cpu: field: "autocompleteone", options: [ - { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, + { + type: "subheader", + text: "B - Series machine types: 2 GB of RAM per CPU core", + }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1190,7 +1349,10 @@ request_new_cpu: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, + { + type: "subheader", + text: "C - Series machine types: 4 GB of RAM per CPU core", + }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1200,7 +1362,10 @@ request_new_cpu: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, + { + type: "subheader", + text: "D - Series machine types: 8 GB of RAM per CPU core", + }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1210,7 +1375,10 @@ request_new_cpu: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, + { + type: "subheader", + text: "E - Series machine types: 16 GB of RAM per CPU core", + }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1235,9 +1403,22 @@ request_new_cpu: label: "Storage type", key: "storage_type", field: "autocompleteone", - options: [{ text: "Regular storage (HDD)", value: "regular" }, { text: "Fast storage (NVME)", value: "nvme" }], + options: + [ + { text: "Regular storage (HDD)", value: "regular" }, + { text: "Fast storage (NVME)", value: "nvme" }, + ], + }, + { + label: "Subscription", + key: "subscription", + field: "autocompleteone", + options: + [ + { text: "On-demand", value: "ondemand" }, + { text: "Spot", value: "spot" }, + ], }, - { label: "Subscription", key: "subscription", field: "autocompleteone", options: [{ text: "On-demand", value: "ondemand" }, { text: "Spot", value: "spot" }] }, ] requirements: [ @@ -1300,7 +1481,12 @@ request_new_gpu: { text: "NVIDIA RTX PRO 6000 96G", value: "rtx.pro.6000.96g" }, ], }, - { label: "How many GPUs?", key: "gpu_amount", field: "autocompleteone", options: [{ text: "1", value: "1" }, { text: "2", value: "2" }] }, + { + label: "How many GPUs?", + key: "gpu_amount", + field: "autocompleteone", + options: [{ text: "1", value: "1" }, { text: "2", value: "2" }], + }, { label: "Machine type", key: "machine_type", @@ -1311,7 +1497,10 @@ request_new_gpu: field: "autocompleteone", options: [ - { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, + { + type: "subheader", + text: "B - Series machine types: 2 GB of RAM per CPU core", + }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1321,7 +1510,10 @@ request_new_gpu: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, + { + type: "subheader", + text: "C - Series machine types: 4 GB of RAM per CPU core", + }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1331,7 +1523,10 @@ request_new_gpu: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, + { + type: "subheader", + text: "D - Series machine types: 8 GB of RAM per CPU core", + }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1341,7 +1536,10 @@ request_new_gpu: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, + { + type: "subheader", + text: "E - Series machine types: 16 GB of RAM per CPU core", + }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1366,9 +1564,22 @@ request_new_gpu: label: "Storage type", key: "storage_type", field: "autocompleteone", - options: [{ text: "Fast storage (NVME)", value: "nvme" }, { text: "Regular storage (HDD)", value: "regular" }], + options: + [ + { text: "Fast storage (NVME)", value: "nvme" }, + { text: "Regular storage (HDD)", value: "regular" }, + ], + }, + { + label: "Subscription", + key: "subscription", + field: "autocompleteone", + options: + [ + { text: "On-demand", value: "ondemand" }, + { text: "Spot", value: "spot" }, + ], }, - { label: "Subscription", key: "subscription", field: "autocompleteone", options: [{ text: "On-demand", value: "ondemand" }, { text: "Spot", value: "spot" }] }, ] requirements: [ @@ -1411,7 +1622,16 @@ request_blue_fleet: autocapitalize: "off", field: "textfield", }, - { label: "Number of machines", hint: "Field should include only numbers", key: "number", min: 2, max: 100, step: 1, field: "number", default: 2 }, + { + label: "Number of machines", + hint: "Field should include only numbers", + key: "number", + min: 2, + max: 100, + step: 1, + field: "number", + default: 2, + }, { label: "Machine type", key: "machine_type", @@ -1627,7 +1847,13 @@ request_expand_existing_volume: label: "Volume name", key: "volume_name", field: "autocompleteone", - options: [{ text: "Archive", value: "archive" }, { text: "Work", value: "work" }, { text: "Scratch", value: "scratch" }, { text: "Backup", value: "backup" }], + options: + [ + { text: "Archive", value: "archive" }, + { text: "Work", value: "work" }, + { text: "Scratch", value: "scratch" }, + { text: "Backup", value: "backup" }, + ], }, { label: "Volume number (optional)", @@ -1635,7 +1861,19 @@ request_expand_existing_volume: field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], + options: + [ + { text: "No number", value: "" }, + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ], optional: true, }, { @@ -1729,7 +1967,19 @@ request_new_storage_volume: field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], + options: + [ + { text: "No number", value: "" }, + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ], optional: true, }, { @@ -1743,7 +1993,12 @@ request_new_storage_volume: field: "number", default: 1, }, - { label: "Enable restore service (optional)", key: "restore", field: "autocompleteone", options: [{ text: "Yes", value: "yes" }, { text: "No", value: "no" }] }, + { + label: "Enable restore service (optional)", + key: "restore", + field: "autocompleteone", + options: [{ text: "Yes", value: "yes" }, { text: "No", value: "no" }], + }, ] requirements: [ @@ -1794,14 +2049,31 @@ request_volume_deletion: autocapitalize: "off", field: "textfield", }, - { label: "Volume name", key: "volume_name", field: "autocompleteone", options: ["archive", "work", "scratch", "backup"] }, + { + label: "Volume name", + key: "volume_name", + field: "autocompleteone", + options: ["archive", "work", "scratch", "backup"], + }, { label: "Volume number (optional)", key: "volume_number", field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], + options: + [ + { text: "No number", value: "" }, + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ], optional: true, }, ] @@ -1834,7 +2106,12 @@ request_internal_kista: fields: [ - { label: "Name and Surname", key: "uploaderlabresponsiblefullname", hint: "Full name of sender or signatory", field: "textfield" }, + { + label: "Name and Surname", + key: "uploaderlabresponsiblefullname", + hint: "Full name of sender or signatory", + field: "textfield", + }, { label: "Uploader Lab", key: "labname", @@ -1904,8 +2181,18 @@ request_coordinator_update: { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { label: "Email address", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, - { label: "Phone number", key: "phone", pattern: "[0-9+]{3,}", field: "textfield" }, + { + label: "Email address", + key: "email", + pattern: "[^@].*[@]+.*", + field: "textfield", + }, + { + label: "Phone number", + key: "phone", + pattern: "[0-9+]{3,}", + field: "textfield", + }, ] requirements: [ @@ -1933,7 +2220,15 @@ new_data_space: I am looking forward to an email verification on the data space registration so we can start to order our labs. Best, - fields: [{ label: "Service center name", key: "service_center", pattern: "(.){3,}", field: "textfield" }] + fields: + [ + { + label: "Service center name", + key: "service_center", + pattern: "(.){3,}", + field: "textfield", + }, + ] requirements: [ "Guide: Scientific access", @@ -1993,7 +2288,12 @@ request_workbench_access: { text: "MATLAB (need license)", value: "MATLAB" }, { text: "Stata (need license)", value: "Stata" }, ], - default: [{ text: "Rstudio", value: "Rstudio" }, { text: "Jupyter", value: "Jupyter" }, { text: "Python", value: "Python" }], + default: + [ + { text: "Rstudio", value: "Rstudio" }, + { text: "Jupyter", value: "Jupyter" }, + { text: "Python", value: "Python" }, + ], }, ] requirements: @@ -2094,9 +2394,24 @@ request_workbench_troubleshooting: autocapitalize: "off", field: "textfield", }, - { label: "Operating system", key: "operating_system", field: "textfield", hint: "Windows, MacOS, or Linux (e.g. Ubuntu)" }, - { label: "Web browser", key: "web_browser", field: "textfield", hint: "Google Chrome or Mozilla Firefox?" }, - { label: "Problem description", key: "problem_description", field: "textarea", autocapitalize: "off" }, + { + label: "Operating system", + key: "operating_system", + field: "textfield", + hint: "Windows, MacOS, or Linux (e.g. Ubuntu)", + }, + { + label: "Web browser", + key: "web_browser", + field: "textfield", + hint: "Google Chrome or Mozilla Firefox?", + }, + { + label: "Problem description", + key: "problem_description", + field: "textarea", + autocapitalize: "off", + }, ] requirements: [ @@ -2106,7 +2421,10 @@ request_workbench_troubleshooting: "Cost: Included in the lab subscription.", "We care about your privacy. Read our privacy statement (link here) to learn how we process your personal data when you send us a request.", ] - attachments: ["Screenshots or any error logs that might be useful for investigation of the issue."] + attachments: + [ + "Screenshots or any error logs that might be useful for investigation of the issue.", + ] request_ssh_pass_reset: title: "Request SSH passphrase reset" @@ -2231,8 +2549,19 @@ request_vpn_link: hint: "Get your IP address here: https://docs.hdc.ntnu.no/ipv4/", field: "textfield", }, - { label: "Access duration", key: "access_duration", field: "selectone", options: ["Temporary", "Permanent"], default: ["Temporary"] }, - { label: "Access Country", key: "country", pattern: '^[\-A-z0-9\._]*$', field: "textfield" }, + { + label: "Access duration", + key: "access_duration", + field: "selectone", + options: ["Temporary", "Permanent"], + default: ["Temporary"], + }, + { + label: "Access Country", + key: "country", + pattern: '^[\-A-z0-9\._]*$', + field: "textfield", + }, ] requirements: [ @@ -2406,7 +2735,12 @@ request_update_lagtun_rep: autocapitalize: "off", field: "textfield", }, - { label: "Email", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, + { + label: "Email", + key: "email", + pattern: "[^@].*[@]+.*", + field: "textfield", + }, ] requirements: [ @@ -2444,7 +2778,12 @@ request_update_data_rep: autocapitalize: "off", field: "textfield", }, - { label: "Email", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, + { + label: "Email", + key: "email", + pattern: "[^@].*[@]+.*", + field: "textfield", + }, ] requirements: [ @@ -2510,8 +2849,7 @@ request_tape_backup: label: "Scope of tape write", key: "tapewrite_type", field: "autocompleteone", - options: - [ + options: [ { text: "Full volume backup", value: "Full volume" }, #{ text: "Selected dataset backup", value: "Selected dataset" }, ], @@ -2521,8 +2859,7 @@ request_tape_backup: key: "volume_target", hint: "Select the volume. Leave as N/A for selected dataset backups.", field: "autocompleteone", - options: - [ + options: [ #{ text: "Not applicable (selected dataset)", value: "N/A" }, { text: "archive", value: "archive" }, { text: "archive2", value: "archive2" }, @@ -2566,8 +2903,7 @@ request_tape_backup: key: "backup_interval", hint: "For scheduled backups only. Select 'Not applicable' for one-time archive.", field: "autocompleteone", - options: - [ + options: [ { text: "Not applicable (one-time archive)", value: "N/A" }, #{ text: "Daily", value: "Daily" }, #{ text: "Weekly", value: "Weekly" }, @@ -2660,7 +2996,12 @@ request_community_membership: { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { label: "Email", key: "email", pattern: "[^@]+@[^@]+\\.[^@]+", field: "textfield" }, + { + label: "Email", + key: "email", + pattern: "[^@]+@[^@]+\\.[^@]+", + field: "textfield", + }, ] requirements: [ From d61dbacba546a0bbaab23c1e8515b9bf99f3503e Mon Sep 17 00:00:00 2001 From: kei5uke Date: Wed, 5 Aug 2026 16:00:07 +0200 Subject: [PATCH 02/21] prettier --- .vscode/settings.json | 4 ++++ docs/public/cfg/service_desk.yml | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3456e8c675..75c7315c11 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,5 +37,9 @@ "files.trimTrailingWhitespace": false, "editor.tabSize": 2, "editor.defaultFormatter": null + }, + "[yml]": { + "editor.formatOnSave": false, + "editor.defaultFormatter": null } } diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index 08e823b41f..bf790f6584 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -197,12 +197,6 @@ request_new_lab: scratch_gb={scratch_volume} --- - Billing information: - --- - account_information_k_sted="{account_information_k_sted}" - account_information_p_number="{account_information_p_number}" - --- - Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user From 4045a59673febf7535fdbf6ad6e634b4fdffceb7 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Wed, 5 Aug 2026 16:04:38 +0200 Subject: [PATCH 03/21] fix: missing fields --- docs/public/cfg/service_desk.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index bf790f6584..08e823b41f 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -197,6 +197,12 @@ request_new_lab: scratch_gb={scratch_volume} --- + Billing information: + --- + account_information_k_sted="{account_information_k_sted}" + account_information_p_number="{account_information_p_number}" + --- + Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user From 5b0bd4c1f39b96d2f4dadc30fbbddcebceb2bbd7 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Wed, 5 Aug 2026 16:23:26 +0200 Subject: [PATCH 04/21] format setting --- .vscode/settings.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 75c7315c11..66998d961a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -36,10 +36,7 @@ "[docs/public/cfg/service_desk.yml]": { "files.trimTrailingWhitespace": false, "editor.tabSize": 2, - "editor.defaultFormatter": null - }, - "[yml]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": null + "editor.defaultFormatter": null, + "editor.formatOnSave": false } } From 11c8ff406f7fb79720309391fc9ead9c5dfdfba8 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Thu, 6 Aug 2026 09:17:08 +0200 Subject: [PATCH 05/21] put it back --- docs/public/cfg/service_desk.yml | 487 +++++-------------------------- 1 file changed, 73 insertions(+), 414 deletions(-) diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index 08e823b41f..416ddd7b79 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -17,18 +17,8 @@ general_contact_request: fields: [ { label: "Request topic", key: "topic", field: "textfield" }, - { - label: "Lab (Optional)", - key: "lab_name", - field: "textfield", - optional: true, - }, - { - label: "Data Space (Optional)", - key: "data_space", - field: "textfield", - optional: true, - }, + { label: "Lab (Optional)", key: "lab_name", field: "textfield", optional: true }, + { label: "Data Space (Optional)", key: "data_space", field: "textfield", optional: true }, ] requirements: [ @@ -187,7 +177,7 @@ request_new_lab: --- lab_name="{lab_name}" --- - + We would like to start with the following machine type and storage resources for our home machine: --- @@ -197,46 +187,6 @@ request_new_lab: scratch_gb={scratch_volume} --- - Billing information: - --- - account_information_k_sted="{account_information_k_sted}" - account_information_p_number="{account_information_p_number}" - --- - - Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: - - https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user - - I am looking forward to receive an email verification stating that the lab is up and running. - - - Best regards, - body_external: | - Hi HUNT Cloud team, - - I would like to request a new lab. - - I have attached a signed lab agreement to this email for the following lab: - - --- - lab_name="{lab_name}" - --- - - We would like to start with the following machine type and storage resources for our home machine: - - --- - machine_type="{machine_type}" - archive_gb={archive_volume} - work_gb={work_volume} - scratch_gb={scratch_volume} - --- - - Billing information: - --- - billing_information_peppol_bis="{billing_information_peppol_bis}" - billing_information_reference_number="{billing_information_reference_number}" - --- - Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user @@ -255,12 +205,12 @@ request_new_lab: autocapitalize: "off", field: "textfield", }, - # { label: "Data space name", - # key: "data_space", - # pattern: "[-a-z0-9]{3,}", - # hint: "Data space name should include only letters a-z, 0-9, or dot.", - # field: "textfield" - # }, +# { label: "Data space name", +# key: "data_space", +# pattern: "[-a-z0-9]{3,}", +# hint: "Data space name should include only letters a-z, 0-9, or dot.", +# field: "textfield" +# }, { label: "Machine type (c1 is default)", key: "machine_type", @@ -268,10 +218,7 @@ request_new_lab: field: "autocompleteone", options: [ - { - type: "subheader", - text: "B - Series machine types: 2 GB of RAM per CPU core", - }, + { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -281,10 +228,7 @@ request_new_lab: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { - type: "subheader", - text: "C - Series machine types: 4 GB of RAM per CPU core", - }, + { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -294,10 +238,7 @@ request_new_lab: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { - type: "subheader", - text: "D - Series machine types: 8 GB of RAM per CPU core", - }, + { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -307,10 +248,7 @@ request_new_lab: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { - type: "subheader", - text: "E - Series machine types: 16 GB of RAM per CPU core", - }, + { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -353,34 +291,6 @@ request_new_lab: field: "number", default: 300, }, - { - label: "Account Informatin: K.STED", - key: "account_information_k_sted", - autocapitalize: "off", - field: "textfield", - type: "ntnu-internal", - }, - { - label: "Account Informatin: P.NUMBER", - key: "account_information_p_number", - autocapitalize: "off", - field: "textfield", - type: "ntnu-internal", - }, - { - label: "Billing Informatin: PEPPOL BIS", - key: "billing_information_peppol_bis", - autocapitalize: "off", - field: "textfield", - type: "external", - }, - { - label: "Billing Informatin: REFERENCE NUMBER", - key: "billing_information_reference_number", - autocapitalize: "off", - field: "textfield", - type: "external", - }, ] requirements: [ @@ -485,11 +395,7 @@ request_external_import_kista: autocapitalize: "off", field: "textfield", }, - { - label: "External organization", - key: "external_organization", - field: "textfield", - }, + { label: "External organization", key: "external_organization", field: "textfield" }, { label: "Public IPv4 address of external organization (only if outside of NTNU)", key: "ipaddress", @@ -540,11 +446,7 @@ request_external_export_kista: autocapitalize: "off", field: "textfield", }, - { - label: "External organization", - key: "external_organization", - field: "textfield", - }, + { label: "External organization", key: "external_organization", field: "textfield" }, { label: "Public IPv4 address of external organization (only if outside of NTNU)", key: "ipaddress", @@ -638,28 +540,13 @@ update_data_space_administrator_role: autocapitalize: "off", field: "textfield", }, - { - label: "Role", - key: "role", - field: "selectone", - options: ["Compliance", "Data", "Technical", "Knowledge", "Financial"], - }, + { label: "Role", key: "role", field: "selectone", options: ["Compliance", "Data", "Technical", "Knowledge", "Financial"] }, { label: "Name and Surname", key: "name", field: "textfield" }, { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { - label: "Email", - key: "email", - pattern: "[^@]+@[^@]+\\.[^@]+", - field: "textfield", - }, - { - label: "Phone number", - key: "phone", - pattern: "[0-9+]{3,}", - field: "textfield", - }, + { label: "Email", key: "email", pattern: "[^@]+@[^@]+\\.[^@]+", field: "textfield" }, + { label: "Phone number", key: "phone", pattern: "[0-9+]{3,}", field: "textfield" }, ] requirements: [ @@ -890,14 +777,12 @@ request_lab_transfer: "Cost: Included in your data space subscription.", "We care about your privacy. Read our privacy statement (link here) to learn how we process your personal data when you send us a request.", ] - attachments: - [ - "Required: Signed lab transfer order (.pdf)", - "Optional: Signed invoice profile (.pdf)", - ] + attachments: ["Required: Signed lab transfer order (.pdf)", "Optional: Signed invoice profile (.pdf)"] ### Data Controller Orders + + request_organizational_access: title: "Request organizational access to HUNT Cloud" template: @@ -913,15 +798,7 @@ request_organizational_access: Best regards, - fields: - [ - { - label: "Organization", - key: "organization", - autocapitalize: "off", - field: "textfield", - }, - ] + fields: [{ label: "Organization", key: "organization", autocapitalize: "off", field: "textfield" }] requirements: [ "Who can order: Representatives for the organizational unit that request access.", @@ -933,6 +810,7 @@ request_organizational_access: ] attachments: [HUNT Cloud organizational access request form (.pdf)] + ### Lab orders request_access_new_user: @@ -953,12 +831,7 @@ request_access_new_user: fields: [ - { - label: "Name of user", - key: "username", - autocapitalize: "off", - field: "textfield", - }, + { label: "Name of user", key: "username", autocapitalize: "off", field: "textfield" }, { label: "Lab name", key: "lab_name", @@ -1053,12 +926,7 @@ reactivate_lab_user: autocapitalize: "off", field: "textfield", }, - { - label: "Name of user", - key: "username", - autocapitalize: "off", - field: "textfield", - }, + { label: "Name of user", key: "username", autocapitalize: "off", field: "textfield" }, ] requirements: [ @@ -1169,10 +1037,7 @@ request_machine_size_update: field: "autocompleteone", options: [ - { - type: "subheader", - text: "B - Series machine types: 2 GB of RAM per CPU core", - }, + { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1182,10 +1047,7 @@ request_machine_size_update: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { - type: "subheader", - text: "C - Series machine types: 4 GB of RAM per CPU core", - }, + { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1195,10 +1057,7 @@ request_machine_size_update: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { - type: "subheader", - text: "D - Series machine types: 8 GB of RAM per CPU core", - }, + { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1208,10 +1067,7 @@ request_machine_size_update: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { - type: "subheader", - text: "E - Series machine types: 16 GB of RAM per CPU core", - }, + { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1231,10 +1087,7 @@ request_machine_size_update: field: "autocompleteone", options: [ - { - type: "subheader", - text: "B - Series machine types: 2 GB of RAM per CPU core", - }, + { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1244,10 +1097,7 @@ request_machine_size_update: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { - type: "subheader", - text: "C - Series machine types: 4 GB of RAM per CPU core", - }, + { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1257,10 +1107,7 @@ request_machine_size_update: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { - type: "subheader", - text: "D - Series machine types: 8 GB of RAM per CPU core", - }, + { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1270,10 +1117,7 @@ request_machine_size_update: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { - type: "subheader", - text: "E - Series machine types: 16 GB of RAM per CPU core", - }, + { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1336,10 +1180,7 @@ request_new_cpu: field: "autocompleteone", options: [ - { - type: "subheader", - text: "B - Series machine types: 2 GB of RAM per CPU core", - }, + { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1349,10 +1190,7 @@ request_new_cpu: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { - type: "subheader", - text: "C - Series machine types: 4 GB of RAM per CPU core", - }, + { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1362,10 +1200,7 @@ request_new_cpu: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { - type: "subheader", - text: "D - Series machine types: 8 GB of RAM per CPU core", - }, + { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1375,10 +1210,7 @@ request_new_cpu: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { - type: "subheader", - text: "E - Series machine types: 16 GB of RAM per CPU core", - }, + { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1403,22 +1235,9 @@ request_new_cpu: label: "Storage type", key: "storage_type", field: "autocompleteone", - options: - [ - { text: "Regular storage (HDD)", value: "regular" }, - { text: "Fast storage (NVME)", value: "nvme" }, - ], - }, - { - label: "Subscription", - key: "subscription", - field: "autocompleteone", - options: - [ - { text: "On-demand", value: "ondemand" }, - { text: "Spot", value: "spot" }, - ], + options: [{ text: "Regular storage (HDD)", value: "regular" }, { text: "Fast storage (NVME)", value: "nvme" }], }, + { label: "Subscription", key: "subscription", field: "autocompleteone", options: [{ text: "On-demand", value: "ondemand" }, { text: "Spot", value: "spot" }] }, ] requirements: [ @@ -1481,12 +1300,7 @@ request_new_gpu: { text: "NVIDIA RTX PRO 6000 96G", value: "rtx.pro.6000.96g" }, ], }, - { - label: "How many GPUs?", - key: "gpu_amount", - field: "autocompleteone", - options: [{ text: "1", value: "1" }, { text: "2", value: "2" }], - }, + { label: "How many GPUs?", key: "gpu_amount", field: "autocompleteone", options: [{ text: "1", value: "1" }, { text: "2", value: "2" }] }, { label: "Machine type", key: "machine_type", @@ -1497,10 +1311,7 @@ request_new_gpu: field: "autocompleteone", options: [ - { - type: "subheader", - text: "B - Series machine types: 2 GB of RAM per CPU core", - }, + { type: "subheader", text: "B - Series machine types: 2 GB of RAM per CPU core" }, { text: "b1 - 2 CPUs / 4 GB RAM", value: "default.b1" }, { text: "b2 - 4 CPUs / 8 GB RAM", value: "default.b2" }, { text: "b3 - 8 CPUs / 16 GB RAM", value: "default.b3" }, @@ -1510,10 +1321,7 @@ request_new_gpu: { text: "b7 - 64 CPUs / 128 GB RAM", value: "default.b7" }, { text: "b8 - 80 CPUs / 160 GB RAM", value: "default.b8" }, { type: "divider" }, - { - type: "subheader", - text: "C - Series machine types: 4 GB of RAM per CPU core", - }, + { type: "subheader", text: "C - Series machine types: 4 GB of RAM per CPU core" }, { text: "c1 - 2 CPUs / 8 GB RAM", value: "default.c1" }, { text: "c2 - 4 CPUs / 16 GB RAM", value: "default.c2" }, { text: "c3 - 8 CPUs / 32 GB RAM", value: "default.c3" }, @@ -1523,10 +1331,7 @@ request_new_gpu: { text: "c7 - 64 CPUs / 256 GB RAM", value: "default.c7" }, { text: "c8 - 80 CPUs / 320 GB RAM", value: "default.c8" }, { type: "divider" }, - { - type: "subheader", - text: "D - Series machine types: 8 GB of RAM per CPU core", - }, + { type: "subheader", text: "D - Series machine types: 8 GB of RAM per CPU core" }, { text: "d1 - 2 CPUs / 16 GB RAM", value: "default.d1" }, { text: "d2 - 4 CPUs / 32 GB RAM", value: "default.d2" }, { text: "d3 - 8 CPUs / 64 GB RAM", value: "default.d3" }, @@ -1536,10 +1341,7 @@ request_new_gpu: { text: "d7 - 64 CPUs / 512 GB RAM", value: "default.d7" }, { text: "d8 - 80 CPUs / 640 GB RAM", value: "default.d8" }, { type: "divider" }, - { - type: "subheader", - text: "E - Series machine types: 16 GB of RAM per CPU core", - }, + { type: "subheader", text: "E - Series machine types: 16 GB of RAM per CPU core" }, { text: "e1 - 2 CPUs / 32 GB RAM", value: "default.e1" }, { text: "e2 - 4 CPUs / 64 GB RAM", value: "default.e2" }, { text: "e3 - 8 CPUs / 128 GB RAM", value: "default.e3" }, @@ -1564,22 +1366,9 @@ request_new_gpu: label: "Storage type", key: "storage_type", field: "autocompleteone", - options: - [ - { text: "Fast storage (NVME)", value: "nvme" }, - { text: "Regular storage (HDD)", value: "regular" }, - ], - }, - { - label: "Subscription", - key: "subscription", - field: "autocompleteone", - options: - [ - { text: "On-demand", value: "ondemand" }, - { text: "Spot", value: "spot" }, - ], + options: [{ text: "Fast storage (NVME)", value: "nvme" }, { text: "Regular storage (HDD)", value: "regular" }], }, + { label: "Subscription", key: "subscription", field: "autocompleteone", options: [{ text: "On-demand", value: "ondemand" }, { text: "Spot", value: "spot" }] }, ] requirements: [ @@ -1622,16 +1411,7 @@ request_blue_fleet: autocapitalize: "off", field: "textfield", }, - { - label: "Number of machines", - hint: "Field should include only numbers", - key: "number", - min: 2, - max: 100, - step: 1, - field: "number", - default: 2, - }, + { label: "Number of machines", hint: "Field should include only numbers", key: "number", min: 2, max: 100, step: 1, field: "number", default: 2 }, { label: "Machine type", key: "machine_type", @@ -1847,13 +1627,7 @@ request_expand_existing_volume: label: "Volume name", key: "volume_name", field: "autocompleteone", - options: - [ - { text: "Archive", value: "archive" }, - { text: "Work", value: "work" }, - { text: "Scratch", value: "scratch" }, - { text: "Backup", value: "backup" }, - ], + options: [{ text: "Archive", value: "archive" }, { text: "Work", value: "work" }, { text: "Scratch", value: "scratch" }, { text: "Backup", value: "backup" }], }, { label: "Volume number (optional)", @@ -1861,19 +1635,7 @@ request_expand_existing_volume: field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: - [ - { text: "No number", value: "" }, - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ], + options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], optional: true, }, { @@ -1967,19 +1729,7 @@ request_new_storage_volume: field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: - [ - { text: "No number", value: "" }, - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ], + options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], optional: true, }, { @@ -1993,12 +1743,7 @@ request_new_storage_volume: field: "number", default: 1, }, - { - label: "Enable restore service (optional)", - key: "restore", - field: "autocompleteone", - options: [{ text: "Yes", value: "yes" }, { text: "No", value: "no" }], - }, + { label: "Enable restore service (optional)", key: "restore", field: "autocompleteone", options: [{ text: "Yes", value: "yes" }, { text: "No", value: "no" }] }, ] requirements: [ @@ -2049,31 +1794,14 @@ request_volume_deletion: autocapitalize: "off", field: "textfield", }, - { - label: "Volume name", - key: "volume_name", - field: "autocompleteone", - options: ["archive", "work", "scratch", "backup"], - }, + { label: "Volume name", key: "volume_name", field: "autocompleteone", options: ["archive", "work", "scratch", "backup"] }, { label: "Volume number (optional)", key: "volume_number", field: "autocompleteone", hint: "If no number in volume name use 1.", default: "", - options: - [ - { text: "No number", value: "" }, - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ], + options: [{ text: "No number", value: "" }, "1", "2", "3", "4", "5", "6", "7", "8", "9"], optional: true, }, ] @@ -2106,12 +1834,7 @@ request_internal_kista: fields: [ - { - label: "Name and Surname", - key: "uploaderlabresponsiblefullname", - hint: "Full name of sender or signatory", - field: "textfield", - }, + { label: "Name and Surname", key: "uploaderlabresponsiblefullname", hint: "Full name of sender or signatory", field: "textfield" }, { label: "Uploader Lab", key: "labname", @@ -2181,18 +1904,8 @@ request_coordinator_update: { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { - label: "Email address", - key: "email", - pattern: "[^@].*[@]+.*", - field: "textfield", - }, - { - label: "Phone number", - key: "phone", - pattern: "[0-9+]{3,}", - field: "textfield", - }, + { label: "Email address", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, + { label: "Phone number", key: "phone", pattern: "[0-9+]{3,}", field: "textfield" }, ] requirements: [ @@ -2220,15 +1933,7 @@ new_data_space: I am looking forward to an email verification on the data space registration so we can start to order our labs. Best, - fields: - [ - { - label: "Service center name", - key: "service_center", - pattern: "(.){3,}", - field: "textfield", - }, - ] + fields: [{ label: "Service center name", key: "service_center", pattern: "(.){3,}", field: "textfield" }] requirements: [ "Guide: Scientific access", @@ -2288,12 +1993,7 @@ request_workbench_access: { text: "MATLAB (need license)", value: "MATLAB" }, { text: "Stata (need license)", value: "Stata" }, ], - default: - [ - { text: "Rstudio", value: "Rstudio" }, - { text: "Jupyter", value: "Jupyter" }, - { text: "Python", value: "Python" }, - ], + default: [{ text: "Rstudio", value: "Rstudio" }, { text: "Jupyter", value: "Jupyter" }, { text: "Python", value: "Python" }], }, ] requirements: @@ -2394,24 +2094,9 @@ request_workbench_troubleshooting: autocapitalize: "off", field: "textfield", }, - { - label: "Operating system", - key: "operating_system", - field: "textfield", - hint: "Windows, MacOS, or Linux (e.g. Ubuntu)", - }, - { - label: "Web browser", - key: "web_browser", - field: "textfield", - hint: "Google Chrome or Mozilla Firefox?", - }, - { - label: "Problem description", - key: "problem_description", - field: "textarea", - autocapitalize: "off", - }, + { label: "Operating system", key: "operating_system", field: "textfield", hint: "Windows, MacOS, or Linux (e.g. Ubuntu)" }, + { label: "Web browser", key: "web_browser", field: "textfield", hint: "Google Chrome or Mozilla Firefox?" }, + { label: "Problem description", key: "problem_description", field: "textarea", autocapitalize: "off" }, ] requirements: [ @@ -2421,10 +2106,7 @@ request_workbench_troubleshooting: "Cost: Included in the lab subscription.", "We care about your privacy. Read our privacy statement (link here) to learn how we process your personal data when you send us a request.", ] - attachments: - [ - "Screenshots or any error logs that might be useful for investigation of the issue.", - ] + attachments: ["Screenshots or any error logs that might be useful for investigation of the issue."] request_ssh_pass_reset: title: "Request SSH passphrase reset" @@ -2549,19 +2231,8 @@ request_vpn_link: hint: "Get your IP address here: https://docs.hdc.ntnu.no/ipv4/", field: "textfield", }, - { - label: "Access duration", - key: "access_duration", - field: "selectone", - options: ["Temporary", "Permanent"], - default: ["Temporary"], - }, - { - label: "Access Country", - key: "country", - pattern: '^[\-A-z0-9\._]*$', - field: "textfield", - }, + { label: "Access duration", key: "access_duration", field: "selectone", options: ["Temporary", "Permanent"], default: ["Temporary"] }, + { label: "Access Country", key: "country", pattern: '^[\-A-z0-9\._]*$', field: "textfield" }, ] requirements: [ @@ -2735,12 +2406,7 @@ request_update_lagtun_rep: autocapitalize: "off", field: "textfield", }, - { - label: "Email", - key: "email", - pattern: "[^@].*[@]+.*", - field: "textfield", - }, + { label: "Email", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, ] requirements: [ @@ -2778,12 +2444,7 @@ request_update_data_rep: autocapitalize: "off", field: "textfield", }, - { - label: "Email", - key: "email", - pattern: "[^@].*[@]+.*", - field: "textfield", - }, + { label: "Email", key: "email", pattern: "[^@].*[@]+.*", field: "textfield" }, ] requirements: [ @@ -2849,7 +2510,8 @@ request_tape_backup: label: "Scope of tape write", key: "tapewrite_type", field: "autocompleteone", - options: [ + options: + [ { text: "Full volume backup", value: "Full volume" }, #{ text: "Selected dataset backup", value: "Selected dataset" }, ], @@ -2859,7 +2521,8 @@ request_tape_backup: key: "volume_target", hint: "Select the volume. Leave as N/A for selected dataset backups.", field: "autocompleteone", - options: [ + options: + [ #{ text: "Not applicable (selected dataset)", value: "N/A" }, { text: "archive", value: "archive" }, { text: "archive2", value: "archive2" }, @@ -2903,7 +2566,8 @@ request_tape_backup: key: "backup_interval", hint: "For scheduled backups only. Select 'Not applicable' for one-time archive.", field: "autocompleteone", - options: [ + options: + [ { text: "Not applicable (one-time archive)", value: "N/A" }, #{ text: "Daily", value: "Daily" }, #{ text: "Weekly", value: "Weekly" }, @@ -2996,12 +2660,7 @@ request_community_membership: { label: "Department", key: "department", field: "textfield" }, { label: "Faculty", key: "faculty", field: "textfield" }, { label: "Institution", key: "institution", field: "textfield" }, - { - label: "Email", - key: "email", - pattern: "[^@]+@[^@]+\\.[^@]+", - field: "textfield", - }, + { label: "Email", key: "email", pattern: "[^@]+@[^@]+\\.[^@]+", field: "textfield" }, ] requirements: [ From 4784420327c8e4d24c2aefa352b7318fa0296742 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Thu, 6 Aug 2026 09:40:37 +0200 Subject: [PATCH 06/21] no prettier --- docs/public/cfg/service_desk.yml | 69 ++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index 416ddd7b79..0e3f58d1b0 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -187,6 +187,12 @@ request_new_lab: scratch_gb={scratch_volume} --- + Billing information: + --- + account_information_k_sted="{account_information_k_sted}" + account_information_p_number="{account_information_p_number}" + --- + Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user @@ -195,6 +201,41 @@ request_new_lab: Best regards, + body_external: | + Hi HUNT Cloud team, + + I would like to request a new lab. + + I have attached a signed lab agreement to this email for the following lab: + + --- + lab_name="{lab_name}" + --- + + We would like to start with the following machine type and storage resources for our home machine: + + --- + machine_type="{machine_type}" + archive_gb={archive_volume} + work_gb={work_volume} + scratch_gb={scratch_volume} + --- + + Billing information: + --- + billing_information_peppol_bis="{billing_information_peppol_bis}" + billing_information_reference_number="{billing_information_reference_number}" + --- + + Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: + + https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user + + I am looking forward to receive an email verification stating that the lab is up and running. + + + Best regards, + fields: [ { @@ -291,6 +332,34 @@ request_new_lab: field: "number", default: 300, }, + { + label: "Account Informatin: K.STED", + key: "account_information_k_sted", + autocapitalize: "off", + field: "textfield", + type: "ntnu-internal", + }, + { + label: "Account Informatin: P.NUMBER", + key: "account_information_p_number", + autocapitalize: "off", + field: "textfield", + type: "ntnu-internal", + }, + { + label: "Billing Informatin: PEPPOL BIS", + key: "billing_information_peppol_bis", + autocapitalize: "off", + field: "textfield", + type: "external", + }, + { + label: "Billing Informatin: REFERENCE NUMBER", + key: "billing_information_reference_number", + autocapitalize: "off", + field: "textfield", + type: "external", + }, ] requirements: [ From ddd8b96b44a6a09a5d71536fd458ef3ee43eb551 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Thu, 6 Aug 2026 11:15:08 +0200 Subject: [PATCH 07/21] feat: templater engine --- .../theme/components/legacy/ServiceDesk.vue | 35 +++++++++------ docs/.vitepress/theme/plugins/nunjucks.ts | 11 +++++ docs/public/cfg/service_desk.yml | 45 ++++--------------- package.json | 2 + 4 files changed, 43 insertions(+), 50 deletions(-) create mode 100644 docs/.vitepress/theme/plugins/nunjucks.ts diff --git a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue index 077b8e5cf4..61a0df0936 100644 --- a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue +++ b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue @@ -7,6 +7,8 @@ defineOptions({ name: "ServiceDesk", }) +import nunjucksEnv from "../../plugins/nunjucks" + // Emits definition const emit = defineEmits(["update:modelValue"]) @@ -43,6 +45,18 @@ const panel = ref(0) const clientType = ref("") // Computed properties + +// Context handed to nunjucks when rendering subject/body: the entered +// form fields plus a derived is_external flag, so a single template can +// branch on {% if is_external %} instead of needing a separate +// body/body_external pair. +const templateContext = computed(() => { + return { + ...formData.value, + is_external: clientType.value === "external", + } +}) + const messageSubject = computed(() => { return subjectTemplate.value ? wrap(subjectTemplate.value) : null }) @@ -110,11 +124,10 @@ const activateSendButtons = () => { const submit = () => { panel.value = 3 if (props.template) { - if (clientType.value === "ntnu-internal") { - bodyTemplate.value = props.template.body - } else { - bodyTemplate.value = props.template.body_external - } + // There's only one body template now — the internal/external + // difference is handled inside the template via {% if is_external %}, + // driven by templateContext, not by picking a different string here. + bodyTemplate.value = props.template.body } setTimeout(activateSendButtons, 1200) } @@ -144,14 +157,10 @@ const actionSendOutlookPopup = () => { const wrap = (template) => { let text = template - for (const [key, value] of Object.entries(formData.value)) { - if (value || value === "") { - if (Array.isArray(value)) { - text = text.replaceAll(`{${key}}`, value.join(", ")) - } else { - text = text.replaceAll(`{${key}}`, value) - } - } + try { + text = nunjucksEnv.renderString(template, templateContext.value) + } catch (ex) { + console.log("Failed to render template", ex) } text = text.replaceAll("\n---\n", "\n```\n") return text diff --git a/docs/.vitepress/theme/plugins/nunjucks.ts b/docs/.vitepress/theme/plugins/nunjucks.ts new file mode 100644 index 0000000000..bde2b14bd6 --- /dev/null +++ b/docs/.vitepress/theme/plugins/nunjucks.ts @@ -0,0 +1,11 @@ +// Library for render Jinja template + +import nunjucks from "nunjucks" + +const nunjucksEnv = new nunjucks.Environment(null, { + autoescape: false, + trimBlocks: true, + lstripBlocks: true, +}) + +export default nunjucksEnv diff --git a/docs/public/cfg/service_desk.yml b/docs/public/cfg/service_desk.yml index 0e3f58d1b0..3c9f65da44 100644 --- a/docs/public/cfg/service_desk.yml +++ b/docs/public/cfg/service_desk.yml @@ -187,44 +187,15 @@ request_new_lab: scratch_gb={scratch_volume} --- - Billing information: + Billing information ({% if is_external %}External{% else %}NTNU internal{% endif %}): --- - account_information_k_sted="{account_information_k_sted}" - account_information_p_number="{account_information_p_number}" - --- - - Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: - - https://docs.hdc.ntnu.no/administer-science/service-desk/lab-orders/#add-a-new-lab-user - - I am looking forward to receive an email verification stating that the lab is up and running. - - - Best regards, - body_external: | - Hi HUNT Cloud team, - - I would like to request a new lab. - - I have attached a signed lab agreement to this email for the following lab: - - --- - lab_name="{lab_name}" - --- - - We would like to start with the following machine type and storage resources for our home machine: - - --- - machine_type="{machine_type}" - archive_gb={archive_volume} - work_gb={work_volume} - scratch_gb={scratch_volume} - --- - - Billing information: - --- - billing_information_peppol_bis="{billing_information_peppol_bis}" - billing_information_reference_number="{billing_information_reference_number}" + {% if is_external %} + billing_information_peppol_bis="{{ billing_information_peppol_bis }}" + billing_information_reference_number="{{ billing_information_reference_number }}" + {% else %} + account_information_k_sted="{{ account_information_k_sted }}" + account_information_p_number="{{ account_information_p_number }}" + {% endif %} --- Our lab leader or lab coordinator will as quickly as possible forward individual user agreements for our initial users as separate requests using this link: diff --git a/package.json b/package.json index 207fb04eb4..ac4d2f11b3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "devDependencies": { + "@types/nunjucks": "^3.2.6", "@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue-jsx": "^5.1.1", "@vue/test-utils": "^2.4.6", @@ -30,6 +31,7 @@ "axios": "^1.12.2", "country-list-json": "^1.1.0", "markdown-it": "^14.1.0", + "nunjucks": "^3.2.4", "pdf-lib": "^1.17.1", "signature_pad": "^5.1.1", "vue-pdf-embed": "^2.1.3", From d4f5823f4819e64d12c929175f26cdfd169dc5df Mon Sep 17 00:00:00 2001 From: kei5uke Date: Thu, 6 Aug 2026 13:52:03 +0200 Subject: [PATCH 08/21] fix: hardcoded values --- .../theme/components/legacy/ServiceDesk.vue | 68 +++---------------- docs/.vitepress/theme/plugins/nunjucks.ts | 4 ++ docs/public/cfg/service_desk.yml | 23 +++++-- 3 files changed, 32 insertions(+), 63 deletions(-) diff --git a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue index 61a0df0936..430cfe942d 100644 --- a/docs/.vitepress/theme/components/legacy/ServiceDesk.vue +++ b/docs/.vitepress/theme/components/legacy/ServiceDesk.vue @@ -9,10 +9,8 @@ defineOptions({ import nunjucksEnv from "../../plugins/nunjucks" -// Emits definition const emit = defineEmits(["update:modelValue"]) -// Props definition const props = defineProps({ id: { type: String, default: "applet" }, modelValue: { type: Boolean, default: false }, // Changed from 'value' to 'modelValue' @@ -29,7 +27,6 @@ const props = defineProps({ fullscreen: { type: Boolean, default: false }, }) -// Reactive data const subjectTemplate = ref(null) const bodyTemplate = ref(null) const formData = ref({}) @@ -42,18 +39,10 @@ const sendClicked = ref(false) const finalizeClicked = ref(false) const panel = ref(0) -const clientType = ref("") -// Computed properties - -// Context handed to nunjucks when rendering subject/body: the entered -// form fields plus a derived is_external flag, so a single template can -// branch on {% if is_external %} instead of needing a separate -// body/body_external pair. const templateContext = computed(() => { return { ...formData.value, - is_external: clientType.value === "external", } }) @@ -66,7 +55,11 @@ const messageBody = computed(() => { }) const formFilled = computed(() => { - return props.fields.filter((item) => item.type === undefined || item.type === clientType.value).every((item) => (formData.value[item.key] || item.optional ? true : false)) + return ( + props.fields + .filter((item) => item.type === undefined || item.type === formData.value['client_type']) + .every((item) => (formData.value[item.key] || item.optional ? true : false)) + ) }) const encodedSubject = computed(() => { @@ -122,11 +115,8 @@ const activateSendButtons = () => { } const submit = () => { - panel.value = 3 + panel.value = 2 if (props.template) { - // There's only one body template now — the internal/external - // difference is handled inside the template via {% if is_external %}, - // driven by templateContext, not by picking a different string here. bodyTemplate.value = props.template.body } setTimeout(activateSendButtons, 1200) @@ -134,24 +124,24 @@ const submit = () => { const review = () => { finalizeClicked.value = true - panel.value = 2 + panel.value = 1 } const actionSend = () => { sendClicked.value = true - panel.value = 3 + panel.value = 2 window.location.href = mailto.value } const actionSendOutlook = () => { sendClicked.value = true - panel.value = 3 + panel.value = 2 window.location.href = deeplinkUrl.value } const actionSendOutlookPopup = () => { sendClicked.value = true - panel.value = 3 + panel.value = 2 window.open(deeplinkUrl.value, "_blank") } @@ -264,41 +254,6 @@ onMounted(() => { - - - NTNU or External - - - - - - - - - - - Continue - - - - - Form @@ -420,7 +375,7 @@ onMounted(() => { /> {