Compare commits

..

78 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
xdrm-brackets d7710a2b92 fix: view.websocket (fixed update) 2017-12-08 00:39:43 +01:00
xdrm-brackets f856b67f7e BIG FIX: session_name with logout .... 2017-12-08 00:32:18 +01:00
xdrm-brackets 965b634f72 fix: view.websocket (object length fixes '/event' notification count) 2017-12-08 00:06:34 +01:00
xdrm-brackets d7a5e57a22 fix: view.websocket (object length fixes '/emergency' notification count) 2017-12-08 00:05:52 +01:00
xdrm-brackets 56b4327184 IMPORTANT fix: websocket (now will work also for '/event' channel 2017-12-08 00:01:25 +01:00
Guillaume FAUVET b12eb46939 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-07 23:44:09 +01:00
Guillaume FAUVET 514f56db18 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-07 23:44:09 +01:00
Guillaume FAUVET 11895fb875 fix: config.modules (user mail & admin mail must be of mail type instead of text) 2017-12-07 23:44:09 +01:00
Guillaume FAUVET 2791dda887 fix: view.vue-config (boolean must be initialize with false) 2017-12-07 23:44:09 +01:00
Guillaume FAUVET d0dc02e53f 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-07 23:43:13 +01:00
Guillaume FAUVET 0406689523 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-07 23:40:58 +01:00
SeekDaSky d5078b9bc9 Merge branch 'master' of https://git.xdrm.io/ndli1718/main 2017-12-07 23:40:15 +01:00
SeekDaSky e82f192f8e Implémentation de l'interop pour la suppression de message (promis c'est le dernier commit sur master) 2017-12-07 23:40:05 +01:00
xdrm-brackets 96b92e02cb lolfix 2017-12-07 23:38:55 +01:00
xdrm-brackets 48f9be4f3c minfix 2017-12-07 23:37:06 +01:00
SeekDaSky ce31a026c5 minfix 2017-12-07 23:36:10 +01:00
SeekDaSky 1327cfebda merge 2017-12-07 23:32:22 +01:00
xdrm-brackets 8875440602 minfix 2017-12-07 23:31:07 +01:00
xdrm-brackets 4699fe9e70 minfix 2017-12-07 23:27:39 +01:00
xdrm-brackets ec45b1c13a fix: view.websocket (object to data) 2017-12-07 23:19:49 +01:00
xdrm-brackets ca3e25b0e7 upd: view.websocket (not array contat, now object merging) 2017-12-07 22:48:39 +01:00
xdrm-brackets dc167766fa tmp: geolocation to test through https (must push to master) sorry .. 2017-12-07 22:36:04 +01:00
xdrm-brackets b7d22fad31 upd: vue.emergency (now send with api) 2017-12-07 22:25:39 +01:00
42 changed files with 1915 additions and 111 deletions

View File

@ -25,11 +25,13 @@
public static function check(){ public static function check(){
/* (1) Initialisation /* (1) Initialisation
---------------------------------------------------------*/ ---------------------------------------------------------*/
if( !isset($_SESSION['TOKEN']) ) $_SESSION['TOKEN'] = []; if( !isset($_SESSION['TOKEN']) ) $_SESSION['TOKEN'] = [];
if( !isset($_SESSION['AUTH']) ) $_SESSION['AUTH'] = []; if( !isset($_SESSION['AUTH']) ) $_SESSION['AUTH'] = [];
if( !isset($_SESSION['PERM']) ) $_SESSION['PERM'] = []; if( !isset($_SESSION['PERM']) ) $_SESSION['PERM'] = [];
if( !isset($_SESSION['USER']) ) $_SESSION['USER'] = []; if( !isset($_SESSION['USER']) ) $_SESSION['USER'] = [];
if( !isset($_SESSION['ADMIN']) ) $_SESSION['ADMIN'] = []; if( !isset($_SESSION['ADMIN']) ) $_SESSION['ADMIN'] = [];
if( !isset($_SESSION['NAME']) ) $_SESSION['NAME'] = '';
if( !isset($_SESSION['WS']) ) $_SESSION['WS'] = true;
/* (2) Gestion de AUTH (authentification) /* (2) Gestion de AUTH (authentification)
@ -37,8 +39,10 @@
$AUTH = ''; $AUTH = '';
/* (1) Si Auth dans HEADER, on le récupère */ /* (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']; $AUTH = $_SERVER['PHP_AUTH_DIGEST'];
$_SESSION['WS'] = true;
}
/* (2) Si SESSION déja connectée -> no récupère le token */ /* (2) Si SESSION déja connectée -> no récupère le token */
elseif( isset($_SESSION['TOKEN']) && is_string($_SESSION['TOKEN']) ) elseif( isset($_SESSION['TOKEN']) && is_string($_SESSION['TOKEN']) )

View File

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

View File

@ -52,6 +52,7 @@ class admin{
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Update session */ /* (1) Update session */
$_SESSION['TOKEN'] = 'a'.$fetched_admin['token']; $_SESSION['TOKEN'] = 'a'.$fetched_admin['token'];
$_SESSION['WS'] = true; // to tell websocket we are connected
new AuthSystemDefault; new AuthSystemDefault;
/* (2) Return status */ /* (2) Return status */
@ -105,4 +106,10 @@ class admin{
} }
public function DELETE_logout(){
$_SESSION = [];
}
} }

