Skip to content

Commit

Permalink
Merge pull request #5 from beepnl/webpack
Browse files Browse the repository at this point in the history
Release v2.1 - Collaboration groups
  • Loading branch information
pvgennip authored May 29, 2019
2 parents 2ff4186 + 918b4e7 commit 460c6c3
Show file tree
Hide file tree
Showing 1,271 changed files with 102,631 additions and 4,283 deletions.
24 changes: 19 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_NAME=BEEP

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
Expand All @@ -17,16 +18,17 @@ DB_USERNAME_BACKUP=user
DB_PASSWORD_BACKUP=pass

LARAVEL_INFLUX_PROVIDER_PROTOCOL=http
LARAVEL_INFLUX_PROVIDER_USER=
LARAVEL_INFLUX_PROVIDER_PASSWORD=
LARAVEL_INFLUX_PROVIDER_USER=user_influx
LARAVEL_INFLUX_PROVIDER_PASSWORD=pass_influx
LARAVEL_INFLUX_PROVIDER_HOST=localhost
LARAVEL_INFLUX_PROVIDER_PORT=8086
LARAVEL_INFLUX_PROVIDER_DATABASE=bee_data

BROADCAST_DRIVER=log
CACHE_DRIVER=array
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
QUEUE_DRIVER=sync
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
Expand All @@ -38,9 +40,21 @@ MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=

PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

DEBUGBAR_ENABLED=false

WEBAPP_URL=https://beep.test/webapp#!/
WEBAPP_EMAIL_VERIFY_URL=login
WEBAPP_PASSWORD_RESET_URL=login/reset/

DEBUGBAR_ENABLED=false
GOOGLE_MAPS_KEY=
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

