Compare commits

..

55 Commits

Author SHA1 Message Date
xdrm-brackets 010160e109 test prod@releaser@1 2017-12-10 23:39:36 +01:00
xdrm-brackets 51dab68805 watch position over time instead of getCurrent 2017-12-08 05:40:21 +01:00
xdrm-brackets d534f1f37c fix: geoloc with HIGH accuracy 2017-12-08 05:33:22 +01:00
xdrm-brackets fad2ac4696 upd: added google Maps link 2017-12-08 05:24:28 +01:00
xdrm-brackets cea356fb66 Merge branch 'master' of https://git.xdrm.io/ndli1718/main 2017-12-08 05:05:11 +01:00
xdrm-brackets 5a8cc4ddb7 ADDED update client (js) 2017-12-08 05:04:49 +01:00
Guillaume FAUVET 972dc6f86d add: public_html.css.accueil (add css for home page)
add: public_html.image.* (add new images for types )
upd: view.vue.container.dashboard (add some content)
upd: view.vue.home (add css reference for home page)
2017-12-08 04:54:59 +01:00
xdrm-brackets 1463253b86 DELETE msg btn now below message box 2017-12-08 04:50:09 +01:00
xdrm-brackets 7cb932335c upd: vue.emergency (user can now DELETE its own messages) 2017-12-08 04:47:23 +01:00
xdrm-brackets 044abf22e4 upd: api.message (UPT message/emergency) 2017-12-08 04:30:43 +01:00
xdrm-brackets 741656e6f1 now send string to ws-server 2017-12-08 04:24:55 +01:00
xdrm-brackets 2b53f076bc removed apache error 2017-12-08 04:22:34 +01:00
xdrm-brackets 855cfa023a 'id' is now of type 'id' 2017-12-08 04:22:27 +01:00
xdrm-brackets 11761e16e2 upd: api.message (DELETE message/emergency) 2017-12-08 04:17:41 +01:00
xdrm-brackets 512bd699de fix ridicule (2char) 2017-12-08 03:46:42 +01:00
xdrm-brackets 2da458ad31 FUCK YES -> api: POST message/emergency (now works with DB FINALLY) 2017-12-08 03:39:29 +01:00
xdrm-brackets 8e78142119 Added api: POST message/emergency (with db) 2017-12-08 03:18:29 +01:00
xdrm-brackets ec59cde080 fix: fix con 2017-12-08 03:04:57 +01:00
xdrm-brackets 60a6ec10bf debug@2 2017-12-08 03:02:22 +01:00
xdrm-brackets 89520180c7 debug 2017-12-08 02:58:17 +01:00
xdrm-brackets dd4ae7e748 Merge branch 'api-with-db' of https://git.xdrm.io/ndli1718/main into api-with-db 2017-12-08 02:54:32 +01:00
xdrm-brackets 81449426a5 Removed 'username' from POST message/emergency + POST message/event (because already in session) 2017-12-08 02:54:21 +01:00
xdrm-brackets 27942b8b82 fix: $_SESSION['name'] is now ok with API calls (tokens, etc) 2017-12-08 02:50:47 +01:00
xdrm-brackets a073f5632d clean modules.json 2017-12-08 02:50:47 +01:00
Guillaume FAUVET d2b54f431b add: build.router.controller.loader
upd: build.router.controller.api
upd: build.router.controller.page
2017-12-08 02:50:47 +01:00
xdrm-brackets aa5b97dcc8 add: repo.event (event default 'getAll()' with limit 'getById', 'create', 'update', 'remove') 2017-12-08 02:50:47 +01:00
xdrm-brackets 69df30d57c add: repo.emergency (emergency default 'getAll()' with limit 'getById', 'create', 'update', 'remove') 2017-12-08 02:50:47 +01:00
SeekDaSky 26c6a6bb22 Merge branch 'master' of https://git.xdrm.io/ndli1718/main 2017-12-08 02:45:32 +01:00
SeekDaSky 3c68e0a100 fix date 2017-12-08 02:45:23 +01:00
Guillaume FAUVET b1bafa61a8 fix: view.vue.signup-form (correct invalid username argument + secure sign up) 2017-12-08 02:35:16 +01:00
xdrm-brackets 87504efc0a add: repo.event (event default 'getAll()' with limit 'getById', 'create', 'update', 'remove') 2017-12-08 02:22:23 +01:00
xdrm-brackets d8156b3f55 add: repo.emergency (emergency default 'getAll()' with limit 'getById', 'create', 'update', 'remove') 2017-12-08 02:20:05 +01:00
SeekDaSky f468536e13 Merge branch 'master' of https://git.xdrm.io/ndli1718/main 2017-12-08 02:01:03 +01:00
SeekDaSky f3437d8db9 add: Interop pour le channel event 2017-12-08 01:56:52 +01:00
Guillaume FAUVET 65ad834bd8 add: public_html/image/header (missing logout icon) 2017-12-08 01:56:52 +01:00
Guillaume FAUVET c0013f25b0 upd: build.router.controller (add _SERVER.session.connected)
upd: public_html.header = (add icon logout)
upd: public_html.signup-form (add backlink to login)
upd: view.vue.header = (change icon if connected or not)
upd: view.vue.signup-form = (add backling to login)
2017-12-08 01:56:52 +01:00
xdrm-brackets 90c05624ab fix: view.main (added geolocation) | upd: vue.emergency|vue.event (added geolocation use) 2017-12-08 01:56:52 +01:00
Guillaume FAUVET a04a0ede20 Merge remote-tracking branch 'origin/dev-logout' into dev-logout 2017-12-08 01:25:28 +01:00
Guillaume FAUVET 8d62ed08e5 add: public_html/image/header (missing logout icon) 2017-12-08 01:25:10 +01:00
Guillaume FAUVET dbdc578ea3 upd: build.router.controller (add _SERVER.session.connected)
upd: public_html.header = (add icon logout)
upd: public_html.signup-form (add backlink to login)
upd: view.vue.header = (change icon if connected or not)
upd: view.vue.signup-form = (add backling to login)
2017-12-08 01:22:32 +01:00
Guillaume FAUVET 438607a1e6 upd: build.router.controller (add _SERVER.session.connected)
upd: public_html.header = (add icon logout)
upd: public_html.signup-form (add backlink to login)
upd: view.vue.header = (change icon if connected or not)
upd: view.vue.signup-form = (add backling to login)
2017-12-08 01:22:03 +01:00
xdrm-brackets 66d8eb39eb fix: view.main (added geolocation) | upd: vue.emergency|vue.event (added geolocation use) 2017-12-08 01:02:52 +01:00
SeekDaSky a906da7266 Merge branch 'master' of https://git.xdrm.io/ndli1718/main 2017-12-08 00:47:06 +01:00
SeekDaSky a297a89287 merge 2017-12-08 00:45:16 +01:00
xdrm-brackets 94ad405dee fix: view.websocket (fixed update) 2017-12-08 00:45:16 +01:00
xdrm-brackets 1400d445ee BIG FIX: session_name with logout .... 2017-12-08 00:45:16 +01:00
xdrm-brackets bdf119700c fix: view.websocket (object length fixes '/event' notification count) 2017-12-08 00:45:16 +01:00
xdrm-brackets 97c6dcf8be fix: view.websocket (object length fixes '/emergency' notification count) 2017-12-08 00:45:16 +01:00
xdrm-brackets f3e3f1496b IMPORTANT fix: websocket (now will work also for '/event' channel 2017-12-08 00:45:16 +01:00
Guillaume FAUVET e8d385f1f6 upt: public_html.css.layout (css for sign up form)
upt: public_html.css.login-form (add new css for sign up button)
upt: view.vue.header (close sign up form on menu click)
upt: view.vue.login-form (add sign up button in the login form authentication)
upt: view.vue.wrapper (add new popup for sign up)
upt: view.home (add reference css for sign up)
upt: view.vue-config (add gstore.add.signupform for popup sign up visibility)
2017-12-08 00:45:16 +01:00
Guillaume FAUVET 0596380219 add: public_html.css.signup-form (css for sign up form authentication)
add: view.vue.signup-form (vue for sign up form authentication)
2017-12-08 00:45:16 +01:00
Guillaume FAUVET db00a1cdc3 fix: config.modules (user mail & admin mail must be of mail type instead of text) 2017-12-08 00:45:16 +01:00
Guillaume FAUVET 7f183ed8ea fix: view.vue-config (boolean must be initialize with false) 2017-12-08 00:45:16 +01:00
Guillaume FAUVET 067ef7de6a upt: public_html.css.header (add new background-image for user authentication)
upt: public_html.css.layout (add new css for user authentication)
upt: view.vue.header (add a button for showing login interface)
upt: view.vue.wrapper (add a button for showing login interface)
upt: view.home (add a reference to user authentication css)
upt: view.vue-config (add boolean gstore.data.loginform to display user authentication interface)
2017-12-08 00:45:16 +01:00
Guillaume FAUVET 35129d49f0 add: public_html.css.login-form (css for user authentication)
add: public_html.image.header.notif.login (icon for user authentication for header)
add: view.vue.login-form (vue for user authentication)
2017-12-08 00:45:16 +01:00
34 changed files with 1291 additions and 110 deletions

View File

@ -39,8 +39,10 @@
$AUTH = '';
/* (1) Si Auth dans HEADER, on le récupère */
if( isset($_SERVER['PHP_AUTH_DIGEST']) && is_string($_SERVER['PHP_AUTH_DIGEST']) )
if( isset($_SERVER['PHP_AUTH_DIGEST']) && is_string($_SERVER['PHP_AUTH_DIGEST']) ){
$AUTH = $_SERVER['PHP_AUTH_DIGEST'];
$_SESSION['WS'] = true;
}
/* (2) Si SESSION déja connectée -> no récupère le token */
elseif( isset($_SESSION['TOKEN']) && is_string($_SESSION['TOKEN']) )

View File

@ -119,7 +119,8 @@
// On rajoute l'erreur au message
$returnData = array_merge([
'error' => $this->error->get(),
'ErrorDescription' => $this->error->explicit()
'ErrorDescription' => $this->error->explicit(),
'name' => $_SESSION['NAME']
],
$this->data
);
@ -127,6 +128,7 @@
return json_encode($returnData);
}
}
?>

