Skip to content

Commit

Permalink
UI improvements (4)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 9, 2023
1 parent 5f2bcc5 commit fe37cef
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 26 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/image-builder-from-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
inputs:
architecture:
description: 'ARM architecture: armv6l/aarch64'
tagCustomPiOS:
default: ''
description: 'Optional tag of CustomPiOS'

jobs:
build:
Expand All @@ -24,6 +27,12 @@ jobs:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS

- name: Select CustomPiOS version
if: github.event.inputs.tagCustomPiOS != ''
run: |
cd CustomPiOS
git reset --hard ${{ github.event.inputs.tagCustomPiOS }}
- name: Prepare HyperHDR module
run: |
cd CustomPiOS
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
description: 'HyperHDR release tag (for example 17.0.0.0)'
architecture:
description: 'ARM architecture: armv6l/aarch64'
tagCustomPiOS:
default: ''
description: 'Optional tag of CustomPiOS'
debian:
default: ""
default: ''
description: 'optional Debian version'

jobs:
Expand All @@ -22,7 +25,12 @@ jobs:
- name: Overrride Debian download link
if: github.event.inputs.debian != ''
run: |
echo "HYPERHDR_DEB='https://github.com/awawa-dev/HyperHDR/releases/download/v${{ github.event.inputs.tags }}/hyperhdr_{{ github.event.inputs.tags }}~${{ github.event.inputs.debian }}_${{ github.event.inputs.architecture }}.deb'" >> $GITHUB_ENV
tag_name="${{ github.event.inputs.tags }}"
first_version="${tag_name%beta*}"
second_version="${tag_name#*beta}"
[ ${first_version} != ${second_version} ] && second_version="~beta${second_version}"
[ ${first_version} == ${second_version} ] && second_version=""
echo "HYPERHDR_DEB='https://github.com/awawa-dev/HyperHDR/releases/download/v${{ github.event.inputs.tags }}/HyperHDR_${first_version}~${{ github.event.inputs.debian }}${second_version}_${{ github.event.inputs.architecture }}.deb'" >> $GITHUB_ENV
- name: Install Dependencies
run: |
Expand All @@ -35,6 +43,12 @@ jobs:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS

- name: Select CustomPiOS version
if: github.event.inputs.tagCustomPiOS != ''
run: |
cd CustomPiOS
git reset --hard ${{ github.event.inputs.tagCustomPiOS }}
- name: Prepare HyperHDR module
run: |
cd CustomPiOS
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
cmake_minimum_required(VERSION 3.5.0)

message( STATUS "CMake Version: ${CMAKE_VERSION}" )

Expand Down
1 change: 0 additions & 1 deletion sources/hyperhdr-remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cmake_minimum_required(VERSION 3.0.0)
project(hyperhdr-remote)

