@ -44,6 +44,7 @@ load_webconf.get('api/webconfig', function(response) {
} )
var checkcd = setTimeout ( it_am_load_webconf , 10 )
var varparse = setTimeout ( it_am_var_parser , 100 )
function it_am_load_webconf ( ) {
// console.log('DEBUG: run load_webconf')
@ -61,123 +62,125 @@ function it_am_load_webconf() {
var clipboard = new ClipboardJS ( '.cpcmd' ) ;
if ( itam_debug ) {
if ( document . getElementById ( 'debug-config' ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
// console.log(JSON.stringify(webconf, null, 2))
function it_am_var_parser ( ) {
if ( itam_debug ) {
if ( document . getElementById ( 'debug-config' ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
// console.log(JSON.stringify(webconf, null, 2))
let html = ''
html += "<hr>"
html += "<h1>DEBUG</h1>"
html += "<h2>Config</h2>"
html += '<pre>' + "\n"
html += '<code class="language-json hljs">' + "\n"
let html = ''
html += "<hr>"
html += "<h1>DEBUG</h1>"
html += "<h2>Config</h2>"
html += '<pre>' + "\n"
html += '<code class="language-json hljs">' + "\n"
html += JSON . stringify ( webconf , null , 2 )
html += JSON . stringify ( webconf , null , 2 )
html += '</code>' + "\n"
html += '</pre>' + "\n"
html += '</code>' + "\n"
html += '</pre>' + "\n"
html += '<br>'
html += '<br>'
html += '<h2>Server Config</h2>'
html += '<ul>'
html += '<li><a target="_blank" href="' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/config' + '">' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/config' + '</a></li>'
html += '</ul>'
html += '<h2>Server Config</h2>'
html += '<ul>'
html += '<li><a target="_blank" href="' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/config' + '">' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/config' + '</a></li>'
html += '</ul>'
html += '<h2>WebUI Config</h2>'
html += '<ul>'
html += '<li><a target="_blank" href="' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/webconfig' + '">' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/webconfig' + '</a></li>'
html += '</ul>'
html += '<h2>WebUI Config</h2>'
html += '<ul>'
html += '<li><a target="_blank" href="' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/webconfig' + '">' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/api/webconfig' + '</a></li>'
html += '</ul>'
document . getElementById ( 'debug-config' ) . innerHTML = html
document . getElementById ( 'debug-config' ) . innerHTML = html
}
}
}
if ( document . getElementsByClassName ( "IP_ADDR" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "IP_ADDR" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "IP_ADDR" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'HOSTNAME' ]
if ( document . getElementsByClassName ( "IP_ADDR" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "IP_ADDR" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "IP_ADDR" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'HOSTNAME' ]
}
}
}
if ( document . getElementsByClassName ( "WEB_PORT" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "WEB_PORT" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "WEB_PORT" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'PORT' ]
if ( document . getElementsByClassName ( "WEB_PORT" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "WEB_PORT" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "WEB_PORT" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'PORT' ]
}
}
}
if ( document . getElementsByClassName ( "BASE_URL" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "BASE_URL" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "BASE_URL" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'BASE_URL' ]
if ( document . getElementsByClassName ( "BASE_URL" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "BASE_URL" ) . length ; e ++ ) {
// console.log("DEBUG e: "+ e)
document . getElementsByClassName ( "BASE_URL" ) [ e ] . innerHTML = webconf [ 'BROWSER' ] [ 'BASE_URL' ]
}
}
}
if ( document . getElementsByClassName ( "POSIX_WGET_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "POSIX_WGET_CMD" ) . length ; e ++ ) {
let html = ''
let cmd = 'wget -qO- ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.sh | bash -s ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ]
// console.log (cmd)
html += '<div class="input-group mb-3">' + "\n"
html += ' <input type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-wget" data-clipboard-text="' + cmd + '" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "POSIX_WGET_CMD" ) [ e ] . innerHTML = html
if ( document . getElementsByClassName ( "POSIX_WGET_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "POSIX_WGET_CMD" ) . length ; e ++ ) {
let html = ''
let cmd = 'wget -qO- ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.sh | bash -s ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ]
// console.log (cmd)
html += '<div class="input-group mb-3">' + "\n"
html += ' <input type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-wget" data-clipboard-text="' + cmd + '" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "POSIX_WGET_CMD" ) [ e ] . innerHTML = html
}
}
}
if ( document . getElementsByClassName ( "POSIX_CURL_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "POSIX_CURL_CMD" ) . length ; e ++ ) {
let html = ''
let cmd = 'curl -o- ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.sh | bash -s ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ]
// console.log (cmd)
html += '<div class="input-group mb-3">' + "\n"
html += ' <input type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-curl" data-clipboard-text="' + cmd + '" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "POSIX_CURL_CMD" ) [ e ] . innerHTML = html
if ( document . getElementsByClassName ( "POSIX_CURL_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "POSIX_CURL_CMD" ) . length ; e ++ ) {
let html = ''
let cmd = 'curl -o- ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.sh | bash -s ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ]
// console.log (cmd)
html += '<div class="input-group mb-3">' + "\n"
html += ' <input type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-curl" data-clipboard-text="' + cmd + '" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "POSIX_CURL_CMD" ) [ e ] . innerHTML = html
}
}
}
// Example From: https://chocolatey.org/install
// Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
if ( document . getElementsByClassName ( "WIN_CMD_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "WIN_CMD_CMD" ) . length ; e ++ ) {
let html = ''
// let cmd = encodeURIComponent('PowerShell -ExecutionPolicy Unrestricted Invoke-WebRequest \"' + webconf['BROWSER']['BASE_URL'] + '/download/skqitam-setup.ps1\" -Outfile "~\Downloads\skqitam-setup.ps1"; PowerShell -ExecutionPolicy Unrestricted -command "~\Downloads\skqitam-setup.ps1"')
let cmd = 'PowerShell -ExecutionPolicy Unrestricted Invoke-WebRequest \"' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.ps1\" -Outfile "~\Downloads\skqitam-setup.ps1"; PowerShell -ExecutionPolicy Unrestricted -command "~\Downloads\skqitam-setup.ps1 ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '"'
console . log ( cmd )
// Example From: https://chocolatey.org/install
// Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
html += '<div class="input-group mb-3">' + "\n"
html += ' <input id="WIN_CMD_CMD" type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-win" data-clipboard-text="" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "WIN_CMD_CMD" ) [ e ] . innerHTML = html
document . getElementById ( "WIN_CMD_CMD" ) . value = cmd
document . getElementById ( "btn-cp-win" ) . setAttribute ( 'data-clipboard-text' , cmd )
if ( document . getElementsByClassName ( "WIN_CMD_CMD" ) ) {
let webconf = JSON . parse ( sessionStorage . webconf )
for ( e = 0 ; e < document . getElementsByClassName ( "WIN_CMD_CMD" ) . length ; e ++ ) {
let html = ''
// let cmd = encodeURIComponent('PowerShell -ExecutionPolicy Unrestricted Invoke-WebRequest \"' + webconf['BROWSER']['BASE_URL'] + '/download/skqitam-setup.ps1\" -Outfile "~\Downloads\skqitam-setup.ps1"; PowerShell -ExecutionPolicy Unrestricted -command "~\Downloads\skqitam-setup.ps1"')
let cmd = 'PowerShell -ExecutionPolicy Unrestricted Invoke-WebRequest \"' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '/download/skqitam-setup.ps1\" -Outfile "~\Downloads\skqitam-setup.ps1"; PowerShell -ExecutionPolicy Unrestricted -command "~\Downloads\skqitam-setup.ps1 ' + webconf [ 'BROWSER' ] [ 'BASE_URL' ] + '"'
console . log ( cmd )
html += '<div class="input-group mb-3">' + "\n"
html += ' <input id="WIN_CMD_CMD" type="text" class="form-control" placeholder="WGET Command" aria-label="WGET Command" aria-describedby="button-addon2" value="' + cmd + '" disabled>' + "\n"
html += ' <div class="input-group-append">' + "\n"
html += ' <a title="Copy Command to Clipboard" class="btn btn-default cpcmd" type="button" id="btn-cp-win" data-clipboard-text="" onclick="alert(' + "'" + 'Copied Command to Clipboard' + "'" + ')"><span class="far fa-copy"></span></a>' + "\n"
html += ' </div>' + "\n"
html += '</div>' + "\n"
document . getElementsByClassName ( "WIN_CMD_CMD" ) [ e ] . innerHTML = html
document . getElementById ( "WIN_CMD_CMD" ) . value = cmd
document . getElementById ( "btn-cp-win" ) . setAttribute ( 'data-clipboard-text' , cmd )
}
}
}