View File

@ -9,24 +9,161 @@
namespace api\module;
use \database\core\Repo;
use \error\core\Error;
use \error\core\Err;
use kwebsocket\core\wsinterop;
class message
{
public function GET_emergency($argv){
extract($argv);
$messages = [];
return ["sent" => true, "messages" => $messages];
//TODO: tout poster dans la BDD
}
public function POST_emergency($argv){
extract($argv);
/* (1) Get ID_USER if connected
---------------------------------------------------------*/
$id_user = null;
$name = null;
if( count($_SESSION['ADMIN']) > 0 )
$id_user = $_SESSION['ADMIN']['id'];
elseif( count($_SESSION['USER']) > 0 )
$id_user = $_SESSION['USER']['id'];
else
$name = $_SESSION['NAME'];
/* (2) Create emergenct
---------------------------------------------------------*/
/* (1) Try to create entry */
$id_created = Repo::request('emergency', 'create',
$id_user,
$name,
$message,
0,
$location[0],
$location[1],
$URL_0
);
/* (2) If cannot create -> dispatch error */
if( $id_created === false )
return ['error' => new Error(Err::RepoError)];
/* (3) Send to WebSocket
---------------------------------------------------------*/
/* (1) Open socket */
$wsi = new wsinterop('localhost', 9998);
/* (2) Send data */
$wsi->send([
'operation' => 'PostMessage',
'message' => $message,
'username' => $_SESSION['NAME'],
'location' => $location,
'id' => $id_created,
'channelType' => 'Emergency',
'channelName' => "$URL_0"
]);
/* (3) Close socket */
$wsi->close();
return ['sent' => intval($id_created) ];
}
public function DELETE_emergency($argv){
extract($argv);
/* (1) Create emergenct
---------------------------------------------------------*/
/* (1) Try to create entry */
$deleted = Repo::request('emergency', 'remove', $id);
/* (2) If cannot create -> dispatch error */
if( $deleted === false )
return ['error' => new Error(Err::RepoError)];
/* (2) Send to WebSocket
---------------------------------------------------------*/
$wsi = new wsinterop("localhost",9998);
$wsi->send([
'operation' => 'DelMessage',
'id' => "$id",
'channelType' => 'Emergency',
'channelName' => "$URL_0"
]);
$wsi->close();
return ["deleted" => true];
}
public function PUT_emergency($argv){
extract($argv);
/* (1) Create emergenct
---------------------------------------------------------*/
/* (1) Try to create entry */
$updated = Repo::request('emergency', 'update', $id, $message);
/* (2) If cannot create -> dispatch error */
if( $updated === false )
return ['error' => new Error(Err::RepoError)];
/* (2) Send to WebSocket
---------------------------------------------------------*/
/* (1) Create socket */
$wsi = new wsinterop("localhost",9998);
/* (2) Send data */
$wsi->send([
"operation" => "UpdMessage",
"id" => "$id",
"message" => $message,
"channelType" => "Emergency",
"channelName" => "$URL_0"
]);
/* (3) Close socket */
$wsi->close();
return ['updated' => true];
}
public function POST_event($argv){
extract($argv);
$wsi = new wsinterop("localhost",9998);
$wsi->send([
"operation" => "PostMessage",
"message" => $message,
"username" => $username,
"username" => $_SESSION['NAME'],
"location" => $location,
"type" => $type,
//TODO implémenter la récupération d'id depuis la bdd
"id" => uniqid(),
"channelType" => "Emergency",
"channelType" => "Event",
"channelName" => is_null($URL_0) ? "" : "$URL_0"
]);
@ -36,7 +173,7 @@ class message
//TODO: tout poster dans la BDD
}
public function DELETE_emergency($argv){
public function DELETE_event($argv){
extract($argv);
$wsi = new wsinterop("localhost",9998);
@ -44,7 +181,26 @@ class message
$wsi->send([
"operation" => "DelMessage",
"id" => $id,
"channelType" => "Emergency",
"channelType" => "Event",
"channelName" => is_null($URL_0) ? "" : "$URL_0"
]);
$wsi->close();
return ["sent" => true];
//TODO: tout poster dans la BDD
}
public function PUT_event($argv){
extract($argv);
$wsi = new wsinterop("localhost",9998);
$wsi->send([
"operation" => "UpdMessage",
"id" => $id,
"message" => $message,
"channelType" => "Event",
"channelName" => is_null($URL_0) ? "" : "$URL_0"
]);

View File

@ -0,0 +1,146 @@
<?php
namespace database\repo;
use \database\core\Repo_i;
class emergency extends Repo_i{
/* (1) Return all emergencies in database
*
* @limit<int> Nb max voulu
*
* @return emergencies<array> The emergency list
* FALSE on error
*
---------------------------------------------------------*/
public function getAll(int $limit){
/* (1) Statement */
$st = $this->pdo->query("SELECT * FROM `emergency` ORDER BY `timestamp` DESC LIMIT $limit");
/* (2) Fetched data */
return $st->fetchAll();
}
/* (2) Return a emergency by its `id_emergency`
*
* @id_emergency<int> The emergency UID
*
* @return emergency<array> The emergency if found
* FALSE on error
*
---------------------------------------------------------*/
public function getById(int $id_emergency){
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("SELECT * FROM `emergency` WHERE `id_emergency` = :id_emergency LIMIT 1");
/* (2) Bind variables */
$pst->bindParam(':id_emergency', $id_emergency, \PDO::PARAM_INT);
/* (3) Execute */
if( !$pst->execute() ) return false; // if error -> send FALSE
/* (4) Fetched data */
return $pst->fetch();
}
/* (3) Creates a new emergency
*
* @id_user<int|null> The user ID if defined
* @name<String> The user name (if not connected)
* @message<String> The message content
* @type<int> The message type
* @latitude<int> Sender latitude
* @longitude<int> Sender longitude
* @dep<int> Departement id
*
* @return id_created<int> UID of the created emergency
* FALSE on error
*
---------------------------------------------------------*/
public function create($id_user, String $name, String $message, int $type, float $latitude, float $longitude, $dep){
/* (2) Create the emergency
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("INSERT INTO `emergency`(`id_emergency`, `id_user`, `timestamp`, `name`, `message`, `type`, `latitude`, `longitude`, `dep`)
VALUES(DEFAULT, :id_user, DEFAULT, :name, :message, :type, :latitude, :longitude, :dep)");
/* (3) Bind variables */
$pst->bindParam(':id_user', $id_user, \PDO::PARAM_INT);
$pst->bindParam(':name', $name, \PDO::PARAM_STR, 50);
$pst->bindParam(':message', $message, \PDO::PARAM_STR);
$pst->bindParam(':type', $type, \PDO::PARAM_INT);
$pst->bindParam(':latitude', $latitude, \PDO::PARAM_STR);
$pst->bindParam(':longitude', $longitude, \PDO::PARAM_STR);
$pst->bindParam(':dep', $dep, \PDO::PARAM_STR, 2);
/* (4) Execute -> if error return FALSE */
if( !$pst->execute() ) return false;
/* (2) Get the id
---------------------------------------------------------*/
/* (1) Get last inserted id */
return $this->pdo->lastInsertId();
}
/* (4) Updates an emergency
*
* @id_emergency<int> The emergency UID
* @new_msg<String> New message content
*
* @return updated<bool> True if updated
*
---------------------------------------------------------*/
public function update(int $id_emergency, String $new_msg){
/* (1) Update the emergency
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("UPDATE `emergency` SET `message` = :new_msg WHERE `id_emergency` = :id_emergency");
/* (3) Bind variables */
$pst->bindParam(':id_emergency', $id_emergency, \PDO::PARAM_INT);
$pst->bindParam(':new_msg', $new_msg, \PDO::PARAM_STR);
/* (4) Execute -> if error return FALSE */
return $pst->execute();
}
/* (5) Removes an emergency
*
* @id_emergency<int> The emergency UID
*
* @return removed<bool> True has been removed
*
---------------------------------------------------------*/
public function remove(int $id_emergency){
/* (1) Update the emergency
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("DELETE FROM `emergency` WHERE `id_emergency` = :id_emergency");
/* (2) Bind variables */
$pst->bindParam(':id_emergency', $id_emergency, \PDO::PARAM_INT);
/* (3) Execute -> if error return FALSE */
return $pst->execute();
}
}

View File

@ -0,0 +1,148 @@
<?php
namespace database\repo;
use \database\core\Repo_i;
class event extends Repo_i{
/* (1) Return all events in database
*
* @limit<int> Nb max voulu
*
* @return events<array> The event list
* FALSE on error
*
---------------------------------------------------------*/
public function getAll(int $limit){
/* (1) Statement */
$st = $this->pdo->query("SELECT * FROM `event` ORDER BY `timestamp` DESC LIMIT $limit");
/* (2) Fetched data */
return $st->fetchAll();
}
/* (2) Return a event by its `id_event`
*
* @id_event<int> The event UID
*
* @return event<array> The event if found
* FALSE on error
*
---------------------------------------------------------*/
public function getById(int $id_event){
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("SELECT * FROM `event` WHERE `id_event` = :id_event LIMIT 1");
/* (2) Bind variables */
$pst->bindParam(':id_event', $id_event, \PDO::PARAM_INT);
/* (3) Execute */
if( !$pst->execute() ) return false; // if error -> send FALSE
/* (4) Fetched data */
return $pst->fetch();
}
/* (3) Creates a new event
*
* @id_user<int|null> The user ID if defined
* @name<String> The user name (if not connected)
* @timestamp<int> The timestamp
* @message<String> The message content
* @type<int> The message type
* @latitude<int> Sender latitude
* @longitude<int> Sender longitude
* @dep<int> Departement id
*
* @return id_created<int> UID of the created event
* FALSE on error
*
---------------------------------------------------------*/
public function create($id_user, String $name, int $timestamp, String $message, int $type, float $latitude, float $longitude, int $dep){
/* (2) Create the event
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("INSERT INTO `event`(`id_event`, `id_user`, `timestamp`, `name`, `message`, `type`, `latitude`, `longitude`, `dep`)
VALUES(DEFAULT, :id_user, :timestamp, :name, :message, :type, :latitude, :longitude, :dep)");
/* (3) Bind variables */
$pst->bindParam(':id_user', $id_user, \PDO::PARAM_INT);
$pst->bindParam(':timestamp', $timestamp, \PDO::PARAM_INT);
$pst->bindParam(':name', $name, \PDO::PARAM_STR, 50);
$pst->bindParam(':message', $message, \PDO::PARAM_STR);
$pst->bindParam(':type', $type, \PDO::PARAM_INT);
$pst->bindParam(':latitude', $latitude, \PDO::PARAM_STR);
$pst->bindParam(':longitude', $longitude, \PDO::PARAM_STR);
$pst->bindParam(':dep', $dep, \PDO::PARAM_STR, 2);
/* (4) Execute -> if error return FALSE */
if( !$pst->execute() ) return false;
/* (2) Get the id
---------------------------------------------------------*/
/* (1) Get last inserted id */
return $this->pdo->lastInsertId;
}
/* (4) Updates an event
*
* @id_event<int> The event UID
* @new_msg<String> New message content
*
* @return updated<bool> True if updated
*
---------------------------------------------------------*/
public function update(int $id_event, String $new_msg){
/* (1) Update the event
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("UPDATE `event` SET `message` = :new_msg WHERE `id_event` = :id_event");
/* (3) Bind variables */
$pst->bindParam(':id_event', $id_event, \PDO::PARAM_INT);
$pst->bindParam(':new_msg', $new_msg, \PDO::PARAM_STR);
/* (4) Execute -> if error return FALSE */
return $pst->execute();
}
/* (5) Removes an event
*
* @id_event<int> The event UID
*
* @return removed<bool> True has been removed
*
---------------------------------------------------------*/
public function remove(int $id_event){
/* (1) Update the event
---------------------------------------------------------*/
/* (1) Prepare Statement */
$pst = $this->pdo->prepare("DELETE FROM `event` WHERE `id_event` = :id_event");
/* (2) Bind variables */
$pst->bindParam(':id_event', $id_event, \PDO::PARAM_INT);
/* (3) Execute -> if error return FALSE */
return $pst->execute();
}
}

View File

@ -32,11 +32,13 @@
*
*/
public function call(){
/* (1) Authentication */
\router\controller\loader::start();
/* (1) Process response */
/* (2) Process response */
$this->response = $this->request->dispatch();
/* (2) Manages result */
/* (3) Manages result */
if( $this->response instanceof Response )
echo $this->response->serialize();

View File

@ -26,7 +26,8 @@
echo "window._SERVER = ".json_encode([
'session' => [
'name' => $_SESSION['NAME']
'name' => $_SESSION['NAME'],
'connected' => count($_SESSION['ADMIN']) + count($_SESSION['USER']) > 0
]
])."\n";

View File

@ -0,0 +1,57 @@
<?php
/**
* Created by PhpStorm.
* User: jean-kevin
* Date: 08/12/17
* Time: 02:07
*/
namespace router\controller;
use kwebsocket\core\wsinterop;
abstract class loader {
public static function start() {
if( $_SESSION['WS'] || strlen($_SESSION['NAME']) == 0 ){
// ask with websocketInterop
$wsi = new wsinterop('localhost', 9998);
if( count($_SESSION['USER']) > 0 ){
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'user', 'name' => $_SESSION['USER']['username']]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}elseif( count($_SESSION['ADMIN']) > 0 ){
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'admin', 'name' => $_SESSION['ADMIN']['username']]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}else{
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'guest', 'name' => null]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}
$wsi->close();
$wsi = null;
$_SESSION['WS'] = false;
}
}
}

View File

@ -17,7 +17,7 @@
*/
public function __construct($url){
$this->pagename = $url['page'];
// $this->pagename = $url['page'];
}
@ -26,46 +26,8 @@
*
*/
public function load(){
loader::start();
if( $_SESSION['WS'] || strlen($_SESSION['NAME']) == 0 ){
// ask with websocketInterop
$wsi = new wsinterop('localhost', 9998);
if( count($_SESSION['USER']) > 0 ){
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'user', 'name' => $_SESSION['USER']['username']]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}elseif( count($_SESSION['ADMIN']) > 0 ){
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'admin', 'name' => $_SESSION['ADMIN']['username']]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}else{
// get/send name to web socket
$wsi->send(['operation' => "Connect",'type' => 'guest', 'name' => null]);
$check = $wsi->receive();
if( $check['error'] == false )
$_SESSION['NAME'] = $check['name'];
}
$wsi->close();
$wsi = null;
$_SESSION['WS'] = false;
}
if( file_exists(__ROOT__."/view/home.php") )
include __ROOT__."/view/home.php";
else

