所以我有一个警报规则,当队列长度在一段时间内很长时,它会在普罗米修斯中被触发。
通过警报管理器,我能够创建和接收电子邮件。
我现在的问题是,作为我的电子邮件正文的一部分,我想要警报管理器触发电子邮件的日期和时间,或者警报被触发的时间。
我不确定如何做到这一点。我是否可以在警报中创建一个标签并用当前日期/时间以某种方式填充它,或者什么?有任何想法吗?
你能解释一下如何使用警报确认按钮启动 Google Play 应用程序吗?
这是代码:
let confirm = this.alertCtrl.create({
title: 'Nouvelle mise a jour disponible',
message: 'Version ameliorer de eLahiya disponible, voulez vous la telecharger?',
buttons: [
{
text: 'Plus tard',
handler: () => {
console.log('Disagree clicked');
}
},
{
text: 'Mise a jour',
handler: () => {
console.log('Agree clicked');
window.open("play.google.com/store/apps/details?id=<package_name>", '_system', 'location=yes')//
}
}
]
});
confirm.present();
Run Code Online (Sandbox Code Playgroud)
我想让我的应用程序在 Playstore 上打开我的应用程序页面,该怎么做?
这是我的 C 代码。
#include <stdio.h>
int main(){
printf("\a\n");
printf("Startled by the sudden sound, Sally shouted, \"By the Great Pumpkin, what was that!?\"");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
据说,“\a\n”应该发出警报,对吗?然而,出于某种原因,它并没有这样做。我在 Ubuntu Zesty 上,bash 命令beep确实发出哔哔声,但echo -e '\a'没有,所以我不确定问题到底是什么。
提出这个问题是因为其他这样的问题最终没有产生对我来说足够详细/可以理解的答案,或者有一个完全不同的问题,其解决方案不适用于我。
坦率地说,上面链接的帖子的答案太模糊了。“问题不在于 C,而在于别的东西。” 根本没有帮助。
更新:以防万一其他人偶然发现了这一点,这是问题所在:我有 GNOME,因此 WM 是 Gnome-Shell。既然是这样,我就不得不打开声音设置,转到警报,启用它们,并调高音量。我从来没有注意到外壳本身可能是问题所在。在跑步后metacity --replace突然能够听到警报后意识到这一点。
我正在使用 Suricata 设置入侵检测系统 (IDS)。我想编写一个自定义规则,每当我的虚拟机尝试登录失败时都会生成警报。
例子:
alert tcp any any -> $HOME_NET 22 (msg:"SSH Brute Force Attempt";flow:established,to_server;content:"SSH";nocase;offset:0;depth:4;detection_filter:track by_src, count 2, seconds 2;sid:2005; rev:1;)
我尝试了 SSH 规则的各种组合,但无法在 Suricata 警报部分看到任何警报,多次尝试 SSH 失败。(错误尝试 => 使用无效密码生成警报)
请让我知道如何解决这个问题。
我知道这不是让按钮在点击时显示警报的正确方法。
我想了解这背后的逻辑。我知道点击时需要获得对函数的引用才能按预期运行。
在以下示例中,引用了将在单击时调用的箭头函数:
<button onClick={() => alert('hi)}>Click me!</button>
但是在这种情况下,幕后会发生什么:
<button onClick={alert('hi)}>Click me!</button>
为什么 onClick 内部的语句在渲染时被评估?
编辑:我正在使用 React。
我使用 alertifyjs 创建了一个自定义确认对话框,并尝试设置标签和标题,但是,我似乎无法同时实现。请有人帮忙。
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/alertify.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/bootstrap.min.css" />
<script src="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/alertify.min.js"></script>
</head>
<body>
<div style="display:none;">
<div id="dlgContent">
<p> Enter Value One </p>
<input class="ajs-input" id="inpOne" type="text" value="Input One Default Value" />
<p> Enter Value Two </p>
<input class="ajs-input" id="inpTwo" type="text" value="Input two default Value" />
</div>
</div>
<!-- the script -->
<script>
var dlgContentHTML = $('#dlgContent').html();
$('#dlgContent').html("");
alertify.confirm(dlgContentHTML).set('onok', function(closeevent, value) {
var inpOneVal = $('#inpOne').val();
var inpTwoVal = $('#inpTwo').val();
//updateListItems(inpOneVal,inpTwoVal);
if (inpOneVal == "test" …Run Code Online (Sandbox Code Playgroud)我正在使用带有场景构建器的 JavaFX 8,我正在尝试创建一个警报弹出窗口。请参阅下面的代码:
更新:包括我拥有的所有代码(不包括一些个人标识符)。
public class MainViewController {
@FXML
private void handleQuitButtonAction(ActionEvent event) {
System.exit(0);
}
@FXML
private void handleImportButtonAction(ActionEvent event) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Select the file to import");
File file = fileChooser.showOpenDialog(new Stage());
Alert alert;
if (FileAccess.importFile(file)) {
alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Success!");
alert.setHeaderText("Congrats!");
alert.setContentText("Successfully imported data from the chosen file!");
} else {
alert = new Alert(AlertType.ERROR);
alert.setTitle("Error!");
alert.setHeaderText("Sorry...");
alert.setContentText("Something wrong with the import, please try again.");
}
alert.showAndWait();
// Refresh Scroll List
}
@FXML …Run Code Online (Sandbox Code Playgroud) 这是用于交易视图的松树脚本的一部分。在“//Condition”之后的脚本中,我希望仅在条件从多头变为空头或由空头变为多头时生成警报。不是每根蜡烛都像现在这样结束,因为一个条件始终为真。这已更改为一项研究。
threshold = input(title="Threshold", type=float, defval=0.0014, step=0.0001)
buying = l3_0 > threshold ? true : l3_0 < -threshold ? false : buying[1]
///// T edit
selling = l3_0 > -threshold ? true : l3_0 < threshold ? false :
selling[1] //// T edit END
hline(0, title="base line")
bgcolor(l3_0 > 0.0014 ? green : l3_0 < -0.0014 ? red : gray, transp=20)
bgcolor(buying ? green : red, transp=20)
plot(l3_0, color=silver, style=area, transp=75)
plot(l3_0, color=aqua, title="prediction")
///// Stragegy
/////////////////////////////////////////////////////
//longCondition = buying …Run Code Online (Sandbox Code Playgroud) 如何创建一个警报在Vuetify后指定的秒数淡出,在警报类似于引导Vue公司。我试过这个:
<template>
<transition name="fade">
<v-alert v-show="visible" v-bind="$attrs" v-on="$listeners">
<slot></slot>
</v-alert>
</transition>
</template>
<script>
export default {
inheritAttrs: true,
data() {
return {
visible: true,
timer: null
};
},
props: {
duration: {
required: true,
type: Number
}
},
methods: {
fade() {
let value = parseInt(Math.max(this.duration, 0));
if (value != 0)
this.timer = setTimeout(() => (this.visible = false), 1000 * value);
}
},
mounted() {
this.fade();
}
};
</script>
Run Code Online (Sandbox Code Playgroud)
在其他组件中的使用:
<vt-alert
v-if="hasMessage()"
:type="message.type"
:duration="message.duration" …Run Code Online (Sandbox Code Playgroud) 我想在相机打开之前显示一条消息。
现在用户单击一个按钮,消息显示 1 秒钟,然后相机立即打开。一旦我关闭相机,对话框仍然可见。
我希望只有在您单击警报消息上的“确定”后才能打开相机,并且一旦您关闭相机,就不再显示该消息。
//Button Picture
cameraBtn.setOnClickListener {
showDialog()
pb.visibility = View.VISIBLE
checkPermission(Manifest.permission.CAMERA,
CAMERA_PERMISSION_CODE)
startActivityForResult(receiptsViewModel.cameraIntent(requireActivity()),REQUEST_CODE_KAMERA)
}
fun showDialog() {
val dialogBuilder = AlertDialog.Builder(context)
dialogBuilder.setMessage("The message here")
dialogBuilder.setPositiveButton("Done",
DialogInterface.OnClickListener { dialog, whichButton -> })
val b = dialogBuilder.create()
b.show()
}
Run Code Online (Sandbox Code Playgroud) alert ×10
javascript ×2
android ×1
bash ×1
c ×1
camera ×1
dialog ×1
google-play ×1
html ×1
ionic2 ×1
java ×1
javafx ×1
jquery ×1
kotlin ×1
pine-script ×1
popup ×1
prometheus ×1
reactjs ×1
rules ×1
snort ×1
ssh ×1
suricata ×1
time ×1
vue.js ×1
vuetify.js ×1