View File

@ -9,22 +9,198 @@
namespace api\module; namespace api\module;
use \database\core\Repo;
use \error\core\Error;
use \error\core\Err;
use kwebsocket\core\wsinterop; use kwebsocket\core\wsinterop;
class message 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){ public function POST_emergency($argv){
extract($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 = new wsinterop("localhost",9998);
$wsi->send([ $wsi->send([
"operation" => "PostMessage", "operation" => "PostMessage",
"message" => $message, "message" => $message,
"username" => $username, "username" => $_SESSION['NAME'],
"location" => $location, "location" => $location,
"channelType" => "Emergency", "type" => $type,
//TODO implémenter la récupération d'id depuis la bdd
"id" => uniqid(),
"channelType" => "Event",
"channelName" => is_null($URL_0) ? "" : "$URL_0"
]);
$wsi->close();
return ["sent" => true];
//TODO: tout poster dans la BDD
}
public function DELETE_event($argv){
extract($argv);
$wsi = new wsinterop("localhost",9998);
$wsi->send([
"operation" => "DelMessage",
"id" => $id,
"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" "channelName" => is_null($URL_0) ? "" : "$URL_0"
]); ]);

View File

@ -52,6 +52,7 @@ class user{
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Update session */ /* (1) Update session */
$_SESSION['TOKEN'] = 'u'.$fetched_user['token']; $_SESSION['TOKEN'] = 'u'.$fetched_user['token'];
$_SESSION['WS'] = true; // to tell websocket we are connected
new AuthSystemDefault; new AuthSystemDefault;
/* (2) Return status */ /* (2) Return status */
@ -104,4 +105,10 @@ class user{
} }
public function DELETE_logout(){
$_SESSION = [];
}
} }

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(){ public function call(){
/* (1) Authentication */
\router\controller\loader::start();
/* (1) Process response */ /* (2) Process response */
$this->response = $this->request->dispatch(); $this->response = $this->request->dispatch();
/* (2) Manages result */ /* (3) Manages result */
if( $this->response instanceof Response ) if( $this->response instanceof Response )
echo $this->response->serialize(); echo $this->response->serialize();

View File

@ -26,7 +26,8 @@
echo "window._SERVER = ".json_encode([ echo "window._SERVER = ".json_encode([
'session' => [ 'session' => [
'name' => $_SESSION['NAME'] 'name' => $_SESSION['NAME'],
'connected' => count($_SESSION['ADMIN']) + count($_SESSION['USER']) > 0
] ]
])."\n"; ])."\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){ public function __construct($url){
$this->pagename = $url['page']; // $this->pagename = $url['page'];
} }
@ -26,44 +26,8 @@
* *
*/ */
public function load(){ public function load(){
loader::start();
if( !isset($_SESSION['NAME']) || 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;
}
if( file_exists(__ROOT__."/view/home.php") ) if( file_exists(__ROOT__."/view/home.php") )
include __ROOT__."/view/home.php"; include __ROOT__."/view/home.php";
else else

View File

@ -19,12 +19,19 @@
"permissions": [], "permissions": [],
"parameters": { "parameters": {
"username": { "description": "Identifiant de l'administrateur", "type": "varchar(3,20,alphanumeric)" }, "username": { "description": "Identifiant de l'administrateur", "type": "varchar(3,20,alphanumeric)" },
"mail": { "description": "Adresse mail de l'administrateur", "type": "text" }, "mail": { "description": "Adresse mail de l'administrateur", "type": "mail" },
"password": { "description": "Mot de passe de l'administrateur", "type": "text" } "password": { "description": "Mot de passe de l'administrateur", "type": "text" }
}, },
"output": { "output": {
"registered": { "description": "UID du nouvel administrateur", "type": "id" } "registered": { "description": "UID du nouvel administrateur", "type": "id" }
} }
},
"DELETE logout": {
"description": "Déconnexion utilisateur",
"permissions": [],
"parameters": {},
"output": {}
} }
}, },
@ -50,12 +57,19 @@
"permissions": [], "permissions": [],
"parameters": { "parameters": {
"username": { "description": "Identifiant de l'utilisateur", "type": "varchar(3,20,alphanumeric)" }, "username": { "description": "Identifiant de l'utilisateur", "type": "varchar(3,20,alphanumeric)" },
"mail": { "description": "Adresse mail de l'utilisateur", "type": "text" }, "mail": { "description": "Adresse mail de l'utilisateur", "type": "mail" },
"password": { "description": "Mot de passe de l'utilisateur", "type": "text" } "password": { "description": "Mot de passe de l'utilisateur", "type": "text" }
}, },
"output": { "output": {
"registered": { "description": "UID du nouvel utilisateur", "type": "id" } "registered": { "description": "UID du nouvel utilisateur", "type": "id" }
} }
},
"DELETE logout": {
"description": "Déconnexion utilisateur",
"permissions": [],
"parameters": {},
"output": {}
} }
}, },
@ -81,6 +95,66 @@
"message": { "message": {
"POST emergency": { "POST 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" },
"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" : "", "description" : "",
"permissions": [], "permissions": [],
"parameters": { "parameters": {
@ -89,25 +163,18 @@
"type" : "numeric", "type" : "numeric",
"optional" : true "optional" : true
}, },
"id": {
"description": "message a publier",
"type": "text"
},
"message": { "message": {
"description": "message a publier", "description": "message a publier",
"type": "text", "type": "text",
"optional": false "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>"
} }
} }
} }
}, },
"RESTexample": { "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) */ #CONTAINER.message div.me{ /* Message Item (self) */
/* background: #13d89d; */ /* background: #13d89d; */
align-self: flex-end; align-self: flex-end;
margin: .5em 1.5em; margin: 1em 1.5em;
} }
#CONTAINER.message div.end-pad{ #CONTAINER.message div.end-pad{
@ -68,6 +68,46 @@
font-size: .8em; 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 */ #CONTAINER.message div span span.code{ /* Code block */
display: inline-block; display: inline-block;
position: relative; position: relative;