View File

@ -98,31 +98,63 @@
"description" : "",
"permissions": [],
"parameters": {
"URL_0": {
"description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast",
"type" : "numeric",
"optional" : true
},
"message": {
"description": "message a publier",
"type": "text",
"optional": false
},
"username": {
"description": "username affiché dans le channel",
"type": "varchar(3,20)",
"optional": false
},
"location": {
"description": "coordonés GPS du message, des coordonnées invalide ne seront pas affiché",
"type": "array<numeric>"
}
"URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", "type" : "numeric" },
"message": { "description": "message a publier", "type": "text" },
"location": { "description": "coordonés GPS du message, des coordonnées invalide ne seront pas affiché", "type": "array<numeric>" }
}
},
"DELETE emergency": {
"description": "",
"permissions": [],
"parameters": {
"URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", "type": "numeric" },
"id": { "description": "message a publier", "type": "id" }
}
},
"PUT emergency": {
"description" : "",
"permissions": [],
"parameters": {
"URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", "type": "numeric" },
"id": { "description": "message a publier", "type": "id" },
"message": { "description": "message a publier", "type": "text" }
}
},
"GET emergency": {
"description" : "",
"permissions": [],
"parameters": {
"URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", "type" : "numeric" },
"limit": { "description": "nombre de message a récupérer maximum", "type" : "numeric", "optional": true }
}
},
"POST event": {
"description" : "",
"permissions": [],
"parameters": {
"URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", "type": "numeric", "optional": true },
"message": { "description": "message a publier", "type": "text", "optional": false },
"type": { "description": "Flag du type d'evenement", "type": "numeric" },
"location": { "description": "coordonés GPS du message, des coordonnées invalide ne seront pas affiché", "type": "array<numeric>" }
}
},
"DELETE event": {
"description": "",
"permissions": [],
"parameters": {
"URL_0": {
"description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast",
"type": "numeric",
"optional": true
},
"id": {
"description": "message a publier",
"type": "text"
}
}
},
"PUT event": {
"description" : "",
"permissions": [],
"parameters": {
@ -134,9 +166,15 @@
"id": {
"description": "message a publier",
"type": "text"
},
"message": {
"description": "message a publier",
"type": "text",
"optional": false
}
}
}
},
"RESTexample": {

View File

@ -0,0 +1,80 @@
#CONTAINER.accueil{
display: block;
}
#CONTAINER.accueil > * {
padding: 0 50px;
}
#CONTAINER.accueil h1 {
display: inline-block;
position: relative;
letter-spacing: 2px;
background: -webkit-linear-gradient(top left, #474dff, #00E288);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
overflow: hidden;
margin: 50px auto 0 calc(50% - 161.5px);
}
#CONTAINER.accueil h2 {
margin: 25px auto 10px auto;
color: #10c0a3;
}
#CONTAINER .icon-type{
height: 23px;
}
#CONTAINER ul {
margin-top: 10px;
margin-left: 50px;
}
#CONTAINER ul li div {
display: inline-block;
width: 25px;
text-align: center;
}
#CONTAINER.accueil table{
width: 70%;
display: block;
margin: 15px auto 15px 30px;
}
#CONTAINER.accueil table > tbody > tr{
text-align: center;
}
#CONTAINER.accueil table > tbody > tr > td{
width: 115px;
}
#CONTAINER a {
text-decoration: none;
color: inherit;
}
#CONTAINER .phone{
display: inline-block;
vertical-align: middle;
width: 3em;
height: 2em;
padding: -1em;
background: url('/image/container/phone.svg@aaaaaa') center center no-repeat;
background-size: 25px;
background-color: transparent;
border-radius: 50% / 50%;
cursor: pointer;
transition: background .2s ease-in-out;
}
#CONTAINER a:hover .phone{
background-size: 30px;
background-image: url('/image/container/phone.svg@3bc010');
}

