1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 00:09:16 +08:00

feat(alert): Add alert settings (#7196)

Refs #6357
Refs #7005
This commit is contained in:
2024-11-27 15:14:33 +08:00 committed by GitHub
parent b8d8867ebb
commit 00c6466423
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 92 additions and 9 deletions

View File

@ -1,9 +1,9 @@
@font-face {
font-family: "panel"; /* Project id 3575356 */
src: url('iconfont.woff2?t=1724290117056') format('woff2'),
url('iconfont.woff?t=1724290117056') format('woff'),
url('iconfont.ttf?t=1724290117056') format('truetype'),
url('iconfont.svg?t=1724290117056#panel') format('svg');
src: url('iconfont.woff2?t=1732681110788') format('woff2'),
url('iconfont.woff?t=1732681110788') format('woff'),
url('iconfont.ttf?t=1732681110788') format('truetype'),
url('iconfont.svg?t=1732681110788#panel') format('svg');
}
.panel {
@ -14,6 +14,22 @@
-moz-osx-font-smoothing: grayscale;
}
.p-alert-3:before {
content: "\e728";
}
.p-tongyijiancha:before {
content: "\e619";
}
.p-minglinghang:before {
content: "\e61e";
}
.p-17:before {
content: "\e618";
}
.p-alert-1:before {
content: "\e611";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,34 @@
"css_prefix_text": "p-",
"description": "",
"glyphs": [
{
"icon_id": "4472516",
"name": "告警设置",
"font_class": "alert-3",
"unicode": "e728",
"unicode_decimal": 59176
},
{
"icon_id": "3977832",
"name": "统一检查",
"font_class": "tongyijiancha",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "11052436",
"name": "命令行",
"font_class": "minglinghang",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "11124973",
"name": "表单",
"font_class": "17",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "29851742",
"name": "短信告警",

View File

@ -14,6 +14,14 @@
/>
<missing-glyph />
<glyph glyph-name="alert-3" unicode="&#59176;" d="M334.506667 364.495238a97.562819 97.562819 0 1 0 0 39.009524H863.085714a19.504762 19.504762 0 1 0 0-39.009524H334.506667z m354.986666-273.066666H160.914286a19.504762 19.504762 0 1 0 0 39.009523h528.579047a97.523809 97.523809 0 1 0 0-39.009523z m0 546.133333H160.914286a19.504762 19.504762 0 0 0 0 39.009523h528.579047a97.523809 97.523809 0 1 0 0-39.009523zM843.580953 657.066667a58.514286 58.514286 0 1 1-117.028572 0 58.514286 58.514286 0 0 1 117.028572 0z m0-546.133334a58.514286 58.514286 0 1 1-117.028572 0 58.514286 58.514286 0 0 1 117.028572 0z m-546.133334 273.066667a58.514286 58.514286 0 1 1-117.028572 0 58.514286 58.514286 0 0 1 117.028572 0z" horiz-adv-x="1024" />
<glyph glyph-name="tongyijiancha" unicode="&#58905;" d="M464 704a270.95 270.95 0 1 0-105.85-21.35A270.24 270.24 0 0 0 464 704m0 64c-185.57 0-336-150.43-336-336s150.43-336 336-336 336 150.43 336 336-150.43 336-336 336zM710.63 230.63l-45.26-45.26L850.75 0 896 45.25 710.63 230.63zM604.97 569.94L419.6 384.57l-96.57 96.57-45.26-45.26 96.57-96.57 45.26-45.25 45.25 45.25 185.38 185.38-45.26 45.25z" horiz-adv-x="1024" />
<glyph glyph-name="minglinghang" unicode="&#58910;" d="M817 96H207a80 80 0 0 0-80 80V626a80 80 0 0 0 80 80h610a80 80 0 0 0 80-80v-450a80 80 0 0 0-80-80z m29 519a40 40 0 0 1-40 40H216a40 40 0 0 1-40-40v-430a40 40 0 0 1 40-40h590a40 40 0 0 1 40 40V615zM595 264H429a25 25 0 0 0 0 50h166a25 25 0 0 0 0-50zM457.38 438.849l-143.76-83a25 25 0 0 0-25 43.3L396.612 461.5 288.62 523.849a25 25 0 0 0 25 43.3l143.76-83a26.806 26.806 0 0 0 0-45.3z" horiz-adv-x="1024" />
<glyph glyph-name="17" unicode="&#58904;" d="M682.666667 767.829333h128c49.322667 0 86.954667-42.752 86.954666-93.696v-665.770666c0-50.901333-37.674667-93.738667-86.954666-93.738667H215.893333c-49.322667 0-86.997333 42.794667-86.997333 93.738667V674.133333c0 50.944 37.546667 93.696 86.997333 93.696H341.333333V832a21.333333 21.333333 0 0 0 42.666667 0v-170.666667a21.333333 21.333333 0 0 0-42.666667 0V725.162667H215.893333c-24.533333 0-44.330667-22.485333-44.330666-51.029334v-665.770666c0-28.501333 19.84-51.072 44.330666-51.072H810.666667c24.448 0 44.288 22.613333 44.288 51.072V674.133333c0 28.501333-19.797333 51.029333-44.288 51.029334h-128V661.333333a21.333333 21.333333 0 1 0-42.666667 0v170.666667a21.333333 21.333333 0 1 0 42.666667 0v-64.170667zM447.872 725.333333h127.786667a21.333333 21.333333 0 1 1 0 42.666667h-127.786667a21.333333 21.333333 0 1 1 0-42.666667zM341.632 512h341.333333a21.333333 21.333333 0 0 1 0 42.666667h-341.333333a21.333333 21.333333 0 0 1 0-42.666667zM341.632 341.33333300000004h170.666667a21.333333 21.333333 0 1 1 0 42.666667h-170.666667a21.333333 21.333333 0 1 1 0-42.666667zM341.632 170.66666699999996h341.077333a21.333333 21.333333 0 1 1 0 42.666666H341.632a21.333333 21.333333 0 1 1 0-42.666666z" horiz-adv-x="1024" />
<glyph glyph-name="alert-1" unicode="&#58897;" d="M918.505861 601.219133c-9.300928 9.261434-21.721913 9.261434-34.133024 6.170999v49.367985c0 52.458421-40.333644 92.564972-93.088273 92.564972H232.715436c-52.754629 0-93.088272-40.116424-93.088273-92.564972v-52.458421c-12.411111 6.180872-24.832097 3.090435-34.133024-6.161124C86.872535 582.696266 77.561733 558.012274 77.561733 533.32828v-431.969868C77.561733 48.909865 117.90525 8.803314 170.659879 8.803314H853.330248c52.754629 0 93.098146 40.116424 93.098146 92.564972v431.969868c0 24.683992-9.310802 49.367985-27.932407 67.880979zM443.73395 218.617251c37.233334-37.025989 96.198456-37.025989 130.331481 0l55.854938 55.538982 211.008641-200.562375H183.07099l204.808022 203.652812 55.854938-58.629419z m232.730555 98.73597l207.908332 206.733373v-407.285876L676.464505 317.353221z m-443.749069 370.259887h558.569128c18.61173 0 31.032715-12.341997 31.032716-30.854991v-107.997404L533.721913 261.82411c-12.411111-12.341997-31.032715-12.341997-43.443826 0l-102.399075 98.73597-186.196292 185.129944v111.077967c0 18.512994 12.420985 30.854991 31.032716 30.85499z m111.719749-370.259887L139.627163 113.710283v407.285876L344.435185 317.353221z" horiz-adv-x="1024" />
<glyph glyph-name="alert-2" unicode="&#59137;" d="M721.066667 597.538133v51.2a8.533333 8.533333 0 0 1-8.533334 8.533334h-409.6a8.533333 8.533333 0 0 1-8.533333-8.533334v-51.2c0-4.778667 3.822933-8.533333 8.533333-8.533333h409.6a8.533333 8.533333 0 0 1 8.533334 8.533333zM302.933333 503.671467a8.533333 8.533333 0 0 1-8.533333-8.533334v-51.2c0-4.778667 3.822933-8.533333 8.533333-8.533333H499.2a8.533333 8.533333 0 0 1 8.533333 8.533333v51.2a8.533333 8.533333 0 0 1-8.533333 8.533334H302.933333zM704 379.904a230.4 230.4 0 1 1 0-460.8 230.4 230.4 0 0 1 0 460.8z m114.688-345.088a161.109333 161.109333 0 0 0-114.688-47.445333 161.109333 161.109333 0 0 0-114.688 47.445333 161.109333 161.109333 0 0 0-47.445333 114.688c0 43.281067 16.861867 84.036267 47.445333 114.688a161.109333 161.109333 0 0 0 114.688 47.445333 161.109333 161.109333 0 0 0 114.688-47.445333 161.109333 161.109333 0 0 0 47.445333-114.688 161.109333 161.109333 0 0 0-47.445333-114.688z m-148.821333 29.354667a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 0 1-68.266666 0z m12.834133 68.266666h42.5984a8.533333 8.533333 0 0 1 8.6016 8.533334V260.437333a8.533333 8.533333 0 0 1-8.6016 8.533334h-42.5984a8.533333 8.533333 0 0 1-8.6016-8.533334v-119.466666c0-4.7104 3.8912-8.533333 8.6016-8.533334zM456.465067 21.504H209.066667v750.933333H806.4v-366.933333c0-4.7104 3.822933-8.533333 8.533333-8.533333H874.666667a8.533333 8.533333 0 0 1 8.533333 8.533333v409.6a34.133333 34.133333 0 0 1-34.133333 34.133333h-682.666667a34.133333 34.133333 0 0 1-34.133333-34.133333v-836.266667a34.133333 34.133333 0 0 1 34.133333-34.133333h290.133333A8.533333 8.533333 0 0 1 465.066667-46.762667v59.733334a8.533333 8.533333 0 0 1-8.533334 8.533333z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -96,7 +96,7 @@ onMounted(() => {
.el-radio-button__original-radio:checked + .el-radio-button__inner {
color: var(--panel-button-text-color) !important;
background-color: var(--panel-button-bg-color) !important;
border-color: var(--panel-button-active) !important;
border-color: var(--panel-color-primary) !important;
border-radius: 4px;
}
}

View File

@ -540,6 +540,19 @@ const checkHttpOrHttps = (rule, value, callback) => {
}
};
const checkPhone = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback();
} else {
const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.phone')));
} else {
callback();
}
}
};
interface CommonRule {
requiredInput: FormItemRule;
requiredSelect: FormItemRule;
@ -584,6 +597,7 @@ interface CommonRule {
paramExtUrl: FormItemRule;
paramSimple: FormItemRule;
paramHttp: FormItemRule;
phone: FormItemRule;
}
export const Rules: CommonRule = {
@ -806,4 +820,9 @@ export const Rules: CommonRule = {
validator: checkIpv4,
trigger: 'blur',
},
phone: {
validator: checkPhone,
required: true,
trigger: 'blur',
},
};

View File

@ -226,8 +226,7 @@ const message = {
formatErr: 'Format error, please check and retry',
phpExtension: 'Only supports , _ lowercase English and numbers',
paramHttp: 'Must start with http:// or https://',
diffHelper:
'The left side is the old version, the right side is the new version, after editing, click Save using custom version',
phone: 'The format of the phone number is incorrect',
},
res: {
paramError: 'The request failed, please try again later!',

View File

@ -223,6 +223,7 @@ const message = {
formatErr: '格式錯誤檢查後重試',
phpExtension: '僅支持 , _ 小寫英文和數字',
paramHttp: '必須以 http:// 或 https:// 開頭',
phone: '手機號碼格式不正確',
},
res: {
paramError: '請求失敗,請稍後重試!',

View File

@ -223,6 +223,7 @@ const message = {
formatErr: '格式错误检查后重试',
phpExtension: '仅支持 , _ 小写英文和数字',
paramHttp: '必须以 http:// 或 https:// 开头',
phone: '手机号码格式不正确',
},
res: {
paramError: '请求失败,请稍后重试!',

View File

@ -97,6 +97,7 @@ html.dark {
--panel-terminal-tag-active-bg-color: var(--panel-main-bg-color-10);
--panel-terminal-bg-color: var(--panel-main-bg-color-10);
--panel-terminal-tag-active-text-color: var(--panel-color-primary);
--panel-terminal-tag-hover-text-color: var(--panel-color-primary);
--panel-logs-bg-color: var(--panel-main-bg-color-9);
--el-menu-item-bg-color: var(--panel-main-bg-color-10);
@ -362,6 +363,9 @@ html.dark {
.cm-gutters {
background-color: var(--panel-main-bg-color-10);
}
.log-container {
background-color: var(--panel-main-bg-color-10);
}
}
.cm-editor {

View File

@ -46,6 +46,7 @@ html {
--panel-terminal-tag-bg-color: #efefef;
--panel-terminal-tag-active-bg-color: #575758;
--panel-terminal-tag-active-text-color: #ebeef5;
--panel-terminal-tag-hover-text-color: #575758;
--panel-terminal-bg-color: #1e1e1e;
--panel-logs-bg-color: #1e1e1e;

View File

@ -436,6 +436,12 @@ onMounted(() => {
color: var(--panel-terminal-tag-active-text-color);
background-color: var(--panel-terminal-tag-active-bg-color);
}
:deep(.el-tabs__item:hover) {
color: var(--panel-terminal-tag-hover-text-color);
}
:deep(.el-tabs__item.is-active:hover) {
color: var(--panel-terminal-tag-active-text-color);
}
}
.tagButton {

View File

@ -180,4 +180,4 @@ const handleClose = () => {
defineExpose({
acceptParams,
});
</script>
</script>