Skip to content

Commit

Permalink
修复静态页部分资源错误
Browse files Browse the repository at this point in the history
  • Loading branch information
feiyu563 committed Apr 17, 2021
1 parent 8401f8c commit 3883ebd
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 33 deletions.
4 changes: 2 additions & 2 deletions example/linux/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<div class="page-header">
<div class="container text-center">
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="/static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<hr>
</div>
<div class="container">
Expand All @@ -40,7 +40,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<hr>
<div class="container text-center">
<img alt="Brand" width="120" height="120" src="static/img/wx.png">
<img alt="Brand" width="120" height="120" src="/static/img/wx.png">



Expand Down
12 changes: 6 additions & 6 deletions example/linux/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="static/img/prometheus-ico.png" />
<link rel="shortcut icon" href="/static/img/prometheus-ico.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="static/css/bootstrap.min.css" rel="stylesheet" />
<link href="static/css/docs.css" rel="stylesheet" />
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/docs.css" rel="stylesheet" />
<style>
#myBtn {
display: none;
Expand All @@ -32,7 +32,7 @@
<div class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<a class="navbar-brand" href="#">
<img alt="Brand" width="20" height="20" src="static/img/prometheus-ico.png">
<img alt="Brand" width="20" height="20" src="/static/img/prometheus-ico.png">
</a>
<a class="navbar-brand" href="/">PrometheusAlert</a>
<ul class="nav nav-tabs">
Expand All @@ -53,8 +53,8 @@
{{end}}

