瀏覽代碼

Made things a bit cleaner

master
Ludovic 'Archivist' Lagouardette 3 年之前
父節點
當前提交
9ce58d42ae
共有 2 個檔案被更改,包括 5 行新增3 行删除
  1. +4
    -2
      scripts/my_func.lua
  2. +1
    -1
      src/app/button.ecr

+ 4
- 2
scripts/my_func.lua 查看文件

@ -2,12 +2,14 @@ function run_event(name)
print("run " .. name)
if(name == "archivist") then
Business.fetch_add(10)
else
elseif(name == "reset") then
Business.fetch_add(-Business.fetch_add(0))
else
Business.fetch_add(1)
end
end
function display_event(name)
print("display " .. name)
return Business.fetch_add(0)
return tostring(Business.fetch_add(0))
end

+ 1
- 1
src/app/button.ecr 查看文件

@ -2,7 +2,7 @@
<html>
<head></head>
<body>
<div> <%= display_event.as(Lua::Function).call(name).as(Float64).to_i32!; %> </div>
<div> <%= display_event.as(Lua::Function).call(name).as(String); %> </div>
<form method="POST" action=<%= "/"+name %>>
<input type="submit" value="Go">
</form>

Loading…
取消
儲存