-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bruce.wu
committed
Dec 16, 2024
1 parent
cbf56ff
commit 888a167
Showing
14 changed files
with
687 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>弹窗示例</title> | ||
<style> | ||
/* 页面背景半透明遮罩 */ | ||
.modal-overlay { | ||
display: none; /* 默认隐藏 */ | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */ | ||
z-index: 10; | ||
} | ||
|
||
/* 弹窗容器 */ | ||
.modal { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
width: 300px; | ||
padding: 20px; | ||
background-color: white; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); | ||
text-align: center; | ||
z-index: 11; | ||
} | ||
|
||
/* 关闭按钮 */ | ||
.modal-close { | ||
position: absolute; | ||
top: 10px; | ||
right: 10px; | ||
background-color: transparent; | ||
border: none; | ||
font-size: 18px; | ||
font-weight: bold; | ||
cursor: pointer; | ||
color: #555; | ||
} | ||
|
||
.modal-close:hover { | ||
color: red; | ||
} | ||
|
||
/* 显示弹窗 */ | ||
.modal-overlay.active { | ||
display: block; | ||
} | ||
|
||
/* 弹窗标题 */ | ||
.modal-title { | ||
font-size: 18px; | ||
margin-bottom: 10px; | ||
font-weight: bold; | ||
} | ||
|
||
/* 弹窗内容 */ | ||
.modal-content { | ||
font-size: 14px; | ||
color: #333; | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* 弹窗按钮 */ | ||
.modal-button { | ||
padding: 10px 20px; | ||
background-color: #007bff; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
.modal-button:hover { | ||
background-color: #0056b3; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<!-- 打开弹窗按钮 --> | ||
<button id="openModal" class="modal-button">打开弹窗</button> | ||
|
||
<!-- 弹窗 --> | ||
<div id="modalOverlay" class="modal-overlay"> | ||
<div class="modal"> | ||
<button class="modal-close" id="closeModal">×</button> | ||
<div class="modal-title">弹窗标题</div> | ||
<div class="modal-content">这是弹窗的内容,可以自由定制。</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
// 获取元素 | ||
const openModalButton = document.getElementById('openModal'); | ||
const closeModalButton = document.getElementById('closeModal'); | ||
const modalOverlay = document.getElementById('modalOverlay'); | ||
|
||
// 打开弹窗 | ||
openModalButton.addEventListener('click', function () { | ||
modalOverlay.classList.add('active'); | ||
}); | ||
|
||
// 关闭弹窗 | ||
closeModalButton.addEventListener('click', function () { | ||
modalOverlay.classList.remove('active'); | ||
}); | ||
|
||
// 点击遮罩关闭弹窗 | ||
modalOverlay.addEventListener('click', function (e) { | ||
if (e.target === modalOverlay) { | ||
modalOverlay.classList.remove('active'); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/io/jenkins/plugins/blueking/model/dto/SelectedHost.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.jenkins.plugins.blueking.model.dto; | ||
|
||
import java.io.Serializable; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Setter | ||
@Getter | ||
@ToString | ||
public class SelectedHost implements Serializable { | ||
|
||
private static final long serialVersionUID = 3149159959212400924L; | ||
|
||
private boolean selected; | ||
|
||
private String id; | ||
|
||
private String innerip; | ||
|
||
private String outerip; | ||
|
||
private String name; | ||
|
||
public SelectedHost() {} | ||
|
||
public SelectedHost(String id, String innerip, String outerip, String name) { | ||
this.id = id; | ||
this.innerip = innerip; | ||
this.outerip = outerip; | ||
this.name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/io/jenkins/plugins/blueking/utils/SelectedHostFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.jenkins.plugins.blueking.utils; | ||
|
||
import io.jenkins.plugins.blueking.model.dto.SelectedHost; | ||
import java.util.function.Predicate; | ||
|
||
public class SelectedHostFilter implements Predicate<SelectedHost> { | ||
|
||
private final String keyword; | ||
|
||
public SelectedHostFilter(String keyword) { | ||
this.keyword = keyword; | ||
} | ||
|
||
@Override | ||
public boolean test(SelectedHost e) { | ||
if (Utils.isNullOrEmpty(keyword)) { | ||
return true; | ||
} | ||
|
||
if (Utils.isNotEmpty(e.getInnerip()) && e.getInnerip().contains(keyword)) { | ||
return true; | ||
} | ||
if (Utils.isNotEmpty(e.getOuterip()) && e.getOuterip().contains(keyword)) { | ||
return true; | ||
} | ||
return Utils.isNotEmpty(e.getName()) && e.getName().contains(keyword); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
内网IP,外网IP(必填),主机名,模块 | ||
INNER IP,OUTER IP,HOSTNAME,MODULE | ||
172.31.0.29,49.70.30.22,HOST-USER-01,user | ||
172.31.0.20,49.70.30.23,HOST-USER-02,user | ||
192.168.10.20,18.30.11.82,HOST-USER-03,user | ||
172.31.0.29,49.70.30.22,HOST-BILL-01,bill | ||
172.31.0.20,49.70.30.23,HOST-BILL-02,bill | ||
192.168.10.20,18.30.11.82,HOST-BILL-03,bill | ||
172.245.233.175,49.70.30.28,HOST-BILL-01,bill | ||
172.245.255.176,49.71.30.66,HOST-BILL-02,bill | ||
192.168.10.21,100.200.112.128,HOST-BILL-03,bill |
4 changes: 3 additions & 1 deletion
4
...ources/io/jenkins/plugins/blueking/BkHostsChoiceParameterDefinition/help-extraFileId.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<div> | ||
Additional host information file. <br> | ||
Stored in File Credentials, the file must be in CSV format and must follow this template. | ||
Stored in File Credentials, <a | ||
href="https://github.com/dumasd/jenkins-blueking-plugin/blob/main/src/main/resources/host_template.csv">the file | ||
must be in CSV format and must follow this template.</a> | ||
</div> |
Oops, something went wrong.