From e8508bfe33ec0417fed8e4542a9099027f1c5e1f Mon Sep 17 00:00:00 2001 From: Face <69168154+face-hh@users.noreply.github.com> Date: Wed, 20 Aug 2025 14:37:57 +0300 Subject: [PATCH] DNS record management, CSS grid, Regex, location.query --- dns/frontend/dashboard.lua | 43 +--- dns/frontend/domain.html | 137 ++++++++++++ dns/frontend/domain.lua | 300 ++++++++++++++++++++++++++ dns/src/gurt_server.rs | 27 ++- dns/src/gurt_server/models.rs | 44 +++- dns/src/gurt_server/routes.rs | 211 +++++++++++++++++- flumi/Scenes/Tags/input.tscn | 4 +- flumi/Scenes/Tags/select.tscn | 14 +- flumi/Scripts/B9/CSSParser.gd | 53 +++++ flumi/Scripts/B9/Lua.gd | 76 +++++++ flumi/Scripts/Constants.gd | 7 +- flumi/Scripts/Tags/input.gd | 87 +++++--- flumi/Scripts/Tags/p.gd | 2 +- flumi/Scripts/Tags/select.gd | 88 ++++++++ flumi/Scripts/Utils/GridUtils.gd | 84 ++++++++ flumi/Scripts/Utils/GridUtils.gd.uid | 1 + flumi/Scripts/Utils/Lua/DOM.gd | 77 +++++-- flumi/Scripts/Utils/Lua/Event.gd | 2 +- flumi/Scripts/Utils/Lua/Regex.gd | 142 ++++++++++++ flumi/Scripts/Utils/Lua/Regex.gd.uid | 1 + flumi/Scripts/Utils/Lua/ThreadedVM.gd | 10 + flumi/Scripts/main.gd | 64 ++++-- 22 files changed, 1351 insertions(+), 123 deletions(-) create mode 100644 dns/frontend/domain.html create mode 100644 dns/frontend/domain.lua create mode 100644 flumi/Scripts/Utils/GridUtils.gd create mode 100644 flumi/Scripts/Utils/GridUtils.gd.uid create mode 100644 flumi/Scripts/Utils/Lua/Regex.gd create mode 100644 flumi/Scripts/Utils/Lua/Regex.gd.uid diff --git a/dns/frontend/dashboard.lua b/dns/frontend/dashboard.lua index 92734ea..43093e3 100644 --- a/dns/frontend/dashboard.lua +++ b/dns/frontend/dashboard.lua @@ -44,7 +44,7 @@ local function renderDomains() for i, domain in ipairs(domains) do local domainItem = gurt.create('div', { - style = 'domain-item' + style = 'domain-item cursor-pointer hover:bg-[#4b5563]' }) local domainInfo = gurt.create('div', { style = 'w-full' }) @@ -54,51 +54,20 @@ local function renderDomains() style = 'font-bold text-lg' }) - local domainIP = gurt.create('div', { - text = 'IP: ' .. domain.ip, - style = 'text-[#6b7280]' - }) - local domainStatus = gurt.create('div', { text = 'Status: ' .. (domain.status or 'Unknown'), style = 'text-[#6b7280]' }) domainInfo:append(domainName) - domainInfo:append(domainIP) domainInfo:append(domainStatus) - local actions = gurt.create('div', { - style = 'flex gap-2' - }) - - -- Update IP button - local updateBtn = gurt.create('button', { - text = 'Update IP', - style = 'secondary-btn' - }) - - updateBtn:on('click', function() - local newIP = prompt('Enter new IP address for ' .. domain.name .. '.' .. domain.tld .. ':') - if newIP and newIP ~= '' then - updateDomainIP(domain.name, domain.tld, newIP) - end - end) - - -- Delete button - local deleteBtn = gurt.create('button', { text = 'Delete', style = 'danger-btn' }) - - deleteBtn:on('click', function() - if confirm('Are you sure you want to delete ' .. domain.name .. '.' .. domain.tld .. '?') then - deleteDomain(domain.name, domain.tld) - end - end) - - actions:append(updateBtn) - actions:append(deleteBtn) - domainItem:append(domainInfo) - domainItem:append(actions) + + domainItem:on('click', function() + gurt.location.goto('/domain.html?name=' .. domain.name .. '.' .. domain.tld) + end) + domainsList:append(domainItem) end end diff --git a/dns/frontend/domain.html b/dns/frontend/domain.html new file mode 100644 index 0000000..5a422c7 --- /dev/null +++ b/dns/frontend/domain.html @@ -0,0 +1,137 @@ + + Domain Management + + + + + + +