Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

add screen on / off to support page #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/src/components/help/Help.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ const Help = ({
</PostActionButton>
</Panel>
</Col>
<Col md={6}>
<Panel
header={<h3>{t("Activer / désactiver l'écran")}</h3>}>
<PostActionButton bsStyle="success" action="screen-on">
{t('Allumer l\'écran')}
</PostActionButton>

<PostActionButton bsStyle="warning" action="screen-off">
{t('Eteindre l\'écran')}
</PostActionButton>{' '}
</Panel>
</Col>
</Row>
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,8 @@
"Voulez-vous vraiment supprimer toutes ces ROMs ?": "Do you really want to remove all these ROMs?",
"Déposez ici les ROMs à uploader.": "Drop here the ROMs to upload.",
"Supprimer les ROMs sélectionnées": "Delete selected ROMs",
"Nouvelle image": "New image"
}
"Nouvelle image": "New image",
"Activer / désactiver l'écran": "Turn screen on/off",
"Allumer l'écran": "Turn screen on",
"Eteindre l'écran": "Turn screen off"
}
7 changes: 5 additions & 2 deletions locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,8 @@
"Voulez-vous vraiment supprimer toutes ces ROMs ?": "Voulez-vous vraiment supprimer toutes ces ROMs ?",
"Déposez ici les ROMs à uploader.": "Déposez ici les ROMs à uploader.",
"Supprimer les ROMs sélectionnées": "Supprimer les ROMs sélectionnées",
"Nouvelle image": "Nouvelle image"
}
"Nouvelle image": "Nouvelle image",
"Activer / désactiver l'écran": "Activer / désactiver l'écran",
"Allumer l'écran": "Allumer l'écran",
"Eteindre l'écran": "Eteindre l'écran"
}
10 changes: 10 additions & 0 deletions src/routes/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ router.post('/', async (req, res, next) => {
// @todo What to do? The manager will become unreachable.
spawn('shutdown', ['-h', 'now']);
break;
case 'screen-on':
// @todo Wait for reboot. The manager will be unreachable for a while.
spawn('vcgencmd',['display_power 1']);
break;

case 'screen-off':
// @todo Wait for reboot. The manager will be unreachable for a while.
spawn('vcgencmd',['display_power 0']);
break;

case 'deleteRom':
deleteRom(body);

Expand Down