# The following I do not understand completely...
Expand Down
6 changes: 3 additions & 3 deletions www/css/hyperhdr.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ body:not(.dark-mode) .alert.parentAlert {
background-color:#198754;
}
.modal-icon-warning{
background-color:#d07a12;
background-color:#f39c12;
}
.modal-icon-error{
background-color:#d1322e;
Expand Down Expand Up @@ -379,8 +379,8 @@ body:not(.dark-mode) .modal-hyperhdr-header {
}

.modal-header.modal-hyperhdr-header.modal-hyperhdr-header-warning {
background-color:#d07a12 !important;
border-color:#d07a12 !important;
background-color:#f39c12 !important;
border-color:#f39c12 !important;
}

.card-default{
Expand Down
2 changes: 1 addition & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@
"infoDialog_general_success_title": "Success",
"infoDialog_general_warning_title": "Warning",
"infoDialog_import_comperror_text": "Sad! Your browser doesn't support a import. Please try again with another browser.",
"infoDialog_import_confirm_text": "Are you sure to import \"$1\"? <p style='color: red;'>This process can't be reverted! HyperHDR will quit after succesful import and you must start it manually again if HyperHDR is not configured aa Linux service.</p>",
"infoDialog_import_confirm_text": "Are you sure to import \"$1\"? <p class='mt-2' style='color: red;'>This process cannot be undone! HyperHDR will close after a successful import and you have to restart it manually if HyperHDR is not configured as a Linux service.</p>",
"infoDialog_import_confirm_title": "Confirm import",
"infoDialog_import_hyperror_text": "The selected configuration file \"$1\" can't be imported. It's not compatible with HyperHDR v17 and higher!",
"infoDialog_import_jsonerror_text": "The selected configuration file \"$1\" is no .json file or it's corrupted. Error message: ($2)",
Expand Down
14 changes: 7 additions & 7 deletions www/js/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ $(document).ready(function()
});

var inst = e.currentTarget.id.split("_")[1];
showInfoDialog('renInst', $.i18n('conf_general_inst_renreq_t'), getInstanceNameByIndex(inst));
showInfoDialog('renameInstance', $.i18n('conf_general_inst_renreq_t'), getInstanceNameByIndex(inst));

$("#id_btn_ok").off().on('click', function()
{
requestInstanceRename(inst, $('#renInst_name').val())
requestInstanceRename(inst, $('#renameInstance_name').val())
});

$('#renInst_name').off().on('input', function(e)
$('#renameInstance_name').off().on('input', function(e)
{
(e.currentTarget.value.length >= 5 && e.currentTarget.value != getInstanceNameByIndex(inst)) ? $('#id_btn_ok').attr('disabled', false): $('#id_btn_ok').attr('disabled', true);
});
Expand All @@ -60,7 +60,7 @@ $(document).ready(function()
function handleInstanceDelete(e)
{
var inst = e.currentTarget.id.split("_")[1];
showInfoDialog('delInst', $.i18n('conf_general_inst_delreq_h'), $.i18n('conf_general_inst_delreq_t', getInstanceNameByIndex(inst)));
showInfoDialog('deleteInstance', $.i18n('conf_general_inst_delreq_h'), $.i18n('conf_general_inst_delreq_t', getInstanceNameByIndex(inst)));
$("#id_btn_yes").off().on('click', function()
{
requestInstanceDelete(inst)
Expand Down Expand Up @@ -175,9 +175,9 @@ $(document).ready(function()

$('#btn_import_conf').off().on('click', function()
{
showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName));
showInfoDialog('confirm', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName));

$('#id_btn_import').off().on('click', function()
$('#id_btn_confirm').off().on('click', function()
{
removeStorage('lastSelectedInstance', false);
requestRestoreDB(importedConf);
Expand Down Expand Up @@ -217,4 +217,4 @@ $(document).ready(function()
}

removeOverlay();
});
});
17 changes: 6 additions & 11 deletions www/js/ui_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,23 +356,17 @@ function showInfoDialog(type,header,message)
$('#id_body').html('<img src="img/hyperhdr/hyperhdrlogo.png" alt="Redefine ambient light!">');
$('#id_footer').html('<b>'+$.i18n('InfoDialog_nowrite_foottext')+'</b>');
}
else if (type == "import")
{
$('#id_body').html('<i style="margin-bottom:20px" class="fa fa-warning modal-icon-warning">');
$('#id_footer').html('<button type="button" id="id_btn_import" class="btn btn-warning" data-bs-dismiss="modal"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button>');
$('#id_footer').append('<button type="button" class="btn btn-danger" data-bs-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
}
else if (type == "delInst")
else if (type == "deleteInstance")
{
$('#new_modal_dialog_title').html('<h4><i class="fa fa-remove fa-fw"></i>'+ header +'</h4>');
$('#new_modal_dialog_body').html('<div class="mb-3">'+ message +'</div>');
$('#new_modal_dialog_footer').html('<button type="button" id="id_btn_yes" class="btn btn-warning" data-bs-dismiss="modal" data-bs-target="#new_modal_dialog"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_yes')+'</button>');
$('#new_modal_dialog_footer').append('<button type="button" class="btn btn-danger" data-bs-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
}
else if (type == "renInst")
else if (type == "renameInstance")
{
$('#new_modal_dialog_title').html('<h4><i class="fa fa-pencil fa-fw"></i>'+$.i18n('general_btn_rename')+'</h4>');
$('#new_modal_dialog_body').html('<div class="mb-3"><label class="form-label required">'+ header +'</label><input id="renInst_name" type="text" class="form-control"></div>');
$('#new_modal_dialog_body').html('<div class="mb-3"><label class="form-label required">'+ header +'</label><input id="renameInstance_name" type="text" class="form-control"></div>');
$('#new_modal_dialog_footer').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-bs-dismiss="modal" data-bs-target="#new_modal_dialog" disabled><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_ok')+'</button>');
$('#new_modal_dialog_footer').append('<button type="button" class="btn btn-danger" data-bs-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
}
Expand Down Expand Up @@ -403,7 +397,8 @@ function showInfoDialog(type,header,message)
$('#id_footer').append('<button type="button" class="btn btn-danger" data-bs-dismiss="modal" id="tok_deny_acc">'+$.i18n('general_btn_denyAccess')+'</button>');
}

if(type != "confirm" && type != "renInst" && type != "changePassword" && type != "delInst" && type != "error" && type != "error" && type != "warning" && type != "success")
if (type != "confirm" && type != "renameInstance" && type != "changePassword" && type != "deleteInstance" &&
type != "error" && type != "warning" && type != "success")
{
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+header+'</h4>');
$('#id_body').append(message);
Expand All @@ -413,7 +408,7 @@ function showInfoDialog(type,header,message)
$('#id_body').append('<select id="id_select" class="form-select" style="margin-top:10px;width:auto;"></select>');


const myTarget = ((type == "renInst" || type == "changePassword" || type == "delInst" ||
const myTarget = ((type == "renameInstance" || type == "changePassword" || type == "deleteInstance" ||
type=="error" || type=="warning" || type=="success" || type == "confirm") ? "#new_modal_dialog" : "#modal_dialog");

const modal = new bootstrap.Modal($(myTarget), {
Expand Down

0 comments on commit fe37cef

Please sign in to comment.