...
 
Commits (2)
......@@ -24,10 +24,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
*/
/* SERVEUR */
//$config['base_url'] = 'http://91.162.19.165:17000/astreos/';
#$config['base_url'] = 'http://93.104.213.138/astreos/';
$config['base_url'] = 'http://icaging.com/astreos/';
/* LOCAL */
$config['base_url'] = 'http://localhost/astreos/';
//$config['base_url'] = 'http://localhost/astreos/';
/*
|--------------------------------------------------------------------------
......
......@@ -76,9 +76,9 @@ $query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'firediag',
'password' => 'firediag$!',
'database' => 'firediag',
'username' => 'astreos',
'password' => 'WoHvxE982brBdQG',
'database' => 'astreos',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
......
......@@ -9,7 +9,7 @@ class Controller extends MY_Controller {
public function __construct() {
parent::__construct();
$this->serveur_mqtt = 'pil-09.univlehavre.lan';
$this->serveur_mqtt = 'icaging.com';
$this->port = 9001;
$this->topicMQTT_Status = "/system/mqtt";
$this->topicMQTT_Changes = "/system/changeCapteur";
......@@ -82,10 +82,15 @@ class Controller extends MY_Controller {
/* AJAX : Renvoie les capteurs affecté par les filtres */
public function filtreCapteur() {
$tags = $this->input->post('tags') ;
if (empty($tags)) { $tags = [] ;}
$listeCapteur = $this->capteurs->liste_capteurWithTag($tags) ;
$idGroupes = $this->input->post('groupes') ;
if (empty($idGroupes)) { $idGroupes = [] ;}
$unites = $this->input->post('unites') ;
if (empty($unites)) { $unites = [] ;}
//var_dump($idGroupe);
$firstCapteur = true; $firstGroupe = true ;
......
......@@ -321,12 +321,16 @@ function filtreCapteur() {
}
var url = "<?php echo base_url() ?>index.php/controller/filtreCapteur/";
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: { "groupes" : idGroupes, "unites" : unites, "tags" : tags },
error: function (request, error) {
console.log("Erreur requete AJAX ===>");
console.log(request);
console.log(error);
},
success : function(response){
console.log(response);
var parse = JSON.parse(response);
......
......@@ -35,6 +35,43 @@
</a>
</div>
<div class="col-lg-6 animated fadeInDown" style="margin-bottom:10px;">
<a href= "<?php echo base_url() ?>index.php/controller/visu">
<div id="menuPrinc4">
<div class="p-m">
<h1 class="m-xs">Maintenance</h1>
<small class="font-bold no-margins">
Logs du système de <strong>communication</strong> et de <strong>sauvegarde</strong>
</small>
</div>
<div class="flot-chart">
<svg width="100%" height="100%" viewBox="0 0 300 300" preserveAspectRatio="xMaxYMax meet" class="pull-right">
<g id="layer1">
<path id="path4660-5"
d="M 139.03306,87.72789 153.37309,99.574002 44.264123,232.99868 30.547563,249.20915 21.81884,261.67874 3.737942,246.71523 17.454487,231.75172 46.75805,197.46033 72.944201,166.90981 101.62426,135.11235 120.95215,112.0436 135.29216,97.70356 Z"
style="fill:#C9C9EE;stroke:none;stroke-width:0.21821791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<g id="g8-5-3-6" transform="matrix(0.02876703,-0.00436111,-0.00436111,-0.02876703,-62.239289,265.28258)" style="fill:#C9C9EE;stroke:none">
<path style="fill:#C9C9EE" id="path4-28-3-2"
d="m 7697.857,6236.2858 c -242.0093,-137.6414 -434.1295,-382.2769 -484.375,-659 44.7036,-264.6614 571.9666,-422.9962 475.375,-663 -545.488,-416.1572 -1010.8817,-930.9352 -1556,-1350 -569.4084,-444.667 -1117.7387,-919.0187 -1649,-1408 C 3919.8323,1683.3637 3397.9599,1159.4382 2802.857,724.28581 2639.1498,522.30842 2118.8105,352.25428 2432.857,45.285814 2586.0799,-274.11184 2951.2574,-488.0794 3162.109,-94.862625 3748.833,509.52926 4409.172,1030.2417 5021.857,1605.2858 c 798.022,639.5447 1512.7063,1375.0546 2283.875,2045.625 319.488,265.576 642.0836,537.6052 914.125,851.375 359.133,-206.0241 735.026,-417.6423 1095.75,-634.625 262.1337,12.3223 640.3639,354.2521 314.75,579.625 -216.7922,286.2724 -413.6782,592.8795 -653.75,863.75 -348.0867,328.3701 -745.2909,598.7143 -1111.9688,903.875 -45.7223,35.9518 -113.6808,52.2035 -166.7812,21.375 z m 137,-156 c 477.1795,-389.8367 1032.7682,-715.277 1367.125,-1249.875 154.7752,-251.9444 679.0423,-671.1185 161.875,-826.125 -391.4955,162.4207 -1224.3895,685.8283 -1565.7591,1068.2326 -139.2202,-116.1032 206.742,-419.9747 248.5219,-485.3034 100.8824,-157.7436 -348.7044,-499.123 -532.0441,-608.6167 C 6597.3474,3207.1331 5757.8599,2348.271 4830.6226,1588.1608 4208.8222,1023.1827 3565.7603,481.86991 2971.3218,-112.51106 2690.1156,-356.9098 2226.8964,378.56099 2706.3414,483.91081 3928.2652,1442.6876 5018.595,2556.4242 6247.5738,3506.7936 c 517.0482,420.134 990.784,889.4909 1497.5488,1321.3828 293.3496,323.4788 -371.147,489.4703 -390.4687,790.9063 54.9494,179.9298 247.0556,550.613 480.2031,461.2031 z" />
</g>
<g id="g6-0-2" transform="matrix(0.06551393,0.07014273,0.07014273,-0.06551393,-103.51446,148.41008)" style="fill:#C9C9EE;stroke:#C9C9EE;stroke-width:15.99310589;stroke-miterlimit:4;stroke-dasharray:none">
<path style="stroke:#C9C9EE;stroke-width:15.99310589;stroke-miterlimit:4;stroke-dasharray:none" id="path4-2-6-1"
d="m 2440,1683 c -53,-5 -204,-31 -305,-53 -65,-13 -151,-21 -305,-25 -118,-3 -236,-8 -262,-11 -45,-5 -48,-8 -54,-40 l -6,-34 h -477 c -463,0 -709,-5 -898,-16 -81,-5 -93,-8 -93,-24 0,-16 13,-19 107,-25 59,-4 389,-6 734,-3 l 628,5 6,-39 c 5,-30 11,-38 28,-38 12,-1 128,-3 257,-5 216,-4 247,-6 385,-35 198,-42 364,-49 536,-25 68,10 142,26 165,37 104,48 117,219 21,280 -63,41 -307,67 -467,51 z m 252,-44 c 138,-14 194,-33 219,-73 26,-42 25,-106 -2,-140 -32,-41 -65,-53 -192,-71 -166,-24 -328,-17 -525,24 -140,29 -173,32 -385,36 -128,3 -235,5 -239,5 -3,0 -15,16 -27,35 l -21,36 22,29 c 12,17 29,32 37,34 9,3 117,7 241,11 193,5 247,11 375,36 246,49 331,56 497,38 z" />
</g>
<path id="path4640-3"
d="m 103.09451,155.26196 h -4.834976 l 0.906561,3.02186 -0.906561,5.13718 v 4.53278 l 29.009876,32.33395 13.29622,23.26836 c 0,0 21.45521,22.36178 22.05959,23.57051 0.60438,1.20876 17.22463,12.08746 17.22463,12.08746 l 9.36778,0.90656 7.85684,-7.25247 1.51093,-6.04373 -5.43935,-13.59837 -21.75742,-25.38367 -26.59239,-18.43337 -22.66399,-22.36178 -12.99402,-11.78527 z"
style="fill:#C9C9EE;stroke:#C9C9EE;stroke-width:0.21153043px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path id="path4663-0"
d="m 132.57525,53.023433 -5.29039,6.172134 -2.20435,9.69907 -1.32261,5.731268 21.6025,17.193803 17.19379,9.258192 25.57028,10.13994 7.49472,-4.84952 3.08607,-7.494734 -5.73127,-3.086078 -9.2582,-10.580804 -8.37647,-8.817336 -16.75294,-9.258199 -14.10772,-7.494734 z"
style="fill:#C9C9EE;stroke:#C9C9EE;stroke-width:0.21821791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</svg>
</div>
</div>
</a>
</div>
<div class="col-lg-6 animated fadeInDown" style="margin-bottom:10px;">
<a href= "<?php echo base_url() ?>index.php/controller/settings">
<div id="menuPrinc3">
......
......@@ -66,6 +66,16 @@ h5 {
background-color: #1B3C89;
}
#menuPrinc4 {
background-color: #7D7D7D;
color: #ffffff;
border-radius: 10px;
}
#menuPrinc4:hover{
background-color: #A7A7A7;
color: #ffffff;
}
div.barMenu:before {
content:url('../img/bars.png');
}
......
......@@ -54,9 +54,9 @@ axeMin = 999
# ================ CONNECTION BDD ================== #
try:
db = MySQLdb.connect(host="localhost",
user="firediag",
passwd="firediag$!",
db="firediag");
user="astreos",
passwd="WoHvxE982brBdQG",
db="astreos");
except Exception as ex:
print("echec_"+str(ex));
sys.stdout.flush()
......
--
-- Table structure for table `capteur`
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `capteur`;
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capteur` (
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` enum('num','map') NOT NULL DEFAULT 'num',
`topic` varchar(100) NOT NULL,
`nom` varchar(50) NOT NULL,
`unite` varchar(10) DEFAULT 'Val',
`visible` tinyint(1) NOT NULL DEFAULT '1',
`idGroupe` int(11) DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idGroupe` (`idGroupe`),
KEY `idUser` (`idUser`),
CONSTRAINT `capteur_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`),
CONSTRAINT `idGroupe` FOREIGN KEY (`idGroupe`) REFERENCES `groupe` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=latin1;
`username` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
......@@ -36,8 +27,31 @@ CREATE TABLE `groupe` (
PRIMARY KEY (`id`),
KEY `idUser` (`idUser`),
CONSTRAINT `groupe_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
--
-- Table structure for table `capteur`
--
DROP TABLE IF EXISTS `capteur`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capteur` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` enum('num','map') NOT NULL DEFAULT 'num',
`topic` varchar(100) NOT NULL,
`nom` varchar(50) NOT NULL,
`unite` varchar(10) DEFAULT 'Val',
`visible` tinyint(1) NOT NULL DEFAULT '1',
`idGroupe` int(11) DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idGroupe` (`idGroupe`),
KEY `idUser` (`idUser`),
CONSTRAINT `capteur_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`),
CONSTRAINT `idGroupe` FOREIGN KEY (`idGroupe`) REFERENCES `groupe` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=168 DEFAULT CHARSET=latin1;
--
......@@ -49,7 +63,7 @@ DROP TABLE IF EXISTS `notification`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notification` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`temps` datetime NOT NULL,
`temps` datetime(6) NOT NULL,
`type` enum('Alerte','Avertissement','Notification') NOT NULL,
`titre` tinytext NOT NULL,
`message` text NOT NULL,
......@@ -61,7 +75,7 @@ CREATE TABLE `notification` (
KEY `idCapteur` (`idCapteur`),
CONSTRAINT `notification_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`),
CONSTRAINT `notification_ibfk_2` FOREIGN KEY (`idCapteur`) REFERENCES `capteur` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5003 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=11978 DEFAULT CHARSET=latin1;
--
......@@ -81,8 +95,7 @@ CREATE TABLE `seuil` (
PRIMARY KEY (`id`),
KEY `idCapteurSeuil` (`idCapteur`),
CONSTRAINT `idCapteurSeuil` FOREIGN KEY (`idCapteur`) REFERENCES `capteur` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;
--
......@@ -99,24 +112,7 @@ CREATE TABLE `tag` (
PRIMARY KEY (`id`),
KEY `idCapteurTag` (`idCapteur`),
CONSTRAINT `idCapteurTag` FOREIGN KEY (`idCapteur`) REFERENCES `capteur` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=latin1;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
--
......@@ -128,12 +124,28 @@ DROP TABLE IF EXISTS `valeur`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `valeur` (
`id` int(11) NOT NULL AUTO_INCREMENT,
<<<<<<< HEAD
`temps` datetime(6) NOT NULL,
`valeur` varchar(20) DEFAULT NULL,
=======
`temps` datetime NOT NULL,
`valeur` varchar(30) DEFAULT NULL,
>>>>>>> 9dffffe72bda7634755e608b0d679d05826b381b
`idCapteur` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `idCapteur` (`idCapteur`),
CONSTRAINT `idCapteur` FOREIGN KEY (`idCapteur`) REFERENCES `capteur` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41953 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=488970 DEFAULT CHARSET=latin1;
--
-- Ajout d'un index pour augmenter la vitesse de ORDER BY DESC
--
CREATE INDEX `index_valeurtemps` ON `valeur`(`temps`);
--
-- Ajout d'une contrainte d'une valeur par capteur dans un temps t
--
ALTER TABLE `valeur` ADD UNIQUE `valeur_unique`(`temps`, `idCapteur`);