Skip to content

Commit 425a7f6

Browse files
committed
Version 1.0.6
- Change param host to hostname - Support cache for multiple hosts
1 parent 0264b29 commit 425a7f6

File tree

15 files changed

+6906
-6807
lines changed

15 files changed

+6906
-6807
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,31 @@ assignees: ''
77

88
---
99

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
10+
**Describe the bug** A clear and concise description of what the bug is.
11+
12+
**To Reproduce** Steps to reproduce the behavior:
1213

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
1514
1. Go to '...'
1615
2. Click on '....'
1716
3. Scroll down to '....'
1817
4. See error
1918

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
19+
**Expected behavior** A clear and concise description of what you expected to
20+
happen.
2221

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
22+
**Screenshots** If applicable, add screenshots to help explain your problem.
2523

2624
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
25+
26+
- OS: [e.g. iOS]
27+
- Browser [e.g. chrome, safari]
28+
- Version [e.g. 22]
3029

3130
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
3631

37-
**Additional context**
38-
Add any other context about the problem here.
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context** Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
**Is your feature request related to a problem? Please describe.** A clear and
11+
concise description of what the problem is. Ex. I'm always frustrated when [...]
1212

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
13+
**Describe the solution you'd like** A clear and concise description of what you
14+
want to happen.
1515

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
16+
**Describe alternatives you've considered** A clear and concise description of
17+
any alternative solutions or features you've considered.
1818

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
19+
**Additional context** Add any other context or screenshots about the feature
20+
request here.

CODE_OF_CONDUCT.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
88
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, religion, or sexual identity
10-
and orientation.
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
1111

1212
We pledge to act and interact in ways that contribute to an open, welcoming,
1313
diverse, inclusive, and healthy community.
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
25+
- Focusing on what is best not just for us as individuals, but for the overall
26+
community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
30+
- The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -59,9 +59,8 @@ representative at an online or offline event.
5959
## Enforcement
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at
63-
.
64-
All complaints will be reviewed and investigated promptly and fairly.
62+
reported to the community leaders responsible for enforcement at . All
63+
complaints will be reviewed and investigated promptly and fairly.
6564

6665
All community leaders are obligated to respect the privacy and security of the
6766
reporter of any incident.
@@ -82,15 +81,15 @@ behavior was inappropriate. A public apology may be requested.
8281

8382
### 2. Warning
8483

85-
**Community Impact**: A violation through a single incident or series
86-
of actions.
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
8786

8887
**Consequence**: A warning with consequences for continued behavior. No
8988
interaction with the people involved, including unsolicited interaction with
9089
those enforcing the Code of Conduct, for a specified period of time. This
9190
includes avoiding interactions in community spaces as well as external channels
92-
like social media. Violating these terms may lead to a temporary or
93-
permanent ban.
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
9493

9594
### 3. Temporary Ban
9695

@@ -106,19 +105,20 @@ Violating these terms may lead to a permanent ban.
106105
### 4. Permanent Ban
107106

108107
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
108+
standards, including sustained inappropriate behavior, harassment of an
110109
individual, or aggression toward or disparagement of classes of individuals.
111110

112-
**Consequence**: A permanent ban from any sort of public interaction within
113-
the community.
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
114113

115114
## Attribution
116115

117116
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118117
version 2.0, available at
119118
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120119