View File

@ -115,6 +115,8 @@
#header-notif .hnotif.message{ background-image: url('/image/header/notif/message.svg@aaaaaa'); } #header-notif .hnotif.message{ background-image: url('/image/header/notif/message.svg@aaaaaa'); }
#header-notif .hnotif.search{ background-image: url('/image/header/notif/search.svg@aaaaaa'); } #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.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 */ /* HOVER */
#header-notif .hnotif:hover{ #header-notif .hnotif:hover{
@ -127,6 +129,8 @@
#header-notif .hnotif.message:hover{ background-image: url('/image/header/notif/message.svg@23c795'); } #header-notif .hnotif.message:hover{ background-image: url('/image/header/notif/message.svg@23c795'); }
#header-notif .hnotif.search:hover{ background-image: url('/image/header/notif/search.svg@ae51da'); } #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.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

@ -116,4 +116,52 @@ body{
#WRAPPER #NOTIF-STACK.active{ #WRAPPER #NOTIF-STACK.active{
display: block; display: block;
}
/* Login form authentication */
#WRAPPER #LOGIN-FORM{
display: none;
position: absolute;
top: 4em;
left: calc( 100% - 21em );
width: 20em;
min-height: 2em;
height: auto;
border: 1px solid #ddd;
border-radius: 3px;
background-color: #fff;
overflow: hidden;
z-index: 101;
}
#WRAPPER #LOGIN-FORM.active{
display: block;
}
/* Sign up form authentication */
#WRAPPER #SIGNUP-FORM{
display: none;
position: absolute;
top: 4em;
left: calc( 100% - 21em );
width: 20em;
min-height: 2em;
height: auto;
border: 1px solid #ddd;
border-radius: 3px;
background-color: #fff;
overflow: hidden;
z-index: 101;
}
#WRAPPER #SIGNUP-FORM.active{
display: block;
} }

