mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge remote-tracking branch 'origin/master' into page_registry_issue_1258
# Conflicts: # extensions/support-page/renderer.tsx
This commit is contained in:
commit
356cbefddc
@ -6,7 +6,7 @@ In this topic, we'll teach you the fundamental concepts for building extensions.
|
||||
|
||||
Simple Lens extension that adds "Hello World" page to a cluster menu.
|
||||
|
||||
### Linux
|
||||
### Setup the extension directory
|
||||
|
||||
First you will need to clone the [Lens Extension samples](https://github.com/lensapp/lens-extension-samples) repository to your local machine:
|
||||
|
||||
@ -16,12 +16,36 @@ git clone https://github.com/lensapp/lens-extension-samples.git
|
||||
|
||||
Next you need to create a symlink from the directory that Lens will monitor for user installed extensions to the sample extension, in this case **helloworld-sample**:
|
||||
|
||||
**Linux & MacOS**
|
||||
```sh
|
||||
mkdir -p ~/.k8slens/extensions
|
||||
cd ~/.k8slens/extensions
|
||||
ln -s <lens-extension-samples directory>/helloworld-sample helloworld-sample
|
||||
ln -s lens-extension-samples/helloworld-sample helloworld-sample
|
||||
```
|
||||
|
||||
**Windows**
|
||||
|
||||
Create the directory that Lens will monitor for user installed extensions:
|
||||
|
||||
```sh
|
||||
mkdir C:\Users\<user>\.k8slens\extensions -force
|
||||
cd C:\Users\<user>\.k8slens\extensions
|
||||
```
|
||||
|
||||
If you have administrator rights, you can create symlink to the sample extension, in this case **helloworld-sample**:
|
||||
|
||||
```sh
|
||||
cmd /c mklink /D helloworld-sample lens-extension-samples\helloworld-sample
|
||||
```
|
||||
|
||||
Without administrator rights, you need to copy the extensions sample directory into `C:\Users\<user>\.k8slens\extensions`:
|
||||
|
||||
```
|
||||
Copy-Item 'lens-extension-samples\helloworld-sample' 'C:\Users\<user>\.k8slens\extensions\helloworld-sample'
|
||||
```
|
||||
|
||||
### Build the extension
|
||||
|
||||
To build the extension you can use `make` or run the `npm` commands manually:
|
||||
|
||||
```sh
|
||||
|
||||
@ -14,8 +14,8 @@ export default class SupportPageRendererExtension extends LensRendererExtension
|
||||
statusBarItems: Interface.StatusBarRegistration[] = [
|
||||
{
|
||||
item: (
|
||||
<div className="flex align-center gaps hover-highlight" onClick={() => this.navigate()}>
|
||||
<Component.Icon material="help" smallest/>
|
||||
<div className="SupportPageIcon flex align-center" onClick={() => this.navigate()}>
|
||||
<Component.Icon interactive material="help" smallest/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -10,4 +10,10 @@
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.SupportPageIcon {
|
||||
color: white;
|
||||
font-size: var(--font-size-small);
|
||||
padding-right: calc(var(--padding) / 2);
|
||||
}
|
||||
@ -2,27 +2,19 @@
|
||||
$spacing: $padding / 2;
|
||||
--flex-gap: #{$spacing};
|
||||
|
||||
font-size: $font-size-small;
|
||||
background-color: #3d90ce;
|
||||
background-color: var(--blue);
|
||||
padding: 0 2px;
|
||||
color: white;
|
||||
height: 22px;
|
||||
|
||||
#current-workspace {
|
||||
font-size: var(--font-size-small);
|
||||
color: white;
|
||||
padding: $padding / 4 $padding / 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hover-highlight {
|
||||
&:hover {
|
||||
background-color: #ffffff33;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.extensions {
|
||||
> * {
|
||||
padding: $padding / 4 $padding / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class BottomBar extends React.Component {
|
||||
const { currentWorkspace } = workspaceStore;
|
||||
return (
|
||||
<div className="BottomBar flex gaps">
|
||||
<div id="current-workspace" className="flex gaps align-center hover-highlight">
|
||||
<div id="current-workspace" className="flex gaps align-center">
|
||||
<Icon smallest material="layers"/>
|
||||
<span className="workspace-name">{currentWorkspace.name}</span>
|
||||
</div>
|
||||
|
||||
@ -9,20 +9,6 @@
|
||||
grid-area: main;
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
> * {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
background-color: $mainBackground;
|
||||
|
||||
> * {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ClustersMenu {
|
||||
@ -32,4 +18,18 @@
|
||||
.BottomBar {
|
||||
grid-area: bottom-bar;
|
||||
}
|
||||
|
||||
#lens-views {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
background-color: $mainBackground;
|
||||
|
||||
iframe {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
.ClusterView {
|
||||
flex: 1;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ export class ClusterView extends React.Component<Props> {
|
||||
const { cluster } = this;
|
||||
const showStatus = cluster && (!cluster.available || !hasLoadedView(cluster.id) || !cluster.ready)
|
||||
return (
|
||||
<div className="ClusterView">
|
||||
<div className="ClusterView flex align-center">
|
||||
{showStatus && (
|
||||
<ClusterStatus key={cluster.id} clusterId={cluster.id} className="box center"/>
|
||||
)}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
--min-width: 570px;
|
||||
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid !important;
|
||||
grid-template-rows: min-content 1fr;
|
||||
@ -13,6 +14,11 @@
|
||||
&.top {
|
||||
position: fixed !important; // allow to cover ClustersMenu
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: $mainBackground;
|
||||
|
||||
// adds extra space for traffic-light top buttons (mac only)
|
||||
.is-mac & > .header {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user