欢迎图片

Changes for page Lua Script

Last modified by Devin Chen on 2025/11/10 16:04

From version 6.2
edited by xingzhi lin
on 2025/10/31 10:41
Change comment: There is no comment for this version
To version 6.3
edited by xingzhi lin
on 2025/10/31 10:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -7847,8 +7847,60 @@
7847 7847  
7848 7848  == user_secure.usersecure_getInfo ==
7849 7849  
7850 +**Prototype : **user_secure.usersecure_getInfo()
7851 +
7852 +**Function: **Get all user information
7853 +
7854 +**Return: **
7855 +
7856 +* Success: User data table
7857 +* Failure: Returns nil
7858 +
7859 +**Example**
7860 +
7861 +{{code language="LUA"}}
7862 +secure = user_secure.usersecure_getInfo()
7863 + for index,j in pairs(secure) do
7864 + for msg,value in pairs(j) do
7865 + if "permission" == msg then
7866 + print("index",index,"msg",msg,"value",table.concat(value,','))
7867 + else
7868 + print("index",index,"msg",msg,"value",value)
7869 + end
7870 +
7871 + end
7872 + end
7873 +
7874 +{{/code}}
7875 +
7850 7850  == user_secure.usersecure_addInfo ==
7851 7851  
7878 +
7879 +**Prototype : **user_secure.usersecure_addInfo(username,password,supassword,desc,hide,permission)
7880 +
7881 +**Function: **Add user information
7882 +
7883 +**Parameters**:
7884 +
7885 +* username(string):新增用户名(长度16位)
7886 +* password(string):密码(长度8位)
7887 +* supassword(string):确认密码(长度8位)
7888 +* desc(string):描述,(长度10位)
7889 +* hide(bool):控制隐藏,true :权限不足时隐藏
7890 +* permission(table):权限,1为拥有权限,0为无权限
7891 +
7892 +**Return: **
7893 +
7894 +* Success: Return 0
7895 +* Failure: Returns nil
7896 +
7897 +**Example**
7898 +
7899 +{{code language="LUA"}}
7900 +tab = {0,1,1,1,1,1,1,1,1,1,1,1}
7901 +user_secure.usersecure_addInfo("user1","123","123","user1",false,"tab")
7902 +{{/code}}
7903 +
7852 7852  == user_secure.usersecure_deleteInfo ==
7853 7853  
7854 7854  == user_secure.usersecure_login ==
... ... @@ -7859,7 +7859,38 @@
7859 7859  
7860 7860  = LuaChart =
7861 7861  
7914 +== chart.setAlarmBtnSpacing ==
7862 7862  
7916 +**Prototype : **user_secure.usersecure_getInfo()
7917 +
7918 +**Function: **Connect to a DB file.(If the file does not exist)
7919 +
7920 +**Parameters**:
7921 +
7922 +* dbFilePath (string): Full path to the DB file to connect to (create)
7923 +
7924 +**Return: **
7925 +
7926 +* Success: database object
7927 +* Failure: Returns nil and error.
7928 +
7929 +**Example**
7930 +
7931 +{{code language="LUA"}}
7932 +sql = require "Luasqlite" -- Introducing the lua libraries  
7933 +env = sql.sqlite3() -- Get the environment class
7934 +{{/code}}
7935 +
7936 +== chart.setAlarmBtnScale ==
7937 +
7938 +== chart.setFormulaBtnSpacing ==
7939 +
7940 +== chart.setFormulaBtnScale ==
7941 +
7942 +== chart.setBarChartBtnSpacing ==
7943 +
7944 +== chart.setBarChartBtnScale ==
7945 +
7863 7863  = Environment operation =
7864 7864  
7865 7865  (% class="wikigeneratedid" id="HGetsqliteenvironment" %)