and using the server loadavg code I wrote and have been adding gauges. All is great so far, and I'm loving JET, but have ran into an issue.
Here is the loadavg.js code:
Code:
/**
* @license
* Copyright (c) 2014, 2018, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
/*
* Your incidents ViewModel code goes here
*/
define([
"ojs/ojcore",
"knockout",
"jquery",
"text!data/data.json",
"ojs/ojknockout",
"ojs/ojvalidation-number",
"ojs/ojgauge",
"ojs/ojchart"
], function(oj, ko, $, file) {
function UnixViewModel() {
var self = this;
self.load1 = ko.observable(0);
self.load5 = ko.observable(0);
self.load15 = ko.observable(0);
self.lable1 = { text: "1min" };
self.lable5 = { text: "5min" };
self.lable15 = { text: "15min" };
self.allprocs = ko.observable(0);
self.alltheprocs = ko.observable(0);
self.activeprocs = ko.observable(0);
self.lastpid = ko.observable(0);
self.customSvgStyle = { fill: "url(" + document.URL + "#pattern)" };
self.val = ko.observable("pie");
self.select = ko.observable("bar");
setInterval(function() {
var query = { loadavg: "1" };
$.getJSON("https://www.unix.com/ojet.php", query, function(json) {
// console.log(JSON.stringify(json));
var n = 0;
$.each(json, function(key, val) {
n++;
switch (n) {
case 1:
self.load1(parseFloat(val));
break;
case 2:
self.load5(parseFloat(val));
break;
case 3:
self.load15(parseFloat(val));
break;
case 4:
var vals = val.split("/");
var active = Math.round(parseInt(vals[0]));
var all = Math.round(parseInt(vals[1]));
self.allprocs(val);
self.activeprocs(active);
self.alltheprocs(all);
break;
case 5:
self.lastpid(parseInt(val));
break;
default:
}
// console.log("success items " + items.length + " " + val);
});
})
// self.datasource = ko.observableArray(items);
.done(function() {
//console.log("second success");
})
.fail(function() {
console.log("error");
})
.always(function() {
//console.log("complete");
});
}, 1000);
var data = JSON.parse(file);
self.datasource = ko.observableArray(data);
// Below are a set of the ViewModel methods invoked by the oj-module component.
// Please reference the oj-module jsDoc for additional information.
/**
* Optional ViewModel method invoked after the View is inserted into the
* document DOM. The application can put logic that requires the DOM being
* attached here.
* This method might be called multiple times - after the View is created
* and inserted into the DOM and after the View is reconnected
* after being disconnected.
*/
self.connected = function() {
// Implement if needed
};
/**
* Optional ViewModel method invoked after the View is disconnected from the DOM.
*/
self.disconnected = function() {
//console.log(" self.disconnected = function()");
// Implement if needed
};
/**
* Optional ViewModel method invoked after transition to the new View is complete.
* That includes any possible animation between the old and the new View.
*/
self.transitionCompleted = function() {
// Implement if needed
};
}
/*
* Returns a constructor for the ViewModel so that the ViewModel is constructed
* each time the view is displayed. Return an instance of the ViewModel if
* only one instance of the ViewModel is needed.
*/
return new UnixViewModel();
});
Hi guys, I have a problem with installing new Solaris servers via jet/jumpstart (tried both).
I`ve configured server, created profile for a client, issued
{1} boot net -v install
and went to get some cofee...
After I came back, client was able to load system from server, get IP and,... (4 Replies)
Hi guys,
I would like to install a Jet-Server into a non-global zone and i'm running in the nfs problem (there is no nfs-server implementation for non-global zones)
has anyone done this already? or have a workaround?
thx
---------- Post updated at 05:03 AM ---------- Previous update... (0 Replies)
This is a video well worth watching if you have any interests at all in the future of web development, web development frameworks and Javascript.
https://www.youtube.com/watch?v=V8mhIEeTMCc
.
Fixed typo in Oracle Jet URL (oraclejet.org) (0 Replies)
Working on LP: 10. Lesson 1: Oracle JET 4.x - Lesson 1 - Part 4: Data Binding in this Oracle JET online course - Soar higher with Oracle JavaScript Extension Toolkit (JET), I have created this code for incidents.js
I cannot get the load average data in this Oracle JET test to update the... (4 Replies)
Oracle JET is marketed as a kind of "anti-framework" approach to web development but from my experience Oracle JET is just another type of framework. So, I would describe JET as "a meta-framework" because JET is a framework that is built to import and use other frameworks and Javascript... (4 Replies)
Creating a Simple Linux Dashboard with Oracle Jet - Part 1 the Server Side PHP Code
Creating a simple Linux dashboard with Oracle Jet is easy and fun. It's simple to create a dashboard to monitor your Linux server using Oracle JET. The sky is the limit with indicators and gauges.
... (7 Replies)