require('./model');
require('./resource');
import { BaseViewModel } from '../master/baseViewModel.js';

export function OnlineUserViewModel() {
    var self = this;
    self.init = function () {
        self.fillTableProperties();
        self.getRecords();
    };
    ko.utils.extend(self, new BaseViewModel({
        entityName: "OnlineUser",
        getList: true,
        apiService: {
            actionList: ["filterby"]
        },
        buttons: [
            { name: 'help', access: false, cMenu: false },
            { name: 'refresh', access: false, cMenu: false },
            { name: 'tools', access: false, cMenu: false }
        ],
        sortDirection: "Ascending",
        sortProperty: "userId",
        context: self,
        cols: onlineuserModelRes,
        searchKeyType: "enter",
        saveState: true,
        selectRow: false,
        contextMenu: false,
        resizable: true
    }));
    self.btnVisibility = ko.computed(function () {
        self.vishelp(true);
        self.visrefresh(true);
        self.vistools(true);
    });
}
