forked from DigitalBox98/SimpleExtJSApp
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90dd192
commit 5632759
Showing
4 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
// Namespace definition | ||
Ext.ns('SYNOCOMMUNITY.RRManager'); | ||
|
||
// Translator | ||
_V = function (category, element) { | ||
return _TT("SYNOCOMMUNITY.RRManager.Widget", category, element) | ||
} | ||
|
||
Ext.ns("SYNO.SDS.SystemInfoApp"); | ||
|
||
Ext.define("SYNOCOMMUNITY.RRManager.Widget", { | ||
extend: "Ext.Panel", | ||
minimizable: true, | ||
taskButton: undefined, | ||
constructor: function constructor(a) { | ||
this.initializeSouthTable(); | ||
var b = Ext.apply(this.getConfig(), a); | ||
SYNOCOMMUNITY.SimpleExtJSApp.WidgetCustom.superclass.constructor.call(this, b); | ||
this.westIcon = this.getIconComponent(); | ||
this.centerContent = this.getContentComponent(); | ||
this.isActive = false; | ||
this.timestamp = null; | ||
this.uptime = null; | ||
this.appSetting = SYNO.SDS.SystemInfoApp.SystemHealthDefaultApp | ||
}, | ||
getConfig: function getConfig() { | ||
return { | ||
layout: "fit", | ||
border: false, | ||
defaults: { | ||
border: false | ||
}, | ||
items: [this.getViewConfig()] | ||
} | ||
}, | ||
getViewConfig: function getViewConfig() { | ||
return { | ||
itemId: "layoutPanel", | ||
layout: "vbox", | ||
height: "100%", | ||
border: false, | ||
padding: "4px 12px 5px 12px", | ||
cls: "syno-sysinfo-system-health", | ||
defaults: { | ||
border: false | ||
}, | ||
items: [{ | ||
xtype: "container", | ||
itemId: "northPanel", | ||
height: 20, | ||
width: 296, | ||
cls: "syno-sysinfo-system-health-status", | ||
items: [{ | ||
xtype: "box", | ||
itemId: "westIcon" | ||
}, { | ||
xtype: "box", | ||
itemId: "centerContent", | ||
region: "center" | ||
}] | ||
}, { | ||
region: "south", | ||
height: 84, | ||
width: 296, | ||
items: this.southTable | ||
}] | ||
} | ||
}, | ||
doCollapse: function doCollapse() { | ||
this.getEl().setHeight(84); | ||
this.doLayout() | ||
}, | ||
doExpand: function doExpand() { | ||
this.getEl().setHeight(172); | ||
this.doLayout() | ||
}, | ||
setApp: function setApp(a) { | ||
this.appSetting = a | ||
}, | ||
|
||
getIconComponent: function getIconComponent() { | ||
return this.getComponent("layoutPanel").getComponent("northPanel").getComponent("westIcon") | ||
}, | ||
getContentComponent: function getContentComponent() { | ||
return this.getComponent("layoutPanel").getComponent("northPanel").getComponent("centerContent") | ||
}, | ||
onClickTitle: function onClickTitle() { | ||
SYNO.SDS.AppLaunch(this.appSetting.appInstance, this.appSetting.launchParam) | ||
}, | ||
onActivate: function onActivate() { | ||
this.isActive = true; | ||
}, | ||
onDeactivate: function onDeactivate() { | ||
this.isActive = false; | ||
this.unmask() | ||
}, | ||
mask: Ext.emptyFn, | ||
unmask: Ext.emptyFn, | ||
initializeSouthTable: function initializeSouthTable() { | ||
var b = Ext.util.Format.htmlEncode(_V("widget", "message")); | ||
var c = Ext.util.Format.htmlEncode(_S("hostname")); | ||
this.southTable = new Ext.Panel({ | ||
layout: "table", | ||
itemId: "southTable", | ||
cls: "sys-info-south-table", | ||
margins: 0, | ||
height: 84, | ||
layoutConfig: { | ||
columns: 2, | ||
cellCls: "sys-info-row" | ||
}, | ||
items: [{ | ||
xtype: "box", | ||
html: String.format('<p ext:qtip="{1}" class="syno-sysinfo-system-health-south-title">{0}</p>', b, Ext.util.Format.htmlEncode(b)) | ||
}, { | ||
xtype: "box", | ||
html: String.format('<p ext:qtip="{1}" class="syno-sysinfo-system-health-south-data">{0}</p>', c, Ext.util.Format.htmlEncode(c)) | ||
}] | ||
}) | ||
}, | ||
|
||
destroy: function destroy() { | ||
var a = this; | ||
a.onDeactivate(); | ||
if (a.taskButton) { | ||
Ext.destroy(a.taskButton) | ||
} | ||
if (a.southGrid && a.southGrid.getStore()) { | ||
a.southGrid.getStore().destroy() | ||
} | ||
SYNOCOMMUNITY.RRManager.Widget.superclass.destroy.call(this) | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,6 @@ col_version="Verison" | |
col_name="Name" | ||
col_description="Description" | ||
|
||
|
||
[widget] | ||
message="Hello world!" |