{{define "endhtml"}}
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<div class="container">
<button onclick="topFunction()" id="myBtn"><span class="glyphicon glyphicon-plane"></span><p>返回顶部</p></button>
<script>
Expand Down
2 changes: 1 addition & 1 deletion example/linux/views/template_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
function typeChange(){
var objS = document.getElementById("type");
Expand Down
2 changes: 1 addition & 1 deletion example/linux/views/template_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function () {
typeChange();
Expand Down
2 changes: 1 addition & 1 deletion example/linux/views/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
</div>
<div class="page-header">
<div class="container text-center">
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script>
$(function(){
$(".btn").click(function(){
Expand Down
4 changes: 2 additions & 2 deletions example/windows/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<div class="page-header">
<div class="container text-center">
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="/static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<hr>
</div>
<div class="container">
Expand All @@ -40,7 +40,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<hr>
<div class="container text-center">
<img alt="Brand" width="120" height="120" src="static/img/wx.png">
<img alt="Brand" width="120" height="120" src="/static/img/wx.png">



Expand Down
12 changes: 6 additions & 6 deletions example/windows/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="static/img/prometheus-ico.png" />
<link rel="shortcut icon" href="/static/img/prometheus-ico.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="static/css/bootstrap.min.css" rel="stylesheet" />
<link href="static/css/docs.css" rel="stylesheet" />
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/docs.css" rel="stylesheet" />
<style>
#myBtn {
display: none;
Expand All @@ -32,7 +32,7 @@
<div class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<a class="navbar-brand" href="#">
<img alt="Brand" width="20" height="20" src="static/img/prometheus-ico.png">
<img alt="Brand" width="20" height="20" src="/static/img/prometheus-ico.png">
</a>
<a class="navbar-brand" href="/">PrometheusAlert</a>
<ul class="nav nav-tabs">
Expand All @@ -53,8 +53,8 @@
{{end}}

{{define "endhtml"}}
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<div class="container">
<button onclick="topFunction()" id="myBtn"><span class="glyphicon glyphicon-plane"></span><p>返回顶部</p></button>
<script>
Expand Down
2 changes: 1 addition & 1 deletion example/windows/views/template_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
function typeChange(){
var objS = document.getElementById("type");
Expand Down
2 changes: 1 addition & 1 deletion example/windows/views/template_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function () {
typeChange();
Expand Down
2 changes: 1 addition & 1 deletion example/windows/views/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
</div>
<div class="page-header">
<div class="container text-center">
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script>
$(function(){
$(".btn").click(function(){
Expand Down
4 changes: 2 additions & 2 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<div class="page-header">
<div class="container text-center">
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<p><a target="_blank" rel="noopener noreferrer" href="https://github.com/feiyu563/PrometheusAlert"><img src="/static/img/it.png" alt="it" style="max-width:50%;"></a></p>
<hr>
</div>
<div class="container">
Expand All @@ -40,7 +40,7 @@ <h4 class="text-muted"><a target="_blank" rel="noopener noreferrer" href="https:
</div>
<hr>
<div class="container text-center">
<img alt="Brand" width="120" height="120" src="static/img/wx.png">
<img alt="Brand" width="120" height="120" src="/static/img/wx.png">



Expand Down
12 changes: 6 additions & 6 deletions views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="static/img/prometheus-ico.png" />
<link rel="shortcut icon" href="/static/img/prometheus-ico.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="static/css/bootstrap.min.css" rel="stylesheet" />
<link href="static/css/docs.css" rel="stylesheet" />
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/docs.css" rel="stylesheet" />
<style>
#myBtn {
display: none;
Expand All @@ -32,7 +32,7 @@
<div class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<a class="navbar-brand" href="#">
<img alt="Brand" width="20" height="20" src="static/img/prometheus-ico.png">
<img alt="Brand" width="20" height="20" src="/static/img/prometheus-ico.png">
</a>
<a class="navbar-brand" href="/">PrometheusAlert</a>
<ul class="nav nav-tabs">
Expand All @@ -53,8 +53,8 @@
{{end}}

{{define "endhtml"}}
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<div class="container">
<button onclick="topFunction()" id="myBtn"><span class="glyphicon glyphicon-plane"></span><p>返回顶部</p></button>
<script>
Expand Down
2 changes: 1 addition & 1 deletion views/template_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
function typeChange(){
var objS = document.getElementById("type");
Expand Down
2 changes: 1 addition & 1 deletion views/template_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</div>
</form>
</div>
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function () {
typeChange();
Expand Down
81 changes: 81 additions & 0 deletions views/template_test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{template "main"}}
<title>PrometheusAlert</title>
</head>

<body>
{{template "head" .}}
<div class="bs-docs-header">
<div class="container">
<label class="col-sm-2">模版测试</label>
</div>
</div>
<div class="container">
<div class="bs-example" >
<div class="input-group">
<span class="input-group-addon">模版名称</span>
<input type="text" id="name" class="form-control" name="name" value="{{.Template.Tplname}}" readonly>
</div>
<br />

<div class="input-group">
<span class="input-group-addon">模版类型</span>
<input type="text" id="type" class="form-control" name="type" value="{{.Template.Tpltype}}" readonly>
</div>

<br />
<label>模版内容:</label>
<br />
<textarea id="content" name="content" cols="30" rows="10" class="form-control" readonly>{{.Template.Tpl}}</textarea>
<br />

<label>消息协议JSON内容:</label>
<br />
<textarea id="pjson" name="pjson" cols="30" rows="10" class="form-control" placeholder="可在PrometheusAlert日志中查找"></textarea>
<br />

<div class="input-group">
<span class="input-group-addon">{{if eq .Template.Tpltype "dd"}}钉钉机器人地址{{else}}{{if eq .Template.Tpltype "wx"}}微信机器人地址{{else}}{{if eq .Template.Tpltype "fs"}}飞书机器人地址{{else}}手机号{{end}}{{end}}{{end}}</span>
<input type="text" id="purl" class="form-control" name="purl" value="">
</div>
<br />

<div class="text-right">
<button type="button" class="btn btn-primary" onclick="sendtest();">模版测试</button>
</div>

</div>
<script type="text/javascript">
function sendtest(){
var uname=document.getElementById("name");
var utype=document.getElementById("type");
var upjson=document.getElementById("pjson");
var upurl=document.getElementById("purl");
var sendurl="";
if (utype.value=="dd"){
sendurl='{{ urlfor "PrometheusAlertController.PrometheusAlert"}}?type='+utype.value+'&tpl='+uname.value+'&ddurl='+upurl.value;
} else if(utype.value=="wx"){
sendurl='{{ urlfor "PrometheusAlertController.PrometheusAlert"}}?type='+utype.value+'&tpl='+uname.value+'&wxurl='+upurl.value;
} else if(utype.value=="fs"){
sendurl='{{ urlfor "PrometheusAlertController.PrometheusAlert"}}?type='+utype.value+'&tpl='+uname.value+'&fsurl='+upurl.value;
} else{
sendurl='{{ urlfor "PrometheusAlertController.PrometheusAlert"}}?type='+utype.value+'&tpl='+uname.value+'&phone='+upurl.value;
}
if (upjson.value.length==0){
alert('消息协议JSON内容不能为空');
}else{
var json_data = JSON.stringify(upjson.value);
$.ajax({
url: sendurl,
async: false,
type: "post",
data: upjson.value,
success: function (data, status) {
alert(data);
},
});

};
}
</script>
</div>
{{template "endhtml"}}
2 changes: 1 addition & 1 deletion views/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
</div>
<div class="page-header">
<div class="container text-center">
<script type="text/javascript" src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script>
$(function(){
$(".btn").click(function(){
Expand Down

0 comments on commit 3883ebd

Please sign in to comment.