Implemented user profile settings, OAuth apps, and maintenance windows. Other minor fixes/improvements

This commit is contained in:
2021-03-11 10:37:07 -05:00
parent a020009c47
commit c58e2fc545
48 changed files with 3152 additions and 36 deletions

View File

@ -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 <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LMC - My Profile // Remove SSH Key</title>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="remove.css" />
<script src="remove.js" type="module"></script>
</head>
<body>
<!--#include virtual="/include/header.html"-->
<!--#include virtual="/include/profile_subnav.html"-->
<div id="main-content" class="wrapper">
<div id="remove">
<p>Are you sure you want to delete the key <strong id="label"></strong>?</p>
<button disabled id="remove-button" type="button">Yes, delete this sucker</button>
</div>
</div>
</body>
</html>

View File

@ -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 <https://www.gnu.org/licenses/>.
*/
@import url('/global.css');
#remove {
padding: 15px 15px 15px;
}

View File

@ -0,0 +1,80 @@
/*
* 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, apiDelete, apiGet, parseParams, setupHeader } from "/global.js";
(function()
{
// Element names specific to this page
elements.label = "label";
elements.removeButton = "remove-button";
// Data received from API calls
var data = {};
// Static references to UI elements
var ui = {};
ui.label = {};
ui.removeButton = {};
// Callback for key API call
var displayKey = function(response)
{
ui.label.innerHTML = response.label;
ui.removeButton.disabled = false;
};
// Click handler for remove button
var handleRemove = function(event)
{
if (event.currentTarget.disabled)
return;
apiDelete("/profile/sshkeys/" + data.params.kid, function(response)
{
location.href = "/profile/ssh";
});
};
// Initial setup
var setup = function()
{
// Parse URL parameters
data.params = parseParams();
// We need a key ID, so die if we don't have it
if (!data.params.kid) {
alert("No key ID supplied!");
return;
}
setupHeader();
// Get element references
ui.label = document.getElementById(elements.label);
ui.removeButton = document.getElementById(elements.removeButton);
// Register event handlers
ui.removeButton.addEventListener("click", handleRemove);
// Get data from API
apiGet("/profile/sshkeys/" + data.params.kid, displayKey, null);
};
// Attach onload handler
window.addEventListener("load", setup);
})();