From 56a38583fd770ad8851de49485489e30baa7467c Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Tue, 21 Apr 2015 17:14:45 +0200 Subject: NMS: More coarse-tuning of comments Wouldn't call it fine tuning. Now got active/inactive/persists/delete state working OK, and things are showing up prettier. --- web/nms.gathering.org/comment-change.pl | 24 ++++++ web/nms.gathering.org/nms2/index.html | 7 +- web/nms.gathering.org/nms2/js/nms.js | 139 +++++++++++++++++++++----------- web/nms.gathering.org/port-state.pl | 2 +- 4 files changed, 119 insertions(+), 53 deletions(-) create mode 100755 web/nms.gathering.org/comment-change.pl (limited to 'web') diff --git a/web/nms.gathering.org/comment-change.pl b/web/nms.gathering.org/comment-change.pl new file mode 100755 index 0000000..13ed058 --- /dev/null +++ b/web/nms.gathering.org/comment-change.pl @@ -0,0 +1,24 @@ +#! /usr/bin/perl +use CGI qw(fatalsToBrowser); +use DBI; +use lib '../../include'; +use utf8; +use nms; +use strict; +use warnings; +use Data::Dumper; + +my $cgi = CGI->new; + +my $dbh = nms::db_connect(); + +my $id = $dbh->quote($cgi->param('comment') || die ); +my $state= $dbh->quote($cgi->param('state') || die); + + +my $q = $dbh->prepare("UPDATE switch_comments SET state = " . $state . " WHERE id = " . $id . ";"); +$q->execute(); + +print $cgi->header(-type=>'text/json; charset=utf-8'); +print "{ 'state': 'ok' }"; + diff --git a/web/nms.gathering.org/nms2/index.html b/web/nms.gathering.org/nms2/index.html index 7d4a718..50a81eb 100644 --- a/web/nms.gathering.org/nms2/index.html +++ b/web/nms.gathering.org/nms2/index.html @@ -141,16 +141,13 @@ -
+