Merge branch 'backstage:master' into plugin-azure-functions

This commit is contained in:
Wesley
2022-10-18 18:11:46 +02:00
committed by GitHub
502 changed files with 6074 additions and 1906 deletions
-15
View File
@@ -1,15 +0,0 @@
---
title: GKE Usage
author: BESTSELLER
authorUrl: https://bestsellerit.com
category: Discovery
description: This plugin will show you the cost and resource usage of your application within Google Kubernetes Engine (GKE).
documentation: https://github.com/BESTSELLER/backstage-plugin-gkeusage/blob/master/README.md
iconUrl: img/gke-logo.png
npmPackageName: '@bestsellerit/backstage-plugin-gkeusage'
tags:
- gke
- cost
- google
- usage
- metering
+27 -1
View File
@@ -16,11 +16,30 @@ const {
const pluginsDirectory = require('path').join(process.cwd(), 'data/plugins');
const pluginMetadata = fs
.readdirSync(pluginsDirectory)
.map(file => yaml.load(fs.readFileSync(`./data/plugins/${file}`, 'utf8')))
.map(file => {
const fileContent = fs.readFileSync(`./data/plugins/${file}`, 'utf8');
let metadata = yaml.load(fileContent);
const gitIsoDate = require('child_process')
.execFileSync('git', [
'log',
'-1',
'--format="%ai"',
'--reverse',
`./data/plugins/${file}`,
])
.toString();
metadata.date = new Date(gitIsoDate);
return metadata;
})
.sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
const truncate = text =>
text.length > 170 ? text.substr(0, 170) + '...' : text;
const newForDays = 100;
const addPluginDocsLink = '/docs/plugins/add-to-marketplace';
const defaultIconUrl = 'img/logo-gradient-on-dark.svg';
@@ -100,8 +119,15 @@ const Plugins = () => (
authorUrl,
documentation,
category,
date,
}) => (
<div className="PluginCard">
{Math.trunc((Date.now() - date) / (1000 * 60 * 60 * 24)) <
newForDays && (
<div className="ribbon ribbon-top-right">
<span>NEW</span>
</div>
)}
<div className="PluginCardHeader">
<div className="PluginCardImage">
<img src={iconUrl || defaultIconUrl} alt={title} />
+29
View File
@@ -4,6 +4,7 @@
padding: 16px;
display: flex;
flex-direction: column;
position: relative;
}
.PluginGrid {
@@ -141,3 +142,31 @@
#add-plugin-card {
border: 1px solid #69ddc7;
}
/* RIBBON */
.ribbon {
width: 80px;
height: 80px;
overflow: hidden;
position: absolute;
}
.ribbon span {
position: absolute;
display: block;
width: 140px;
padding: 4px 0;
background-color: rgb(54, 186, 162, 0.85);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
color: #fff;
text-align: center;
}
.ribbon-top-right {
top: 0;
right: 0;
}
.ribbon-top-right span {
left: -17px;
top: 11px;
transform: rotate(45deg);
}