Skip to content

Commit

Permalink
v2.0 to master (#30)
Browse files Browse the repository at this point in the history
* v2.0.1

* ignoring dist

* Start on fullscreen support: --fullscreen arg

* Agregando idioma Español

* logo

* priority colors

* i18n

* no-cache

Co-authored-by: Leandro Corsino <lcorsino@lujandecuyo.gob.ar>
  • Loading branch information
rogeriolino and Leandro Corsino authored Oct 25, 2020
1 parent 47ad453 commit aa70a7b
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
dist/electron/*
dist/web/*
build/*
dist/*
!build/icons
node_modules/
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "painel-web",
"description": "Novo SGA panel",
"license": "MIT",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "http://novosga.org",
"author": {
"name": "Rogerio Lino",
Expand Down
3 changes: 3 additions & 0 deletions src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<head>
<meta charset="utf-8">
<title>Painel Web</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<% if (htmlWebpackPlugin.options.nodeModules) { %>
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
<script>
Expand Down
12 changes: 9 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ const winURL = process.env.NODE_ENV === 'development'
: `file://${__dirname}/index.html`

function createWindow () {
const fullscreen = process.argv.indexOf('--fullscreen') !== -1

/**
* Initial window options
*/
mainWindow = new BrowserWindow({
useContentSize: true
useContentSize: true,
fullscreen: fullscreen
})

mainWindow.loadURL(winURL)
Expand Down Expand Up @@ -68,8 +71,11 @@ function createWindow () {
]
}
]
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)

if (!fullscreen) {
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
}
}

