add search engine - ringle
This commit is contained in:
@@ -74,7 +74,7 @@ end
|
||||
|
||||
local function loadDomains()
|
||||
print('Loading domains...')
|
||||
local response = fetch('gurt://localhost:8877/auth/domains?page=1&size=100', {
|
||||
local response = fetch('gurt://localhost:8877/auth/domains?page=1&limit=100', {
|
||||
headers = {
|
||||
Authorization = 'Bearer ' .. authToken
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ gurt.select('#add-record-btn'):on('click', function()
|
||||
local recordType = gurt.select('#record-type').value
|
||||
local recordName = gurt.select('#record-name').value
|
||||
local recordValue = gurt.select('#record-value').value
|
||||
local recordTTL = tonumber(gurt.select('#record-ttl').value) or ''
|
||||
local recordTTL = tonumber(gurt.select('#record-ttl').value) or 'none'
|
||||
|
||||
if not recordValue or recordValue == '' then
|
||||
showError('record-error', 'Record value is required')
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
input {
|
||||
w-full p-3 border border-gray-600 rounded-md bg-[#374151] text-white mb-4 placeholder:text-[#999999] outline-none active:border-red-500
|
||||
text-xs w-full p-3 border border-gray-600 rounded-md bg-[#374151] text-white mb-4 placeholder:text-[#999999] outline-none active:border-red-500
|
||||
}
|
||||
|
||||
button {
|
||||
@@ -51,4 +51,4 @@
|
||||
|
||||
<p id="log-output" style="min-h-24"></p>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
@@ -39,9 +39,9 @@ local function renderTLDSelector()
|
||||
local total = #tlds
|
||||
local intervalId
|
||||
|
||||
intervalId = gurt.setInterval(function()
|
||||
intervalId = setInterval(function()
|
||||
if i > total then
|
||||
gurt.clearInterval(intervalId)
|
||||
clearInterval(intervalId)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
28
dns/migrations/010_add_search_crawl_status.sql
Normal file
28
dns/migrations/010_add_search_crawl_status.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Search engine domain crawl status tracking
|
||||
CREATE TABLE IF NOT EXISTS domain_crawl_status (
|
||||
domain_id INTEGER PRIMARY KEY REFERENCES domains(id) ON DELETE CASCADE,
|
||||
last_crawled_at TIMESTAMPTZ,
|
||||
next_crawl_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||
crawl_status VARCHAR(20) DEFAULT 'pending' CHECK (crawl_status IN ('pending', 'crawling', 'completed', 'failed', 'disabled')),
|
||||
error_message TEXT,
|
||||
pages_found INTEGER DEFAULT 0,
|
||||
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_domain_crawl_status_next_crawl ON domain_crawl_status(next_crawl_at);
|
||||
CREATE INDEX IF NOT EXISTS idx_domain_crawl_status_status ON domain_crawl_status(crawl_status);
|
||||
|
||||
-- Function to update the updated_at column
|
||||
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
NEW.updated_at = CURRENT_TIMESTAMP;
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
-- Trigger for updated_at
|
||||
DROP TRIGGER IF EXISTS update_domain_crawl_status_updated_at ON domain_crawl_status;
|
||||
CREATE TRIGGER update_domain_crawl_status_updated_at
|
||||
BEFORE UPDATE ON domain_crawl_status
|
||||
FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();
|
||||
Reference in New Issue
Block a user