Skip to content

Commit

Permalink
Improve system monitoring blocks and home page
Browse files Browse the repository at this point in the history
  • Loading branch information
foivospro committed Sep 3, 2024
1 parent 5cdbe2e commit 545c8c3
Show file tree
Hide file tree
Showing 12 changed files with 443 additions and 106 deletions.
Binary file modified blockly_unix_database.db
Binary file not shown.
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@
{ kind: 'block', type: 'findDuplicates' },
{ kind: 'block', type: 'showUniqs' },
{ kind: 'block', type: 'cut' },
{ kind: 'block', type: 'sed' },
{ kind: 'block', type: 'echo' }
{ kind: 'block', type: 'sed' }
]
},
{
Expand Down
18 changes: 15 additions & 3 deletions public/blocks/dateBlock.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
var dateBlock = {
type: 'date',
message0: '%{BKY_DATE}',
message0: '%{BKY_SYSTEM_DATE_COMMAND}',
category: 'System Monitoring',
unix_description: [
{
command: 'date'
desc: 'Display or set the system date and time',
utc_time: '-u'
}
],
message1: '%{BKY_DATE_UTC_TIME}',
args1: [
{
type: 'field_checkbox',
name: 'utc_time',
checked: false
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_DATE_TOOLTIP}',
helpUrl: 'https://linux.die.net/man/1/date'
helpUrl: '%{BKY_DATE_HELPURL}'
};

Blockly.defineBlocksWithJsonArray([dateBlock]);
47 changes: 44 additions & 3 deletions public/blocks/dfBlock.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,58 @@
var dfBlock = {
type: 'df',
message0: '%{BKY_DF}',
category: 'System Monitoring',
category: 'System Commands',
unix_description: [
{
command: 'df'
desc: '-h',
show_fs_type: '-T',
show_total_blocks: '-B',
show_used_blocks: '-u',
show_available_blocks: '-a',
block_size: '-k',
target_fs: '-t'
}
],
message1: '%{BKY_DF_SHOW_FS_TYPE}',
args1: [
{
type: 'field_checkbox',
name: 'show_fs_type',
checked: false
}
],
message2: '%{BKY_DF_SHOW_TOTAL_BLOCKS}',
args2: [
{
type: 'field_checkbox',
name: 'show_total_blocks',
checked: false
}
],
message3: '%{BKY_DF_SHOW_USED_BLOCKS}',
args3: [
{
type: 'field_checkbox',
name: 'show_used_blocks',
checked: false
}
],
message4: '%{BKY_DF_SHOW_AVAILABLE_BLOCKS}',
args4: [
{
type: 'field_checkbox',
name: 'show_available_blocks',
checked: false
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_DF_TOOLTIP}',
helpUrl: 'https://linux.die.net/man/1/df'
helpUrl: '%{BKY_DF_HELPURL}'
};

Blockly.defineBlocksWithJsonArray([dfBlock]);
54 changes: 51 additions & 3 deletions public/blocks/hostnameBlock.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,65 @@
var hostnameBlock = {
type: 'hostname',
message0: '%{BKY_HOSTNAME}',
message0: '%{BKY_SYSTEM_HOSTNAME_COMMAND}',
category: 'System Monitoring',
unix_description: [
{
command: 'hostname'
desc: "Show or set the system's hostname",
show_hostname: '',
set_hostname: "-s'str'",
show_aliases: '-a',
show_ip: '-i',
show_fqdn: '-f'
}
],
message1: '%{BKY_HOSTNAME_SHOW_HOSTNAME}',
args1: [
{
type: 'field_checkbox',
name: 'show_hostname',
checked: false
}
],
message2: '%{BKY_HOSTNAME_SET_HOSTNAME}',
args2: [
{
type: 'field_input',
name: 'set_hostname',
text: 'Enter new hostname'
}
],
message3: '%{BKY_HOSTNAME_SHOW_ALIASES}',
args3: [
{
type: 'field_checkbox',
name: 'show_aliases',
checked: false
}
],
message4: '%{BKY_HOSTNAME_SHOW_IP}',
args4: [
{
type: 'field_checkbox',
name: 'show_ip',
checked: false
}
],
message5: '%{BKY_HOSTNAME_SHOW_FQDN}',
args5: [
{
type: 'field_checkbox',
name: 'show_fqdn',
checked: false
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_HOSTNAME_TOOLTIP}',
helpUrl: 'https://linux.die.net/man/1/hostname'
helpUrl: '%{BKY_HOSTNAME_HELPURL}'
};

Blockly.defineBlocksWithJsonArray([hostnameBlock]);
62 changes: 55 additions & 7 deletions public/blocks/psBlock.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,67 @@
var psBlock = {
type: 'ps',
category: 'System Monitoring',
message0: 'ps',
message0: '%{BKY_PS}',
category: 'System Commands',
unix_description: [
{
command: 'ps'
desc: '-e',
show_all_processes: '-e',
show_process_user: "-u'str'",
show_process_pid: "-p'str'",
format: '-o',
show_thread: '-L',
sort_by: '--sort',
filter_by: '--pid'
}
],
args0: [],
message1: '%{BKY_PS_SHOW_ALL}',
args1: [
{
type: 'field_checkbox',
name: 'show_all_processes',
checked: false // by default it's disabled
}
],
message2: '%{BKY_PS_SHOW_USER}',
args2: [
{
type: 'field_input',
name: 'show_process_user',
text: ''
}
],
message3: '%{BKY_PS_SHOW_PID}',
args3: [
{
type: 'field_input',
name: 'show_process_pid',
text: ''
}
],
message4: '%{BKY_PS_FORMAT}',
args4: [
{
type: 'field_input',
name: 'format',
text: ''
}
],
message5: '%{BKY_PS_SHOW_THREAD}',
args5: [
{
type: 'field_checkbox',
name: 'show_thread',
checked: false // by default it's disabled
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: 'Εμφανίζει πληροφορίες για τις διεργασίες που εκτελούνται.',
helpUrl: 'https://linux.die.net/man/1/ps'
tooltip: '%{BKY_PS_TOOLTIP}',
helpUrl: '%{BKY_PS_HELPURL}' // URL to further information or documentation.
};

Blockly.defineBlocksWithJsonArray([psBlock]);
//
35 changes: 33 additions & 2 deletions public/blocks/uptimeBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,45 @@ var uptimeBlock = {
category: 'System Monitoring',
unix_description: [
{
command: 'uptime'
desc: 'Displays how long the system has been running, the number of users, and the system load averages.',
pretty: '-p',
since: '-s',
kernel_version: '-v',
help: '--help'
}
],
message1: '%{BKY_UPTIME_PRETTY}',
args1: [
{
type: 'field_checkbox',
name: 'pretty',
checked: false
}
],
message2: '%{BKY_UPTIME_SINCE}',
args2: [
{
type: 'field_checkbox',
name: 'since',
checked: false
}
],
message3: '%{BKY_UPTIME_KERNEL_VERSION}',
args3: [
{
type: 'field_checkbox',
name: 'kernel_version',
checked: false
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_UPTIME_TOOLTIP}',
helpUrl: 'https://linux.die.net/man/1/uptime'
helpUrl: '%{BKY_UPTIME_HELPURL}'
};

Blockly.defineBlocksWithJsonArray([uptimeBlock]);
52 changes: 50 additions & 2 deletions public/blocks/whoBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,62 @@ var whoBlock = {
category: 'System Monitoring',
unix_description: [
{
command: 'who'
desc: 'Display who is logged in and related information',
show_heading: '-H',
show_all: '-a',
show_users: '-u',
show_boot_time: '-b',
show_runlevel: '-r'
}
],
message1: '%{BKY_WHO_SHOW_HEADING}',
args1: [
{
type: 'field_checkbox',
name: 'show_heading',
checked: false
}
],
message2: '%{BKY_WHO_SHOW_ALL}',
args2: [
{
type: 'field_checkbox',
name: 'show_all',
checked: false
}
],
message3: '%{BKY_WHO_SHOW_USERS}',
args3: [
{
type: 'field_checkbox',
name: 'show_users',
checked: false
}
],
message4: '%{BKY_WHO_SHOW_BOOT_TIME}',
args4: [
{
type: 'field_checkbox',
name: 'show_boot_time',
checked: false
}
],
message5: '%{BKY_WHO_SHOW_RUNLEVEL}',
args5: [
{
type: 'field_checkbox',
name: 'show_runlevel',
checked: false
}
],

extensions: ['integer_validation'],

style: 'System Monitoring',
previousStatement: 'Action',
nextStatement: 'Action',
tooltip: '%{BKY_WHO_TOOLTIP}',
helpUrl: 'https://linux.die.net/man/1/who'
helpUrl: '%{BKY_WHO_HELPURL}'
};

Blockly.defineBlocksWithJsonArray([whoBlock]);
Loading

0 comments on commit 545c8c3

Please sign in to comment.