Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Sep 2, 2023
1 parent e79ac42 commit 71bb497
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 2 deletions.
9 changes: 8 additions & 1 deletion core/src/main/resources/hudson/PluginManager/installed.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ THE SOFTWARE.

<j:choose>
<j:when test="${noPlugins}">
<l:notice icon="symbol-plugins" text="${%No plugins installed}" />
<l:notice icon="symbol-plugins" text="${%No plugins installed}">
<div id="asd">
<div id="dontcallmeback">Recommended</div>
<div id="permanentpiece">
</div>
</div>
</l:notice>
</j:when>
<j:otherwise>
<table id="plugins" class="jenkins-table sortable">
Expand Down Expand Up @@ -281,6 +287,7 @@ THE SOFTWARE.
</div>

<st:adjunct includes="hudson.PluginManager._installed"/>
<script src="${resURL}/jsbundles/pages/manage-jenkins/plugins/installed.js" type="text/javascript"/>
</l:main-panel>
</l:layout>
</j:jelly>
3 changes: 2 additions & 1 deletion core/src/main/resources/lib/layout/notice.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:d="jelly:define">
<st:documentation>
<st:attribute name="text" use="required">
Sets the text for the notice. HTML isn't supported.
Expand All @@ -36,5 +36,6 @@ THE SOFTWARE.
<div class="jenkins-notice">
<l:icon src="${attrs.icon}" />
<div>${attrs.text}</div>
<d:invokeBody />
</div>
</j:jelly>
17 changes: 17 additions & 0 deletions war/src/main/js/pages/manage-jenkins/plugins/installed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pluginManager from "@/api/pluginManager";

pluginManager.init(() => {
console.log()

const permanentpiece = document.querySelector("#permanentpiece");

pluginManager.recommendedPluginNames().slice(0, 3).forEach((plugin) => {

permanentpiece.innerHTML += `<a href="./available?filter=${plugin}" class="jenkins-button">
<span>${plugin}</span>
<span>Appearance</span>
</a>`;

})

})
1 change: 1 addition & 0 deletions war/src/main/scss/components/_notice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
font-size: var(--font-size-base);
margin-bottom: 30px;
font-weight: 500;
padding: 50px;

svg {
width: 2.5rem;
Expand Down
36 changes: 36 additions & 0 deletions war/src/main/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,39 @@
@use "components";
@use "form";
@use "pages";

#asd {
margin-top: 30px;
}

#dontcallmeback {
font-weight: 500;
margin-bottom: 10px;
font-size: var(--font-size-sm);
margin-left: 15px;
}

#permanentpiece {
display: grid;
grid-template-columns: 1fr;
gap: calc(var(--section-padding) / 3);
min-width: 400px;

a {
flex-direction: column;
align-items: start;
gap: 0;
padding: 10px 15px;
background: var(--background);
font-size: var(--font-size-sm);

&::before {
background: white;
}

span:last-of-type {
color: var(--text-color-secondary);
font-weight: normal;
}
}
}
6 changes: 6 additions & 0 deletions war/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module.exports = (env, argv) => ({
"src/main/js/pages/manage-jenkins/system-information",
),
],
"pages/manage-jenkins/plugins/installed": [
path.join(
__dirname,
"src/main/js/pages/manage-jenkins/plugins/installed.js",
),
],
app: [path.join(__dirname, "src/main/js/app.js")],
"pages/manage-jenkins": [
path.join(__dirname, "src/main/js/pages/manage-jenkins"),
Expand Down

0 comments on commit 71bb497

Please sign in to comment.