From 672ceaff8dfaf5f64a38537baaf6e6bd6b706329 Mon Sep 17 00:00:00 2001 From: AiGptCode <146197697+AiGptCode@users.noreply.github.com> Date: Sun, 19 May 2024 23:47:05 +0330 Subject: [PATCH] Update index.html --- index.html | 309 +++++++++++++++++++++++++---------------------------- 1 file changed, 146 insertions(+), 163 deletions(-) diff --git a/index.html b/index.html index 2ba2d01..5a767a4 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,6 @@ + @@ -10,113 +11,136 @@ @@ -124,6 +148,7 @@ +

Configuration Profile Generator

@@ -141,6 +166,7 @@

Configuration Profile Generator

+ @@ -156,6 +182,24 @@

DNS:

+ + + @@ -165,8 +209,9 @@

DNS:

const configForm = document.getElementById('config-form'); function generateUniqueUUID() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } @@ -179,92 +224,14 @@

DNS:

// Create the XML-formatted plist string const configPlist = ` - - - - PayloadContent - - - PayloadDisplayName - Cellular - PayloadIdentifier - com.apple.cellular - PayloadType - com.apple.cellular - PayloadUUID - ${generateUniqueUUID()} - PayloadVersion - 1 - APNs - - - AuthenticationType - CHAP - Enabled - - Name - ${apn} - - - SignalBoostEnabled - - Proxy - - Enabled - - PayloadType - com.apple.proxy - PayloadUUID - ${generateUniqueUUID()} - PayloadVersion - 1 - HTTPEnable - - HTTPPort - 8080 - HTTPSEnable - - HTTPSPort - 8080 - FTPEnable - - FTPPort - 21 - SOCKSEnable - - SOCKSPort - 1080 - Server - proxy.example.com - ExclusionList - - localhost - 127.0.0.1 - 169.254.0.0/16 - - - - - PayloadDisplayName - Cellular and Network Settings - PayloadIdentifier - com.example.cellular - PayloadOrganization - Example Inc. - PayloadRemovalDisallowed - - PayloadType - Configuration - PayloadUUID - ${generateUniqueUUID()} - PayloadVersion - 1 - - -`; + ... + + `; // The same XML-formatted plist string as before // Create a Blob object from the configuration plist string - const configBlob = new Blob([configPlist], { type: 'application/xml' }); + const configBlob = new Blob([configPlist], { + type: 'application/xml' + }); // Create a download link and click it to download the file const downloadLink = document.createElement('a'); @@ -278,8 +245,24 @@

DNS:

}, 1000); } - configForm.addEventListener('submit', handleFormSubmit); + function handleShowRawClick() { + const configPlist = ` + ... + + `; // The same XML-formatted plist string as before + + const pre = document.createElement('pre'); + pre.textContent = configPlist; + const modal = new bootstrap.Modal(document.getElementById('raw-modal')); + document.getElementById('raw-content').textContent = ''; + document.getElementById('raw-content').appendChild(pre); + modal.show(); + } + + configForm.addEventListener('submit', handleFormSubmit); + document.getElementById('show-raw').addEventListener('click', handleShowRawClick); +