+
+
diff --git a/dns/domain_clone/domain_clone.css b/dns/domain_clone/domain_clone.css
new file mode 100644
index 0000000..642469b
--- /dev/null
+++ b/dns/domain_clone/domain_clone.css
@@ -0,0 +1,31 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+@import url('/global.css');
+
+#domain-clone {
+ padding: 0px 15px 15px;
+}
+
+tbody:not(.lmc-tbody-head) tr:last-of-type {
+ border: none;
+}
+
+tbody:not(.lmc-tbody-head) tr td:first-of-type {
+ font-weight: bold;
+ text-align: right;
+}
diff --git a/dns/domain_clone/domain_clone.js b/dns/domain_clone/domain_clone.js
new file mode 100644
index 0000000..ca3a026
--- /dev/null
+++ b/dns/domain_clone/domain_clone.js
@@ -0,0 +1,95 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+import { settings, elements, apiGet, apiPost, parseParams, setupHeader } from "/global.js";
+
+(function()
+{
+ // Element names specific to this page
+ elements.cloneButton = "clone-button";
+ elements.existingDomain = "existing-domain";
+ elements.newDomain = "new-domain";
+
+ // Data recieved from API calls
+ var data = {};
+
+ // Static references to UI elements
+ var ui = {};
+ ui.cloneButton = {};
+ ui.existingDomain = {};
+ ui.newDomain = {};
+
+ // Callback for domains API call
+ var displayDomains = function(response)
+ {
+ // Add domains to selector
+ for (var i = 0; i < response.data.length; i++) {
+ var domain = document.createElement("option");
+ domain.value = response.data[i].id;
+ domain.innerHTML = response.data[i].domain;
+ ui.existingDomain.appendChild(domain);
+ }
+
+ // Request the next page if there are more pages
+ if (response.page != response.pages)
+ apiGet("/domains?page=" + (response.page + 1), displayDomains, null);
+ else
+ ui.cloneButton.disabled = false;
+ };
+
+ // Click handler for clone button
+ var handleClone = function(event)
+ {
+ if (event.currentTarget.disabled)
+ return;
+
+ // This request takes a few seconds
+ ui.cloneButton.disabled = true;
+
+ var req = {
+ "domain": ui.newDomain.value
+ };
+
+ apiPost("/domains/" + ui.existingDomain.value + "/clone", req, function(response)
+ {
+ location.href = "/dns/domain?did=" + response.id;
+ });
+ };
+
+ // Initial setup
+ var setup = function()
+ {
+ // Parse URL parameters
+ data.params = parseParams();
+
+ setupHeader();
+
+ // Get element references
+ ui.cloneButton = document.getElementById(elements.cloneButton);
+ ui.existingDomain = document.getElementById(elements.existingDomain);
+ ui.newDomain = document.getElementById(elements.newDomain);
+
+ // Attach event handlers
+ ui.cloneButton.addEventListener("click", handleClone);
+
+ // Get data from API
+ apiGet("/domains", displayDomains, null);
+ };
+
+ // Attach onload handler
+ window.addEventListener("load", setup);
+})();
diff --git a/dns/domain_clone/index.shtml b/dns/domain_clone/index.shtml
new file mode 100644
index 0000000..21b9259
--- /dev/null
+++ b/dns/domain_clone/index.shtml
@@ -0,0 +1,55 @@
+
+
+
+
+
+ LMC - Clone a Zone
+
+
+
+
+
+
+
+
+
diff --git a/dns/domain_delete/domain_delete.css b/dns/domain_delete/domain_delete.css
new file mode 100644
index 0000000..9e202f8
--- /dev/null
+++ b/dns/domain_delete/domain_delete.css
@@ -0,0 +1,26 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+@import url('/global.css');
+
+#domain {
+ font-weight: bold;
+}
+
+#domain-delete {
+ padding: 0px 15px 15px;
+}
diff --git a/dns/domain_delete/domain_delete.js b/dns/domain_delete/domain_delete.js
new file mode 100644
index 0000000..087fae6
--- /dev/null
+++ b/dns/domain_delete/domain_delete.js
@@ -0,0 +1,87 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+import { settings, elements, apiDelete, apiGet, parseParams, setupHeader } from "/global.js";
+
+(function()
+{
+ // Element names specific to this page
+ elements.deleteButton = "delete-button";
+ elements.domain = "domain";
+
+ // Data recieved from API calls
+ var data = {};
+
+ // Static references to UI elements
+ var ui = {};
+ ui.deleteButton = {};
+ ui.domain = {};
+
+ // Callback for domain details API call
+ var displayDetails = function(response)
+ {
+ // Set page title and header stuff
+ document.title += " // " + response.domain;
+ ui.domain.innerHTML = response.domain;
+ ui.deleteButton.disabled = false;
+ };
+
+ // Click handler for delete button
+ var handleDelete = function(event)
+ {
+ if (event.currentTarget.disabled)
+ return;
+
+ apiDelete("/domains/" + data.params.did, function(response)
+ {
+ location.href = "/dns";
+ });
+ };
+
+ // Initial setup
+ var setup = function()
+ {
+ // Parse URL parameters
+ data.params = parseParams();
+
+ // We need a domain ID, so die if we don't have it
+ if (!data.params.did) {
+ alert("No domain ID supplied!");
+ return;
+ }
+
+ setupHeader();
+
+ // Update links on page to include proper Linode ID
+ var anchors = document.getElementsByTagName("a");
+ for (var i = 0; i < anchors.length; i++)
+ anchors[i].href = anchors[i].href.replace("did=0", "did=" + data.params.did);
+
+ // Get element references
+ ui.deleteButton = document.getElementById(elements.deleteButton);
+ ui.domain = document.getElementById(elements.domain);
+
+ // Attach event handlers
+ ui.deleteButton.addEventListener("click", handleDelete);
+
+ // Get data from API
+ apiGet("/domains/" + data.params.did, displayDetails, null);
+ };
+
+ // Attach onload handler
+ window.addEventListener("load", setup);
+})();
diff --git a/dns/domain_delete/index.shtml b/dns/domain_delete/index.shtml
new file mode 100644
index 0000000..e7155ae
--- /dev/null
+++ b/dns/domain_delete/index.shtml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ LMC - Remove Zone
+
+
+
+
+
+
+
+
+
diff --git a/dns/domain_import/domain_import.css b/dns/domain_import/domain_import.css
new file mode 100644
index 0000000..997b6f8
--- /dev/null
+++ b/dns/domain_import/domain_import.css
@@ -0,0 +1,36 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+@import url('/global.css');
+
+#domain-import {
+ padding: 0px 15px 15px;
+}
+
+#domain-import p {
+ background-color: #8BCBEA;
+ padding: 8px;
+}
+
+tbody:not(.lmc-tbody-head) tr:last-of-type {
+ border: none;
+}
+
+tbody:not(.lmc-tbody-head) tr td:first-of-type {
+ font-weight: bold;
+ text-align: right;
+}
diff --git a/dns/domain_import/domain_import.js b/dns/domain_import/domain_import.js
new file mode 100644
index 0000000..45a128e
--- /dev/null
+++ b/dns/domain_import/domain_import.js
@@ -0,0 +1,72 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+import { settings, elements, apiPost, parseParams, setupHeader } from "/global.js";
+
+(function()
+{
+ // Element names specific to this page
+ elements.domain = "domain";
+ elements.importButton = "import-button";
+ elements.nameserver = "nameserver";
+
+ // Data recieved from API calls
+ var data = {};
+
+ // Static references to UI elements
+ var ui = {};
+ ui.domain = {};
+ ui.importButton = {};
+ ui.nameserver = {};
+
+ // Click handler for import button
+ var handleImport = function(event)
+ {
+ if (event.currentTarget.disabled)
+ return;
+
+ var req = {
+ "domain": ui.domain.value,
+ "remote_nameserver": ui.nameserver.value
+ };
+
+ apiPost("/domains/import", req, function(response)
+ {
+ location.href = "/dns/domain?did=" + response.id;
+ });
+ };
+
+ // Initial setup
+ var setup = function()
+ {
+ // Parse URL parameters
+ data.params = parseParams();
+
+ setupHeader();
+
+ // Get element references
+ ui.domain = document.getElementById(elements.domain);
+ ui.importButton = document.getElementById(elements.importButton);
+ ui.nameserver = document.getElementById(elements.nameserver);
+
+ // Attach event handlers
+ ui.importButton.addEventListener("click", handleImport);
+ };
+
+ // Attach onload handler
+ window.addEventListener("load", setup);
+})();
diff --git a/dns/domain_import/index.shtml b/dns/domain_import/index.shtml
new file mode 100644
index 0000000..30b5e81
--- /dev/null
+++ b/dns/domain_import/index.shtml
@@ -0,0 +1,56 @@
+
+
+
+
+
+ LMC - Import a Zone
+
+
+
+
+
+
+
Your nameserver must allow zone transfers (AXFR) from 96.126.114.97, 96.126.114.98, 2600:3c00::5e, and 2600:3c00::5f
+
+
+
+
diff --git a/dns/domain_soa/domain_soa.css b/dns/domain_soa/domain_soa.css
new file mode 100644
index 0000000..c99a7f1
--- /dev/null
+++ b/dns/domain_soa/domain_soa.css
@@ -0,0 +1,32 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+@import url('/global.css');
+
+#domain-soa {
+ padding: 0px 15px 15px;
+}
+
+tbody:not(.lmc-tbody-head) tr td:first-of-type {
+ font-weight: bold;
+ text-align: right;
+ white-space: nowrap;
+}
+
+tbody:not(.lmc-tbody-head) tr:last-of-type {
+ border: none;
+}
diff --git a/dns/domain_soa/domain_soa.js b/dns/domain_soa/domain_soa.js
new file mode 100644
index 0000000..4681691
--- /dev/null
+++ b/dns/domain_soa/domain_soa.js
@@ -0,0 +1,164 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+import { settings, elements, apiGet, apiPut, parseParams, setupHeader } from "/global.js";
+
+(function()
+{
+ // Element names specific to this page
+ elements.axfr = "axfr";
+ elements.email = "email";
+ elements.expire = "expire";
+ elements.domain = "domain";
+ elements.domainLabel = "domain-label";
+ elements.domainTag = "domain-tag";
+ elements.domainTagLink = "domain-tag-link";
+ elements.refresh = "refresh";
+ elements.retry = "retry";
+ elements.saveButton = "save-button";
+ elements.status = "status";
+ elements.tags = "tags";
+ elements.ttl = "ttl";
+
+ // Data recieved from API calls
+ var data = {};
+ data.domain = {};
+
+ // Static references to UI elements
+ var ui = {};
+ ui.axfr = {};
+ ui.email = {};
+ ui.expire = {};
+ ui.domain = {};
+ ui.domainLabel = {};
+ ui.domainTag = {};
+ ui.domainTagLink = {};
+ ui.refresh = {};
+ ui.retry = {};
+ ui.saveButton = {};
+ ui.status = {};
+ ui.tags = {};
+ ui.ttl = {};
+
+ // Callback for domain details API call
+ var displayDetails = function(response)
+ {
+ data.domain = response;
+
+ // Set page title and header stuff
+ document.title += " // " + data.domain.domain;
+ ui.domainLabel.innerHTML = data.domain.domain;
+ if (data.domain.tags.length == 1) {
+ ui.domainTagLink.href = "/dns?tag=" + data.domain.tags[0];
+ ui.domainTagLink.innerHTML = "(" + data.domain.tags[0] + ")";
+ ui.domainTag.style.display = "inline";
+ }
+
+ // Set form info
+ ui.domain.value = data.domain.domain;
+ ui.email.value = data.domain.soa_email;
+ ui.status.value = data.domain.status;
+ ui.tags.value = data.domain.tags.join(",");
+ ui.axfr.value = data.domain.axfr_ips.join("\n");
+ ui.ttl.value = data.domain.ttl_sec;
+ ui.refresh.value = data.domain.refresh_sec;
+ ui.retry.value = data.domain.retry_sec;
+ ui.expire.value = data.domain.expire_sec;
+
+ ui.saveButton.disabled = false;
+ };
+
+ // Click handler for save button
+ var handleSave = function(event)
+ {
+ if (event.currentTarget.disabled)
+ return;
+
+ // This request can take a few seconds,
+ // so disable the button to prevent antsy users from double-submitting
+ ui.saveButton.disabled = true;
+
+ var req = {
+ "domain": ui.domain.value,
+ "soa_email": ui.email.value,
+ "status": ui.status.value,
+ "tags": [],
+ "axfr_ips": [],
+ "ttl_sec": parseInt(ui.ttl.value),
+ "refresh_sec": parseInt(ui.refresh.value),
+ "retry_sec": parseInt(ui.retry.value),
+ "expire_sec": parseInt(ui.expire.value)
+ };
+
+ if (ui.tags.value.length)
+ req.tags = ui.tags.value.split(",");
+ if (ui.axfr.value.length) {
+ var axfrLines = ui.axfr.value.split("\n");
+ for (var i = 0; i < axfrLines.length; i++)
+ req.axfr_ips = req.axfr_ips.concat(axfrLines[i].split(";"));
+ }
+
+ apiPut("/domains/" + data.params.did, req, function(response)
+ {
+ location.href = "/dns/domain?did=" + data.params.did;
+ });
+ };
+
+ // Initial setup
+ var setup = function()
+ {
+ // Parse URL parameters
+ data.params = parseParams();
+
+ // We need a domain ID, so die if we don't have it
+ if (!data.params.did) {
+ alert("No domain ID supplied!");
+ return;
+ }
+
+ setupHeader();
+
+ // Update links on page to include proper Linode ID
+ var anchors = document.getElementsByTagName("a");
+ for (var i = 0; i < anchors.length; i++)
+ anchors[i].href = anchors[i].href.replace("did=0", "did=" + data.params.did);
+
+ // Get element references
+ ui.axfr = document.getElementById(elements.axfr);
+ ui.email = document.getElementById(elements.email);
+ ui.expire = document.getElementById(elements.expire);
+ ui.domain = document.getElementById(elements.domain);
+ ui.domainLabel = document.getElementById(elements.domainLabel);
+ ui.domainTag = document.getElementById(elements.domainTag);
+ ui.domainTagLink = document.getElementById(elements.domainTagLink);
+ ui.refresh = document.getElementById(elements.refresh);
+ ui.retry = document.getElementById(elements.retry);
+ ui.saveButton = document.getElementById(elements.saveButton);
+ ui.status = document.getElementById(elements.status);
+ ui.tags = document.getElementById(elements.tags);
+ ui.ttl = document.getElementById(elements.ttl);
+
+ // Attach event handlers
+ ui.saveButton.addEventListener("click", handleSave);
+
+ // Get data from API
+ apiGet("/domains/" + data.params.did, displayDetails, null);
+ };
+
+ // Attach onload handler
+ window.addEventListener("load", setup);
+})();
diff --git a/dns/domain_soa/index.shtml b/dns/domain_soa/index.shtml
new file mode 100644
index 0000000..24d7c7f
--- /dev/null
+++ b/dns/domain_soa/index.shtml
@@ -0,0 +1,165 @@
+
+
+
+
+
+ LMC - Edit Domain
+
+
+
+
+
+
+
+
+
diff --git a/dns/resource_delete/resource_delete.css b/dns/resource_delete/resource_delete.css
new file mode 100644
index 0000000..4c1e73d
--- /dev/null
+++ b/dns/resource_delete/resource_delete.css
@@ -0,0 +1,22 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+@import url('/global.css');
+
+#resource-delete {
+ padding: 0px 15px 15px;
+}
diff --git a/dns/resource_delete/resource_delete.js b/dns/resource_delete/resource_delete.js
new file mode 100644
index 0000000..c5036b4
--- /dev/null
+++ b/dns/resource_delete/resource_delete.js
@@ -0,0 +1,121 @@
+/*
+ * This file is part of Linode Manager Classic.
+ *
+ * Linode Manager Classic is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Linode Manager Classic is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Linode Manager Classic. If not, see .
+ */
+
+import { settings, elements, apiDelete, apiGet, parseParams, setupHeader } from "/global.js";
+
+(function()
+{
+ // Element names specific to this page
+ elements.deleteButton = "delete-button";
+ elements.domainLabel = "domain-label";
+ elements.domainTag = "domain-tag";
+ elements.domainTagLink = "domain-tag-link";
+ elements.recordType = "record-type";
+ elements.topLinksTitle = "top-links-title";
+
+ // Data recieved from API calls
+ var data = {};
+
+ // Static references to UI elements
+ var ui = {};
+ ui.deleteButton = {};
+ ui.domainLabel = {};
+ ui.domainTag = {};
+ ui.domainTagLink = {};
+ ui.recordType = {};
+ ui.topLinksTitle = {};
+
+ // Callback for domain details API call
+ var displayDetails = function(response)
+ {
+ // Set page title and header stuff
+ document.title += " // " + response.domain;
+ ui.domainLabel.innerHTML = response.domain;
+ if (response.tags.length == 1) {
+ ui.domainTagLink.href = "/dns?tag=" + response.tags[0];
+ ui.domainTagLink.innerHTML = "(" + response.tags[0] + ")";
+ ui.domainTag.style.display = "inline";
+ }
+ };
+
+ // Callback for record details API call
+ var displayRecord = function(response)
+ {
+ ui.recordType.innerHTML = response.type;
+ if (response.name && response.name.length != 0)
+ ui.topLinksTitle.innerHTML += " " + response.name;
+ else
+ ui.topLinksTitle.innerHTML += " " + response.target;
+ ui.deleteButton.disabled = false;
+ };
+
+ // Click handler for delete button
+ var handleDelete = function(event)
+ {
+ if (event.currentTarget.disabled)
+ return;
+
+ apiDelete("/domains/" + data.params.did + "/records/" + data.params.rid, function(response)
+ {
+ location.href = "/dns/domain?did=" + data.params.did;
+ });
+ };
+
+ // Initial setup
+ var setup = function()
+ {
+ // Parse URL parameters
+ data.params = parseParams();
+
+ // We need a domain ID, so die if we don't have it
+ if (!data.params.did) {
+ alert("No domain ID supplied!");
+ return;
+ }
+
+ // We also need a resource ID
+ if (!data.params.rid) {
+ alert("No resource ID supplied!");
+ return;
+ }
+
+ setupHeader();
+
+ // Update links on page to include proper Linode ID
+ var anchors = document.getElementsByTagName("a");
+ for (var i = 0; i < anchors.length; i++)
+ anchors[i].href = anchors[i].href.replace("did=0", "did=" + data.params.did);
+
+ // Get element references
+ ui.deleteButton = document.getElementById(elements.deleteButton);
+ ui.domainLabel = document.getElementById(elements.domainLabel);
+ ui.domainTag = document.getElementById(elements.domainTag);
+ ui.domainTagLink = document.getElementById(elements.domainTagLink);
+ ui.recordType = document.getElementById(elements.recordType);
+ ui.topLinksTitle = document.getElementsByClassName(elements.topLinksTitle)[0];
+
+ // Attach event handlers
+ ui.deleteButton.addEventListener("click", handleDelete);
+
+ // Get data from API
+ apiGet("/domains/" + data.params.did, displayDetails, null);
+ apiGet("/domains/" + data.params.did + "/records/" + data.params.rid, displayRecord, null);
+ };
+
+ // Attach onload handler
+ window.addEventListener("load", setup);
+})();
diff --git a/global.css b/global.css
index 724d015..c159c60 100644
--- a/global.css
+++ b/global.css
@@ -57,6 +57,10 @@ button {
font-size: 14px;
}
+#domain-tag {
+ display: none;
+}
+
header {
background-color: #32AE4D;
}
diff --git a/linodes/linodes.js b/linodes/linodes.js
index 5c52981..f03e3f2 100644
--- a/linodes/linodes.js
+++ b/linodes/linodes.js
@@ -233,8 +233,12 @@ import { settings, elements, regionNames, apiGet, parseParams, setupHeader } fro
return;
}
+ // Remove tag filter if there are no linodes with given tag
+ if (data.linodes.length == 0 && data.params.tag)
+ location.href = "/linodes";
+
// Redirect to add page if there are no linodes
- if (data.linodes.length == 0)
+ if (data.linodes.length == 0 && !data.params.tag)
location.href = "/linodes/add";
// Sort