121-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
120+
Community Impact Guidelines were inspired by
121+
[Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124124
[homepage]: https://www.contributor-covenant.org

mod.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,40 @@ router.get("/api/:apiName", async (ctx) => {
2525
username: ctx.request.url.searchParams.get("username")!,
2626
password: ctx.request.url.searchParams.get("password")!,
2727
protocol: (ctx.request.url.searchParams.get("protocol")!),
28-
host: ctx.request.url.searchParams.get("host")!,
28+
hostname: ctx.request.url.searchParams.get("hostname")!,
2929
port: Number(ctx.request.url.searchParams.get("port")!),
3030
};
3131

3232
if (ctx.params.apiName === "service") {
3333
let services: Array<ServiceModel>;
34-
if (cache.has("services")) {
35-
services = cache.get("services")!;
34+
if (cache.has(`${payload.hostname}-services`)) {
35+
services = cache.get(`${payload.hostname}-services`)!;
3636
} else {
3737
services = await getServices(payload);
38-
cache.put("services", services);
38+
cache.put(`${payload.hostname}-services`, services);
3939
}
4040
ctx.response.body = services;
4141
}
4242

4343
if (ctx.params.apiName === "dependencies") {
4444
let deps: Array<DependenciesModel>;
45-
if (cache.has("dependencies")) {
46-
deps = cache.get("dependencies")!;
45+
if (cache.has(`${payload.hostname}-dependencies`)) {
46+
deps = cache.get(`${payload.hostname}-dependencies`)!;
4747
} else {
4848
deps = await getDependsServices(payload);
49-
cache.put("dependencies", deps);
49+
cache.put(`${payload.hostname}-dependencies`, deps);
5050
}
5151
ctx.response.body = deps;
5252
}
5353

5454
if (ctx.params.apiName === "system") {
5555
let system: SystemModel;
5656

57-
if (cache.has("system-info")) {
58-
system = cache.get("system-info")!;
57+
if (cache.has(`${payload.hostname}-system-info`)) {
58+
system = cache.get(`${payload.hostname}-system-info`)!;
5959
} else {
6060
system = await getSystem(payload);
61-
cache.put("system-info", system);
61+
cache.put(`${payload.hostname}-system-info`, system);
6262
}
6363

6464
ctx.response.body = system;
@@ -70,7 +70,7 @@ router.post("/api/service", async (ctx) => {
7070
username: ctx.request.url.searchParams.get("username")!,
7171
password: ctx.request.url.searchParams.get("password")!,
7272
protocol: (ctx.request.url.searchParams.get("protocol")!),
73-
host: ctx.request.url.searchParams.get("host")!,
73+
hostname: ctx.request.url.searchParams.get("hostname")!,
7474
port: Number(ctx.request.url.searchParams.get("port")!),
7575
};
7676

@@ -79,15 +79,17 @@ router.post("/api/service", async (ctx) => {
7979

8080
if (service !== undefined) {
8181
//Change the cache
82-
if (cache.has("services")) {
83-
const services = cache.get<ServiceModel[]>("services")!;
82+
if (cache.has(`${payload.hostname}-services`)) {
83+
const services = cache.get<ServiceModel[]>(
84+
`${payload.hostname}-services`,
85+
)!;
8486
const cachedServiceIndex = services.findIndex((v) => {
8587
return v.name === service.name;
8688
});
8789

8890
if (cachedServiceIndex > -1) {
8991
services[cachedServiceIndex] = service;
90-
cache.put("services", services);
92+
cache.put(`${payload.hostname}-services`, services);
9193
}
9294
}
9395
}

q-manui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "q-manui",
3-
"version": "1.0.5",
4-
"description": "DenoMan 1.0.5",
3+
"version": "1.0.6",
4+
"description": "DenoMan 1.0.6",
55
"productName": "DenoMan",
66
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
77
"private": true,

q-manui/src/components/ServerComponent.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="s-right col-grow">
1010
<q-tab-panels v-model="tab">
1111
<q-tab-panel name="dashboard">
12-
<dashboard-component />
12+
<dashboard-component :host="host" />
1313
</q-tab-panel>
1414
<q-tab-panel name="services" style="padding: 0">
1515
<q-splitter
@@ -21,6 +21,7 @@
2121
<div class="q-a-xl no-margin no-padding">
2222
<service-details-component
2323
:service="selectedService"
24+
:host="host"
2425
v-on:on-open-service="
2526
(svr: ServiceModel) => {
2627
openService(svr);
@@ -76,6 +77,7 @@
7677
<service-window-component
7778
v-if="isDialogOpen"
7879
:service="doubleClickedService"
80+
:host="host"
7981
/>
8082
</dialog>
8183
</template>

q-manui/src/components/ServiceDetailsComponent.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@
146146
import { PropType, defineComponent, ref } from 'vue';
147147
import { getSystemInformation } from './service-api';
148148
149-
import { ControlAction, ServiceModel, SystemModel } from './models';
149+
import {
150+
ControlAction,
151+
ServiceModel,
152+
SystemModel,
153+
WinRMPayload,
154+
} from './models';
150155
import { bus } from 'boot/bus';
151156
152157
export default defineComponent({
@@ -157,6 +162,10 @@ export default defineComponent({
157162
type: Object as PropType<ServiceModel>,
158163
required: false,
159164
},
165+
host: {
166+
type: Object as PropType<WinRMPayload>,
167+
required: true,
168+
},
160169
},
161170
162171
methods: {
@@ -173,11 +182,11 @@ export default defineComponent({
173182
174183
emits: ['onOpenService'],
175184
176-
setup() {
185+
setup(props) {
177186
const data = ref<SystemModel>({} as SystemModel);
178187
179188
const isLoading = ref(true);
180-
getSystemInformation()
189+
getSystemInformation(props.host)
181190
.then((response) => {
182191
data.value = response;
183192
})

q-manui/src/components/dashboard/DashboardComponent.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</template>
6666

6767
<script lang="ts">
68-
import { defineComponent, onMounted, ref } from 'vue';
68+
import { PropType, defineComponent, onMounted, ref } from 'vue';
6969
import _filter from 'lodash/filter';
7070
import _groupBy from 'lodash/groupBy';
7171
import _sortBy from 'lodash/sortBy';
@@ -85,6 +85,7 @@ import {
8585
SystemModel,
8686
ServiceStatusModel,
8787
DependenciesModel,
88+
WinRMPayload,
8889
} from '../models';
8990
9091
type DashboardModel = {
@@ -99,6 +100,12 @@ type DashboardModel = {
99100
100101
export default defineComponent({
101102
name: 'DashboardComponent',
103+
props: {
104+
host: {
105+
type: Object as PropType<WinRMPayload>,
106+
required: true,
107+
},
108+
},
102109
components: {
103110
DCardComponent,
104111
SystemInfoComponent,
@@ -109,7 +116,7 @@ export default defineComponent({
109116
ServiceTypeComponent,
110117
},
111118
112-
setup() {
119+
setup(props) {
113120
const model = ref<DashboardModel>({
114121
services: {},
115122
drivers: {},
@@ -217,19 +224,19 @@ export default defineComponent({
217224
};
218225
219226
const loadServices = async (): Promise<ServiceModel[] | undefined> => {
220-
const res = await serviceApi.getServices();
227+
const res = await serviceApi.getServices(props.host);
221228
return res;
222229
};
223230
224231
const loadSystem = async (): Promise<SystemModel> => {
225-
const res = await serviceApi.getSystemInformation();
232+
const res = await serviceApi.getSystemInformation(props.host);
226233
return res;
227234
};
228235
229236
const loadDependencies = async (): Promise<
230237
DependenciesModel[] | undefined
231238
> => {
232-
const res = await serviceApi.getDependencies();
239+
const res = await serviceApi.getDependencies(props.host);
233240
return res;
234241
};
235242

0 commit comments

Comments
 (0)