mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Deployed e87b4836be to master with MkDocs 1.2.1 and mike 1.0.1
This commit is contained in:
1 parent
d341619ca5
commit
6322053115
13 files changed
+285
-285
No files matched your search
@@ -995,7 +995,7 @@
|
||||
</table>
|
||||
<h4 id="returns_2">Returns<a class="headerlink" href="#returns_2" title="Permanent link">#</a></h4>
|
||||
<p><code>Disposer</code></p>
|
||||
<p>An optional disopser, Lens will cleanup when the extension is disabled or uninstalled even if this is not called</p>
|
||||
<p>An optional disposer, Lens will cleanup when the extension is disabled or uninstalled even if this is not called</p>
|
||||
<hr />
|
||||
<h3 id="createinstance">createInstance<a class="headerlink" href="#createinstance" title="Permanent link">#</a></h3>
|
||||
<p>▸ <code>Static</code> <strong>createInstance</strong><T, R>(...<code>args</code>): <code>T</code></p>
|
||||
|
||||
@@ -1109,7 +1109,7 @@
|
||||
<p>▸ <strong>getExtensionFileFolder</strong>(): <code>Promise</code><string></p>
|
||||
<p>getExtensionFileFolder returns the path to an already created folder. This
|
||||
folder is for the sole use of this extension.</p>
|
||||
<p>Note: there is no security done on this folder, only obfiscation of the
|
||||
<p>Note: there is no security done on this folder, only obfuscation of the
|
||||
folder name.</p>
|
||||
<h4 id="returns_6">Returns<a class="headerlink" href="#returns_6" title="Permanent link">#</a></h4>
|
||||
<p><code>Promise</code><string></p>
|
||||
|
||||
@@ -1220,7 +1220,7 @@
|
||||
<p>▸ <strong>getExtensionFileFolder</strong>(): <code>Promise</code><string></p>
|
||||
<p>getExtensionFileFolder returns the path to an already created folder. This
|
||||
folder is for the sole use of this extension.</p>
|
||||
<p>Note: there is no security done on this folder, only obfiscation of the
|
||||
<p>Note: there is no security done on this folder, only obfuscation of the
|
||||
folder name.</p>
|
||||
<h4 id="returns_5">Returns<a class="headerlink" href="#returns_5" title="Permanent link">#</a></h4>
|
||||
<p><code>Promise</code><string></p>
|
||||
|
||||
@@ -806,7 +806,7 @@ In this section you will learn how this extension works under the hood.</p>
|
||||
<p>The Hello World sample extension does three things:</p>
|
||||
<ul>
|
||||
<li>Implements <code>onActivate()</code> and outputs a message to the console.</li>
|
||||
<li>Implements <code>onDectivate()</code> and outputs a message to the console.</li>
|
||||
<li>Implements <code>onDeactivate()</code> and outputs a message to the console.</li>
|
||||
<li>Registers <code>ClusterPage</code> so that the page is visible in the left-side menu of the cluster dashboard.</li>
|
||||
</ul>
|
||||
<p>Let's take a closer look at our Hello World sample's source code and see how these three things are achieved.</p>
|
||||
|
||||
@@ -849,7 +849,7 @@ To reload Lens, enter <code>CMD+R</code> on Mac and <code>Ctrl+R</code> on Windo
|
||||
<p>To dive deeper, consider looking at <a href="../../capabilities/common-capabilities/">Common Capabilities</a>, <a href="../../capabilities/styling/">Styling</a>, or <a href="../anatomy/">Extension Anatomy</a>.</p>
|
||||
<p>If you find problems with the Lens Extension Generator, or have feature requests, you are welcome to raise an <a href="https://github.com/lensapp/generator-lens-ext/issues">issue</a>.
|
||||
You can find the latest Lens contribution guidelines <a href="https://docs.k8slens.dev/latest/contributing">here</a>.</p>
|
||||
<p>The Generator source code is hosted at <a href="https://github.com/lensapp/generator-lens-ext">Github</a>.</p>
|
||||
<p>The Generator source code is hosted at <a href="https://github.com/lensapp/generator-lens-ext">GitHub</a>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -937,7 +937,7 @@ Also, we can define needed sorting callbacks and search filters for the list:</p
|
||||
<span class="k">return</span> <span class="p">(</span>
|
||||
<span class="o"><</span><span class="nx">TabLayout</span><span class="o">></span>
|
||||
<span class="o"><</span><span class="nx">KubeObjectListLayout</span>
|
||||
<span class="nx">className</span><span class="o">=</span><span class="s2">"Certicates"</span> <span class="nx">store</span><span class="o">=</span><span class="p">{</span><span class="nx">certificatesStore</span><span class="p">}</span>
|
||||
<span class="nx">className</span><span class="o">=</span><span class="s2">"Certificates"</span> <span class="nx">store</span><span class="o">=</span><span class="p">{</span><span class="nx">certificatesStore</span><span class="p">}</span>
|
||||
<span class="nx">sortingCallbacks</span><span class="o">=</span><span class="p">{{</span>
|
||||
<span class="p">[</span><span class="nx">sortBy</span><span class="p">.</span><span class="nx">name</span><span class="p">]</span><span class="o">:</span> <span class="p">(</span><span class="nx">certificate</span>: <span class="kt">Certificate</span><span class="p">)</span> <span class="o">=></span> <span class="nx">certificate</span><span class="p">.</span><span class="nx">getName</span><span class="p">(),</span>
|
||||
<span class="p">[</span><span class="nx">sortBy</span><span class="p">.</span><span class="nx">namespace</span><span class="p">]</span><span class="o">:</span> <span class="p">(</span><span class="nx">certificate</span>: <span class="kt">Certificate</span><span class="p">)</span> <span class="o">=></span> <span class="nx">certificate</span><span class="p">.</span><span class="nx">metadata</span><span class="p">.</span><span class="nx">namespace</span><span class="p">,</span>
|
||||
|
||||
@@ -893,7 +893,7 @@ Note that pages are associated with the <a href="../renderer-extension/"><code>R
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
<p>When the menu item is clicked the <code>navigate()</code> method looks for and displays a global page with id <code>"myGlobalPage"</code>.
|
||||
This page would be defined in your extension's <code>Renderer.LensExtension</code> implmentation (See <a href="../renderer-extension/"><code>Renderer.LensExtension</code></a>).</p>
|
||||
This page would be defined in your extension's <code>Renderer.LensExtension</code> implementation (See <a href="../renderer-extension/"><code>Renderer.LensExtension</code></a>).</p>
|
||||
<h3 id="addcatalogsource-and-removecatalogsource-methods"><code>addCatalogSource()</code> and <code>removeCatalogSource()</code> Methods<a class="headerlink" href="#addcatalogsource-and-removecatalogsource-methods" title="Permanent link">#</a></h3>
|
||||
<p>The <code>Main.LensExtension</code> class also provides the <code>addCatalogSource()</code> and <code>removeCatalogSource()</code> methods, for managing custom catalog items (or entities).
|
||||
See the <a href="../catalog/"><code>Catalog</code></a> documentation for full details about the catalog.</p>
|
||||
|
||||
@@ -797,7 +797,7 @@ This is the cluster that the resource stack will be applied to, and the construc
|
||||
<code>kubectlApplyFolder()</code> applies to the cluster all kubernetes resources found in the folder passed to it, in this case <code>../resources</code>.
|
||||
Similarly, <code>ExampleClusterFeature</code> implements an <code>uninstall()</code> method which simply invokes the <code>kubectlDeleteFolder()</code> method of the <code>Renderer.K8sApi.ResourceStack</code> class.
|
||||
<code>kubectlDeleteFolder()</code> tries to delete from the cluster all kubernetes resources found in the folder passed to it, again in this case <code>../resources</code>. </p>
|
||||
<p><code>ExampleClusterFeature</code> also implements an <code>isInstalled()</code> method, which demonstrates how you can utiliize the kubernetes api to inspect the resource stack status.
|
||||
<p><code>ExampleClusterFeature</code> also implements an <code>isInstalled()</code> method, which demonstrates how you can utilize the kubernetes api to inspect the resource stack status.
|
||||
<code>isInstalled()</code> simply tries to find a pod named <code>example-pod</code>, as a way to determine if the pod is already installed.
|
||||
This method can be useful in creating a context-sensitive UI for installing/uninstalling the feature, as demonstrated in the next sample code.</p>
|
||||
<p>To allow the end-user to control the life cycle of this cluster feature the following code sample shows how to implement a user interface based on React and custom Lens UI components:</p>
|
||||
|
||||
@@ -889,8 +889,8 @@ This can be done in <code>./renderer.ts</code>:</p>
|
||||
<span class="k">return</span> <span class="p">(</span>
|
||||
<span class="o"><</span><span class="nx">Checkbox</span>
|
||||
<span class="nx">label</span><span class="o">=</span><span class="s2">"I understand appPreferences"</span>
|
||||
<span class="nx">value</span><span class="o">=</span><span class="p">{</span><span class="nx">ExamplePreferencesStore</span><span class="p">.</span><span class="nx">getInstace</span><span class="p">().</span><span class="nx">enabled</span><span class="p">}</span>
|
||||
<span class="nx">onChange</span><span class="o">=</span><span class="p">{</span><span class="nx">v</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">ExamplePreferencesStore</span><span class="p">.</span><span class="nx">getInstace</span><span class="p">().</span><span class="nx">enabled</span> <span class="o">=</span> <span class="nx">v</span><span class="p">;</span> <span class="p">}}</span>
|
||||
<span class="nx">value</span><span class="o">=</span><span class="p">{</span><span class="nx">ExamplePreferencesStore</span><span class="p">.</span><span class="nx">getInstance</span><span class="p">().</span><span class="nx">enabled</span><span class="p">}</span>
|
||||
<span class="nx">onChange</span><span class="o">=</span><span class="p">{</span><span class="nx">v</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">ExamplePreferencesStore</span><span class="p">.</span><span class="nx">getInstance</span><span class="p">().</span><span class="nx">enabled</span> <span class="o">=</span> <span class="nx">v</span><span class="p">;</span> <span class="p">}}</span>
|
||||
<span class="o">/></span>
|
||||
<span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
@@ -843,7 +843,7 @@ The following will be a quick walk through on how to make the tarball which will
|
||||
<p>Say you have your project folder at <code>~/my-extension/</code> and you want to create an NPM package we need to do the following within your git repo:</p>
|
||||
<div class="highlight"><pre><span></span><code>npm pack
|
||||
</code></pre></div>
|
||||
<p>This will create a NPM tarball that can be hosted on Github Releases or any other publicly available file hosting service.</p>
|
||||
<p>This will create a NPM tarball that can be hosted on GitHub Releases or any other publicly available file hosting service.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user