Skip to content

Commit 8805aae

Browse files
committed
Various small updates
1 parent 36e3c69 commit 8805aae

File tree

13 files changed

+307
-11
lines changed

13 files changed

+307
-11
lines changed

src/adabas/admin.ts

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const AdminCommands = [
4848
{ command: "gcb", path: [] },
4949
{ command: "cluster", path: [] },
5050
{ command: "tcp", path: [] },
51+
{ command: "plog", path: ["PLOG"] },
5152
]
5253

5354

@@ -167,6 +168,25 @@ export class AdabasAdmin {
167168
commandStats(): Promise<any> {
168169
return triggerCallCommandArray(this.status.Dbid, 6);
169170
}
171+
commandStatsReset(): Promise<any> {
172+
const getConfig = {
173+
headers: authHeader("application/json"),
174+
useCredentails: true,
175+
};
176+
try {
177+
return axios
178+
.delete(config.Url() + "/adabas/database/" + this.status.Dbid+"/commandstats", getConfig);
179+
}
180+
catch (error: any) {
181+
if (error.response) {
182+
if (error.response.status == 401 || error.response.status == 403) {
183+
userService.logout();
184+
location.reload();
185+
}
186+
}
187+
throw error;
188+
}
189+
}
170190
// Provide the current monitor I/O statistics and the number of call per second
171191
monitor(): Promise<any> {
172192
return triggerCallCommand(this.status.Dbid, 7);
@@ -221,7 +241,23 @@ export class AdabasAdmin {
221241
async adatcp(): Promise<any> {
222242
return triggerCallCommand(this.status.Dbid, 15);
223243
}
224-
// Delete the given Adabas file number (all data is removed as well)!!
244+
// Get the PLOG stats of the Adabas database
245+
plogstats(): Promise<any> {
246+
return triggerCallCommand(this.status.Dbid, 16);
247+
}
248+
feofplog(): Promise<any> {
249+
const getConfig = {
250+
headers: authHeader("application/json"),
251+
useCredentails: true,
252+
};
253+
return axios
254+
.post(config.Url() + "/adabas/database/"
255+
+ this.status.Dbid + ":feofplog", {}, getConfig)
256+
.catch((error: any) => {
257+
console.log("Error "+JSON.stringify(error));
258+
});
259+
}
260+
// Delete the given Adabas file number (all data is removed as well)!!
225261
async deleteFile(file: number): Promise<any> {
226262
const getConfig = {
227263
headers: authHeader("application/json"),
@@ -401,6 +437,26 @@ export class AdabasAdmin {
401437
});
402438
return highwater;
403439
}
440+
// Retrieve current Adabas Highwater mark information
441+
async highWaterMarkReset(): Promise<any> {
442+
const getConfig = {
443+
headers: authHeader("application/json"),
444+
useCredentails: true,
445+
};
446+
try {
447+
return axios
448+
.delete(config.Url() + "/adabas/database/" + this.status.Dbid+"/hwm", getConfig);
449+
}
450+
catch (error: any) {
451+
if (error.response) {
452+
if (error.response.status == 401 || error.response.status == 403) {
453+
userService.logout();
454+
location.reload();
455+
}
456+
}
457+
throw error;
458+
}
459+
}
404460
// Retrieve a list of checkpoints in the database in an given time frame
405461
checkpoints(from: string, to: string): Promise<any> {
406462
return triggerCallOnArray("/adabas/database/" + this.status.Dbid + "/checkpoints?end_time=" + to + "&start_time=" + from, ["Checkpoints"]);

src/admin_views/DatabasePlog.vue

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!--
2+
* Copyright (c) 2020 Software AG (http://www.softwareag.com/)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.-->
15+
16+
<template>
17+
<div class="databaseplog">
18+
<MyHeader></MyHeader>
19+
<DatabasePlogStat :url="url" />
20+
</div>
21+
</template>
22+
23+
<script lang="ts">
24+
import { Component, Prop, Vue } from 'vue-property-decorator';
25+
import MyHeader from '@/components/Header.vue';
26+
import DatabasePlogStat from '@/components/DatabasePlogStat.vue';
27+
28+
@Component({
29+
components: {
30+
MyHeader,
31+
DatabasePlogStat,
32+
},
33+
})
34+
export default class DatabasePlog extends Vue {
35+
@Prop(String) readonly url: string | undefined;
36+
}
37+
</script>

src/components/CommandstatsData.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<b-col>
1919
<Url :url="'/adabas/database/' + url + '/cmdstats'" />
2020
</b-col>
21+
<b-col class="text-right">
22+
<b-button v-on:click="resetCommands()">Reset</b-button>
23+
</b-col>
2124
</b-row>
2225
<b-row>
2326
<b-col sm="4" class="h-100 p-1">
@@ -202,6 +205,13 @@ export default defineComponent({
202205
clearInterval(timer);
203206
timer = null;
204207
});
208+
function resetCommands() {
209+
if (!db || db==null) {
210+
db = SearchDatabases(props.url);
211+
return;
212+
}
213+
db.commandStatsReset();
214+
};
205215
function loadCommandStat() {
206216
if (!db || db==null) {
207217
db = SearchDatabases(props.url);
@@ -230,6 +240,7 @@ export default defineComponent({
230240
doughnutChartRef,
231241
barChartProps,
232242
barChartRef,
243+
resetCommands,
233244
imgData,
234245
};
235246
},

src/components/DatabaseInfos.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import { SearchDatabases } from '@/adabas/admin';
6969
ErrorModal,
7070
},
7171
})
72-
export default class ParameterList extends Vue {
72+
export default class DatabaseInfos extends Vue {
7373
@Prop(String) readonly url: string | undefined;
7474
@Provide() type = 'static';
7575
data() {

src/components/DatabaseList.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@
3535
<b-col> <CreateDatabase /> </b-col>
3636
</b-row>
3737
<b-row
38-
><b-col sm="4">
38+
><b-col sm="10">
3939
<b-pagination
4040
v-model="currentPage"
4141
:total-rows="databases.length"
4242
:per-page="perPage"
4343
aria-controls="my-table"
4444
></b-pagination>
4545
</b-col>
46-
<b-col sm="8">
46+
<b-col sm="2">
47+
<b-form-select v-model="perPage" :options="perPageOptions" size="sm" class="mt-3"></b-form-select>
48+
</b-col></b-row>
49+
<b-row>
50+
<b-col>
4751
<b-form-group
4852
label="Filter"
4953
label-cols-sm="3"
@@ -236,6 +240,13 @@
236240
>
237241
Activity
238242
</b-dropdown-item>
243+
<b-dropdown-item
244+
size="sm"
245+
:to="'/plogstat/' + row.item.status.Dbid"
246+
class="mr-2"
247+
>
248+
PLOG
249+
</b-dropdown-item>
239250
<b-dropdown-item
240251
size="sm"
241252
:to="'/threadtable/' + row.item.status.Dbid"
@@ -341,6 +352,7 @@ export default class DatabaseList extends Vue {
341352
return {
342353
perPage: 10,
343354
currentPage: 1,
355+
perPageOptions: [10,20,50,100],
344356
filter: '',
345357
filterOn: [],
346358
fields: [
@@ -425,6 +437,7 @@ export default class DatabaseList extends Vue {
425437
'SET_STATUS',
426438
'Error calling' + operation + ':' + JSON.stringify(error),
427439
);
440+
router.push('/nuclog/' + dbid.dbid());
428441
});
429442
}
430443
/*

src/components/DatabasePlogStat.vue

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<!--
2+
* Copyright (c) 2020 Software AG (http://www.softwareag.com/)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.-->
15+
16+
<template>
17+
<div class="databaseplogstats p-2">
18+
<Sidebar :url="url" />
19+
<b-card
20+
:header="'Adabas Database PLOG information for database ' + url"
21+
border-variant="secondary"
22+
header-border-variant="secondary"
23+
>
24+
<b-card-body>
25+
<b-row>
26+
<b-col>
27+
<Url url="/adabas/database" />
28+
</b-col>
29+
<b-col class="text-right">
30+
<b-button v-on:click="forceFEOF()">Force EOF</b-button>
31+
</b-col>
32+
</b-row>
33+
<b-row>
34+
<b-table
35+
class="w-100 p-3"
36+
striped
37+
bordered
38+
hover
39+
small
40+
:items="infos"
41+
:fields="fields"
42+
></b-table>
43+
</b-row>
44+
</b-card-body>
45+
</b-card>
46+
<StatusBar />
47+
<ErrorModal />
48+
</div>
49+
</template>
50+
51+
<script lang="ts">
52+
import { Component, Prop, Provide, Vue } from 'vue-property-decorator';
53+
import Sidebar from './Sidebar.vue';
54+
import StatusBar from './StatusBar.vue';
55+
import store from '../store/index';
56+
import Url from './Url.vue';
57+
import ErrorModal from '@/components/ErrorModal.vue';
58+
import { SearchDatabases } from '@/adabas/admin';
59+
60+
@Component({
61+
components: {
62+
Sidebar,
63+
StatusBar,
64+
Url,
65+
ErrorModal,
66+
},
67+
})
68+
export default class DatabasePlogStat extends Vue {
69+
@Prop(String) readonly url: string | undefined;
70+
@Provide() type = 'static';
71+
data() {
72+
return {
73+
db: null,
74+
infos: [],
75+
fields: ['Name', 'Value'],
76+
};
77+
}
78+
created() {
79+
this.$data.db = SearchDatabases(this.url);
80+
this.queryInformation();
81+
}
82+
queryInformation(): void {
83+
this.$data.db.plogstats().then((response: any) => {
84+
console.log(JSON.stringify(response));
85+
this.$data.information = response.PLOG;
86+
this.$data.DatabaseInfos = [];
87+
Object.entries(response["PLOG"]).forEach((key: any) => {
88+
this.$data.infos.push({ Name: key[0], Value: key[1] });
89+
});
90+
});
91+
}
92+
getTypeItem(newtype: any): void {
93+
console.log('Get type item ' + newtype);
94+
this.queryInformation();
95+
}
96+
forceFEOF(newtype: any): void {
97+
this.$data.db.feofplog();
98+
}
99+
}
100+
</script>
101+
102+
<!-- Add "scoped" attribute to limit CSS to this component only -->
103+
<style scoped lang="scss">
104+
h3 {
105+
margin: 40px 0 0;
106+
}
107+
.card-header {
108+
font-weight: bold;
109+
font-size: 18px;
110+
}
111+
ul {
112+
list-style-type: none;
113+
padding: 0;
114+
}
115+
li {
116+
display: inline-block;
117+
margin: 0 10px;
118+
}
119+
a {
120+
color: #42b983;
121+
}
122+
</style>

src/components/FilesList.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@
4040
</b-col>
4141
</b-row>
4242
<b-row
43-
><b-col sm="4">
43+
><b-col sm="10">
4444
<b-pagination
4545
v-model="currentPage"
4646
:total-rows="files.length"
4747
:per-page="perPage"
4848
aria-controls="my-table"
4949
></b-pagination>
50-
</b-col>
51-
<b-col sm="8">
50+
</b-col><b-col sm="2">
51+
<b-form-select v-model="perPage" :options="perPageOptions" size="sm" class="mt-3"></b-form-select>
52+
</b-col></b-row><b-row>
53+
<b-col sm="12">
5254
<b-form-group
5355
label="Filter"
5456
label-cols-sm="3"
@@ -90,6 +92,9 @@
9092
:items="files"
9193
:fields="fields"
9294
>
95+
<template v-slot:cell(RecordCount)="row">
96+
{{new Intl.NumberFormat().format(row.item.RecordCount)}}
97+
</template>
9398
<template v-slot:cell(action)="row">
9499
<b-dropdown
95100
size="sm"
@@ -261,8 +266,9 @@ export default class FilesList extends Vue {
261266
newNr: 500,
262267
currentFile: 0,
263268
perPage: 10,
269+
perPageOptions: [10,20,50,100],
264270
currentPage: 1,
265-
fields: ["FileNr", "Name", "RecordCount", "IsLob", "IsLobRoot", "action"],
271+
fields: ["FileNr", "Name","Type", "RecordCount", "IsLob", "IsLobRoot", "action"],
266272
files: [],
267273
filter: "",
268274
filterOn: ["FileNr", "Name"],

0 commit comments

Comments
 (0)