View File

@ -35,7 +35,7 @@
#CONTAINER.message div.me{ /* Message Item (self) */
/* background: #13d89d; */
align-self: flex-end;
margin: .5em 1.5em;
margin: 1em 1.5em;
}
#CONTAINER.message div.end-pad{
@ -68,6 +68,46 @@
font-size: .8em;
}
#CONTAINER.message div span.del, /* Del btn */
#CONTAINER.message div span.maps, /* Maps btn */
#CONTAINER.message div span.upd{ /* Update btn */
display: block;
position: absolute;
top: calc( 100% + .2em );
left: calc( 100% - 1.5em );
width: 1em;
height: 1em;
background: url('/image/container/del-msg.svg@777777') center center no-repeat;
background-size: 80% auto;
cursor: pointer;
}
#CONTAINER.message div span.maps{
top: .3em;
left: calc( 100% - 1em - .2em );
background-image: url('/image/container/maps.svg@dddddd');
background-size: auto 100%;
}
#CONTAINER.message div span.upd{
left: calc( 100% - 3em );
background-image: url('/image/container/edit-msg.svg@777777');
}
#CONTAINER.message div span.del:hover{
background-image: url('/image/container/del-msg.svg@e33222')
}
#CONTAINER.message div span.upd:hover{
background-image: url('/image/container/edit-msg.svg@2ab1dd')
}
#CONTAINER.message div span.maps:hover{
background-image: url('/image/container/maps.svg@29c98e');
}
#CONTAINER.message div span span.code{ /* Code block */
display: inline-block;
position: relative;

View File

@ -116,6 +116,7 @@
#header-notif .hnotif.search{ background-image: url('/image/header/notif/search.svg@aaaaaa'); }
#header-notif .hnotif.menu{ background-image: url('/image/header/notif/menu.svg@aaaaaa'); }
#header-notif .hnotif.login{ background-image: url('/image/header/notif/login.svg@aaaaaa'); }
#header-notif .hnotif.logout{ background-image: url('/image/header/notif/logout.svg@aaaaaa'); }
/* HOVER */
#header-notif .hnotif:hover{
@ -129,6 +130,7 @@
#header-notif .hnotif.search:hover{ background-image: url('/image/header/notif/search.svg@ae51da'); }
#header-notif .hnotif.menu:hover{ background-image: url('/image/header/notif/menu.svg@4a8ad8'); }
#header-notif .hnotif.login:hover{ background-image: url('/image/header/notif/login.svg@660088'); }
#header-notif .hnotif.logout:hover{ background-image: url('/image/header/notif/logout.svg@660088'); }

View File

