Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Dec 25, 2024
1 parent 6d7d5a4 commit 8a0f0d8
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions public/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -13355,16 +13355,6 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
return newString
}
},
debug: {
writeTextFile: async function( { fileName , fileText } ) {
let resultsCode = await yz.postToYazzReturnJson(
"/http_post_save_debug_text_as_file",
{
debugFileName: fileName,
debugFileText: fileText
})
}
},
componentsAPI: {
vue: {
getDesignModeUiControlNameReturnsVueInstance: function( { controlName } ) {
Expand Down Expand Up @@ -13400,7 +13390,16 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
},
}
},

debug: {
writeTextFile: async function( { fileName , fileText } ) {
let resultsCode = await yz.postToYazzReturnJson(
"/http_post_save_debug_text_as_file",
{
debugFileName: fileName,
debugFileText: fileText
})
}
},
uiDb: {
//
// sqlui() - replaces all SQL commands so that debug data can be synced with server
Expand All @@ -13409,19 +13408,19 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
// setupAlaSqlSync() - used to sync data from UI to server side Sqlite for debugging purposes
//

sqlui: function ( sql , params ) {
sqlui: function ( sql , params ) {
let ret = yz.uiDb.sqluiDebug(null, sql , params)
return ret
},
sqlui1: function ( sql , params ) {
sqlui1: function ( sql , params ) {
let res = null
let resBack = yz.uiDb.sqlui( sql , params )
if (resBack && resBack.length > 0) {
res = resBack[0]
}
return res
},
sqluiDebug: function ( dbgCode , sql , params ) {
sqluiDebug: function ( dbgCode , sql , params ) {
yz.uiDb.currentDebugStack.currentSqlDebugId = dbgCode
let ret = alasql(sql , params)
if ((typeof $DEBUGUI !== 'undefined') && ($DEBUGUI == "true") && yz.uiDb.tablesCreated) {
Expand Down Expand Up @@ -13480,7 +13479,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
}
return ret
},
setupAlaSqlDatabase: async function ( ) {
setupAlaSqlDatabase: async function ( ) {
alasql("CREATE TABLE ui_tables (table_name STRING)");
alasql("CREATE TABLE ui_fields (table_name STRING, field_name STRING, field_type STRING)");
yz.uiDb.sqlui("select * from ui_tables")
Expand Down Expand Up @@ -13713,7 +13712,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
await yz.uiDb.readSourceFileForDebugging("/public/go.html")
await yz.uiDb.readSourceFileForDebugging("/public/visifile_drivers/apps/appstore.vjs")
},
readSourceFileForDebugging: async function ( fileName ) {
readSourceFileForDebugging: async function ( fileName ) {
if ((typeof $DEBUGUI == 'undefined') || (!$DEBUGUI)) {
return
}
Expand All @@ -13726,7 +13725,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
[result.fileName,result.contents])
yz.uiDb.linesOfSourceFile[result.fileName] = result.contents.split('\n');
},
findSourceLineInCode: function ( searchText ) {
findSourceLineInCode: function ( searchText ) {
let found = false
let startLine = null
let endLine = null
Expand Down Expand Up @@ -13780,7 +13779,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
}
return { found: found , fileName: foundFile, lineNumber: lineNumberOfSearchItem, lineText: foundLine , context: surroundingLines }
},
findFnNameInDebugString: function ( { line , dbg }) {
findFnNameInDebugString: function ( { line , dbg }) {
let indexOfDbgId = line.indexOf(dbg)

if (indexOfDbgId == null) {
Expand All @@ -13800,7 +13799,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
//let sourceForFunction = yz.uiDb.findSourceLineInCode(functionNameString + ":")
return functionNameString
},
getCallStack: function ( ) {
getCallStack: function ( ) {
// Create an Error object to get the stack trace
const error = new Error();

Expand All @@ -13813,7 +13812,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
// Remove any leading or trailing spaces from each line
return stackArray.map(line => line.trim());
},
getFnNameFromStackTrace: function ( fnLine ) {
getFnNameFromStackTrace: function ( fnLine ) {
//'at Proxy.installAppNow (eval at addRuntimePipelinesAndRunCode (http://192.168.1.171/app/appstore.html:1070:36), <anonymous>:158:29)'
let indexProxy = fnLine.indexOf("Proxy.")
if (indexProxy != -1) {
Expand All @@ -13827,7 +13826,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
let fnNameString = fnStartString.substring(0,indexEndFn)
return fnNameString
},
getFnNameFromLine: function ( fnLine ) {
getFnNameFromLine: function ( fnLine ) {
//'at Proxy.installAppNow (eval at addRuntimePipelinesAndRunCode (http://192.168.1.171/app/appstore.html:1070:36), <anonymous>:158:29)'
let indexColon = fnLine.indexOf(":")
if (indexColon == -1) {
Expand All @@ -13838,11 +13837,11 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
let trimmed = fnUptoColon.trim()
return trimmed
},
endOfDebugSection: function ( returnValue ) {
endOfDebugSection: function ( returnValue ) {
yz.uiDb.currentDebugStack.steps.pop()
return returnValue
},
debugFn: function ( argsPassedIn ) {
debugFn: function ( argsPassedIn ) {
if ((typeof $DEBUGUI == 'undefined') || (!$DEBUGUI)) {
return
}
Expand Down Expand Up @@ -13950,7 +13949,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
])
}
},
startDebug: function ( debugId ) {
startDebug: function ( debugId ) {
//----------------------------------------------------------------------------------/
//
// /-------------------------------------/
Expand Down Expand Up @@ -14070,7 +14069,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
let latestLogId = yz.uiDb.sqlui1("select MAX(id) as id from ui_table_debug_trace_log")
yz.uiDb.currentDebugStack.steps.push(latestLogId.id)
},
endDebug: function ( ) {
endDebug: function ( ) {
if ((typeof $DEBUGUI == 'undefined') || (!$DEBUGUI)) {
return
}
Expand All @@ -14080,7 +14079,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
yz.uiDb.currentDebugStack.debugTraceid = null
yz.uiDb.currentDebugStack.steps = []
},
createAlaSqlTable: async function ( { tableName , fields , sendToDebugSqliteServer } ) {
createAlaSqlTable: async function ( { tableName , fields , sendToDebugSqliteServer } ) {
if (typeof(sendToDebugSqliteServer) !== 'undefined') {
yz.uiDb.sendToServerDebugSqliteLookup[tableName] = sendToDebugSqliteServer
} else {
Expand Down Expand Up @@ -14268,10 +14267,10 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t


},
getUiDbData: function ( { tableName } ) {
getUiDbData: function ( { tableName } ) {
return yz.uiDb.uiDbTableData[tableName].data
},
convertUiDbStringToVal: function ( propType , propValue ) {
convertUiDbStringToVal: function ( propType , propValue ) {
let dbPropValue = null

if (propType == "STRING") {
Expand All @@ -14294,7 +14293,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
return dbPropValue

},
callUiDbGlobalVarEventListeners: function ( varName , propType, varValue) {
callUiDbGlobalVarEventListeners: function ( varName , propType, varValue) {
let realVarValue = yz.uiDb.convertUiDbStringToVal(propType,varValue)

if (yz.uiDb.uiDbGlobalVarChangeEvents[varName]) {
Expand All @@ -14307,7 +14306,7 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
yz.uiDb.uiDbGlobalVars[varName] = realVarValue

},
createGlobalVars: function ( ) {
createGlobalVars: function ( ) {
//sqlui("insert into ui_table_global_vars (prop_id, prop_type, prop_value) values (?,?,?)",["visible_app_id", "INTEGER", -1])
yz.setGlobalVar("visible_app_id", -1)
yz.setGlobalVar("show_running_apps", false)
Expand Down

0 comments on commit 8a0f0d8

Please sign in to comment.