Added Account section
This commit is contained in:
34
account/cancel/cancel.css
Normal file
34
account/cancel/cancel.css
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@import url('/global.css');
|
||||
|
||||
#cancel {
|
||||
padding: 15px 15px 15px;
|
||||
}
|
||||
|
||||
#cancel-note {
|
||||
background-color: #8BCBEA;
|
||||
margin: 15px auto 0;
|
||||
padding: 10px;
|
||||
width: 51%;
|
||||
}
|
||||
|
||||
tbody tr td:first-of-type {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
74
account/cancel/cancel.js
Normal file
74
account/cancel/cancel.js
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { settings, elements, apiPost, parseParams, setupHeader } from "/global.js";
|
||||
|
||||
(function()
|
||||
{
|
||||
// Element names specific to this page
|
||||
elements.cancelButton = "cancel-button";
|
||||
elements.confirm = "confirm";
|
||||
elements.reason = "reason";
|
||||
|
||||
// Data received from API calls
|
||||
var data = {};
|
||||
|
||||
// Static references to UI elements
|
||||
var ui = {};
|
||||
ui.cancelButton = {};
|
||||
ui.confirm = {};
|
||||
ui.reason = {};
|
||||
|
||||
// Click handler for cancel button
|
||||
var handleCancel = function(event)
|
||||
{
|
||||
if (!ui.confirm.checked)
|
||||
return;
|
||||
|
||||
var req = {
|
||||
"comments": ui.reason.value
|
||||
};
|
||||
|
||||
apiPost("/account/cancel", req, function(response)
|
||||
{
|
||||
if (response.survey_link)
|
||||
location.href = response.survey_link;
|
||||
else
|
||||
location.href = "/logout";
|
||||
});
|
||||
};
|
||||
|
||||
// Initial setup
|
||||
var setup = function()
|
||||
{
|
||||
// Parse URL parameters
|
||||
data.params = parseParams();
|
||||
|
||||
setupHeader();
|
||||
|
||||
// Get element references
|
||||
ui.cancelButton = document.getElementById(elements.cancelButton);
|
||||
ui.confirm = document.getElementById(elements.confirm);
|
||||
ui.reason = document.getElementById(elements.reason);
|
||||
|
||||
// Attach event handlers
|
||||
ui.cancelButton.addEventListener("click", handleCancel);
|
||||
};
|
||||
|
||||
// Attach onload handler
|
||||
window.addEventListener("load", setup);
|
||||
})();
|
62
account/cancel/index.shtml
Normal file
62
account/cancel/index.shtml
Normal file
@ -0,0 +1,62 @@
|
||||
<!--
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>LMC - Account // Cancel</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="cancel.css" />
|
||||
<script src="cancel.js" type="module"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!--#include virtual="/include/header.html"-->
|
||||
<!--#include virtual="/include/account_subnav.html"-->
|
||||
<div id="main-content" class="wrapper">
|
||||
<div id="cancel">
|
||||
<table class="lmc-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">Cancel Account</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Sorry to see you go!</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="lmc-tr3">
|
||||
<td>Reason</td>
|
||||
<td>
|
||||
Please share why you're cancelling your account:<br />
|
||||
<textarea id="reason" rows="6" cols="65"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="lmc-tr3">
|
||||
<td></td>
|
||||
<td>
|
||||
<input id="confirm" type="checkbox" /> <label for="confirm">I confirm that I want to cancel this entire account</label><br />
|
||||
<br />
|
||||
<button id="cancel-button" type="button">Cancel this Account Immediately</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p id="cancel-note">NOTE: This will <strong>immediately</strong> shut down and cancel all of your Linodes, DNS hosting, and inactivate all Users. You will not be able to log into your account after cancelling.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user