calc ram option value from daemon option

This commit is contained in:
Peter Hormanns 2024-10-21 15:34:34 +02:00
parent ca9215d5a1
commit 42dec2b87d
4 changed files with 34 additions and 24 deletions

View File

@ -1,19 +1,2 @@
INSERT INTO component ( basepacket_id, basecomponent_id, admin_only, article_number, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity )
ALTER TABLE domain SELECT basepacket_id, basecomponent_id, false, 1023, 128, 10240, 128, 64, 0 from basepacket, basecomponent where basepacket_code='PAC/WEB' and basecomponent_code='RAM';
ADD COLUMN passenger_python character varying(256) DEFAULT '/usr/bin/python3',
ADD COLUMN passenger_nodejs character varying(256) DEFAULT '/usr/bin/node',
ADD COLUMN passenger_ruby character varying(256) DEFAULT '/usr/bin/ruby',
ADD COLUMN fcgi_php_bin character varying(256) DEFAULT '/usr/lib/cgi-bin/php';
INSERT INTO domain_option (domain_option_name) VALUES
('passenger'),
('passengerfriendlyerrorpages'),
('cgi'),
('fastcgi');
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='cgi' ), domain_id FROM domain;
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='fastcgi' ), domain_id FROM domain;
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='passenger' ), domain_id FROM domain;

View File

@ -5,7 +5,7 @@
<groupId>de.hsadmin</groupId> <groupId>de.hsadmin</groupId>
<artifactId>hsar</artifactId> <artifactId>hsar</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>4.0.15</version> <version>4.0.16</version>
<name>HSAdmin Stable Backend Webapp</name> <name>HSAdmin Stable Backend Webapp</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<properties> <properties>
@ -36,12 +36,12 @@
<dependency> <dependency>
<groupId>de.hsadmin.core</groupId> <groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-util</artifactId> <artifactId>hsadmin-util</artifactId>
<version>4.0.15</version> <version>4.0.16</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>de.hsadmin.core</groupId> <groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-qserv</artifactId> <artifactId>hsadmin-qserv</artifactId>
<version>4.0.15</version> <version>4.0.16</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>

View File

@ -200,6 +200,19 @@ public class JsonPillarServlet extends HttpServlet {
int storage = pacStorage.getQuantity(); int storage = pacStorage.getQuantity();
writer.println(" , \"storage\": " + storage); writer.println(" , \"storage\": " + storage);
} }
final PacComponent pacDaemons = pac.getPacComponent("DAEMON");
int daemon = 0;
int ram = 16;
if (pacDaemons != null && pacDaemons.getQuantity() > 0) {
daemon = pacDaemons.getQuantity();
ram = daemon * 640;
}
writer.println(" , \"daemon\": " + daemon);
final PacComponent pacRAM = pac.getPacComponent("RAM");
if (pacRAM != null) {
ram = pacRAM.getQuantity();
}
writer.println(" , \"ram\": " + ram);
final PacComponent pacOffice = pac.getPacComponent("OFFICE"); final PacComponent pacOffice = pac.getPacComponent("OFFICE");
if (pacOffice != null) { if (pacOffice != null) {
int office = pacOffice.getQuantity(); int office = pacOffice.getQuantity();

View File

@ -1,5 +1,9 @@
<Context path="/hsar" reloadable="true" crossContext="true"> <Context path="/hsar" reloadable="true" crossContext="true">
<Valve className="org.apache.catalina.valves.ErrorReportValve"
showReport="false"
showServerInfo="false" />
<ResourceLink <ResourceLink
name="jdbc/HSAdminDB" name="jdbc/HSAdminDB"
global="jdbc/HSAdminDB" global="jdbc/HSAdminDB"
@ -11,8 +15,18 @@
type="javax.jms.QueueConnectionFactory"/> type="javax.jms.QueueConnectionFactory"/>
<ResourceLink <ResourceLink
name="jms/hsadminSystem-h99" name="jms/hsadminSystem-h96"
global="jms/hsadminSystem-h99" global="jms/hsadminSystem-h96"
type="javax.jms.Queue"/>
<ResourceLink
name="jms/hsadminSystem-h97"
global="jms/hsadminSystem-h97"
type="javax.jms.Queue"/>
<ResourceLink
name="jms/hsadminSystem-h98"
global="jms/hsadminSystem-h98"
type="javax.jms.Queue"/> type="javax.jms.Queue"/>
<ResourceLink <ResourceLink