View File

@ -0,0 +1,129 @@
/* Header */
#LOGIN-FORM > .head{
display: block;
position: relative;
width: 100%;
padding: .7em 0;
border-radius: 3px 3px 0 0;
border-bottom: 1px solid #ddd;
text-align: center;
color: #888;
}
/* Container */
#LOGIN-FORM > .body{
display: block;
position: relative;
width: 100%;
min-height: 2em;
height: auto;
border-radius: 0 0 3px 3px;
overflow: auto;
}
/* Items */
#LOGIN-FORM > .body > form{
display: block;
position: relative;
padding: .8em 1em;
border-bottom: 1px solid #ddd;
background-color: #fff;
color: #555;
cursor: pointer;
transition: background-color .2s ease-in-out,
color .2s ease-in-out;
}
#LOGIN-FORM > .body > form * {
text-align: center;
}
#LOGIN-FORM > .body > form > *{
display: block;
}
#LOGIN-FORM > .body > form > input{
padding: 5px;
margin: 5px auto 10px auto;
border-color: #777777;
}
#LOGIN-FORM > .body > form > input.err{
border-color: #ff0000;
}
#LOGIN-FORM > .body > form #btn-connection,
#LOGIN-FORM > .body > form #btn-signup{
border-width: 2px;
padding: 6px;
margin: 8px auto 0 auto;
font-weight: bold;
cursor: pointer;
transition: background-color .2s ease-in-out,
color .2s ease-in-out;
}
#LOGIN-FORM > .body > form #btn-connection{
color: #21bb89;
background-color: #fff;
border-color: #21bb89;
}
#LOGIN-FORM > .body > form #btn-connection:hover{
color: #fff;
background-color: #21bb89;
}
#LOGIN-FORM > .body > form #btn-signup{
color: #660088;
background-color: #fff;
border-color: #660088;
}
#LOGIN-FORM > .body > form #btn-signup:hover{
color: #fff;
background-color: #660088;
}
#LOGIN-FORM > .body > form #btn-connection + span{
margin-left: 5px;
margin-right: 5px;
}
#LOGIN-FORM > .body > form > #msg-err{
color: #ff0000;
font-size: 0.85em;
}
#LOGIN-FORM > .body > form,
#LOGIN-FORM > .body > form > input,
#LOGIN-FORM > .body > form button {
font-family: inherit;
}
#LOGIN-FORM > .body > form > input,
#LOGIN-FORM > .body > form button {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border-style: solid;
border-width: 1px;
outline: none;
}

View File