app.on('ready', createWindow)
Expand Down
17 changes: 14 additions & 3 deletions src/renderer/layouts/Default.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div class="layout-content" :style="{ 'background-color': config.pageBgColor, 'color': config.pageFontColor }">
<div class="layout-content" :style="{ 'background-color': pageBgColor, 'color': pageFontColor }">
<div class="columns is-gapless">
<div class="column is-multiline featured-column">
<header class="column">
<featured :message="lastMessage" v-if="lastMessage" @blink="playAudio" :fontColor="config.pageFontColor"></featured>
<featured :message="lastMessage" v-if="lastMessage" @blink="playAudio" :fontColor="pageFontColor"></featured>
</header>
<footer class="column" :style="{ 'background-color': config.footerBgColor, 'color': config.footerFontColor }">
<img src="static/images/logo.png">
<img :src="logoUrl">
</footer>
</div>
<div class="column is-one-quarter history-column" :style="{ 'background-color': config.sidebarBgColor, 'color': config.sidebarFontColor }">
Expand Down Expand Up @@ -46,6 +46,17 @@
},
config () {
return this.$store.state.config
},
logoUrl () {
return this.config.logo || 'static/images/logo.png'
},
pageBgColor () {
const peso = this.lastMessage.$data ? this.lastMessage.$data.peso : 1
return peso > 0 ? this.config.pageBgColorPriority : this.config.pageBgColorNormal
},
pageFontColor () {
const peso = this.lastMessage.$data ? this.lastMessage.$data.peso : 1
return peso > 0 ? this.config.pageFontColorPriority : this.config.pageFontColorNormal
}
},
methods: {
Expand Down
51 changes: 45 additions & 6 deletions src/renderer/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<span class="select is-fullwidth">
<select v-model="config.locale">
<option value="en">English</option>
<option value="es">Español</option>
<option value="pt_BR">Português (Brasil)</option>
</select>
</span>
Expand All @@ -76,29 +77,65 @@
</div>
</div>

<div class="columns">
<div class="column">
<div class="field">
<label class="label">
{{ 'settings.label.logo'|trans }}
</label>
<div class="control">
<input class="input is-medium" type="url" placeholder="https://" v-model="config.logo">
</div>
</div>
</div>
</div>

<h3 class="title">{{ 'settings.interface.colors'| trans }}</h3>

<div class="columns">
<div class="column">
<div class="field">
<label class="label">
{{ 'settings.label.page_bg_color'|trans }}
{{ 'settings.label.page_bg_color_normal'|trans }}
</label>
<div class="control">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageBgColorNormal">
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">
{{ 'settings.label.page_font_color_normal'|trans }}
</label>
<div class="control">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageBgColor">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageFontColorNormal">
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">
{{ 'settings.label.page_font_color'|trans }}
{{ 'settings.label.page_bg_color_priority'|trans }}
</label>
<div class="control">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageFontColor">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageBgColorPriority">
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">
{{ 'settings.label.page_font_color_priority'|trans }}
</label>
<div class="control">
<input class="input is-medium" type="text" placeholder="#000000" v-model="config.pageFontColorPriority">
</div>
</div>
</div>
</div>

<div class="columns">
<div class="column">
<div class="field">
<label class="label">
Expand Down Expand Up @@ -359,8 +396,10 @@
ctx.config.services = ctx.config.services || []
ctx.config.alert = ctx.config.alert || audio.alertsAvailable.Default
ctx.config.pageBgColor = ctx.config.pageBgColor || '#FFFFFF'
ctx.config.pageFontColor = ctx.config.pageFontColor || '#000000'
ctx.config.pageBgColorNormal = ctx.config.pageBgColorNormal || '#FFFFFF'
ctx.config.pageFontColorNormal = ctx.config.pageFontColorNormal || '#000000'
ctx.config.pageBgColorPriority = ctx.config.pageBgColorPriority || '#FFFFFF'
ctx.config.pageFontColorPriority = ctx.config.pageFontColorPriority || '#FF0000'
ctx.config.sidebarBgColor = ctx.config.sidebarBgColor || '#4FC08D'
ctx.config.sidebarFontColor = ctx.config.sidebarFontColor || '#000000'
ctx.config.footerBgColor = ctx.config.footerBgColor || '#F1F1F1'
Expand Down
7 changes: 5 additions & 2 deletions static/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
"settings.title": "Settings",
"settings.subtitle": "Panel settings",
"settings.interface.colors": "Colors",
"settings.label.page_bg_color": "Page background",
"settings.label.page_font_color": "Page font",
"settings.label.logo": "Logo",
"settings.label.page_bg_color_normal": "Page background (Normal)",
"settings.label.page_font_color_normal": "Page font (Normal)",
"settings.label.page_bg_color_priority": "Page background (Priority)",
"settings.label.page_font_color_priority": "Page font (Priority)",
"settings.label.sidebar_bg_color": "Sidebar background",
"settings.label.sidebar_font_color": "Sidebar font",
"settings.label.footer_bg_color": "Footer background",
Expand Down
37 changes: 37 additions & 0 deletions static/i18n/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"menu.settings": "Configuración",
"menu.go_back": "Volver",
"menu.general": "General",
"menu.interface": "Interface",
"menu.server": "Servidor",
"menu.services": "Servicios",
"menu.sound": "Sonido",
"history.title": "Historial",
"history.empty": "Vacío",
"settings.title": "Configuración",
"settings.subtitle": "Panel de configuración",
"settings.interface.colors": "Colores",
"settings.label.page_bg_color_normal": "Fondo de la páginad (Normal)",
"settings.label.page_font_color_normal": "Fuente de la página (Normal)",
"settings.label.page_bg_color_priority": "Fondo de la página (Prioridad)",
"settings.label.page_font_color_priority": "Fuente de la página (Prioridad)",
"settings.label.sidebar_bg_color": "Fondo de la barra",
"settings.label.sidebar_font_color": "Fuente de la barra",
"settings.label.footer_bg_color": "Fondo del pie",
"settings.label.footer_font_color": "Fuente del pie",
"settings.label.clock_bg_color": "Fondo del reloj",
"settings.label.clock_font_color": "Fuente del reloj",
"settings.label.locale": "Idioma",
"settings.label.server": "Servidor",
"settings.label.username": "Usuario",
"settings.label.password": "Contraseña",
"settings.label.client_id": "Client ID",
"settings.label.client_secret": "Client Secret",
"settings.label.unity": "Unidad",
"settings.label.services": "Servicios",
"settings.label.alert": "Alerta",
"settings.label.speech_enabled": "Vocalizar (experimental !!!)",
"settings.btn.save": "Guardar",
"settings.services.empty": "Vacío",
"date_format": "DD [de] MMMM [de] YYYY"
}
7 changes: 5 additions & 2 deletions static/i18n/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
"settings.title": "Configurações",
"settings.subtitle": "Configurações do painel",
"settings.interface.colors": "Cores",
"settings.label.page_bg_color": "Fundo da página",
"settings.label.page_font_color": "Fonte da página",
"settings.label.logo": "Logo",
"settings.label.page_bg_color_normal": "Fundo da página (Normal)",
"settings.label.page_font_color_normal": "Fonte da página (Normal)",
"settings.label.page_bg_color_priority": "Fundo da página (Prioridade)",
"settings.label.page_font_color_priority": "Fonte da página (Prioridade)",
"settings.label.sidebar_bg_color": "Fundo da lateral",
"settings.label.sidebar_font_color": "Fonte da lateral",
"settings.label.footer_bg_color": "Fundo do rodapé",
Expand Down

0 comments on commit aa70a7b

Please sign in to comment.