Skip to content

Commit

Permalink
update languages.ini and license
Browse files Browse the repository at this point in the history
  • Loading branch information
ventoy committed Feb 27, 2021
1 parent 96c5a25 commit 08634fb
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 80 deletions.
2 changes: 1 addition & 1 deletion IMG/cpio/sbin/init
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

####################################################################
# #
# Step 1 : extract busybox & set busybox enviroment #
# Step 1 : extract busybox & set busybox environment #
# #
####################################################################

Expand Down
2 changes: 1 addition & 1 deletion IMG/cpio/ventoy/hook/daphile/disk_hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

. /ventoy/hook/ventoy-hook-lib.sh

# Just for KVM test enviroment
# Just for KVM test environment
$BUSYBOX_PATH/modprobe virtio_blk 2>/dev/null
$BUSYBOX_PATH/modprobe virtio_pci 2>/dev/null

Expand Down
2 changes: 1 addition & 1 deletion IMG/cpio/ventoy/hook/gentoo/disk_hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

. /ventoy/hook/ventoy-hook-lib.sh

# Just for KVM test enviroment
# Just for KVM test environment
$BUSYBOX_PATH/modprobe virtio_blk 2>/dev/null
$BUSYBOX_PATH/modprobe virtio_pci 2>/dev/null

Expand Down
82 changes: 11 additions & 71 deletions INSTALL/VentoyWeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ print_usage() {
echo ' OPTION: (optional)'
echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)'
echo ' -p PORT http server PORT (default is 24680)'
echo " -n don't start web browser"
echo ' -h print this help'
echo ''
}
Expand All @@ -16,37 +15,6 @@ print_err() {
echo ""
}

check_option() {
app="$1"
$app --help 2>&1 | grep -q "$2"
}

get_user() {
name=$(logname)
if [ -n "$name" -a "$name" != "root" ]; then
echo $name; return
fi

name=${HOME#/home/}
if [ -n "$name" -a "$name" != "root" ]; then
echo $name; return
fi
}

chromium_proc() {
app="$1"

url="http://${HOST}:${PORT}/index.html"

if check_option "$app" '[-][-]app='; then
su $VUSER -c "$app --app=$url >> $LOGFILE 2>&1"
elif check_option "$app" '[-][-]new[-]window='; then
su $VUSER -c "$app --new-window $url >> $LOGFILE 2>&1"
else
su $VUSER -c "$app $url >> $LOGFILE 2>&1"
fi
}

uid=$(id -u)
if [ $uid -ne 0 ]; then
print_err "Please use sudo or run the script as root."
Expand Down Expand Up @@ -87,8 +55,6 @@ while [ -n "$1" ]; do
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
print_usage
exit 0
elif [ "$1" = "-n" ]; then
NOWEB=1
elif [ "$1" = "-H" ]; then
shift
if echo $1 | grep -q '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'; then
Expand Down Expand Up @@ -116,63 +82,37 @@ if ps -ef | grep "V2DServer.*$HOST.*$PORT" | grep -q -v grep; then
exit 1
fi

VUSER=$(get_user)
LOGFILE=log.txt
#delete the log.txt if it's more than 8MB
if [ -f $LOGFILE ]; then
logsize=$(stat -c '%s' $LOGFILE)
if [ $logsize -gt 8388608 ]; then
rm -f $LOGFILE
su $VUSER -c "touch $LOGFILE"
fi
else
su $VUSER -c "touch $LOGFILE"
fi



if [ -f ./tool/$TOOLDIR/V2DServer.xz ]; then
xz -d ./tool/$TOOLDIR/V2DServer.xz
chmod +x ./tool/$TOOLDIR/V2DServer
fi

V2DServer "$HOST" "$PORT" &

vtVer=$(cat ventoy/version)
echo ""
echo "=================================================================="
echo " Ventoy Server $vtVer is running at http://${HOST}:${PORT} ..."
echo "=================================================================="
echo ""
echo "################ Press Ctrl + C to exit ######################"
echo ""

if [ "$NOWEB" = "1" ]; then
echo "Please open your web browser and visit http://${HOST}:${PORT}"
else
if which -a google-chrome-stable >> $LOGFILE 2>&1; then
chromium_proc google-chrome-stable
elif which -a google-chrome >> $LOGFILE 2>&1; then
chromium_proc google-chrome
elif which -a chrome >> $LOGFILE 2>&1; then
chromium_proc chrome
elif which -a browser >> $LOGFILE 2>&1; then
chromium_proc browser
elif which -a firefox >> $LOGFILE 2>&1; then
su $VUSER -c "firefox --no-remote \"http://${HOST}:${PORT}/index.html\""
else
echo "Please open your web browser and visit http://${HOST}:${PORT}"
fi
fi

if ps -ef | grep "V2DServer.*$HOST.*$PORT" | grep -q -v grep; then
echo ""
echo "==============================================================="
if [ "$LANG" = "zh_CN.UTF-8" ]; then
echo " Ventoy Server $vtVer 已经启动 ..."
echo " 请打开浏览器,访问 http://${HOST}:${PORT}"
else
print_err "Ventoy Server Error! Please check log.txt."
echo " Ventoy Server $vtVer is running ..."
echo " Please open your browser and visit http://${HOST}:${PORT}"
fi
echo "==============================================================="
echo ""
echo "################## Press Ctrl + C to exit #####################"
echo ""

wait $!

V2DServer "$HOST" "$PORT"

if [ -n "$OLDDIR" ]; then
CURDIR=$(pwd)
Expand Down
Binary file modified LANGUAGES/languages.ini
Binary file not shown.
1 change: 1 addition & 0 deletions License/license-AdminLTE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AdminLTE follows the MIT License (see MIT.txt)
1 change: 1 addition & 0 deletions License/license-bootstrap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bootstrap follows the MIT License (see MIT.txt)
1 change: 1 addition & 0 deletions License/license-jquery.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jquery follows the MIT License (see MIT.txt)
3 changes: 3 additions & 0 deletions License/license-libhttp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libhttp follows the MIT License (see MIT.txt)

Ventoy does not modify its source code, only its header file and lib is used.
2 changes: 1 addition & 1 deletion LinuxGUI/Ventoy2Disk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char **argv)
rc = ventoy_http_start(ip, port);
if (rc)
{
printf("failed to start http server\n");
printf("Ventoy failed to start http server, check log.txt for detail\n");
}
else
{
Expand Down
42 changes: 39 additions & 3 deletions LinuxGUI/WebUI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h4 id='part_config_dlg_title'>Configuration</h4>

<div class="form-group" style="width:520px;">
<div class="col-sm-6" style="float:left; width:350px;">
<input type="number" min="1" class="form-control" id="vtoy_preserve_space" style="font-family: couriew new;font-size: 14px;"/>
<input type="text" maxlength="14" class="form-control" id="vtoy_preserve_space" style="font-family: couriew new;font-size: 14px;"/>
</div>
<div class="col-sm-6" style="float:left; width:150px;">
<select id="vtoy_space_unit_dropbox" class="form-control valid vtoyselect2" aria-invalid="false">
Expand Down Expand Up @@ -381,7 +381,17 @@ <h3 class="box-title" id="vtoy_dev_ver_title" style="font-size: 14px;font-weight
$('h3#vtoy_local_ver_title').text(vtoy_cur_language.STR_LOCAL_VER);
$('h3#vtoy_dev_ver_title').text(vtoy_cur_language.STR_DISK_VER);
$('span#vtoy_status_title').text(vtoy_cur_language.STR_STATUS);
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE);