vendor/*
/vendor
!resources/views/vendor/
!resources/views/vendor/mail/
!resources/views/vendor/mail/*
Expand All @@ -22,7 +22,18 @@ storage/logs/*

Homestead.json
Homestead.yaml
.idea
.env
.phpunit.result.cache
.DS_Store
.phpintel
.phpintel
.log

npm-debug.log
yarn-error.log
/.idea
/.vscode
/.vagrant
public/uploads/avatars/1548334183.jpg
public/uploads/avatars/1548448850.jpg

/node_modules
Binary file added BEEP-management-interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions apache/portal-vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<VirtualHost *:80>
ServerName api.beep.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"
Include "/opt/bitnami/apps/BEEP/apache/portal.conf"
</VirtualHost>

# Legacy measurement data endpoint for VPS1 server
<VirtualHost *:80>
ServerName bee.iconize.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"

RewriteEngine On
RewriteCond %{THE_REQUEST} !^(POST).*(api)
RewriteRule ^ - [L,R=404]

Include "/opt/bitnami/apps/BEEP/apache/portal.conf"
</VirtualHost>

Listen 443
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !EDH !RC4"
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300

<VirtualHost *:443>
ServerName api.beep.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"

SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/api.beep.nl.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/api.beep.nl.key"

Include "/opt/bitnami/apps/BEEP/apache/portal.conf"
</VirtualHost>

# Legacy measurement data endpoint for VPS1 server
<VirtualHost *:443>
ServerName bee.iconize.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"

RewriteEngine On
RewriteCond %{THE_REQUEST} !^(POST).*(api)
RewriteRule ^ - [L,R=404]

SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/bee_iconize_nl_bundle.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/bee_iconize_nl.key"

Include "/opt/bitnami/apps/BEEP/apache/portal.conf"
</VirtualHost>
17 changes: 17 additions & 0 deletions apache/portal.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Directory "/opt/bitnami/apps/BEEP/public/">

Options +FollowSymlinks -Indexes -MultiViews

# Enable .htaccess files to override directives by AllowOverride All
AllowOverride All

<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>

<IfVersion >= 2.3>
Require all granted
</IfVersion>

</Directory>
22 changes: 22 additions & 0 deletions apache/webapp-vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<VirtualHost *:80>
ServerName app.beep.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"
Include "/opt/bitnami/apps/BEEP/apache/webapp.conf"
</VirtualHost>

<VirtualHost *:443>
ServerName app.beep.nl
DocumentRoot "/opt/bitnami/apps/BEEP/public"

// Redirects the Angular app to the web route
Redirect "/index.html" "/webapp"

#RewriteEngine On
#RewriteRule "^/index\.html(.*)$" "/webapp$1" [PT]

SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/app.beep.nl.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/app.beep.nl.key"

Include "/opt/bitnami/apps/BEEP/apache/webapp.conf"
</VirtualHost>
20 changes: 20 additions & 0 deletions apache/webapp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Directory "/opt/bitnami/apps/BEEP/public/">

#Options +MultiViews
#AllowOverride None

Options +FollowSymlinks -Indexes -MultiViews

# Enable .htaccess files to override directives by AllowOverride All
AllowOverride All

<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>

<IfVersion >= 2.3>
Require all granted
</IfVersion>

</Directory>
36 changes: 0 additions & 36 deletions app/Action.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Category extends Model

protected $table = 'categories';

protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type', 'old_id'];
protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type', 'required'];
protected $guarded = ['id'];

protected $hidden = ['created_at','updated_at', 'category_input_id', 'physical_quantity_id','_lft','_rgt','pivot','description','input_type','options','parent_id','old_id'];
Expand Down
7 changes: 6 additions & 1 deletion app/Checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Checklist extends Model

protected $hidden = ['pivot','deleted_at'];

protected $appends = ['category_ids'];
protected $appends = ['category_ids', 'required_ids'];

// check for deletion of linked items
protected static function boot() {
Expand All @@ -55,6 +55,11 @@ public function getCategoryIdsAttribute()
return $this->categoryIdArray();
}

public function getRequiredIdsAttribute()
{
return $this->categories()->where('required', '=', true)->pluck('id')->toArray();
}

public function categories()
{
return $this->belongsToMany(Category::class, 'checklist_category')->withPivot('order')->orderBy('order');
Expand Down
33 changes: 0 additions & 33 deletions app/ChecklistFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,39 +108,6 @@ public function convertUsersChecklists($users, $debug=false)
}

//die(print_r($hive->actions()->pluck('created_at')->toArray()));

if ($hive->conditions()->count() + $hive->actions()->count() == 0)
continue;

// Create an inspection for each date and convert Actions + Conditions to InspectionItems on the inspections
$dates = $hive->conditions()->orderBy('created_at', 'desc')->groupBy('created_at')->pluck('created_at');
$dates = $dates->merge($hive->actions()->orderBy('created_at', 'desc')->groupBy('created_at')->pluck('created_at'));
$dates_array = $dates->unique()->toArray();
//die(print_r($dates_array));
foreach ($dates_array as $date)
{
$date_ins = $hive->inspections()->where('created_at',$date);
if ($date_ins->count() == 0)
{
$ins = Inspection::create(['created_at'=>$date,'attention'=>-1,'impression'=>-1,'notes'=>'']);
$ins->users()->syncWithoutDetaching($user->id);
$ins->hives()->syncWithoutDetaching($hive->id);
$count['inspections']++;
}
else
{
$ins = $date_ins->first();
}

$actions = $hive->actions()->orderBy('id', 'desc')->where('created_at',$date)->get()->unique('category_id');
foreach ($actions as $a)
$count['actions'] += $this->createInspectionItem($a, $ins, $debug);

$conditions = $hive->conditions()->orderBy('id', 'desc')->where('created_at',$date)->get()->unique('category_id');
foreach ($conditions as $c)
$count['conditions'] += $this->createInspectionItem($c, $ins, $debug);

}
//die(print_r(['user'=>$user->name, 'count'=>$count]));
}
print_r(['id'=>$user->id, 'user'=>$user->name, 'count'=>$count]);
Expand Down
42 changes: 0 additions & 42 deletions app/Condition.php

This file was deleted.

2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ protected function schedule(Schedule $schedule)
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
Loading

0 comments on commit 460c6c3

Please sign in to comment.