@ -0,0 +1,116 @@
/* Header */
#SIGNUP-FORM > .head{
display: block;
position: relative;
width: 100%;
padding: .7em 0;
border-radius: 3px 3px 0 0;
border-bottom: 1px solid #ddd;
text-align: center;
color: #888;
}
/* Container */
#SIGNUP-FORM > .body{
display: block;
position: relative;
width: 100%;
min-height: 2em;
height: auto;
border-radius: 0 0 3px 3px;
overflow: auto;
}
/* Items */
#SIGNUP-FORM > .body > form{
display: block;
position: relative;
padding: .8em 1em;
border-bottom: 1px solid #ddd;
background-color: #fff;
color: #555;
cursor: pointer;
transition: background-color .2s ease-in-out,
color .2s ease-in-out;
}
#SIGNUP-FORM > .body > form * {
text-align: center;
}
#SIGNUP-FORM > .body > form > *{
display: block;
}
#SIGNUP-FORM > .body > form > input{
padding: 5px;
margin: 5px auto 10px auto;
border-color: #777777;
}
#SIGNUP-FORM > .body > form > input.err{
border-color: #ff0000;
}
#SIGNUP-FORM > .body > form > #btn-create-account{
color: #21bb89;
background-color: #fff;
border-color: #21bb89;
border-width: 2px;
padding: 6px;
margin: 15px auto 0 auto;
font-weight: bold;
cursor: pointer;
transition: background-color .2s ease-in-out,
color .2s ease-in-out;
}
#SIGNUP-FORM > .body > form > #btn-create-account:hover{
color: #fff;
background-color: #21bb89;
}
#SIGNUP-FORM > .body > form > #msg-err{
color: #ff0000;
font-size: 0.85em;
}
#SIGNUP-FORM > .body > form,
#SIGNUP-FORM > .body > form > input,
#SIGNUP-FORM > .body > form > button {
font-family: inherit;
}
#SIGNUP-FORM > .body > form > input,
#SIGNUP-FORM > .body > form > button {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border-style: solid;
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,49 @@
<?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"
enable-background="new 0 0 32 32"
height="27.500999"
id="Layer_1"
version="1.1"
viewBox="0 0 25.530701 27.500999"
width="25.530701"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="login.svg"><metadata
id="metadata3435"><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="defs3433" /><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="namedview3431"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="14.359375"
inkscape:cx="0.48565475"
inkscape:cy="12.727735"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><path
inkscape:connector-curvature="0"
id="fill-edit"
d="M 12.724609,0 C 9.2036094,0 6.3476562,3.3760156 6.3476562,7.5410156 c 0,4.1650004 2.9096407,9.2031254 6.4316408,9.2031254 3.521,0 6.320312,-5.039125 6.320312,-9.2031254 0,-4.165 -2.854,-7.5410156 -6.375,-7.5410156 z m 6.458985,13.169922 c -1.209,2.763 -3.847297,5.072266 -6.404297,5.072266 -3.1220001,0 -5.3886564,-2.282922 -6.5976564,-5.044922 -7.03099997,3.642 -6.14648435,12.859375 -6.14648435,12.859375 0,1.262 0.99410935,1.445312 2.16210935,1.445312 l 10.5820314,0 10.564453,0 c 1.17,0 2.167969,-0.184312 2.167969,-1.445312 0.001,0 0.701875,-9.243719 -6.328125,-12.886719 z"
style="fill:#515151" /></svg>

After

Width:  |  Height:  |  Size: 2.2 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,7 +18,10 @@
<link rel='stylesheet' type='text/css' href='/css/menu.css'> <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/header.css'>
<link rel='stylesheet' type='text/css' href='/css/container.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/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'>
<!-- JS dependencies --> <!-- JS dependencies -->
<script type='text/javascript' src='/js/_SERVER.js'></script> <script type='text/javascript' src='/js/_SERVER.js'></script>

View File

@ -55,4 +55,11 @@ window._router_ = router;
require('./websocket'); require('./websocket');
/* (3) Remove global ref to router */ /* (3) Remove global ref to router */
delete window._router_; delete window._router_;
/* (4) Get geolocation
---------------------------------------------------------*/
navigator.geolocation && navigator.geolocation.watchPosition(function(loc){
gstore.data.loc = [ loc.coords.latitude, loc.coords.longitude ];
}, null, { enableHighAccuracy: true });

View File

