Skip to content

Commit

Permalink
Usability: Dark/Light mode switch added, Fixes: DB not available - lo…
Browse files Browse the repository at this point in the history
…g human error instead of an exception, Technical: Upgrade to Vuetify 1.5.7
  • Loading branch information
valasek committed Mar 19, 2019
1 parent b9c0ae9 commit 7595a3f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
6 changes: 3 additions & 3 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vue-axios": "^2.1.4",
"vue-markdown": "^2.2.4",
"vue-router": "^3.0.2",
"vuetify": "^1.5.6",
"vuetify": "^1.5.7",
"vuetify-stylus-fixed-table-header": "^1.1.0",
"vuetify-upload-button": "^1.2.2",
"vuex": "^3.1.0"
Expand Down
8 changes: 6 additions & 2 deletions client/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright © 2018-2019 Stanislav Valasek <[email protected]> -->

<template>
<v-app>
<v-app :dark="goDark">
<v-snackbar v-model="notification" :color="notificationType" :left="true" :timeout="5000">
{{ notificationText }}
</v-snackbar>
Expand All @@ -21,7 +21,10 @@
<v-divider class="menuSettings" />

<v-list-tile class="menuSettings">
<v-switch v-model="weekUnlocked" :disabled="isCurrentWeek===true" label="Enable editing of this week" color="error" hide-details class="body-1" />
<v-switch v-model="weekUnlocked" :disabled="isCurrentWeek===true" label="Enable editing of this week" color="info" hide-details class="body-1" />
</v-list-tile>
<v-list-tile class="menuSettings">
<v-switch v-model="goDark" label="Enable dark mode" color="info" hide-details class="body-1" />
</v-list-tile>
</v-list>
</v-navigation-drawer>
Expand Down Expand Up @@ -69,6 +72,7 @@
data () {
return {
goDark: false,
drawer: true,
items: [
{ title: 'Report my work', icon: 'work_outline', route: 'report' },
Expand Down
Binary file modified screenshots/screencast.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions server/models/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
package models

import (
"os"
"time"

"github.com/valasek/timesheet/server/logger"

"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql" // needed because of gorm design
_ "github.com/jinzhu/gorm/dialects/postgres" // needed because of gorm design
Expand Down Expand Up @@ -59,11 +62,13 @@ func NewPostgresDB(dataSourceName string) *DB {

db, err := gorm.Open("postgres", dataSourceName)
if err != nil {
panic(err)
logger.Log.Error("cannot open postgres connection, error: ", err)
os.Exit(1)
}

if err = db.DB().Ping(); err != nil {
panic(err)
logger.Log.Error("cannot ping postgres, error: ", err)
os.Exit(1)
}

// db.LogMode(true)
Expand All @@ -76,11 +81,14 @@ func NewMySQLDB(dataSourceName string) *DB {

db, err := gorm.Open("mysql", dataSourceName)
if err != nil {
panic(err)
logger.Log.Error("cannot open mysql connection, error: ", err)
os.Exit(1)
}

if err = db.DB().Ping(); err != nil {
panic(err)
// panic("ping", err)
logger.Log.Error("cannot ping mysql, error: ", err)
os.Exit(1)
}

// db.LogMode(true)
Expand Down
2 changes: 1 addition & 1 deletion server/timesheet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ url: "" # URL on which application is running
PORT: "3000" # port on which application is running

# DB type
dbType: "mysql" # allowed types postgresql or mysql
dbType: "postgresql" # allowed types postgresql or mysql

# Production URL - will be read from production environment config variable
# If set, Database settings section variables will be ignored
Expand Down

0 comments on commit 7595a3f

Please sign in to comment.