Skip to content

Commit

Permalink
fix code prod
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMi37 committed Sep 15, 2023
1 parent ae713c9 commit 522f17c
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 22 deletions.
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Document name="apptools-django.ZPM">
<Module>
<Name>apptools-django</Name>
<Version>1.2.1</Version>
<Version>1.2.2</Version>
<Description>Application tools for technical support and DBMS administrator use Django</Description>
<Packaging>module</Packaging>
<Keywords>Application tools admin</Keywords>
Expand Down
13 changes: 7 additions & 6 deletions src/cls/apptools/core/sys.cls
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,15 @@ ClassMethod IndGetRows(gn, ByRef FieldsValue, ByRef out) As %Status
ClassMethod SetTableHeader(gn = "^mtempSQLGN", arg...) As %String
{
set @gn@(-3,"timestamp")=$lb($$$AppDT($h))
zw arg
if $d(arg(1))>9 {
for i=1:1 quit:'$d(arg(1,i),data) do SetCol(i,data)
for i=1:1 quit:'$d(arg(1,i),data) do SetCol(gn,data,i)
}
else {
for i=1:1 quit:'$d(arg(i),data) do SetCol(i,data)
for i=1:1 quit:'$d(arg(i),data) do SetCol(gn,data,i)
}
quit $$$OK
SetCol(i,data)
SetCol(gn,data,i)
set @gn@(0)=$g(@gn@(0))_$lb(data)
set @gn@(-1,$ZStrip(data,"<>WCP"))=i //Name = Number
quit
Expand All @@ -421,13 +422,13 @@ ClassMethod SetTableRow(gn = "^mtempSQLGN", row, arg...) As %String
{
set @gn@(row)=""
if $d(arg(1))>9 {
for i=1:1 quit:'$d(arg(1,i),data) do SetRow(row,i,data)
for i=1:1 quit:'$d(arg(1,i),data) do SetRow(gn,row,data)
}
else {
for i=1:1 quit:'$d(arg(i),data) do SetRow(row,i,data)
for i=1:1 quit:'$d(arg(i),data) do SetRow(gn,row,data)
}
quit $$$OK
SetRow(row,i,data)
SetRow(gn,row,data)
set @gn@(row)=$g(@gn@(row))_$lb(data)
quit
}
Expand Down
65 changes: 61 additions & 4 deletions src/cls/apptools/core/telebot.cls
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,36 @@ ClassMethod GetPortal(arg = "", js) As %String
set js=..GetResp(arg)
try {
if 'js.django.authenticated quit
set gn="^||tmpPortal"
set gn="^||tmp"
set %Param=js.django.arg
if %Param["iditem=" {
;do ##class(apptools.core.telebot).GetPortalNS(0,gn,"Namespaces"," ")
set js.title=" by "_%Param
set iditem=$p(%Param,"iditem=",2)
set data=##class(apptools.core.telebot).AddIdItem(,,iditem)
set method=$lg(data,1),id=$lg(data,2)
set js.title=" by "_method_", " _id
set js.draw="Form for "_%Param
quit
}
set js.prod={}
set js.prod.count=##class(apptools.core.telebot).GetPortalProd(0,gn)

set js.proc={}
set js.proc.count=##class(apptools.core.telebot).GetPortalProc(1,gn)

set js.lock={}
set js.lock.count=##class(apptools.core.telebot).GetPortalLock(1,gn)

set js.db={}
set js.db.count=##class(apptools.core.telebot).GetPortalNS(1,gn,"Databases")

set js.ns={}
set js.ns.count=##class(apptools.core.telebot).GetPortalNS(1,gn,"Namespaces")

set js.alerts={}
do ##class(%SYSTEM.Monitor).GetAlerts(,.str,.last)
set st=$o(str(""),-1)
set js.alerts.count=+st
kill @gn
if %Param["Namespaces" {
do ##class(apptools.core.telebot).GetPortalNS(0,gn,"Namespaces"," ")
}
Expand All @@ -115,6 +125,9 @@ ClassMethod GetPortal(arg = "", js) As %String
elseif %Param["Process" {
do ##class(apptools.core.telebot).GetPortalProc(0,gn)
}
elseif %Param["Products" {
do ##class(apptools.core.telebot).GetPortalProd(1,gn)
}
elseif %Param["Locktab" {
do ##class(apptools.core.telebot).GetPortalLock(0,gn)
}
Expand Down Expand Up @@ -153,6 +166,49 @@ ClassMethod GetPortalLock(count, gn) As %String
quit 0
}

/// do ##class(apptools.core.telebot).GetPortalProd(1,"^tmpNSoutpot"," ")
ClassMethod GetPortalProd(count, gn, %Param = " ") As %String
{
new $namespace
set $namespace= "%SYS"
if count=0 {
quit ..GetPortalProds(0)
}
d ..GetPortalProds(1,gn)
set %AppLogInfoTemp("colomn")="NameSpace____ProductName",%AppLogInfoTemp("method")="Products"
set %exec="##class(apptools.core.telebot).AddUrl(.%AppLogInfoVal, .%AppLogInfoCol, .%AppLogInfoHead, .%AppLogInfoTemp)"
set run="set st=##class(apptools.core.LogInfoPane).DrawSQL(""r "_gn_""",10000,$zu(5),%Param,%exec,,"""")"
do ##class(apptools.core.sys).Run2Spool(run,gn)
quit 0
}

/// do ##class(apptools.core.telebot).GetPortalProds(1,"^tmpNSoutpot"," ")
ClassMethod GetPortalProds(count, gn, %Param = " ") As %String
{
new $namespace
set listns=##class(apptools.core.sys).ListNS(.inf,"NotPref,Ens")
;do ##class(apptools.core.Production).EnsAction("info",,.out)
set i="",coun=0
do:count ##class(apptools.core.sys).SetTableHeader(gn,"NameSpace____ProductName","Status")
for { set i=$o(inf(i)) quit:i=""
if $d(inf(i,"Ens")) {
set $namespace= i
set p=""
for { set p=$o(inf(i,"Ens",p)) quit:p=""
set coun=coun+1
if count {
Set sc = ##class(Ens.Director).GetProductionStatus(p,.Stat)
s stat=$s(Stat=1:"Running",Stat=2:"Stopped",Stat=3:"Suspended",Stat=4:"Troubled",1:"?")
do ##class(apptools.core.sys).SetTableRow(gn,coun,i_"____"_p,stat)

}
}
}
}
do:count ##class(apptools.core.sys).SetTableFooter(gn)
quit coun
}

/// do ##class(apptools.core.telebot).GetPortalProc(1,"^tmpNSoutpot","Namespaces"," ")
ClassMethod GetPortalProc(count, gn, SectionHeader = "Namespaces", %Param = " ") As %String
{
Expand Down Expand Up @@ -191,12 +247,13 @@ ClassMethod AddUrl(Val, Col, Head, Temp, Del = 0) As %String
}

/// Procedure for ##class(apptools.core.telebot).AddIdItem("temp",123)
ClassMethod AddIdItem(method, id) As %String
ClassMethod AddIdItem(method = "", id = "", iditem = "") As %String
{
set gn=$na(@..#GN@(+$h))
set gnn=$na(@..#GN@($h-1))
if $d(@gnn) KILL @gnn set @gn=+$h
if '$d(@gn) set @gn=+$h ;init node new day
if iditem, $d(@gn@(iditem),data) quit data
set item=$i(@gn)
set @gn@(item)=$lb(method,id)
quit item
Expand Down
4 changes: 2 additions & 2 deletions templates/inc/inc-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{% else %}
<!--{{iris_footer}}-->
<span class="text-muted"> | <a href="/iris_mp/">Iris Portal</a> </span>
<span class="text-muted"> | <a target="_blank" href="/iris_info/">iris_info</a> </span>
<span class="text-muted"> | <a target="_blank" href="/iris_alerts/">iris_alerts</a> </span>
<!--<span class="text-muted"> | <a target="_blank" href="/iris_info/">iris_info</a> </span>
<span class="text-muted"> | <a target="_blank" href="/iris_alerts/">iris_alerts</a> </span>-->
<span class="text-muted">
<a target="_blank" href="{{ iris_footer.url }}> {{ iris_footer.ver }} </a> </span>
{% for enum in iris_footer.apps %}
Expand Down
29 changes: 20 additions & 9 deletions templates/pages/iris_mp.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,47 @@ <h1>{{ pagename }}</h1>
</div>
<div class="row">
<div class="col-sm-4"><h3>{% trans 'View Messages Log' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Alerts"> {% trans 'Alerts' %}: {{ iris_portal.alerts.count }} </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Alerts"> {% trans 'Alerts' %}: <b>{{ iris_portal.alerts.count }} </b> </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Messages"> {% trans 'Messages' %}: {{ iris_portal.mess.count }} </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Namespaces' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Namespaces">{% trans 'Quantity' %}: {{ iris_portal.ns.count }} </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Namespaces">{% trans 'Quantity' %}:<b> {{ iris_portal.ns.count }} </b> </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Database' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Databases">{% trans 'Quantity' %}: {{ iris_portal.db.count }} </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Databases">{% trans 'Quantity' %}:<b> {{ iris_portal.db.count }} </b></a> </span>
</div>
</div>
<div class="row">
<div class="col-sm-4"><h3>{% trans 'LockTab' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Locktab">{% trans 'Quantity' %}: {{ iris_portal.lock.count }} </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Locktab">{% trans 'Quantity' %}:<b> {{ iris_portal.lock.count }} </b></a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Products' %}</h3>
{% trans 'Quantity' %}: {{ iris_portal.process.count }}
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Products">{% trans 'Quantity' %}:<b> {{ iris_portal.prod.count }} </b></a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Web Application' %}</h3>
{% trans 'Quantity' %}: {{ iris_portal.process.count }}
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Apps">{% trans 'Quantity' %}:<b> {{ iris_portal.apps.count }} </b></a> </span>
</div>
</div>
<div class="row">
<div class="col-sm-4"><h3>{% trans 'Users' %}</h3>
{% trans 'Quantity' %}: {{ iris_portal.process.count }}
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Users">{% trans 'Quantity' %}:<b> {{ iris_portal.users.count }} </b> </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Roles' %}</h3>
{% trans 'Quantity' %}: {{ iris_portal.process.count }}
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Roles">{% trans 'Quantity' %}:<b> {{ iris_portal.roles.count }} </b> </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Process' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Process">{% trans 'Quantity' %}: {{ iris_portal.proc.count }} </a> </span>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Process">{% trans 'Quantity' %}:<b> {{ iris_portal.proc.count }} </b> </a> </span>
</div>
</div>
<div class="row">
<div class="col-sm-4"><h3>{% trans 'Services' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Serv">{% trans 'Quantity' %}: {{ iris_portal.serv.count }} </b> </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Resources' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Resours">{% trans 'Quantity' %}: {{ iris_portal.resours.count }} </b> </a> </span>
</div>
<div class="col-sm-4"><h3>{% trans 'Tasks' %}</h3>
<span class="text-muted"> <a href="/iris_mp_list/?mp_context=Tasks">{% trans 'Quantity' %}: {{ iris_portal.tasks.count }} </b> </a> </span>
</div>
</div>
</div>
Expand Down

0 comments on commit 522f17c

Please sign in to comment.