@ -107,3 +107,10 @@
border-width: 1px;
outline: none;
}
#SIGNUP-FORM > .body > form > #membre{
font-size: 0.8em;
color: #006eff;
text-decoration: underline;
margin-top: 8px;
}

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="Layer_1"
version="1.1"
viewBox="0 0 20 22"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="del-msg.svg"
width="20"
height="22"><metadata
id="metadata4199"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs4197" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1056"
id="namedview4195"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="39.666667"
inkscape:cx="10"
inkscape:cy="12"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><style
type="text/css"
id="style4191">
.st0{fill:#1E232D;}
</style><path
d="M 7,0 7,2 0,2 0,4 20,4 20,2 13,2 13,0 7,0 Z M 2,6 2,19.699219 C 2,20.799219 2.9,22 4,22 l 12,0 c 1.1,0 2,-1.200781 2,-2.300781 L 18,6 16,6 16,20 4,20 4,6 2,6 Z M 7,8 7,18 9,18 9,8 7,8 Z m 4,0 0,10 2,0 0,-10 -2,0 z"
id="fill-edit"
inkscape:connector-curvature="0" /></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="35.994999"
viewBox="0 0 35.994999 35.994999"
width="35.994999"
id="svg4173"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="edit-msg.svg">
<metadata
id="metadata4183">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4181" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1056"
id="namedview4179"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="19.833333"
inkscape:cx="18"
inkscape:cy="18"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg4173" />
<path
d="m 29.324219,0 c -0.5125,0 -1.024063,0.1959375 -1.414063,0.5859375 L 24.25,4.2441406 l 7.5,7.5000004 3.660156,-3.6582035 c 0.78,-0.78 0.78,-2.0500781 0,-2.8300781 L 30.740234,0.5859375 C 30.350234,0.1959375 29.836719,0 29.324219,0 Z M 22.130859,6.3652344 0,28.494141 l 0,7.5 7.5,0 22.130859,-22.128907 -7.5,-7.4999996 z"
id="fill-edit"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="16"
version="1.1"
viewBox="0 0 10 16"
width="10"
id="svg4174"
inkscape:version="0.91 r13725"
sodipodi:docname="maps.svg">
<metadata
id="metadata4185">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1056"
id="namedview4183"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="42.072853"
inkscape:cx="0.16900642"
inkscape:cy="5.1542799"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg4174" />
<defs
id="defs4178" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:1"
d="M 0.02038,6 C 0.00689,5.83531 0,5.66854 0,5.5 0,2.46243 2.23858,0 5,0 7.76142,0 10,2.46243 10,5.5 10,5.66854 9.993,5.83531 9.9796,6 L 10,6 C 10,9.00574 5,16 5,16 5,16 0,9.02234 0,6 Z M 5,7 C 6.10457,7 7,6.10457 7,5 7,3.89543 6.10457,3 5,3 3.89543,3 3,3.89543 3,5 3,6.10457 3.89543,7 5,7 Z m 0,0"
id="fill-edit"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="352"
id="Layer_1"
version="1.1"
viewBox="0 0 352.04639 352"
width="352.04639"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="phone.svg"><metadata
id="metadata3396"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3394" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1855"
inkscape:window-height="1056"
id="namedview3392"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="1.7949219"
inkscape:cx="176.07275"
inkscape:cy="176.1"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><path
d="m 335.97275,255.4 c -14.6,-15 -56.1,-43.1 -83.3,-43.1 -6.3,0 -11.8,1.4 -16.3,4.3 -13.3,8.5 -23.9,15.1 -29,15.1 -2.8,0 -5.8,-2.5 -12.4,-8.2 l -1.1,-1 c -18.3,-15.9 -22.2,-20 -29.3,-27.4 l -1.8,-1.9 c -1.3,-1.3 -2.4,-2.5 -3.5,-3.6 -6.2,-6.4 -10.7,-11 -26.6,-29 l -0.7,-0.8 c -7.6,-8.6 -12.6,-14.2 -12.9,-18.3 -0.3,-4 3.2,-10.5 12.1,-22.6 10.8,-14.6 11.2,-32.6 1.3,-53.5 -7.9,-16.5 -20.8,-32.3 -32.2,-46.2 L 99.272748,18 c -9.8,-12 -21.2,-18 -33.9,-18 -14.1,0 -25.8,7.6 -32,11.6 -0.5,0.3 -1,0.7 -1.5,1 -13.9,8.8 -24.0000004,20.9 -27.8000004,33.2 -5.7,18.5 -9.5,42.5 17.8000004,92.4 23.6,43.2 45,72.2 79.000002,107.1 32,32.8 46.2,43.4 78,66.4 35.4,25.6 69.4,40.3 93.2,40.3 22.1,0 39.5,0 64.3,-29.9 26,-31.4 15.2,-50.6 -0.4,-66.7 z"
id="fill-edit"
inkscape:connector-curvature="0" /></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="1280"
viewBox="0 0 1568 1280"
width="1568"
id="svg3406"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logout.svg">
<metadata
id="metadata3414">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3412" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1153"
inkscape:window-height="480"
id="namedview3410"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.13169643"
inkscape:cx="239.72881"
inkscape:cy="640"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="0"
inkscape:current-layer="svg3406" />
<path
d="m 640,1184 q 0,4 1,20 1,16 0.5,26.5 -0.5,10.5 -3,23.5 -2.5,13 -10,19.5 -7.5,6.5 -20.5,6.5 l -320,0 Q 169,1280 84.5,1195.5 0,1111 0,992 L 0,288 Q 0,169 84.5,84.5 169,0 288,0 l 320,0 q 13,0 22.5,9.5 9.5,9.5 9.5,22.5 0,4 1,20 1,16 0.5,26.5 -0.5,10.5 -3,23.5 -2.5,13 -10,19.5 Q 621,128 608,128 l -320,0 q -66,0 -113,47 -47,47 -47,113 l 0,704 q 0,66 47,113 47,47 113,47 l 312,0 11.5,1 11.5,3 8,5.5 7,9 2,13.5 z m 928,-544 q 0,26 -19,45 l -544,544 q -19,19 -45,19 -26,0 -45,-19 -19,-19 -19,-45 l 0,-288 -448,0 q -26,0 -45,-19 -19,-19 -19,-45 l 0,-384 q 0,-26 19,-45 19,-19 45,-19 l 448,0 0,-288 q 0,-26 19,-45 19,-19 45,-19 26,0 45,19 l 544,544 q 19,19 19,45 z"
id="fill-edit"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><svg height="60px" version="1.1" viewBox="0 0 60 60" width="60px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#1B1A19" id="Fill-175-+-Fill-176-+-Fill-177"><path d="M60,38 C60,37.448 59.552,37 59,37 L53.91,37 C53.431,34.167 50.967,32 48,32 C45.033,32 42.569,34.167 42.09,37 L19.91,37 C19.431,34.167 16.967,32 14,32 C11.033,32 8.569,34.167 8.09,37 L1,37 C0.448,37 0,37.448 0,38 C0,38.552 0.448,39 1,39 L3,39 L3,46 C3,48.617 5.477,51 8.198,51 L11.156,51 L16.137,59.505 C16.385,59.928 16.902,60.11 17.36,59.933 L22.924,57.788 L27.585,59.91 L27.599,59.913 L27.784,59.957 L27.984,59.997 L28,60 L28.171,59.966 L28.358,59.934 L34.102,57.734 L39.631,59.929 C39.751,59.978 39.876,60 39.999,60 C40.353,60 40.693,59.812 40.874,59.486 L45.588,51 L54,51 C56.369,51 60,48.76 60,46 L60,39 C60,38.814 59.935,38.649 59.847,38.5 C59.935,38.351 60,38.186 60,38 L60,38 Z M48,34 C50.206,34 52,35.794 52,38 C52,40.206 50.206,42 48,42 C45.794,42 44,40.206 44,38 C44,35.794 45.794,34 48,34 L48,34 Z M14,34 C16.206,34 18,35.794 18,38 C18,40.206 16.206,42 14,42 C11.794,42 10,40.206 10,38 C10,35.794 11.794,34 14,34 L14,34 Z M22.597,55.771 L17.434,57.761 L13.474,51 L27,51 L27,57.446 L23.371,55.794 C23.126,55.684 22.849,55.676 22.597,55.771 L22.597,55.771 Z M39.552,57.747 L34.477,55.731 C34.243,55.639 33.984,55.637 33.75,55.727 L29,57.546 L29,51 L43.3,51 L39.552,57.747 L39.552,57.747 Z M58,46 C58,47.362 55.543,49 54,49 L12,49 L11.893,49.022 L11.729,49 L8.198,49 C6.614,49 5,47.486 5,46 L5,39 L8.09,39 C8.569,41.833 11.033,44 14,44 C16.967,44 19.431,41.833 19.91,39 L42.09,39 C42.569,41.833 45.033,44 48,44 C50.967,44 53.431,41.833 53.91,39 L58,39 L58,46 L58,46 Z" id="Fill-175"/><path d="M29.567,32.302 C29.717,32.382 29.878,32.419 30.037,32.419 C30.394,32.419 30.74,32.228 30.92,31.89 C31.18,31.403 30.996,30.797 30.508,30.537 C23.63,26.869 25.251,23.28 27.304,18.737 C28.185,16.788 29.087,14.789 29.18,12.777 C31.258,14.095 33,16.007 33,18 C33,18.464 33.319,18.867 33.77,18.973 C34.225,19.078 34.687,18.862 34.894,18.447 C36.686,14.863 38.696,10.844 34.298,2.877 C42.521,6.311 46.877,13.37 45.03,20.757 C44.939,21.12 45.058,21.502 45.338,21.75 C45.619,21.997 46.013,22.069 46.361,21.933 C47.843,21.359 49.981,19.289 50.873,15.691 C51.909,17.67 53.019,20.658 52.74,23.266 C52.557,24.984 51.806,26.261 50.445,27.168 C49.986,27.474 49.862,28.095 50.168,28.555 C50.474,29.014 51.095,29.139 51.555,28.832 C53.414,27.593 54.482,25.792 54.729,23.479 C55.22,18.884 52.21,13.517 50.984,12.251 C50.706,11.966 50.286,11.872 49.915,12.011 C49.543,12.151 49.289,12.498 49.268,12.895 C49.125,15.589 48.273,17.412 47.399,18.553 C47.968,10.457 41.994,2.935 32.286,0.042 C31.887,-0.076 31.45,0.066 31.199,0.401 C30.948,0.737 30.933,1.194 31.162,1.545 C35.585,8.348 35.423,12.012 34.231,15.108 C33.022,12.859 30.589,11.087 28.417,10.091 C28.064,9.928 27.649,9.986 27.353,10.237 C27.057,10.488 26.933,10.888 27.035,11.263 C27.581,13.267 26.561,15.524 25.481,17.914 C23.501,22.297 21.037,27.753 29.567,32.302" id="Fill-176"/><path d="M40.628,30.071 C40.116,30.277 39.866,30.858 40.071,31.372 C40.228,31.762 40.603,32 41,32 C41.124,32 41.249,31.977 41.372,31.929 C43.311,31.153 44.407,29.276 44.457,26.645 C44.535,22.484 42.034,17.254 39.406,16.086 C39.04,15.923 38.607,15.996 38.315,16.272 C38.021,16.548 37.922,16.974 38.063,17.351 C39.428,20.989 38.767,23.496 37.408,24.092 C36.305,24.577 34.958,23.705 34.058,21.925 C33.875,21.563 33.488,21.347 33.087,21.379 C32.683,21.412 32.338,21.684 32.214,22.07 C30.967,25.944 30.96,28.375 34.293,31.707 C34.684,32.098 35.316,32.098 35.707,31.707 C36.098,31.316 36.098,30.684 35.707,30.293 C33.672,28.258 33.176,26.851 33.575,24.715 C35.07,26.282 36.857,26.519 38.212,25.923 C39.81,25.222 40.98,23.347 40.809,20.473 C41.764,22.233 42.495,24.578 42.456,26.606 C42.422,28.434 41.807,29.6 40.628,30.071" id="Fill-177"/></g></g></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="20"
version="1.2"
viewBox="0 0 20 20"
width="20"
xml:space="preserve"
id="svg3422"
inkscape:version="0.91 r13725"
sodipodi:docname="rain.svg"><metadata
id="metadata3445"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3443" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1855"
inkscape:window-height="1056"
id="namedview3441"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="38.291667"
inkscape:cx="8.7725789"
inkscape:cy="12"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg3422" /><g
id="Layer_1"
transform="translate(-2,-4)"><g
id="g3425"><path
d="m 15,22 c -0.552,0 -1,-0.447 -1,-1 l 0,-6 c 0,-0.553 0.448,-1 1,-1 0.552,0 1,0.447 1,1 l 0,6 c 0,0.553 -0.448,1 -1,1 z"
id="path3427"
inkscape:connector-curvature="0" /></g><g
id="g3429"><path
d="M 9,22 C 8.448,22 8,21.553 8,21 l 0,-6 c 0,-0.553 0.448,-1 1,-1 0.552,0 1,0.447 1,1 l 0,6 c 0,0.553 -0.448,1 -1,1 z"
id="path3431"
inkscape:connector-curvature="0" /></g><g
id="g3433"><path
d="m 12,24 c -0.552,0 -1,-0.447 -1,-1 l 0,-6 c 0,-0.553 0.448,-1 1,-1 0.552,0 1,0.447 1,1 l 0,6 c 0,0.553 -0.448,1 -1,1 z"
id="path3435"
inkscape:connector-curvature="0" /></g><g
id="g3437"><path
d="M 6,18 C 3.794,18 2,16.206 2,14 2,12.139 3.277,10.571 5.001,10.126 5,10.084 5,10.042 5,10 5,6.691 7.691,4 11,4 13.587,4 15.824,5.639 16.65,8.015 19.586,7.771 22,10.128 22,13 c 0,2.241 -1.507,4.223 -3.666,4.819 -0.535,0.146 -1.083,-0.166 -1.23,-0.697 -0.147,-0.532 0.165,-1.083 0.698,-1.23 C 19.096,15.534 20,14.345 20,13 c 0,-1.654 -1.346,-3 -3,-3 -0.242,0 -0.499,0.041 -0.811,0.13 L 15.115,10.436 14.93,9.334 C 14.604,7.402 12.952,6 11,6 8.794,6 7,7.794 7,10 c 0,0.272 0.027,0.545 0.082,0.808 L 7.33,12.01 5.908,11.994 C 4.897,12 4,12.897 4,14 c 0,1.103 0.897,2 2,2 0.552,0 1,0.447 1,1 0,0.553 -0.448,1 -1,1 z"
id="path3439"
inkscape:connector-curvature="0" /></g></g></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new -0.71 -1.337 141.732 141.732" height="141.732px" id="Livello_1" version="1.1" viewBox="-0.71 -1.337 141.732 141.732" width="141.732px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Livello_66"><path d="M136.314,53.739L136.314,53.739l-16.896-4.931l12.231-7.688c2.58-1.622,3.465-5.218,1.976-8.024 c-1.486-2.81-4.787-3.771-7.367-2.149l-12.269,7.715l4.541-18.456c0.771-3.137-0.938-6.354-3.813-7.194 c-2.877-0.839-5.838,1.02-6.605,4.154l-7.336,29.803L75.662,62.75l-0.084-0.056H75.57l-0.002-24.781l20.039-21.818 c2.104-2.294,2.104-6.013-0.002-8.307c-2.104-2.294-5.521-2.294-7.627,0L75.57,21.3L75.568,5.875c0-3.244-2.414-5.874-5.396-5.875 c-2.979,0.001-5.395,2.631-5.395,5.875v15.382L52.411,7.788c-2.105-2.294-5.521-2.294-7.63,0s-2.107,6.013,0,8.307L64.78,37.871 V62.8l-0.053-0.104l-0.076,0.05l-25.104-15.78L32.214,17.16c-0.771-3.138-3.729-4.994-6.604-4.154 c-2.879,0.84-4.586,4.061-3.813,7.191l4.541,18.457l-12.269-7.714c-2.582-1.621-5.881-0.655-7.369,2.15 c-1.489,2.81-0.604,6.403,1.975,8.021l12.234,7.69l-16.9,4.936c-2.878,0.842-4.587,4.062-3.812,7.194 c0.771,3.134,3.729,4.993,6.607,4.154l27.318-7.974l19.739,12.41L34.11,81.942l-27.314-7.97c-2.882-0.84-5.837,1.021-6.606,4.153 C-0.584,81.259,1.125,84.479,4,85.317l16.897,4.934L8.663,97.94c-2.58,1.622-3.466,5.215-1.978,8.024s4.791,3.771,7.371,2.147 l12.266-7.713l-4.538,18.456c-0.771,3.134,0.938,6.354,3.813,7.194s5.836-1.021,6.605-4.153l7.334-29.804l25.11-15.787l0.084,0.053 l0.043-0.084l0.002,0.084h0.011l0.002,24.785l-20.04,21.817c-2.104,2.294-2.104,6.014,0,8.307c2.107,2.294,5.521,2.294,7.629,0 l12.41-13.509v15.424c0,3.245,2.416,5.875,5.396,5.875c2.979,0,5.393-2.63,5.393-5.874l0.002-15.382l12.368,13.468 c2.105,2.294,5.521,2.294,7.63,0c2.104-2.294,2.104-6.013,0-8.307l-20-21.775V76.344l0.01,0.018l0.074-0.047l25.104,15.781 l7.334,29.803c0.771,3.138,3.729,4.994,6.605,4.154s4.586-4.06,3.812-7.194l-4.541-18.456l12.269,7.712 c2.58,1.622,5.883,0.66,7.368-2.146c1.49-2.812,0.607-6.402-1.973-8.024l-12.233-7.688l16.896-4.934c0,0,0,0,0.002,0 c2.877-0.839,4.584-4.06,3.812-7.19c-0.771-3.134-3.729-4.993-6.604-4.153l-27.32,7.97L86.453,69.539l19.75-12.417l27.317,7.97 v0.001c2.879,0.839,5.836-1.021,6.605-4.154C140.898,57.8,139.191,54.579,136.314,53.739"/></g><g id="Livello_1_1_"/></svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="19"
version="1.2"
viewBox="0 0 20 19"
width="20"
xml:space="preserve"
id="svg3562"
inkscape:version="0.91 r13725"
sodipodi:docname="storm.svg"><metadata
id="metadata3577"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3575" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="735"
inkscape:window-height="480"
id="namedview3573"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="9.8333333"
inkscape:cx="10"
inkscape:cy="11"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="0"
inkscape:current-layer="svg3562" /><g
id="Layer_1"
transform="translate(-2,-4)"><g
id="g3565"><path
d="m 17,18 c -0.553,0 -1,-0.447 -1,-1 0,-0.553 0.447,-1 1,-1 1.654,0 3,-1.346 3,-3 0,-1.654 -1.346,-3 -3,-3 -0.238,0 -0.496,0.042 -0.813,0.131 L 15.116,10.432 14.93,9.334 C 14.604,7.402 12.951,6 11,6 8.795,6 7,7.794 7,10 c 0,0.274 0.027,0.545 0.082,0.806 l 0.26,1.24 -1.436,-0.052 C 4.896,12 4,12.897 4,14 c 0,1.103 0.896,2 2,2 0.553,0 1,0.447 1,1 0,0.553 -0.447,1 -1,1 C 3.795,18 2,16.206 2,14 2,12.139 3.277,10.571 5.002,10.126 5,10.084 5,10.042 5,10 5,6.691 7.691,4 11,4 13.587,4 15.824,5.638 16.649,8.015 19.574,7.774 22,10.127 22,13 c 0,2.757 -2.243,5 -5,5 z"
id="path3567"
inkscape:connector-curvature="0" /></g><g
id="g3569"><polygon
points="9.639,23 14.139,18.95 11.139,17.5 12.639,14 8.139,18.051 11.139,19.5 "
id="polygon3571" /></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="64px" id="Layer_1" style="enable-background:new 0 0 44 64;" version="1.1" viewBox="0 0 44 64" width="44px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Body_7_"><g><path d="M32,0H12C9.791,0,8,1.791,8,4v56c0,2.209,1.791,4,4,4h20c2.209,0,4-1.791,4-4V4 C36,1.791,34.209,0,32,0z" style="fill:#666666;"/></g></g><g id="Tunnel_Visor"><g><path d="M0,8c2.938,0,6,10,6,10h2V6H0V8z M0,26c2.938,0,6,10,6,10h2 V24H0V26z M0,44c2.938,0,6,9.999,6,9.999h2v-12H0V44z M36,6v12h2c0,0,3.063-10,6-10V6H36z M36,36h2c0,0,3.063-10,6-10v-2h-8V36z M36,53.999h2c0,0,3.063-9.999,6-9.999v-2.001h-8V53.999z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#333333;"/></g></g><g id="Green"><g><ellipse cx="22" cy="49.982" rx="6" ry="6.006" style="fill:#88C057;"/></g></g><g id="Yellow_2_"><g><ellipse cx="22" cy="31.982" rx="6" ry="6.006" style="fill:#FFCC66;"/></g></g><g id="Red_2_"><g><ellipse cx="22" cy="13.982" rx="6" ry="6.006" style="fill:#ED7161;"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="60px" id="Layer_1" style="enable-background:new 0 0 64.001 60;" version="1.1" viewBox="0 0 64.001 60" width="64.001px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Stand_1_"><g><rect height="8" style="fill:#B3B3B3;" width="32" x="16.001" y="44"/></g></g><g id="Leg"><g><path d="M8.001,56c0,2.209,1.791,4,4,4s4-1.791,4-4V6h-8V56z M48.001,6v50c0,2.209,1.79,4,4,4 c2.209,0,4-1.791,4-4V6H48.001z" style="fill:#CCCCCC;"/></g></g><g id="Bar"><g><path d="M60.445,15.999H3.556C1.592,15.999,0,17.609,0,19.596v8.789c0,1.986,1.592,3.597,3.556,3.597h56.89 c1.963,0,3.555-1.61,3.555-3.597v-8.789C64,17.609,62.408,15.999,60.445,15.999z" style="fill:#E6E6E6;"/></g></g><g id="Stripes_1_"><g><path d="M10.001,16l-10,10v2.395c0.005,1.981,1.594,3.587,3.555,3.587 H6.02L22.001,16H10.001z M60.455,16h-2.454L42.02,31.981h12l9.98-9.98v-2.405C64,17.612,62.413,16.006,60.455,16z M34.001,16 l-16,16h12l16-16H34.001z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#FF8833;"/></g></g><g id="Lights"><g><path d="M12.001,0c-3.313,0-6,2.686-6,6c0,3.313,2.687,6,6,6 s6-2.687,6-6C18.001,2.686,15.314,0,12.001,0z M52.001,0c-3.313,0-6,2.686-6,6c0,3.313,2.687,6,6,6s6-2.687,6-6 C58.001,2.686,55.314,0,52.001,0z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFCC66;"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

1
test@release Normal file
View File

@ -0,0 +1 @@
test prod-releaser@1

View File

@ -18,6 +18,7 @@
<link rel='stylesheet' type='text/css' href='/css/menu.css'>
<link rel='stylesheet' type='text/css' href='/css/header.css'>
<link rel='stylesheet' type='text/css' href='/css/container.css'>
<link rel='stylesheet' type='text/css' href='/css/accueil.css'>
<link rel='stylesheet' type='text/css' href='/css/notification-stack.css'>
<link rel='stylesheet' type='text/css' href='/css/login-form.css'>
<link rel='stylesheet' type='text/css' href='/css/signup-form.css'>

View File

@ -60,6 +60,6 @@ delete window._router_;
/* (4) Get geolocation
---------------------------------------------------------*/
navigator.geolocation && navigator.geolocation.getCurrentPosition(function(loc){
navigator.geolocation && navigator.geolocation.watchPosition(function(loc){
gstore.data.loc = [ loc.coords.latitude, loc.coords.longitude ];
}, null);
}, null, { enableHighAccuracy: true });

View File

@ -129,6 +129,12 @@ gstore.add('new_msg', {
emergency: '',
event: ''
});
// edit-message container
gstore.add('upd_msg', {
inbox: null,
emergency: null,
event: null
});
// if message loader
gstore.add('msg_pending', {
inbox: true,

View File

@ -1,9 +1,41 @@
<template>
<div id='CONTAINER'>
DASHBOARD
<div id='CONTAINER' class='accueil'>
<h1>{{ nom_app.toUpperCase() }}</h1>
<h2>Ayez les bons réflexes !</h2>
<p>Parce que chaque seconde gagnée est précieuse pour augmenter la chance de survie de la personne accidentée,
voici les principaux numéros d'urgences ouvert 24/7 : </p>
<table>
<tbody>
<tr>
<td><a href="tel:15">15<div class='phone'></div></a></td>
<td><a href="tel:17">17<div class='phone'></div></a></td>
<td><a href="tel:18">18<div class='phone'></div></a></td>
<td><a href="tel:112">112<div class='phone'></div></a></td>
</tr>
<tr>
<td>SAMU</td>
<td>Police</td>
<td>Pompier</td>
<td>Urgence<br>européenne</td>
</tr>
</tbody>
</table>
<h2>Le concept</h2>
<div>
<p>{{ nom_app }} est la toute dernière application de prévention routière. C'est également une manière simple
d'échanger sur le traffic, et de prévenir l'accident. Parmi les 3 centre de discussion, vous retrouverez
les icônes suivants : </p>
<ul>
<li><div><img class='icon-type' src="/public_html/image/type/rain.svg"/></div> : forte pluie</li>
<li><div><img class='icon-type' src="/public_html/image/type/snow.svg"/></div> : neige ou verglas</li>
<li><div><img class='icon-type' src="/public_html/image/type/storm.svg"/></div> : tempête ou orage</li>
<li><div><img class='icon-type' src="/public_html/image/type/accident.svg"/></div> : accident de voiture</li>
<li><div><img class='icon-type' src="/public_html/image/type/traffic.svg"/></div> : ralentissements</li>
<li><div><img class='icon-type' src="/public_html/image/type/work.svg"/></div> : travaux sur la route</li>
</ul>
</div>
</div>
</template>
@ -11,7 +43,12 @@
<script>
export default {
name: 'CONTAINER_DASHBOARD',
data(){ return { gstore: gstore.data }; }
name: 'CONTAINER_ACCUEIL',
data(){
return {
gstore: gstore.data,
nom_app: 'Ndli1718'
};
}
}
</script>

View File

@ -6,6 +6,9 @@
<span class='author' v-text='msg.user' v-if='id == 0 || gstore.notif.emergency.data[id-1].user != msg.user'></span>
<span class='content' v-html='bbcode(msg.message)'></span>
<span class='date' v-text='local_date(id)'></span>
<span @click='del_message(msg.id)' class='del' v-if='msg.user == gstore.server.session.name'></span>
<span @click='upd_message(msg.id, msg.message)' class='upd' v-if='msg.user == gstore.server.session.name'></span>
<span @click='maps(msg.location)' class='maps' v-if='msg.user != gstore.server.session.name && msg.location[0] != 0 && msg.location[1] != 0'></span>
</div>
<div class='end-pad'></div> <!-- End Spacing -->
@ -29,9 +32,12 @@ export default {
dep: "31"
}; },
methods: {
maps(coord){
window.open('https://www.google.com/maps/?q=-'+coord[0]+','+coord[1]);
},
local_date: function(id){
/* (1) Get current date */
var cur = new Date( gstore.data.notif.emergency.data[id].timestamp );
/* (1) Get current date (convert unix timestamp to javascript timestamp */
var cur = new Date( gstore.data.notif.emergency.data[id].timestamp * 1000);
/* (2) First line -> show whole date */
if( id < 1 )
@ -52,6 +58,48 @@ export default {
if( msg.trim().length == 0 )
return;
/* (1) If in EDIT_MODE
---------------------------------------------------------*/
if( gstore.data.upd_msg.emergency != null ){
/* (2) Prepare request */
var rq = {
id: this.gstore.upd_msg.emergency,
message: msg
};
/* (3) Add loader */
gstore.data.msg_pending.emergency = true;
/* (4) Send request */
api.call("PUT message/emergency/"+this.dep, rq, function(rs){
// {1} If error -> exit //
if( rs.error != 0 )
return;
// {2} Update message content //
for( var id in gstore.data.notif.emergency.data )
if( gstore.data.notif.emergency.data[id].id == gstore.data.upd_msg.emergency )
gstore.data.notif.emergency.data[id].message = msg;
// {3} exit EDIT_MODE //
gstore.data.upd_msg.emergency = null;
// {4} Empty input //
gstore.data.new_msg.emergency = '';
});
/* (2) If IN NEW_MSG_MODE
---------------------------------------------------------*/
}else{
/* (2) Prepare request */
var rq = {
message: this.gstore.new_msg.emergency,
@ -74,6 +122,22 @@ export default {
});
}
},
del_message(id_msg){
api.call("DELETE message/emergency/"+this.dep, { id: id_msg }, function(rs){});
},
upd_message(id_msg, msg_content){
/* (1) Move to 'edit_mode' */
this.gstore.upd_msg.emergency = id_msg;
/* (2) Copy message content to INPUT */
this.gstore.new_msg.emergency = msg_content;
},
bbcode: function(msg){
return this.gstore.func.bbcode(msg);

View File

@ -28,7 +28,7 @@ export default {
methods: {
local_date: function(id){
/* (1) Get current date */
var cur = new Date( gstore.data.notif.event.data[id].timestamp );
var cur = new Date( gstore.data.notif.event.data[id].timestamp * 1000 );
/* (2) First line -> show whole date */
if( id < 1 )

View File

@ -13,7 +13,8 @@
<!-- Header Notif -->
<div id='header-notif'>
<div v-for='(notif, link) in gstore.notif' @click='show_notif(link)' :class='"hnotif " + notif.class' :data-count='notif.count'></div>
<div @click='show_login()' class='hnotif login'></div>
<div v-if='!is_connected' @click='show_login()' class='hnotif login'></div>
<div v-if='is_connected' @click='logout()' class='hnotif logout'></div>
</div>
</div>
@ -24,7 +25,12 @@
<script>
export default {
name: 'HEADER',
data(){ return { gstore: gstore.data }; },
data(){
return {
gstore: gstore.data,
is_connected: _SERVER.session.connected
};
},
methods: {
show_notif(uri){
this.gstore.func.nav(this.$router, uri);
@ -32,6 +38,11 @@ export default {
show_login() {
this.gstore.signupform = false;
this.gstore.loginform = !this.gstore.loginform;
},
logout() {
api.call('DELETE user/logout', null, function() {
document.location = '';
});
}
}
}

View File

@ -19,6 +19,7 @@
<input v-model='password_val' type='password' id='password'>
<p v-if='err_username || err_mail || err_unknow' id='msg-err'>{{ err_message }}</p>
<button id='btn-create-account'>Créer mon compte</button>
<p @click='redirect_login' id='membre'>Déjà membre ? Connectez-vous !</p>
</form>
</div>
@ -43,21 +44,30 @@
},
methods: {
create_account() {
const const_username = this.username_val;
const const_mail = this.mail_val;
const const_password = this.password_val;
let request = {
username: this.username_val,
mail: this.mail_val,
password: this.password_val
username: const_username,
mail: const_mail,
password: const_password
};
api.call("POST user/signup", request, function (response) {
/* (1) Check if is there an error and display theme that goes with */
console.log(response);
if (response.error == 17) {
if (response.error == 17 && response.ErrorDescription.indexOf('mail') !== -1) {
this.err_username = false;
this.err_mail = true;
this.err_unknow = false;
this.err_message = 'Le mail est invalide';
}
else if (response.error == 17 && response.ErrorDescription.indexOf('username') !== -1) {
this.err_username = true;
this.err_mail = false;
this.err_unknow = false;
this.err_message = 'Le nom d\'utilisateur a des caractères invalides';
}
else if (response.error == 29) {
this.err_username = true;
this.err_mail = true;
@ -72,9 +82,22 @@
}
/* (2) Close the sign up form authentication */
else {
infobox._display('Inscription terminée ! Connexion en cours ...', 'info', 3000);
let request = {
username: const_username,
password: const_password
};
api.call("POST user/login", request, function (response) {
document.location = '';
});
}
}.bind(this));
},
redirect_login() {
this.gstore.signupform = false;
this.gstore.loginform = true;
}
}
}