Skip to content

Commit

Permalink
feat: Add alert settings
Browse files Browse the repository at this point in the history
  • Loading branch information
lan-yonghui committed Nov 27, 2024
1 parent b8d8867 commit c769e72
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 9 deletions.
24 changes: 20 additions & 4 deletions frontend/src/assets/iconfont/iconfont.css
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/iconfont/iconfont.js

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions frontend/src/assets/iconfont/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "短信告警",
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/assets/iconfont/iconfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/src/assets/iconfont/iconfont.ttf
Binary file not shown.
Binary file modified frontend/src/assets/iconfont/iconfont.woff
Binary file not shown.
Binary file modified frontend/src/assets/iconfont/iconfont.woff2
Binary file not shown.
Binary file modified frontend/src/assets/images/1panel-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/components/router-button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/global/form-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -584,6 +597,7 @@ interface CommonRule {
paramExtUrl: FormItemRule;
paramSimple: FormItemRule;
paramHttp: FormItemRule;
phone: FormItemRule;
}

export const Rules: CommonRule = {
Expand Down Expand Up @@ -806,4 +820,9 @@ export const Rules: CommonRule = {
validator: checkIpv4,
trigger: 'blur',
},
phone: {
validator: checkPhone,
required: true,
trigger: 'blur',
},
};
3 changes: 1 addition & 2 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const message = {
formatErr: '格式錯誤檢查後重試',
phpExtension: '僅支持 , _ 小寫英文和數字',
paramHttp: '必須以 http:// 或 https:// 開頭',
phone: '手機號碼格式不正確',
},
res: {
paramError: '請求失敗,請稍後重試!',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const message = {
formatErr: '格式错误检查后重试',
phpExtension: '仅支持 , _ 小写英文和数字',
paramHttp: '必须以 http:// 或 https:// 开头',
phone: '手机号码格式不正确',
},
res: {
paramError: '请求失败,请稍后重试!',
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/styles/element-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/styles/element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions frontend/src/views/host/terminal/terminal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/panel/api-interface/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ const handleClose = () => {
defineExpose({
acceptParams,
});
</script>
</script>

0 comments on commit c769e72

Please sign in to comment.