12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112 |
- /*
- The MIT License (MIT)
- Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contributors. (https://github.com/NikolaySuslov/livecodingspace/blob/master/LICENSE.md)
- */
- /*
- * Cell widgets
- */
- class Widgets {
- constructor() {
- console.log("widget constructor")
- }
- get divider(){
- return {
- $cell: true,
- $type: "hr",
- class: "mdc-list-divider"
- }
- }
- get emptyDiv(){
- return {
- $type: "div",
- style: "padding-bottom: 30px;"
- }
- }
- get break(){
- return {
- $type: "br"
- }
- }
- get space() {
- return {
- $type: "span",
- $text: " "
- }
- }
- get p(){
- return {
- $type: "p"
- }
- }
- inputTextFieldOutlined(obj){
- function initFunc() {
- new mdc.textField.MDCTextField.attachTo(this);
- }
- let inputType = obj.type ? obj.type: 'text';
- let init = obj.init ? obj.init: initFunc;
- let style = obj.style ? obj.style: "";
- let fieldStyle = obj.fieldStyle ? obj.fieldStyle: "";
- return {
- $cell: true,
- $type: "div",
- class: "mdc-text-field mdc-text-field--outlined mdc-text-field--dense",
- style: style,
- $init: init,
- $components:[
- {
- $type: "input",
- type: inputType,
- id: obj.id,
- class: "mdc-text-field__input",
- value: obj.value,
- onchange: obj.change,
- style: obj.fieldStyle
- },
- {
- $type: "div",
- class: "mdc-notched-outline",
- $components:[
- {
- $type: "div",
- class: "mdc-notched-outline__leading"
- },
- {
- $type: "div",
- class: "mdc-notched-outline__notch",
- $components:[
- {
- $type: "label",
- class: "mdc-floating-label",
- for: obj.id,
- $text: obj.label
- }
- ]
- },
- {
- $type: "div",
- class: "mdc-notched-outline__trailing"
- }
- ]
- }
-
-
-
- ]
- //onclick: obj.onclick
- }
- }
- inputTextFieldStandart(obj){
- var propValue = obj.value;
- if (_app.helpers.testJSON(obj.value)){
- propValue = JSON.parse(obj.value);
- } else {
- propValue = obj.value;
- }
- return {
- $cell: true,
- $type: "div",
- class: "mdc-text-field text-field mdc-ripple-upgraded",
- _mdc: null,
- $init: function(){
- //new mdc.mdc.notchedOutline.MDCNotchedOutline(document.querySelector('.mdc-notched-outline'));
- this._mdc = new mdc.textField.MDCTextField.attachTo(this);
- },
- $components:[
- {
- $type: "input",
- type: "text",
- id: obj.id,
- class: "mdc-text-field__input",
- value: propValue,
- onchange: obj.change
- },
- {
- $type: "label",
- class: "mdc-floating-label",
- for: obj.id,
- $text: obj.label
- },
- {
- $type: "div",
- class: "mdc-line-ripple"
- }
-
- ]
- //onclick: obj.onclick
- }
- }
- headerH3(headertype, label, cssclass) {
- return {
- $cell: true,
- $type: headertype,
- class: cssclass,
- $text: label
- }
- }
- simpleCard(obj){
- let style = 'background-image: url(' + obj.imgSrc + '); background-size: cover; background-repeat: no-repeat; height:' + obj.imgHeight + ';';
- var addonClass = obj.addonClass;
- if (!addonClass){
- addonClass = ''
- }
- return {
- $cell: true,
- $type: "div",
- $components:[
- {
- $cell: true,
- $type: "div",
- class: "mdc-card" +' '+ addonClass,
- onclick: obj.onclickfunc,
- $components:[
- {
- $cell: true,
- $type: "section",
- class: "mdc-card__media",
- style: style
- },
- {
- $cell: true,
- $type: "section",
- class: "mdc-card__supporting-text",
- $text: obj.text
- }
- ]
- }
- ]
- }
- }
- listDivider() {
- return {
- $cell: true,
- $type: "hr",
- class: "mdc-list-divider mdc-list-divider--inset"
- }
- }
- createListItem(obj) {
- return {
- $cell: true,
- $type: "li",
- class: "mdc-list-item",
- $components: [
- {
- $cell: true,
- $type: "span",
- class: "mdc-list-item__graphic",
- $components: [
- {
- $cell: true,
- class: "createItems",
- $type: "img",
- src: obj.imgSrc,
- onclick: obj.onclickfunc
- }
- ]
- },
- {
- $cell: true,
- $type: "span",
- class: "mdc-list-item__text",
- $text: obj.title
- // $components: [
- // {
- // $text: obj.title
- // },
- // {
- // $cell: true,
- // $type: "span",
- // class: "mdc-list-item__secondary-text",
- // $text: obj.subTitle
- // }
- // ]
- }
- ]
- }
- }
- createCard(obj){
- return {
- $cell: true,
- $type: "div",
- $components:[
- {
- $cell: true,
- $type: "div",
- class: "mdc-card",
- $components:[
- {
- $cell: true,
- $type: "div",
- class: "mdc-card__horizontal-block",
- $components:[
- {
- $cell: true,
- $type: "section",
- class: "mdc-card__primary",
- $components:[
- {
- $cell: true,
- $type: "h1",
- class: "mdc-card__title mdc-card__title--large",
- $text: obj.title
- },
- {
- $cell: true,
- $type: "h2",
- class: "mdc-card__subtitle",
- $text: obj.subTitle
- }
- ]
- },
- {
-
- $cell: true,
- $type: "img",
- class: "",
- src: obj.imgSrc
-
- }
- ]
- },
- {
- $cell: true,
- $type: "section",
- class: "mdc-card__actions",
- $components:[
- {
- $cell: true,
- $type: "button",
- class: "mdc-button mdc-button--compact mdc-card__action",
- $text: obj.actionLabel
- }
- ]
- }
- ]
- }
- ]
- }
- }
- buttonStroked(obj){
- return {
- $cell: true,
- $type: "button",
- class: "mdc-button mdc-button--outlined",
- $text: obj.label,
- onclick: obj.onclick
- }
- }
- buttonRaised(obj){
- return {
- $cell: true,
- $type: "button",
- class: "mdc-button mdc-button--raised mdc-ripple-upgraded",
- $text: obj.label,
- onclick: obj.onclick
- }
- }
- buttonSimple(obj){
- return {
- $cell: true,
- $type: "button",
- class: "mdc-button",
- $components: [
- {
- $type: "span",
- class: "mdc-button__label",
- $text: obj.label
- }
- ],
- onclick: obj.onclick
- }
- }
- sliderDiscrete(obj) {
- return {
- $cell: true,
- $type: "div",
- class: "mdc-slider mdc-slider--discrete",
- role: "slider",
- 'aria-valuemin': obj.min,
- 'aria-valuemax': obj.max,
- 'aria-label': obj.label,
- $init: obj.init,
- $components: [
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__track-container",
- $components: [
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__track",
-
- }
- ]
- },
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__thumb-container",
- $components: [
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__pin",
- $components: [
- {
- $cell: true,
- $type: "span",
- class: "mdc-slider__pin-value-marker",
- }
- ]
-
- },
- {
- $cell: true,
- $type: "svg",
- class: "mdc-slider__thumb",
- width: 21,
- height: 21,
- $components: [
- {
- $cell: true,
- $type: "circle",
- cx: 10.5,
- cy: 10.5,
- r: 7.875
- }
- ]
- },
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__focus-ring"
- }
- ]
- }
- ]
- }
- }
- sliderContinuous(obj) {
- return {
- $cell: true,
- $type: "div",
- class: "mdc-slider",
- role: "slider",
- tabindex: 0,
- 'id': obj.id,
- 'aria-valuemin': obj.min,
- 'aria-valuemax': obj.max,
- 'aria-label': obj.label,
- 'aria-valuenow': obj.value,
- 'data-step': obj.step,
- $init: obj.init,
- $components: [
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__track-container",
- $components: [
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__track",
-
- }
- ]
- },
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__thumb-container",
- $components: [
- {
- $cell: true,
- $type: "svg",
- class: "mdc-slider__thumb",
- width: 21,
- height: 21,
- $components: [
- {
- $cell: true,
- $type: "circle",
- cx: 10.5,
- cy: 10.5,
- r: 7.875
- }
- ]
- },
- {
- $cell: true,
- $type: "div",
- class: "mdc-slider__focus-ring"
- }
- ]
- }
- ]
- }
- }
- textField(obj) {
- return {
- class: "mdc-text-field",
- style: "width: 100%",
- $cell: true,
- $type: "div",
- $components: [
- {
- class: "mdc-text-field__input prop-text-field-input",
- id: obj.id,
- $cell: true,
- $type: "input",
- type: "text",
- value: obj.value,
- onchange: obj.funconchange
- }
- ]
- }
- }
- icontoggle(obj) {
- var addClass = "";
- if (obj.styleClass){
- addClass = obj.styleClass;
- }
- return {
- $type: "button",
- class: addClass + " mdc-icon-button",
- //$text: obj.label,
- id: obj.id,
- //'data-toggle-on': obj.on,
- // 'data-toggle-off': obj.off,
- 'aria-pressed': obj.state,
- 'aria-hidden': true,
- $init: obj.init,
- $components:[
- {
- $type: "i",
- class: "material-icons mdc-icon-button__icon mdc-icon-button__icon--on",
- $text: JSON.parse(obj.on).content
- },
- {
- $type: "i",
- class: "material-icons mdc-icon-button__icon",
- $text: JSON.parse(obj.off).content
- },
- ]
- }
- }
- floatActionButton(obj) {
- var addClass = "";
- if (obj.styleClass){
- addClass = obj.styleClass;
- }
- return {
- $cell: true,
- $type: "button",
- class: "mdc-fab material-icons " + addClass,
- onclick: obj.onclickfunc,
- $components:[
- {
- $cell: true,
- $type: "span",
- class: "mdc-fab__icon",
- $text: obj.label
- }
- ]
- }
- }
- iconButton(obj) {
- var addClass = "";
- if (obj.styleClass){
- addClass = obj.styleClass;
- }
- return {
- $cell: true,
- $type: "button",
- class: "mdc-button " + addClass,
- onclick: obj.onclick,
- $components:[
- {
- $cell: true,
- $type: "i",
- class: "material-icons mdc-button__icon",
- $text: obj.label
- }
- ]
- }
- }
- imageButton(obj){
- return {
- $cell: true,
- $type: "button",
- class: "mdc-button mdc-button--compact",
- onclick: obj.onclickfunc,
- $components:[
- {
- $cell: true,
- class: obj.styleClass,
- $type: "img",
- src: obj.imgSrc
- }
- ]
- }
-
- }
- listTitle(obj){
- return {
- $type: "div",
- class: "mdc-layout-grid__inner",
- $components: [
- {
- $type: "div",
- class: "mdc-layout-grid__cell",
- $components: [
- {
- $type: "h3",
- class: "",
- $text: obj.text
- }
- ]
- }
- ]
- }
- }
- gridListItem(obj) {
- return {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-2 tooltip " + obj.styleClass,
- $components:[
- {
- class: "tooltiptext",
- $type: "span",
- $text: obj.title
- },
- {
- $type: "div",
- style: "background-color: transparent;",
- $components:[
- {
- class: "",
- $type: "div",
- 'aria-label': obj.title,
- alt: obj.title,
- style: "background-image: url("+ obj.imgSrc + "); background-size: cover; background-repeat: no-repeat; height: "+ obj.imgSize + "; width: " + obj.imgSize + ";",
- onclick: obj.onclickfunc,
-
- }
- ]
- }
- ]
- }
- }
- switch(obj) {
- return {
- $cell: true,
- $type: "div",
- class: "mdc-switch",
- _switch: null,
- id: obj.id,
- $init: obj.init,
- //function(){
- // new mdc.switchControl.MDCSwitch(this);
- // },
- $components: [
- {
- $type: "div",
- class: "mdc-switch__track",
- },
- {
- $type: "div",
- class: "mdc-switch__thumb-underlay",
- $components:[
- {
- $type: "div",
- class: "mdc-switch__thumb",
- $components:[
- {
- $type: "input",
- type: "checkbox",
- class: "mdc-switch__native-control",
- id: 'input-' + obj.id,
- //$init: obj.init,
- //id: "basic-switch",
- onchange: obj.onchange,
- role: "switch"
- }
- ]
- }
- ]
- }
-
- // {
- // $type: "div",
- // class: "mdc-switch__background",
- // $components: [
- // {
- // $type: "div",
- // class: "mdc-switch__knob"
- // }
- // ]
- // }
- ]
- }
- }
- connectionSettingsGUI() {
- let connectionSettings = {
- id: 'connectionSettings',
- $type: 'div',
- $components: [
- _app.widgets.emptyDiv,
- window._app.widgets.buttonRaised(
- {
- "label": 'Connection settings',
- "onclick": function (e) {
- e.preventDefault();
- window.location.pathname = '/settings';
- }
- }), _app.widgets.emptyDiv
- ]
- }
- return connectionSettings
-
- }
- reflectorGUI() {
- let webrtcConnection = {
- $cell: true,
- $components: [
- {
- $type: "p",
- class: "mdc-typography--headline5",
- $text: "Use WebRTC for connection"
- },
- {
- $type: 'p'
- },
- _app.widgets.switch({
- 'id': 'forceWebRTC',
- 'init': function () {
- this._switch = new mdc.switchControl.MDCSwitch(this);
- let config = localStorage.getItem('lcs_config');
- this._switch.checked = JSON.parse(config).webrtc;
-
- // this._replaceSwitch = this._switch;
-
- },
- 'onchange': function (e) {
-
- if (this._switch) {
- let chkAttr = this._switch.checked;//this.getAttribute('checked');
- if (chkAttr) {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.webrtc = true;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- //this._switch.checked = false;
- } else {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.webrtc = false;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- }
- }
- }
- }
- ),
- {
- $type: 'label',
- for: 'input-forceWebRTC',
- $text: 'On / Off'
- }
-
- ]
- }
- let luminaryGlobalHB = {
- $cell: true,
- _luminarySwitch: null,
- $components: [
- {
- $type: "p",
- class: "mdc-typography--headline5",
- $text: "Use Global Heartbeat"
- },
- {
- $type: 'p'
- },
- _app.widgets.switch({
- 'id': 'forceLuminary',
- 'init': function () {
- this._switch = new mdc.switchControl.MDCSwitch(this);
- let config = localStorage.getItem('lcs_config');
- this._switch.checked = JSON.parse(config).luminaryGlobalHB;
-
- // this._replaceSwitch = this._switch;
-
- },
- 'onchange': function (e) {
-
- if (this._switch) {
- let chkAttr = this._switch.checked;//this.getAttribute('checked');
- if (chkAttr) {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.luminaryGlobalHB = true;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- //this._switch.checked = false;
- } else {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.luminaryGlobalHB = false;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- }
- }
- }
- }
- ),
- {
- $type: 'label',
- for: 'input-forceLuminary',
- $text: 'On / Off'
- }
-
- ]
- }
- let luminaryFeature = {
- $type: 'div',
- _luminarySwitch: null,
- $components: [
- {
- $type: "p",
- class: "mdc-typography--headline4",
- $text: "Use Krestianstvo Luminary (experimental)"
- },
- {
- $type: 'p'
- },
- _app.widgets.switch({
- 'id': 'forceLuminary',
- 'init': function () {
- this._switch = new mdc.switchControl.MDCSwitch(this);
- let config = localStorage.getItem('lcs_config');
- this._switch.checked = JSON.parse(config).luminary;
-
- // this._replaceSwitch = this._switch;
-
- },
- 'onchange': function (e) {
-
- if (this._switch) {
- let chkAttr = this._switch.checked;//this.getAttribute('checked');
- if (chkAttr) {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.luminary = true;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- window.location.reload(true);
- //this._switch.checked = false;
- } else {
- let config = JSON.parse(localStorage.getItem('lcs_config'));
- config.luminary = false;
- localStorage.setItem('lcs_config', JSON.stringify(config));
- window.location.reload(true);
- }
- }
- }
- }
- ),
- {
- $type: 'label',
- for: 'input-forceLuminary',
- $text: 'Off / On'
- },
- _app.widgets.p
-
- ]
- }
-
- let reflectorGUI =
- {
- $type: "div",
- id: "reflectorGUI",
- //style:"background-color: #efefef",
- class: "mdc-layout-grid mdc-layout-grid--align-left",
- _reflectorHost: null,
- _dbHost: null,
- _refHostField: null,
- _dbHostField: null,
- _lpath: null,
- _lpathField: null,
- _hbpath: null,
- _hbpathField: null,
- _initData: function () {
- this._reflectorHost = '';
- this._dbHost = '';
-
- let config = JSON.parse(localStorage.getItem('lcs_config'));
-
- if (config.reflector) {
- this._reflectorHost = config.reflector
- }
- if (config.dbhost) {
- this._dbHost =config.dbhost
- }
- if (config.luminaryPath) {
- this._lpath = config.luminaryPath
- }
- if (config.luminaryGlobalHBPath) {
- this._hbpath = config.luminaryGlobalHBPath
- }
- },
- $init: function () {
- this._initData();
- },
- $update: function () {
-
- this.$components = [
- {
- $type: "div",
- class: "mdc-layout-grid__inner",
- $components: [
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "h4",
- class: "mdc-typography--headline4",
- $text: "Gun DB settings"
- }
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "span",
- class: "mdc-typography--headline5",
- $text: "DB Host: "
- },
- window._app.widgets.inputTextFieldOutlined({
- "id": 'dbhostInput',
- "label": "DB Host",
- "value": this._dbHost,
- "type": "text",
- "init": function() {
- this._dbHostField = new mdc.textField.MDCTextField(this);
- },
- "style": 'width: 400px;'
- }),
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "h4",
- class: "mdc-typography--headline4",
- $text: "Reflector settings"
- }
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "span",
- class: "mdc-typography--headline5",
- $text: "Reflector: "
- },
- window._app.widgets.inputTextFieldOutlined({
- "id": 'reflectorInput',
- "label": "Reflector",
- "value": this._reflectorHost,
- "type": "text",
- "init": function() {
- this._refHostField = new mdc.textField.MDCTextField(this);
- },
- "style": 'width: 400px;'
- }),
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [webrtcConnection ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [_app.widgets.divider]
- },
-
- // {
- // $type: "div",
- // class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- // $components: [
- // {
- // $type: "h4",
- // class: "mdc-typography--headline4",
- // $text: "Krestianstvo Luminary settings (experimental)"
- // }
- // ]
- // },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- luminaryFeature
- ]
- },
-
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "span",
- class: "mdc-typography--headline5",
- $text: "Luminary Path: "
- },
- window._app.widgets.inputTextFieldOutlined({
- "id": 'lpathInput',
- "label": "Luminary Path",
- "value": this._lpath,
- "type": "text",
- "init": function() {
- this._lpathField = new mdc.textField.MDCTextField(this);
- },
- "style": 'width: 400px;'
- }),
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- {
- $type: "span",
- class: "mdc-typography--headline5",
- $text: "Global Heartbeat Path: "
- },
- window._app.widgets.inputTextFieldOutlined({
- "id": 'hbpathInput',
- "label": "Global Heartbeat Path",
- "value": this._hbpath,
- "type": "text",
- "init": function() {
- this._hbpathField = new mdc.textField.MDCTextField(this);
- },
- "style": 'width: 400px;'
- }),
- ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [luminaryGlobalHB ]
- },
- {
- $type: "div",
- class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
- $components: [
- window._app.widgets.buttonRaised(
- {
- "label": 'Update',
- "onclick": function (e) {
- e.preventDefault();
-
- let config = JSON.parse(localStorage.getItem('lcs_config'));
-
- config.reflector = this._refHostField.value;
- config.dbhost = this._dbHostField.value;
- config.luminaryPath = this._lpathField.value;
- config.luminaryGlobalHBPath = this._hbpathField.value;
-
- localStorage.setItem('lcs_config', JSON.stringify(config));
- window.location.reload(true);
- }
- }),
- {
- $type: 'span',
- $text: " "
- },
- {
- $type: "button",
- class: "mdc-button mdc-button--raised",
- $text: "Close",
- onclick: function (e) {
- window.location.pathname = '/'
- }
- }
- ]
- }
-
- ]
- }
- ]
- }
-
- }
-
- document.querySelector("#appGUI").$cell({
- id: "appGUI",
- $cell: true,
- $type: "div",
- $components: [reflectorGUI]
- }
- );
-
- }
- }
- export { Widgets }
|