mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-06 01:54:52 +08:00
Compare commits
No commits in common. "8e2490e6bcab0b2f99eb753de370c6d2dda3e2f1" and "b0dbfcb805bcfef9e43849ab4414f184ad6d6a66" have entirely different histories.
8e2490e6bc
...
b0dbfcb805
@ -1,8 +1,9 @@
|
||||
services:
|
||||
dsm:
|
||||
container_name: dsm
|
||||
image: ghcr.io/vdsm/virtual-dsm
|
||||
image: vdsm/virtual-dsm
|
||||
environment:
|
||||
ALLOCATE: "Y"
|
||||
RAM_SIZE: "half"
|
||||
DISK_SIZE: "max"
|
||||
CPU_CORES: "max"
|
||||
|
||||
@ -1,16 +1,19 @@
|
||||
{
|
||||
"name": "Virtual DSM",
|
||||
"service": "vdsm",
|
||||
"service": "dsm",
|
||||
"containerEnv": {
|
||||
"ALLOCATE": "Y"
|
||||
},
|
||||
"forwardPorts": [5000],
|
||||
"portsAttributes": {
|
||||
"5000": {
|
||||
"label": "Web",
|
||||
"onAutoForward": "notify"
|
||||
"onAutoForward": "openBrowser"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
},
|
||||
"dockerComposeFile": "codespaces.yml",
|
||||
"workspaceFolder": "/workspaces/vdsm",
|
||||
"initializeCommand": "docker system prune --all --force"
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
info="/run/shm/msg.html"
|
||||
|
||||
escape () {
|
||||
local s
|
||||
s=${1//&/\&}
|
||||
@ -16,20 +14,16 @@ escape () {
|
||||
file="$1"
|
||||
total="$2"
|
||||
body=$(escape "$3")
|
||||
info="/run/shm/msg.html"
|
||||
|
||||
if [[ "$body" == *"..." ]]; then
|
||||
body="<p class=\"loading\">${body::-3}</p>"
|
||||
body="<p class=\"loading\">${body/.../}</p>"
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
|
||||
if [ ! -s "$file" ] && [ ! -d "$file" ]; then
|
||||
bytes="0"
|
||||
else
|
||||
if [ -s "$file" ]; then
|
||||
bytes=$(du -sb "$file" | cut -f1)
|
||||
fi
|
||||
|
||||
if (( bytes > 1000 )); then
|
||||
if [ -z "$total" ] || [[ "$total" == "0" ]] || [ "$bytes" -gt "$total" ]; then
|
||||
size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/')
|
||||
@ -39,7 +33,6 @@ do
|
||||
fi
|
||||
echo "${body//(\[P\])/($size)}"> "$info"
|
||||
fi
|
||||
|
||||
fi
|
||||
sleep 1 & wait $!
|
||||
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user