@ -14,7 +14,7 @@ gstore.add('notif', {
event: { class: 'event', data: [], count: 0 }, event: { class: 'event', data: [], count: 0 },
inbox: { class: 'message', data: [], count: 0 }, inbox: { class: 'message', data: [], count: 0 },
dashboard: { class: 'menu', data: [], count: 0 } dashboard: { class: 'menu', data: [], count: 0 }
}) });
// Menu // Menu
gstore.add('menu_item', { gstore.add('menu_item', {
@ -129,6 +129,12 @@ gstore.add('new_msg', {
emergency: '', emergency: '',
event: '' event: ''
}); });
// edit-message container
gstore.add('upd_msg', {
inbox: null,
emergency: null,
event: null
});
// if message loader // if message loader
gstore.add('msg_pending', { gstore.add('msg_pending', {
inbox: true, inbox: true,
@ -137,4 +143,13 @@ gstore.add('msg_pending', {
}); // true when message send pending }); // true when message send pending
// notification stack visibility // notification stack visibility
gstore.add('nstack', false); gstore.add('nstack', false);
// location
gstore.add('loc', [0, 0]);
// login form authentication visibility
gstore.add('loginform', false);
// sign up form visibility
gstore.add('signupform', false);

View File

@ -1,9 +1,41 @@
<template> <template>
<div id='CONTAINER'> <div id='CONTAINER' class='accueil'>
<h1>{{ nom_app.toUpperCase() }}</h1>
DASHBOARD <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> </div>
</template> </template>
@ -11,7 +43,12 @@
<script> <script>
export default { export default {
name: 'CONTAINER_DASHBOARD', name: 'CONTAINER_ACCUEIL',
data(){ return { gstore: gstore.data }; } data(){
return {
gstore: gstore.data,
nom_app: 'Ndli1718'
};
}
} }
</script> </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='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='content' v-html='bbcode(msg.message)'></span>
<span class='date' v-text='local_date(id)'></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>
<div class='end-pad'></div> <!-- End Spacing --> <div class='end-pad'></div> <!-- End Spacing -->
@ -24,11 +27,17 @@
<script> <script>
export default { export default {
name: 'CONTAINER_EMERGENCY', name: 'CONTAINER_EMERGENCY',
data(){ return { gstore: gstore.data }; }, data(){ return {
gstore: gstore.data,
dep: "31"
}; },
methods: { methods: {
maps(coord){
window.open('https://www.google.com/maps/?q=-'+coord[0]+','+coord[1]);
},
local_date: function(id){ local_date: function(id){
/* (1) Get current date */ /* (1) Get current date (convert unix timestamp to javascript timestamp */
var cur = new Date( gstore.data.notif.emergency.data[id].timestamp ); var cur = new Date( gstore.data.notif.emergency.data[id].timestamp * 1000);
/* (2) First line -> show whole date */ /* (2) First line -> show whole date */
if( id < 1 ) if( id < 1 )
@ -49,14 +58,85 @@ export default {
if( msg.trim().length == 0 ) if( msg.trim().length == 0 )
return; return;
/* (2) Send message to WebSocket */
wsc_emergency.send(JSON.stringify({message: msg, location: [1.1, 2.2]}));
/* (3) Add loader */
gstore.data.msg_pending.emergency = true;
/* (4) Empty input */ /* (1) If in EDIT_MODE
this.gstore.new_msg.emergency = ''; ---------------------------------------------------------*/
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,
location: this.gstore.loc,
username: this.gstore.server.session.name
};
/* (3) Add loader */
gstore.data.msg_pending.emergency = true;
/* (4) Send request */
api.call("POST message/emergency/"+this.dep, rq, function(rs){
// {1} If error -> exit //
if( rs.error != 0 )
return;
// {2} Empty input //
gstore.data.new_msg.emergency = '';
});
}
},
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){ bbcode: function(msg){

View File

@ -28,7 +28,7 @@ export default {
methods: { methods: {
local_date: function(id){ local_date: function(id){
/* (1) Get current date */ /* (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 */ /* (2) First line -> show whole date */
if( id < 1 ) if( id < 1 )
@ -49,14 +49,27 @@ export default {
if( msg.trim().length == 0 ) if( msg.trim().length == 0 )
return; return;
/* (2) Send message to WebSocket */ /* (2) Prepare request */
wsc_event.send(JSON.stringify({message: msg, location: [1.1, 2.2]})); var rq = {
message: this.gstore.new_msg.event,
location: this.gstore.loc,
username: this.gstore.server.session.name
};
/* (3) Add loader */ /* (3) Add loader */
gstore.data.msg_pending.event = true; gstore.data.msg_pending.event = true;
/* (4) Empty input */ /* (4) Send request */
this.gstore.new_msg.event = ''; api.call("POST message/event/"+this.dep, rq, function(rs){
// {1} If error -> exit //
if( rs.error != 0 )
return;
// {2} Empty input //
gstore.data.new_msg.event = '';
});
}, },
bbcode: function(msg){ bbcode: function(msg){

View File

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

66
view/vue/login-form.vue Normal file
View File

@ -0,0 +1,66 @@
<template>
<div id='LOGIN-FORM' :class='gstore.loginform ? "active" : ""'>
<!-- Header -->
<div class='head'>
<span>Connexion au compte</span>
<i></i>
</div>
<!-- Body -->
<div class='body'>
<form @submit.prevent='authentification'>
<label for='username'>Nom d'utilisateur</label>
<input :class='err_connection ? "err" : ""' v-model='username_val' type='text' id='username'>
<label for='password'>Mot de passe</label>
<input :class='err_connection ? "err" : ""' v-model='password_val' type='password' id='password'>
<p v-if='err_connection' id='msg-err'>Identifiant ou mot de passe incorrect</p>
<div>
<button id='btn-connection'>Se connecter</button>
<span>ou</span>
<button @click='signup' id='btn-signup'>S'inscrire</button>
</div>
</form>
</div>
</div>
</template>
<script>
export default {
name: 'LOGIN_FORM',
data(){
return {
gstore: gstore.data,
username_val: '',
password_val: '',
err_connection: false
};
},
methods: {
authentification() {
let request = {
username: this.username_val,
password: this.password_val
};
api.call("POST user/login", request, function (response) {
/* (1) Check if is there an error and display theme that goes with */
if (response.error != 0 || !response.connected) {
this.err_connection = true;
}
/* (2) Close the login form authentication */
else {
document.location = '';
}
}.bind(this));
},
signup(evt) {
evt.preventDefault();
this.gstore.signupform = true;
}
}
}
</script>

104
view/vue/signup-form.vue Normal file
View File

@ -0,0 +1,104 @@
<template>
<div id='SIGNUP-FORM' :class='gstore.signupform ? "active" : ""'>
<!-- Header -->
<div class='head'>
<span>Création d'un compte</span>
<i></i>
</div>
<!-- Body -->
<div class='body'>
<form @submit.prevent='create_account'>
<label for='username'>Nom d'utilisateur</label>
<input :class='err_username ? "err" : ""' v-model='username_val' type='text' id='username'>
<label for='mail'>Adresse mail</label>
<input :class='err_mail ? "err" : ""' v-model='mail_val' type='email' id='mail'>
<label for='password'>Mot de passe</label>
<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>
</div>
</template>
<script>
export default {
name: 'SIGNUP_FORM',
data(){
return {
gstore: gstore.data,
username_val: '',
mail_val: '',
password_val: '',
err_username: false,
err_mail: false,
err_unknow: false,
err_message: ''
};
},
methods: {
create_account() {
const const_username = this.username_val;
const const_mail = this.mail_val;
const const_password = this.password_val;
let request = {
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 */
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;
this.err_unknow = false;
this.err_message = 'Le nom d\'utilisateur ou le mail est déjà pris';
}
else if (!response.registered) {
this.err_username = false;
this.err_mail = false;
this.err_unknow = true;
this.err_message = 'Impossible de créer le compte pour le moment, veuillez réessayer plus tard';
}
/* (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;
}
}
}
</script>

View File

@ -15,7 +15,10 @@
<notifstack-comp></notifstack-comp> <notifstack-comp></notifstack-comp>
<!-- Login form --> <!-- Login form -->
<!-- <loginform-comp></loginform-comp> --> <loginform-comp></loginform-comp>
<!--Sign pu form-->
<signupform-comp></signupform-comp>
</div> </div>
</template> </template>
@ -23,10 +26,11 @@
<script> <script>
import header_vue from './header.vue' import header_vue from './header.vue'
import menu_vue from './menu.vue' import menu_vue from './menu.vue'
import notifstack_vue from './notification-stack.vue' import notifstack_vue from './notification-stack.vue'
// import loginform_vue from './login-form.vue' import loginform_vue from './login-form.vue'
import signupform_vue from './signup-form.vue';
export default { export default {
name: 'wrapper', name: 'wrapper',
@ -34,7 +38,9 @@
components: { components: {
'HeaderComp': header_vue, 'HeaderComp': header_vue,
'MenuComp': menu_vue, 'MenuComp': menu_vue,
'NotifstackComp': notifstack_vue 'NotifstackComp': notifstack_vue,
'LoginformComp': loginform_vue,
'SignupformComp': signupform_vue
} }
} }

View File

@ -24,11 +24,18 @@ window.wsc_emergency = wsc.channel('emergency/31').listen(function(msg, err){
( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play(); ( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play();
// {2} Add messages to stack // // {2} Add messages to stack //
gstore.data.notif.emergency.data = gstore.data.notif.emergency.data.concat( msg.add ); for( var id in msg.add ){
var tmp = msg.add[id]; // add id to data
tmp.id = id;
gstore.data.notif.emergency.data.push(tmp);
}
// {3} Add notification count if not already on page // // {3} Add notification count if not already on page //
if( router.app.$route.path != '/emergency' ) if( router.app.$route.path != '/emergency' )
gstore.data.notif.emergency.count += msg.add.length; gstore.data.notif.emergency.count += Object.keys(msg.add).length;
} }
@ -36,9 +43,9 @@ window.wsc_emergency = wsc.channel('emergency/31').listen(function(msg, err){
if( msg.del != null ){ if( msg.del != null ){
// {1} Rem messages from stack // // {1} Rem messages from stack //
for( var id of msg.del ) for( var id in gstore.data.notif.emergency.data )
if( gstore.data.notif.emergency.data[id] != null ) if( msg.del[ gstore.data.notif.emergency.data[id].id ] != null )
delete gstore.data.notif.emergency.data[id]; gstore.data.notif.emergency.data[id].message = 'L\'auteur n\'a pas assumé ce message.. Honte à lui !';
} }
@ -46,9 +53,9 @@ window.wsc_emergency = wsc.channel('emergency/31').listen(function(msg, err){
if( msg.upd != null ){ if( msg.upd != null ){
// {1} Update messages in stack // // {1} Update messages in stack //
for( var id of msg.upd ) for( var id in gstore.data.notif.emergency.data )
if( gstore.data.notif.emergency.data[id] != null ) if( msg.upd[ gstore.data.notif.emergency.data[id].id ] != null )
gstore.data.notif.emergency.data[id] = msg.upd[id]; gstore.data.notif.emergency.data[id].message = msg.upd[ gstore.data.notif.emergency.data[id].id ].message;
} }
@ -80,11 +87,18 @@ window.wsc_event = wsc.channel('event/31').listen(function(msg, err){
( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play(); ( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play();
// {2} Add messages to stack // // {2} Add messages to stack //
gstore.data.notif.event.data = gstore.data.notif.event.data.concat( msg.add ); for( var id in msg.add ){
var tmp = msg.add[id]; // add id to data
tmp.id = id;
gstore.data.notif.event.data.push(tmp);
}
// {3} Add notification count if not already on page // // {3} Add notification count if not already on page //
if( router.app.$route.path != '/event' ) if( router.app.$route.path != '/event' )
gstore.data.notif.event.count += msg.add.length; gstore.data.notif.event.count += Object.keys(msg.add).length;
} }
@ -92,9 +106,9 @@ window.wsc_event = wsc.channel('event/31').listen(function(msg, err){
if( msg.del != null ){ if( msg.del != null ){
// {1} Rem messages from stack // // {1} Rem messages from stack //
for( var id of msg.del ) for( var id in gstore.data.notif.event.data )
if( gstore.data.notif.event.data[id] != null ) if( msg.del[ gstore.data.notif.event.data[id].id ] != null )
delete gstore.data.notif.event.data[id]; gstore.data.notif.event.data[id].message = 'L\'auteur n\'a pas assumé ce message.. Honte à lui !';
} }
@ -102,9 +116,9 @@ window.wsc_event = wsc.channel('event/31').listen(function(msg, err){
if( msg.upd != null ){ if( msg.upd != null ){
// {1} Update messages in stack // // {1} Update messages in stack //
for( var id of msg.upd ) for( var id in gstore.data.notif.event.data )
if( gstore.data.notif.event.data[id] != null ) if( msg.upd[ gstore.data.notif.event.data[id].id ] != null )
gstore.data.notif.event.data[id] = msg.upd[id]; gstore.data.notif.event.data[id].message = msg.upd[ gstore.data.notif.event.data[id].id ].message;
} }