if ($('#vtoy_preserve_space_checkbox').is(':checked')) {
var valx = $('#vtoy_preserve_space').val();
if ($('#vtoy_space_unit_dropbox').val() > 0) {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE + ' [ -' + valx + 'MB ]');
} else {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE + ' [ -' + valx + 'GB ]');
}
} else {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE);
}

$('span#vtoy_menu_secure_boot').text(vtoy_cur_language.STR_MENU_SECURE_BOOT);
$('span#vtoy_menu_part_style').text(vtoy_cur_language.STR_MENU_PART_STYLE);
Expand Down Expand Up @@ -525,7 +535,28 @@ <h3 class="box-title" id="vtoy_dev_ver_title" style="font-size: 14px;font-weight
$('#vtoy_set_part_cfg_modal').modal({backdrop: 'static', keyboard: false});
}

$("#vtoy_modal_btn_ok").click(function(){
$("#vtoy_modal_btn_ok").click(function(){
if ($('#vtoy_preserve_space_checkbox').is(':checked')) {
var valx = $('#vtoy_preserve_space').val();
if (valx.length > 14) {
ventoy_display_alert('error', vtoy_cur_language.STR_SPACE_VAL_INVALID);
return;
}

var regPat = /^\d+$/;
if (!(regPat.test(valx))) {
ventoy_display_alert('error', vtoy_cur_language.STR_SPACE_VAL_INVALID);
return;
}

if ($('#vtoy_space_unit_dropbox').val() > 0) {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE + ' [ -' + valx + 'MB ]');
} else {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE + ' [ -' + valx + 'GB ]');
}
} else {
$('span#vtoy_dev_title').text(vtoy_cur_language.STR_DEVICE);
}
$("#vtoy_set_part_cfg_modal").modal('hide');
});

Expand Down Expand Up @@ -749,6 +780,11 @@ <h3 class="box-title" id="vtoy_dev_ver_title" style="font-size: 14px;font-weight

if ($('#vtoy_preserve_space_checkbox').is(':checked')) {
var valx = $('#vtoy_preserve_space').val();
if (valx.length > 14) {
ventoy_display_alert('error', vtoy_cur_language.STR_SPACE_VAL_INVALID);
return;
}

if (valx > 0) {
if ($('#vtoy_space_unit_dropbox').val() > 0) {
reserve = valx * 1024 * 1024;
Expand Down
2 changes: 1 addition & 1 deletion LiveCD/VTOY/ventoy/ventoy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ vline=$(printf "* Ventoy LiveCD %6s *\r\n" "$VTVER")
info "$vline"
info "**************************************************"
echo ""
info "Scaning devices ......"
info "Scanning devices ......"
sleep 5

enum_disk
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/Vmware/Xen...) <br/>
* Menu dynamically switchable between List/TreeView mode
* "Ventoy Compatible" concept
* Plugin Framework
* Injection files to runtime enviroment
* Injection files to runtime environment
* Boot configuration file dynamically replacement
* Highly customizable theme and menu
* USB drive write-protected support
Expand Down

0 comments on commit 08634fb

Please sign in to comment.