Implemented user profile settings, OAuth apps, and maintenance windows. Other minor fixes/improvements
This commit is contained in:
62
profile/referrals/index.shtml
Normal file
62
profile/referrals/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 - My Profile // Referrals</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="referrals.css" />
|
||||
<script src="referrals.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="referrals">
|
||||
<table class="lmc-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">Referrals</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="lmc-tr3">
|
||||
<td>Description</td>
|
||||
<td>
|
||||
Referrals reward you when you refer people to Linode. If someone signs up using your referral code, you'll receive a credit of<br />
|
||||
$20.00, so long as the person you referred remains an active customer for 90 days.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="lmc-tr3">
|
||||
<td>Your referral code</td>
|
||||
<td id="code"></td>
|
||||
</tr>
|
||||
<tr class="lmc-tr3">
|
||||
<td>Your referral URL</td>
|
||||
<td id="url"></td>
|
||||
</tr>
|
||||
<tr class="lmc-tr3">
|
||||
<td></td>
|
||||
<td>You have <span id="total"></span> total referrals: <span id="completed"></span> completed ($<span id="dollars"></span>) and <span id="pending"></span> pending</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
35
profile/referrals/referrals.css
Normal file
35
profile/referrals/referrals.css
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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');
|
||||
|
||||
#code {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
#referrals {
|
||||
padding: 15px 15px 15px;
|
||||
}
|
||||
|
||||
tbody:not(.lmc-tbody-head) tr td:first-of-type {
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#url {
|
||||
font-family: monospace;
|
||||
}
|
75
profile/referrals/referrals.js
Normal file
75
profile/referrals/referrals.js
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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, apiGet, parseParams, setupHeader } from "/global.js";
|
||||
|
||||
(function()
|
||||
{
|
||||
// Element names specific to this page
|
||||
elements.code = "code";
|
||||
elements.completed = "completed";
|
||||
elements.dollars = "dollars";
|
||||
elements.pending = "pending";
|
||||
elements.total = "total";
|
||||
elements.url = "url";
|
||||
|
||||
// Data received from API calls
|
||||
var data = {};
|
||||
|
||||
// Static references to UI elements
|
||||
var ui = {};
|
||||
ui.code = {};
|
||||
ui.completed = {};
|
||||
ui.dollars = {};
|
||||
ui.pending = {};
|
||||
ui.total = {};
|
||||
ui.url = {};
|
||||
|
||||
// Callback for profile API call
|
||||
var displayProfile = function(response)
|
||||
{
|
||||
ui.code.innerHTML = response.referrals.code;
|
||||
ui.url.innerHTML = response.referrals.url;
|
||||
ui.total.innerHTML = response.referrals.total;
|
||||
ui.completed.innerHTML = response.referrals.completed;
|
||||
ui.dollars.innerHTML = response.referrals.credit.toFixed(2);
|
||||
ui.pending.innerHTML = response.referrals.pending;
|
||||
};
|
||||
|
||||
// Initial setup
|
||||
var setup = function()
|
||||
{
|
||||
// Parse URL parameters
|
||||
data.params = parseParams();
|
||||
|
||||
setupHeader();
|
||||
|
||||
// Get element references
|
||||
ui.code = document.getElementById(elements.code);
|
||||
ui.completed = document.getElementById(elements.completed);
|
||||
ui.dollars = document.getElementById(elements.dollars);
|
||||
ui.pending = document.getElementById(elements.pending);
|
||||
ui.total = document.getElementById(elements.total);
|
||||
ui.url = document.getElementById(elements.url);
|
||||
|
||||
// Get data from API
|
||||
apiGet("/profile", displayProfile, null);
|
||||
};
|
||||
|
||||
// Attach onload handler
|
||||
window.addEventListener("load", setup);
|
||||
})();
|
Reference in New Issue
Block a user