JS updates - bulk import updated

pull/194/head
Hunter Long 2019-05-14 13:42:47 -07:00
parent 355e7e325b
commit 67e781925d
5 changed files with 15 additions and 5 deletions

View File

@ -163,3 +163,10 @@ Statping accepts Push Requests! Feel free to add your own features and notifiers
[![Go Report Card](https://goreportcard.com/badge/github.com/hunterlong/statping)](https://goreportcard.com/report/github.com/hunterlong/statping)
[![Build Status](https://travis-ci.com/hunterlong/statping.svg?branch=master)](https://travis-ci.com/hunterlong/statping) [![Cypress.io tests](https://img.shields.io/badge/cypress.io-tests-green.svg?style=flat-square)](https://dashboard.cypress.io/#/projects/bi8mhr/runs)
[![Docker Pulls](https://img.shields.io/docker/pulls/hunterlong/statping.svg)](https://hub.docker.com/r/hunterlong/statping/builds/) [![Godoc](https://godoc.org/github.com/hunterlong/statping?status.svg)](https://godoc.org/github.com/hunterlong/statping)[![Coverage Status](https://coveralls.io/repos/github/hunterlong/statping/badge.svg?branch=master)](https://coveralls.io/github/hunterlong/statping?branch=master)
<p align="center">
<a href="https://www.buymeacoffee.com/hunterlong" target="_blank">
<img height="55" src="https://img.cjx.io/buy-me-redbull.png" >
</a>
</p>

View File

@ -126,14 +126,14 @@ func bulkImportHandler(w http.ResponseWriter, r *http.Request) {
newService, err := commaToService(col)
if err != nil {
utils.Log(3, fmt.Errorf("issue with row %v: %v", i, err))
return
continue
}
service := core.ReturnService(newService)
_, err = service.Create(true)
if err != nil {
utils.Log(3, fmt.Errorf("cannot create service %v: %v", col[0], err))
return
continue
}
utils.Log(1, fmt.Sprintf("Created new service %v", service.Name))
}

View File

@ -124,7 +124,7 @@ $('select#service_type').on('change', function() {
$('#post_data').parent().parent().addClass('d-none');
$('#service_response').parent().parent().addClass('d-none');
$('#service_response_code').parent().parent().addClass('d-none');
$('#headers').parent().parent().removeClass('d-none');
$('#headers').parent().parent().addClass('d-none');
} else if (selected === 'icmp') {
$('#service_port').parent().parent().removeClass('d-none');
$('#headers').parent().parent().addClass('d-none');

View File

@ -1,2 +1,5 @@
name,domain,expected,expected_status,interval,type,method,post_data,port,timeout,order,allow_notifications,public,group_id,headers,permalink
Bulk Upload,http://google.com,,200,60s,http,get,,,60s,1,true,true,,Authorization=example,bulk_example
Bulk Upload,http://google.com,,200,60s,http,get,,,60s,1,TRUE,TRUE,,Authorization=example,bulk_example
JSON Post,https://jsonplaceholder.typicode.com/posts,,200,1m,http,post,"{""id"": 1, ""title"": 'foo', ""body"": 'bar', ""userId"": 1}",,15s,2,TRUE,TRUE,,Content-Type=application/json,json_post_example
Google DNS,8.8.8.8,,,,tcp,,,53,10s,3,TRUE,TRUE,,,google_dns_example
Google DNS UDP,8.8.8.8,,,,udp,,,53,10s,4,TRUE,TRUE,,,google_dns_udp_example

1 name domain expected expected_status interval type method post_data port timeout order allow_notifications public group_id headers permalink
2 Bulk Upload http://google.com 200 60s http get 60s 1 true TRUE true TRUE Authorization=example bulk_example
3 JSON Post https://jsonplaceholder.typicode.com/posts 200 1m http post {"id": 1, "title": 'foo', "body": 'bar', "userId": 1} 15s 2 TRUE TRUE Content-Type=application/json json_post_example
4 Google DNS 8.8.8.8 tcp 53 10s 3 TRUE TRUE google_dns_example
5 Google DNS UDP 8.8.8.8 udp 53 10s 4 TRUE TRUE google_dns_udp_example

View File

@ -1,6 +1,6 @@
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at
// 2019-05-14 12:39:30.867402 -0700 PDT m=+0.544240003
// 2019-05-14 13:40:52.036043 -0700 PDT m=+0.508533092
//
// This contains the most recently Markdown source for the Statping Wiki.
package source