Compare commits
304 Commits
assignuser
...
awscli
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b92a64bc | ||
|
|
f84ecd7212 | ||
|
|
5b6bb90119 | ||
|
|
d5637065c2 | ||
|
|
6d322c3cc2 | ||
|
|
e0ba340ca1 | ||
|
|
79ec7af773 | ||
|
|
752a3329be | ||
|
|
36a246504f | ||
|
|
b2a4b41023 | ||
|
|
852c943f99 | ||
|
|
96e33ca765 | ||
|
|
bae80ec847 | ||
|
|
ce55788a26 | ||
|
|
17e128099e | ||
|
|
17f391ffbd | ||
|
|
23bf5f58f6 | ||
|
|
b36616f28a | ||
|
|
5e266a4461 | ||
|
|
0dd199d5f8 | ||
|
|
0f020e96a7 | ||
|
|
0dcba31636 | ||
|
|
04221eb03a | ||
|
|
c12039d354 | ||
|
|
c5dcc547a9 | ||
|
|
5c3e10f9df | ||
|
|
e1848da829 | ||
|
|
a4ae065d8b | ||
|
|
8e0ffd72fa | ||
|
|
fafe697af5 | ||
|
|
2cf319175d | ||
|
|
643cb9775d | ||
|
|
66085e49c5 | ||
|
|
fd85d65aeb | ||
|
|
24a3573f73 | ||
|
|
048fc6d89d | ||
|
|
bf20f4efd4 | ||
|
|
2fd05a2b54 | ||
|
|
03ce50c255 | ||
|
|
171f552571 | ||
|
|
1843907b42 | ||
|
|
d88a6f2359 | ||
|
|
d273bc937e | ||
|
|
6777d2f0d8 | ||
|
|
3d2506639d | ||
|
|
a9806bd94e | ||
|
|
783642f083 | ||
|
|
2a7fec03d7 | ||
|
|
aed18cccfa | ||
|
|
0f12ee6649 | ||
|
|
fbc727a66e | ||
|
|
897fa2a631 | ||
|
|
43a428592e | ||
|
|
c3796b478f | ||
|
|
e12f60516b | ||
|
|
84fe322c96 | ||
|
|
84263b08dd | ||
|
|
895e069326 | ||
|
|
da4c940055 | ||
|
|
f9e608c06c | ||
|
|
15e8c12508 | ||
|
|
1e543b1e6f | ||
|
|
00739082f2 | ||
|
|
aacf23f57b | ||
|
|
ca037b42ef | ||
|
|
96300e1e99 | ||
|
|
721fbe24b8 | ||
|
|
b20a6fe858 | ||
|
|
658bd6a131 | ||
|
|
be5c9ef85e | ||
|
|
5cc6f7a3c6 | ||
|
|
5fdd26306a | ||
|
|
0e74d8873f | ||
|
|
3f8e9290de | ||
|
|
034dde5e1d | ||
|
|
d0e274cd5f | ||
|
|
b3de18bbda | ||
|
|
e02ac30cde | ||
|
|
49b444cfc8 | ||
|
|
1ab9055fc5 | ||
|
|
fd8e542467 | ||
|
|
7699978f39 | ||
|
|
902db15c17 | ||
|
|
49bd59df62 | ||
|
|
b7e44f436c | ||
|
|
aa26928716 | ||
|
|
8509a520cf | ||
|
|
0037634b70 | ||
|
|
6dfab50871 | ||
|
|
fcc46cdb1a | ||
|
|
06c4fae9c2 | ||
|
|
8b18a65303 | ||
|
|
e4ad1dde54 | ||
|
|
a2b82501aa | ||
|
|
ad0c4cbbd1 | ||
|
|
1a638c16bf | ||
|
|
7dd9fc79c2 | ||
|
|
d492c5e4a8 | ||
|
|
c2a14e5f79 | ||
|
|
c888c068b4 | ||
|
|
7b0bacc990 | ||
|
|
4d66c40c07 | ||
|
|
8a86130fe6 | ||
|
|
b7db4a5f00 | ||
|
|
f3b9869d4f | ||
|
|
0801f84b10 | ||
|
|
9dd091f982 | ||
|
|
190967a889 | ||
|
|
510254922b | ||
|
|
91da6199b3 | ||
|
|
9374a60e2a | ||
|
|
0e1817947e | ||
|
|
870ad47cbc | ||
|
|
4304c56685 | ||
|
|
b7dfee506f | ||
|
|
022b414766 | ||
|
|
05143c78c0 | ||
|
|
04ed3a22ef | ||
|
|
d3f0513224 | ||
|
|
d5efa608bc | ||
|
|
040d2187cb | ||
|
|
2d254ae238 | ||
|
|
82861f2130 | ||
|
|
e0270e6925 | ||
|
|
dc2180af03 | ||
|
|
d240b06c5c | ||
|
|
2434d2d157 | ||
|
|
c631fb141e | ||
|
|
4e27a35e4e | ||
|
|
1b458ab2df | ||
|
|
082e98c01a | ||
|
|
c6d1f84c57 | ||
|
|
c3b9e8532f | ||
|
|
4194973884 | ||
|
|
57a47d7794 | ||
|
|
953930bc42 | ||
|
|
35d78b4db0 | ||
|
|
b8a8b8bace | ||
|
|
e09d03f1ef | ||
|
|
dd2f328f45 | ||
|
|
b3895be44a | ||
|
|
7516f46903 | ||
|
|
3c7327ed57 | ||
|
|
8e1c027038 | ||
|
|
f8fe33039c | ||
|
|
bf6ea3cd51 | ||
|
|
e3aeeea51f | ||
|
|
1fba40289e | ||
|
|
b32c18a349 | ||
|
|
9fc6bdd5a3 | ||
|
|
755fd11f1a | ||
|
|
82984673aa | ||
|
|
de600d1525 | ||
|
|
c1335fdf25 | ||
|
|
36eced4232 | ||
|
|
3f11e36b42 | ||
|
|
db2a3a4d60 | ||
|
|
d7222c6cf0 | ||
|
|
fca71efb1e | ||
|
|
6943d7eaa4 | ||
|
|
4b343830c9 | ||
|
|
f50d81651b | ||
|
|
7ac86a435a | ||
|
|
e2dd677c7f | ||
|
|
1a8a59fd77 | ||
|
|
80c085ca38 | ||
|
|
6f079a6361 | ||
|
|
b2cf816e2f | ||
|
|
6c176726f2 | ||
|
|
47c6a51c39 | ||
|
|
04f509c76b | ||
|
|
261a3518ee | ||
|
|
eb277aa5e8 | ||
|
|
c4b6ef56e6 | ||
|
|
886d8fa202 | ||
|
|
60ce0dcb3e | ||
|
|
35748fe333 | ||
|
|
aa826eb5f3 | ||
|
|
e25619b601 | ||
|
|
12b2e612aa | ||
|
|
b6f095d504 | ||
|
|
c5a9cbde58 | ||
|
|
dc8cae1853 | ||
|
|
e22168f39c | ||
|
|
3319c400b5 | ||
|
|
6725d91663 | ||
|
|
7a78cb6b21 | ||
|
|
0dc76aaf94 | ||
|
|
58daa3a31e | ||
|
|
beb2330bcd | ||
|
|
f38aef13be | ||
|
|
7920909308 | ||
|
|
d9a2df002c | ||
|
|
5ba87ef2c5 | ||
|
|
b83b599553 | ||
|
|
646d49fa2e | ||
|
|
b1535d74a1 | ||
|
|
8606e31bc5 | ||
|
|
4b87a7584a | ||
|
|
5234295a87 | ||
|
|
aba7919400 | ||
|
|
3fdd58db33 | ||
|
|
6651510249 | ||
|
|
326481521a | ||
|
|
b34895a8ae | ||
|
|
3663462bb4 | ||
|
|
815df437c7 | ||
|
|
cfa47cd47d | ||
|
|
fbfd0b5f4c | ||
|
|
ea9a002e01 | ||
|
|
6f8f7b12ab | ||
|
|
bec0ebc623 | ||
|
|
5f863d6ec4 | ||
|
|
d3345aa685 | ||
|
|
aa48199e58 | ||
|
|
028d9822bb | ||
|
|
08deb29ae8 | ||
|
|
1a7537ef27 | ||
|
|
e4ef581049 | ||
|
|
c642c5a5e9 | ||
|
|
0821049fc1 | ||
|
|
996be45987 | ||
|
|
44f654c085 | ||
|
|
98fe966f32 | ||
|
|
159c9a80c1 | ||
|
|
f407ed5899 | ||
|
|
77ed627312 | ||
|
|
57030be78f | ||
|
|
c8953e46d5 | ||
|
|
e18fbd7e6e | ||
|
|
551ad78345 | ||
|
|
dbabd39967 | ||
|
|
5cf2f37e7c | ||
|
|
fb82a18a5a | ||
|
|
930a9dab4a | ||
|
|
382b9b1576 | ||
|
|
524b16fd75 | ||
|
|
07f29da574 | ||
|
|
ecb6ad4d86 | ||
|
|
0c79d43ba1 | ||
|
|
52f8d098b3 | ||
|
|
e4230d58fa | ||
|
|
8df6915b38 | ||
|
|
2616332b4a | ||
|
|
8218f0469b | ||
|
|
8bfd76981f | ||
|
|
2205a9520d | ||
|
|
3f73c93eb2 | ||
|
|
5dfd363ecd | ||
|
|
c69125c5f2 | ||
|
|
50d68d0078 | ||
|
|
73f37b7567 | ||
|
|
d7b2ae93bb | ||
|
|
1ab433daec | ||
|
|
4fa0f78b42 | ||
|
|
fdea228ed1 | ||
|
|
707f0c6830 | ||
|
|
f71ef166b5 | ||
|
|
89462fd21a | ||
|
|
5f99f553c5 | ||
|
|
dddc1314e7 | ||
|
|
c5f50cb6b1 | ||
|
|
885f2986ef | ||
|
|
e45445f919 | ||
|
|
2040c9f914 | ||
|
|
93884ebeea | ||
|
|
dc9354a36a | ||
|
|
5e1e193688 | ||
|
|
ac420b448c | ||
|
|
9a7fcfc885 | ||
|
|
d545acd5eb | ||
|
|
50e2bf7562 | ||
|
|
ac846624df | ||
|
|
37ae3a6cac | ||
|
|
4bff8d0ecd | ||
|
|
a0fe0dc055 | ||
|
|
640ddf1726 | ||
|
|
81262b2c14 | ||
|
|
2159eb67e0 | ||
|
|
9a362f2d52 | ||
|
|
e974a4bd08 | ||
|
|
a4867225d6 | ||
|
|
08188fdf27 | ||
|
|
7ccaa69a6a | ||
|
|
1a06334920 | ||
|
|
e4f070826d | ||
|
|
bf84db1254 | ||
|
|
36ea9bbba1 | ||
|
|
f191fbd7be | ||
|
|
beef010d40 | ||
|
|
4177c357c2 | ||
|
|
7aa064b7a8 | ||
|
|
60d7d4fb00 | ||
|
|
bd63ef3837 | ||
|
|
2ce1939161 | ||
|
|
13150ff2c8 | ||
|
|
456bd00d47 | ||
|
|
5a2a73a671 | ||
|
|
4fc3ea8ad2 | ||
|
|
6988f95e4a | ||
|
|
9f37068d7c | ||
|
|
717fb16e64 | ||
|
|
4c84bbc464 | ||
|
|
86142a0ca3 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -48,4 +48,4 @@ secrets.json
|
||||
|
||||
qmi-cloud-tf-modules/
|
||||
*.pfx
|
||||
|
||||
/photos/*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Stage 1:
|
||||
FROM node:13.8-alpine AS sources
|
||||
FROM node:15.12.0-alpine AS sources
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
RUN apk --no-cache add yarn git
|
||||
|
||||
WORKDIR /var/www/app
|
||||
|
||||
@@ -12,12 +12,13 @@ ADD ./qmi-cloud-common ./qmi-cloud-common
|
||||
RUN yarn install --production
|
||||
|
||||
# Stage 2:
|
||||
FROM node:13.8-alpine AS production
|
||||
FROM node:15.12.0-alpine AS production
|
||||
WORKDIR /var/www/app
|
||||
COPY --from=sources /var/www/app/node_modules ./node_modules
|
||||
COPY --from=sources /var/www/app/package.json ./package.json
|
||||
COPY ./server ./server
|
||||
COPY ./dist ./dist
|
||||
COPY ./mystatsmashup ./mystatsmashup
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 3100
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# QMI Cloud
|
||||
|
||||
[](https://gitlab.com/qmi/qmi-cloud/-/commits/master)
|
||||
|
||||
## Pre-requisites
|
||||
- Docker
|
||||
- Docker-Compose
|
||||
|
||||
10
angular.json
10
angular.json
@@ -38,12 +38,15 @@
|
||||
"src/styles.scss"
|
||||
],
|
||||
"scripts": [
|
||||
|
||||
"node_modules/chart.js/dist/Chart.js",
|
||||
"node_modules/hammerjs/hammer.min.js",
|
||||
"node_modules/marked/lib/marked.js",
|
||||
"node_modules/prismjs/prism.js",
|
||||
"node_modules/prismjs/plugins/line-highlight/prism-line-highlight.js",
|
||||
"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js"
|
||||
"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js",
|
||||
"src/assets/js/qdt-components.js",
|
||||
"src/assets/js/qlikMashupQCS.js"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
@@ -150,5 +153,8 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "qmi-cloud"
|
||||
"defaultProject": "qmi-cloud",
|
||||
"cli": {
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
0
costexport/.keep
Normal file
0
costexport/.keep
Normal file
1
costexport/sample.json
Normal file
1
costexport/sample.json
Normal file
@@ -0,0 +1 @@
|
||||
{"test": "ok"}
|
||||
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
import { Component } from '@angular/core';
|
||||
var AdminComponent = /** @class */ (function () {
|
||||
function AdminComponent() {
|
||||
this.sections = ['Provisions', 'Users', 'Scenarios', 'Notifications', 'Subscriptions'];
|
||||
this.sections = ['Provisions', 'Scenarios', 'Scenario Deploy Opts', 'Users', 'Notifications', 'API keys', 'VM Types'];
|
||||
this.tab = 'Provisions';
|
||||
}
|
||||
AdminComponent.prototype.ngOnInit = function () {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.component.js","sourceRoot":"","sources":["../../../../../src/app/admin/admin.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAOlD;IAKE;QAHA,aAAQ,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QAClF,QAAG,GAAa,YAAY,CAAC;IAEb,CAAC;IAEjB,iCAAQ,GAAR;IACA,CAAC;IAED,kCAAS,GAAT,UAAU,MAAM,EAAE,GAAG;QACnB,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,CAAC,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAdU,cAAc;QAL1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;;OACW,cAAc,CAgB1B;IAAD,qBAAC;CAAA,AAhBD,IAgBC;SAhBY,cAAc"}
|
||||
{"version":3,"file":"admin.component.js","sourceRoot":"","sources":["../../../../../src/app/admin/admin.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAOlD;IAKE;QAHA,aAAQ,GAAG,CAAC,YAAY,EAAE,WAAW,EAAG,sBAAsB,EAAE,OAAO,EAAE,eAAe,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACjH,QAAG,GAAa,YAAY,CAAC;IAEb,CAAC;IAEjB,iCAAQ,GAAR;IACA,CAAC;IAED,kCAAS,GAAT,UAAU,MAAM,EAAE,GAAG;QACnB,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,CAAC,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAdU,cAAc;QAL1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;;OACW,cAAc,CAgB1B;IAAD,qBAAC;CAAA,AAhBD,IAgBC;SAhBY,cAAc"}
|
||||
2
dist/out-tsc/src/app/app-routing.module.js
vendored
2
dist/out-tsc/src/app/app-routing.module.js
vendored
@@ -8,6 +8,7 @@ import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { ProvisionsComponent } from './provisions/provisions.component';
|
||||
import { AdminComponent } from './admin/admin.component';
|
||||
import { StatsComponent } from './stats/stats.component';
|
||||
import { HomeComponent } from './home/home.component';
|
||||
import { AuthGuard } from './services/auth.guard';
|
||||
import { FaqComponent } from './faq/faq.component';
|
||||
@@ -16,6 +17,7 @@ var routes = [
|
||||
{ path: 'faq', component: FaqComponent },
|
||||
{ path: 'provisions', component: ProvisionsComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'admin', component: AdminComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'stats', component: StatsComponent },
|
||||
{ path: '',
|
||||
redirectTo: '/home',
|
||||
pathMatch: 'full'
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"app-routing.module.js","sourceRoot":"","sources":["../../../../src/app/app-routing.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAU,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAQ,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAQ,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAQ,uBAAuB,CAAC;AACx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AAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,IAAM,MAAM,GAAW;IACrB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAC;IACzC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAC;IACvC,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC,SAAS,CAAC,EAAC;IAC/E,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,SAAS,CAAC,EAAC;IACrE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAC;IAC3C,EAAE,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,MAAM;KAClB;IACD,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE;CACpC,CAAC;AAMF;IAAA;IAAgC,CAAC;IAApB,gBAAgB;QAJ5B,QAAQ,CAAC;YACR,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACvC,OAAO,EAAE,CAAC,YAAY,CAAC;SACxB,CAAC;OACW,gBAAgB,CAAI;IAAD,uBAAC;CAAA,AAAjC,IAAiC;SAApB,gBAAgB"}
|
||||
28
dist/out-tsc/src/app/app.module.js
vendored
28
dist/out-tsc/src/app/app.module.js
vendored
@@ -29,17 +29,22 @@ import { TableProvisionsAdminComponent } from './tables/table-provisions.compone
|
||||
import { TableScenariosComponent } from './tables/table-scenarios.component';
|
||||
import { TableUsersComponent } from './tables/table-users.component';
|
||||
import { TableNotificationsComponent } from './tables/table-notifications.component';
|
||||
import { AlertComponent } from './alert/alert.component';
|
||||
import { AlertComponent } from './modals/alert.component';
|
||||
import { AlertService } from './services/alert.service';
|
||||
import { ModalInfoComponent } from './alert/modalinfo.component';
|
||||
import { ModalConfirmComponent } from './alert/confirm.component';
|
||||
import { ModalInfoComponent } from './modals/modalinfo.component';
|
||||
import { ModalConfirmComponent } from './modals/confirm.component';
|
||||
import { FilterPipe } from './filter.pipe';
|
||||
import { FaqComponent } from './faq/faq.component';
|
||||
import { NewProvisionConfirmComponent } from './alert/new-provision.component';
|
||||
import { ScenarioModalComponent } from './alert/edit-scenario.component';
|
||||
import { SubscriptionModalComponent } from './alert/edit-subscription.component';
|
||||
import { TableSubsComponent } from './tables/table-subs.component';
|
||||
import { SubscriptionsService } from './services/subscriptions.service';
|
||||
import { NewProvisionConfirmComponent } from './modals/new-provision.component';
|
||||
import { ScenarioModalComponent } from './modals/edit-scenario.component';
|
||||
import { SubscriptionModalComponent } from './modals/edit-subscription.component';
|
||||
import { TableSubsComponent } from './tables/table-subscriptions.component';
|
||||
import { TableVmTypesComponent } from './tables/table-vmtypes.component';
|
||||
import { SubscriptionsService } from './services/deployopts.service';
|
||||
import { TableApiKeysComponent } from './tables/table-apikeys.component';
|
||||
import { ApikeyModalComponent } from './modals/edit-apikey.component';
|
||||
import { VmTypeModalComponent } from './modals/edit-vmtype.component';
|
||||
import { StatsComponent } from './stats/stats.component';
|
||||
export function markedOptions() {
|
||||
var renderer = new MarkedRenderer();
|
||||
renderer.blockquote = function (text) {
|
||||
@@ -72,7 +77,12 @@ var AppModule = /** @class */ (function () {
|
||||
TableNotificationsComponent,
|
||||
ScenarioModalComponent,
|
||||
SubscriptionModalComponent,
|
||||
TableSubsComponent
|
||||
TableSubsComponent,
|
||||
TableApiKeysComponent,
|
||||
ApikeyModalComponent,
|
||||
TableVmTypesComponent,
|
||||
VmTypeModalComponent,
|
||||
StatsComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
||||
2
dist/out-tsc/src/app/app.module.js.map
vendored
2
dist/out-tsc/src/app/app.module.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"app.module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BAC5B,cAAc,CAAC,OAAO,CAAC;oBACrB,MAAM,EAAE,UAAU;iBACnB,CAAC;aACH;YACD,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE;gBACxE,iBAAiB;gBACjB,gBAAgB;gBAChB,oBAAoB;gBACpB,YAAY;gBACZ,YAAY;gBACZ,SAAS;aACV;YACD,SAAS,EAAE,CAAC,YAAY,CAAC;SAC1B,CAAC;OACW,SAAS,CAAI;IAAD,gBAAC;CAAA,AAA1B,IAA0B;SAAb,SAAS"}
|
||||
43
dist/out-tsc/src/app/modals/alert.component.js
vendored
Normal file
43
dist/out-tsc/src/app/modals/alert.component.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component, ViewChild, ElementRef } from '@angular/core';
|
||||
import { AlertService } from '../services/alert.service';
|
||||
var AlertComponent = /** @class */ (function () {
|
||||
function AlertComponent(_alertService) {
|
||||
this._alertService = _alertService;
|
||||
this.alert = null;
|
||||
}
|
||||
AlertComponent.prototype.ngOnInit = function () {
|
||||
this.subscription = this._alertService.getAlertEmitter().subscribe(function (data) {
|
||||
this.alert = data;
|
||||
}.bind(this));
|
||||
};
|
||||
AlertComponent.prototype.ngOnDestroy = function () {
|
||||
this.subscription.unsubscribe();
|
||||
};
|
||||
AlertComponent.prototype.closeAlert = function () {
|
||||
this.alert = null;
|
||||
};
|
||||
__decorate([
|
||||
ViewChild('qmialert', { static: true }),
|
||||
__metadata("design:type", ElementRef)
|
||||
], AlertComponent.prototype, "alertEl", void 0);
|
||||
AlertComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-alert',
|
||||
templateUrl: './alert.component.html',
|
||||
styleUrls: ['./alert.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [AlertService])
|
||||
], AlertComponent);
|
||||
return AlertComponent;
|
||||
}());
|
||||
export { AlertComponent };
|
||||
//# sourceMappingURL=alert.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/alert.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/alert.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"alert.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/alert.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAQzD;IAME,wBAAoB,aAA2B;QAA3B,kBAAa,GAAb,aAAa,CAAc;QAF/C,UAAK,GAAS,IAAI,CAAC;IAE+B,CAAC;IAEnD,iCAAQ,GAAR;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,UAAS,IAAI;YAC5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,oCAAW,GAAX;QACE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED,mCAAU,GAAV;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAlBwC;QAAxC,SAAS,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAU,UAAU;mDAAC;IAFlD,cAAc;QAL1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;yCAOmC,YAAY;OANpC,cAAc,CAsB1B;IAAD,qBAAC;CAAA,AAtBD,IAsBC;SAtBY,cAAc"}
|
||||
40
dist/out-tsc/src/app/modals/confirm.component.js
vendored
Normal file
40
dist/out-tsc/src/app/modals/confirm.component.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
var ModalConfirmComponent = /** @class */ (function () {
|
||||
function ModalConfirmComponent(modalRef) {
|
||||
this.modalRef = modalRef;
|
||||
this.action = new Subject();
|
||||
}
|
||||
ModalConfirmComponent.prototype.ngOnInit = function () {
|
||||
if (!this.info.buttonColor) {
|
||||
this.info.buttonColor = "danger";
|
||||
}
|
||||
};
|
||||
ModalConfirmComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
ModalConfirmComponent.prototype.confirm = function () {
|
||||
this.action.next();
|
||||
this.modalRef.hide();
|
||||
};
|
||||
ModalConfirmComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-modalconfirm',
|
||||
templateUrl: './confirm.component.html',
|
||||
styleUrls: ['./confirm.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef])
|
||||
], ModalConfirmComponent);
|
||||
return ModalConfirmComponent;
|
||||
}());
|
||||
export { ModalConfirmComponent };
|
||||
//# sourceMappingURL=confirm.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/confirm.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/confirm.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"confirm.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/confirm.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAO/B;IAKE,+BAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QAFzC,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;IAEQ,CAAC;IAE9C,wCAAQ,GAAR;QACE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;SAClC;IACH,CAAC;IAED,2CAAW,GAAX;IAEA,CAAC;IAED,uCAAO,GAAP;QACI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IApBU,qBAAqB;QALjC,SAAS,CAAC;YACT,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;SACxC,CAAC;yCAM8B,WAAW;OAL9B,qBAAqB,CAsBjC;IAAD,4BAAC;CAAA,AAtBD,IAsBC;SAtBY,qBAAqB"}
|
||||
65
dist/out-tsc/src/app/modals/edit-apikey.component.js
vendored
Normal file
65
dist/out-tsc/src/app/modals/edit-apikey.component.js
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { UsersService } from '../services/users.service';
|
||||
var ApikeyModalComponent = /** @class */ (function () {
|
||||
function ApikeyModalComponent(modalRef, _usersService) {
|
||||
this.modalRef = modalRef;
|
||||
this._usersService = _usersService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {};
|
||||
}
|
||||
ApikeyModalComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this._usersService.getUsers().subscribe(function (res) {
|
||||
_this.users = res.results;
|
||||
console.log("apiKey", _this.apiKey);
|
||||
if (_this.apiKey) {
|
||||
_this.sendData = JSON.parse(JSON.stringify(_this.apiKey));
|
||||
}
|
||||
if (_this.apiKey.user) {
|
||||
_this.selectedUser = _this.apiKey.user._id;
|
||||
}
|
||||
});
|
||||
};
|
||||
ApikeyModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
ApikeyModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
this.sendData.user = this.selectedUser;
|
||||
console.log("sendData", this.sendData);
|
||||
this._usersService.addApikey(this.sendData.user).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
ApikeyModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._usersService.delApikey(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
ApikeyModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-apikey',
|
||||
templateUrl: './edit-apikey.component.html',
|
||||
styleUrls: ['./edit-apikey.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, UsersService])
|
||||
], ApikeyModalComponent);
|
||||
return ApikeyModalComponent;
|
||||
}());
|
||||
export { ApikeyModalComponent };
|
||||
//# sourceMappingURL=edit-apikey.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/edit-apikey.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/edit-apikey.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-apikey.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/edit-apikey.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD;IASE,8BAAoB,QAAqB,EAAU,aAA2B;QAA1D,aAAQ,GAAR,QAAQ,CAAa;QAAU,kBAAa,GAAb,aAAa,CAAc;QAN9E,WAAM,GAAiB,IAAI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QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAE,UAAA,GAAG;YAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAhDU,oBAAoB;QALhC,SAAS,CAAC;YACT,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;SAC5C,CAAC;yCAU8B,WAAW,EAAyB,YAAY;OATnE,oBAAoB,CAkDhC;IAAD,2BAAC;CAAA,AAlDD,IAkDC;SAlDY,oBAAoB"}
|
||||
105
dist/out-tsc/src/app/modals/edit-scenario.component.js
vendored
Normal file
105
dist/out-tsc/src/app/modals/edit-scenario.component.js
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { SubscriptionsService } from '../services/deployopts.service';
|
||||
var ScenarioModalComponent = /** @class */ (function () {
|
||||
function ScenarioModalComponent(modalRef, _scenariosService, _subscriptionsService) {
|
||||
this.modalRef = modalRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {
|
||||
availableProductVersions: [{
|
||||
product: 'String: <ie: Qlik Sense>',
|
||||
vmTypeDefault: 'String: <i.e: Standard_D8s_v3>',
|
||||
diskSizeGbDefault: 'Integer: <values: 128,250,500,750,1000>',
|
||||
index: 'vm1',
|
||||
versions: []
|
||||
}]
|
||||
};
|
||||
}
|
||||
ScenarioModalComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this._subscriptionsService.getSubscriptions().subscribe(function (res) {
|
||||
_this.subscriptions = res.results;
|
||||
console.log("SCENARIO", _this.scenario);
|
||||
if (_this.scenario) {
|
||||
_this.sendData = JSON.parse(JSON.stringify(_this.scenario));
|
||||
}
|
||||
console.log("sendData", _this.sendData);
|
||||
if (_this.scenario.subscription) {
|
||||
_this.selectedSubscription = _this.scenario.subscription._id;
|
||||
}
|
||||
else {
|
||||
_this.selectedSubscription = res.results[0]._id;
|
||||
}
|
||||
});
|
||||
};
|
||||
ScenarioModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
ScenarioModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
this.sendData.subscription = this.selectedSubscription;
|
||||
console.log("sendData", this.sendData);
|
||||
//this.action.next(this.sendData);
|
||||
if (this.sendData._id) {
|
||||
var id = this.sendData._id.toString();
|
||||
this.sendData._id = undefined;
|
||||
this._scenariosService.updateScenario(id, this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._scenariosService.addScenario(this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
ScenarioModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._scenariosService.deleteScenario(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
ScenarioModalComponent.prototype.checkOnchange = function ($event, field) {
|
||||
console.log("Checked?", $event.checked);
|
||||
this.sendData[field] = $event.checked;
|
||||
};
|
||||
ScenarioModalComponent.prototype.updateJson = function (event, property) {
|
||||
var editField = event.target.textContent.trim();
|
||||
try {
|
||||
var value = JSON.parse(editField);
|
||||
this.sendData[property] = value;
|
||||
}
|
||||
catch (e) {
|
||||
console.log("error json", e);
|
||||
}
|
||||
};
|
||||
ScenarioModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-scenario',
|
||||
templateUrl: './edit-scenario.component.html',
|
||||
styleUrls: ['./edit-scenario.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, ScenariosService, SubscriptionsService])
|
||||
], ScenarioModalComponent);
|
||||
return ScenarioModalComponent;
|
||||
}());
|
||||
export { ScenarioModalComponent };
|
||||
//# sourceMappingURL=edit-scenario.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/edit-scenario.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/edit-scenario.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-scenario.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/edit-scenario.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC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AAI,CAAC,SAAS,CAAC,CAAC;YAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,8CAAa,GAAb,UAAc,MAAM,EAAE,KAAK;QACzB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IACxC,CAAC;IAED,2CAAU,GAAV,UAAW,KAAU,EAAE,QAAgB;QACrC,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAChD,IAAI;YACA,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAClC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;SAEnC;QAAC,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;SAChC;IACH,CAAC;IAtFU,sBAAsB;QALlC,SAAS,CAAC;YACT,QAAQ,EAAE,kBAAkB;YAC5B,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;SAC9C,CAAC;yCAkB8B,WAAW,EAA6B,gBAAgB,EAAiC,oBAAoB;OAjBhI,sBAAsB,CAuFlC;IAAD,6BAAC;CAAA,AAvFD,IAuFC;SAvFY,sBAAsB"}
|
||||
81
dist/out-tsc/src/app/modals/edit-subscription.component.js
vendored
Normal file
81
dist/out-tsc/src/app/modals/edit-subscription.component.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { SubscriptionsService } from '../services/deployopts.service';
|
||||
var SubscriptionModalComponent = /** @class */ (function () {
|
||||
function SubscriptionModalComponent(modalRef, _subscriptionsService) {
|
||||
this.modalRef = modalRef;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {};
|
||||
}
|
||||
SubscriptionModalComponent.prototype.ngOnInit = function () {
|
||||
if (this.subscription) {
|
||||
this.sendData = JSON.parse(JSON.stringify(this.subscription));
|
||||
}
|
||||
};
|
||||
SubscriptionModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
SubscriptionModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
console.log("sendData", this.sendData);
|
||||
if (!this.sendData.vnetExists) {
|
||||
this.sendData.subnetId = null;
|
||||
this.sendData.appGwSubnetId = null;
|
||||
}
|
||||
else {
|
||||
if (!this.sendData.subnetId || !this.sendData.appGwSubnetId) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//this.action.next(this.sendData);
|
||||
if (this.sendData._id) {
|
||||
var id = this.sendData._id.toString();
|
||||
this.sendData._id = undefined;
|
||||
this._subscriptionsService.updateSubscription(id, this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._subscriptionsService.addSubscription(this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
SubscriptionModalComponent.prototype.checkOnchange = function ($event, field) {
|
||||
console.log("Checked?", $event.checked);
|
||||
this.sendData[field] = $event.checked;
|
||||
};
|
||||
SubscriptionModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._subscriptionsService.deleteScenario(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
SubscriptionModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-subscription',
|
||||
templateUrl: './edit-subscription.component.html',
|
||||
styleUrls: ['./edit-subscription.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, SubscriptionsService])
|
||||
], SubscriptionModalComponent);
|
||||
return SubscriptionModalComponent;
|
||||
}());
|
||||
export { SubscriptionModalComponent };
|
||||
//# sourceMappingURL=edit-subscription.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/edit-subscription.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/edit-subscription.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-subscription.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/edit-subscription.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAOtE;IASE,oCAAoB,QAAqB,EAAU,qBAA2C;QAA1E,aAAQ,GAAR,QAAQ,CAAa;QAAU,0BAAqB,GAArB,qBAAqB,CAAsB;QAN9F,WAAM,GAAiB,IAAI,OAAO,EAAE,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B,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAE,UAAA,GAAG;gBACtE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBACzB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;SACJ;IAGL,CAAC;IAED,kDAAa,GAAb,UAAc,MAAM,EAAE,KAAK;QACzB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IACxC,CAAC;IAED,2CAAM,GAAN;QAAA,iBAMC;QALC,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAE,UAAA,GAAG;YACzE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IA/DU,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,CAAC,oCAAoC,CAAC;SAClD,CAAC;yCAU8B,WAAW,EAAiC,oBAAoB;OATnF,0BAA0B,CAiEtC;IAAD,iCAAC;CAAA,AAjED,IAiEC;SAjEY,0BAA0B"}
|
||||
68
dist/out-tsc/src/app/modals/edit-vmtype.component.js
vendored
Normal file
68
dist/out-tsc/src/app/modals/edit-vmtype.component.js
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
var VmTypeModalComponent = /** @class */ (function () {
|
||||
function VmTypeModalComponent(modalRef, _scenariosService) {
|
||||
this.modalRef = modalRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {};
|
||||
}
|
||||
VmTypeModalComponent.prototype.ngOnInit = function () {
|
||||
if (this.item) {
|
||||
this.sendData = JSON.parse(JSON.stringify(this.item));
|
||||
}
|
||||
};
|
||||
VmTypeModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
VmTypeModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
console.log("sendData", this.sendData);
|
||||
if (this.sendData._id) {
|
||||
this._scenariosService.updateScenarioVmtype(this.sendData._id, this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._scenariosService.createScenarioVmtype(this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
VmTypeModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._scenariosService.deleteScenarioVmtype(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
VmTypeModalComponent.prototype.checkOnchange = function ($event, field) {
|
||||
this.sendData[field] = $event.checked;
|
||||
};
|
||||
VmTypeModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-vmtype',
|
||||
templateUrl: './edit-vmtype.component.html',
|
||||
styleUrls: []
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, ScenariosService])
|
||||
], VmTypeModalComponent);
|
||||
return VmTypeModalComponent;
|
||||
}());
|
||||
export { VmTypeModalComponent };
|
||||
//# sourceMappingURL=edit-vmtype.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/edit-vmtype.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/edit-vmtype.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-vmtype.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/edit-vmtype.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE;IAME,8BAAoB,QAAqB,EAAU,iBAAmC;QAAlE,aAAQ,GAAR,QAAQ,CAAa;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAHtF,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;QACrC,aAAQ,GAAS,EAAE,CAAC;IAEsE,CAAC;IAE3F,uCAAQ,GAAR;QACE,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAA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,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,4CAAa,GAAb,UAAc,MAAM,EAAE,KAAK;QACzB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IACxC,CAAC;IAjDU,oBAAoB;QALhC,SAAS,CAAC;YACT,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,EAAE;SACd,CAAC;yCAO8B,WAAW,EAA6B,gBAAgB;OAN3E,oBAAoB,CAmDhC;IAAD,2BAAC;CAAA,AAnDD,IAmDC;SAnDY,oBAAoB"}
|
||||
31
dist/out-tsc/src/app/modals/modalinfo.component.js
vendored
Normal file
31
dist/out-tsc/src/app/modals/modalinfo.component.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
var ModalInfoComponent = /** @class */ (function () {
|
||||
function ModalInfoComponent(modalRef) {
|
||||
this.modalRef = modalRef;
|
||||
}
|
||||
ModalInfoComponent.prototype.ngOnInit = function () {
|
||||
};
|
||||
ModalInfoComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
ModalInfoComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-modalinfo',
|
||||
templateUrl: './modalinfo.component.html',
|
||||
styleUrls: ['./modalinfo.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef])
|
||||
], ModalInfoComponent);
|
||||
return ModalInfoComponent;
|
||||
}());
|
||||
export { ModalInfoComponent };
|
||||
//# sourceMappingURL=modalinfo.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/modalinfo.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/modalinfo.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"modalinfo.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/modalinfo.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOnD;IAIE,4BAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;IAAI,CAAC;IAE9C,qCAAQ,GAAR;IAEA,CAAC;IAED,wCAAW,GAAX;IAEA,CAAC;IAZU,kBAAkB;QAL9B,SAAS,CAAC;YACT,QAAQ,EAAE,eAAe;YACzB,WAAW,EAAE,4BAA4B;YACzC,SAAS,EAAE,CAAC,4BAA4B,CAAC;SAC1C,CAAC;yCAK8B,WAAW;OAJ9B,kBAAkB,CAc9B;IAAD,yBAAC;CAAA,AAdD,IAcC;SAdY,kBAAkB"}
|
||||
104
dist/out-tsc/src/app/modals/new-provision.component.js
vendored
Normal file
104
dist/out-tsc/src/app/modals/new-provision.component.js
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
var NewProvisionConfirmComponent = /** @class */ (function () {
|
||||
function NewProvisionConfirmComponent(modalRef, _scenariosService) {
|
||||
this.modalRef = modalRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {
|
||||
description: "",
|
||||
servers: null,
|
||||
isExternalAccess: false,
|
||||
};
|
||||
this.selectedProductVersion = {};
|
||||
this.selectedVmType = {};
|
||||
this.selectedNodeCount = {};
|
||||
this.selectedDiskSizeGb = {};
|
||||
this.servers = {};
|
||||
}
|
||||
NewProvisionConfirmComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.vmTypesSub = this._scenariosService.getScenarioVmtypes().subscribe(function (res) {
|
||||
_this.vmTypes = res.results.filter(function (v) { return !v.disabled; });
|
||||
if (_this.scenario.availableProductVersions.length) {
|
||||
_this.scenario.availableProductVersions.forEach(function (server) {
|
||||
if (server.vmTypeDefault) {
|
||||
_this.selectedVmType[server.index] = server.vmTypeDefault;
|
||||
}
|
||||
if (server.nodeCount) {
|
||||
_this.selectedNodeCount[server.index] = server.nodeCount;
|
||||
}
|
||||
_this.selectedDiskSizeGb[server.index] = server.diskSizeGbDefault || 500;
|
||||
if (server.versions && server.versions.length) {
|
||||
var lastIndex = server.versions.length - 1;
|
||||
_this.selectedProductVersion[server.index] = server.productVersionDefault ? server.productVersionDefault : server.versions[lastIndex].name;
|
||||
}
|
||||
});
|
||||
}
|
||||
_this.vmTypesSub.unsubscribe();
|
||||
});
|
||||
};
|
||||
NewProvisionConfirmComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
NewProvisionConfirmComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
if (!this.sendData.description || this.sendData.description.trim() === "") {
|
||||
return;
|
||||
}
|
||||
this.sendData.servers = {};
|
||||
var _loop_1 = function (key) {
|
||||
if (!this_1.sendData.servers[key]) {
|
||||
this_1.sendData.servers[key] = {};
|
||||
}
|
||||
if (this_1.selectedVmType[key]) {
|
||||
this_1.sendData.servers[key].vmType = this_1.selectedVmType[key];
|
||||
}
|
||||
if (this_1.selectedNodeCount[key]) {
|
||||
this_1.sendData.servers[key].nodeCount = this_1.selectedNodeCount[key];
|
||||
}
|
||||
if (this_1.selectedDiskSizeGb[key]) {
|
||||
this_1.sendData.servers[key].diskSizeGb = this_1.selectedDiskSizeGb[key];
|
||||
}
|
||||
this_1.scenario.availableProductVersions.forEach(function (server) {
|
||||
server.versions.forEach(function (v) {
|
||||
if (v.name === _this.selectedProductVersion[key]) {
|
||||
_this.sendData.servers[key].version = v;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
var this_1 = this;
|
||||
for (var key in this.selectedVmType) {
|
||||
_loop_1(key);
|
||||
}
|
||||
console.log("sendData", this.sendData);
|
||||
this.action.next(this.sendData);
|
||||
this.modalRef.hide();
|
||||
};
|
||||
NewProvisionConfirmComponent.prototype.checkOnchange = function ($event) {
|
||||
console.log("Checked?", $event.checked);
|
||||
this.sendData.isExternalAccess = $event.checked;
|
||||
};
|
||||
NewProvisionConfirmComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-provision',
|
||||
templateUrl: './new-provision.component.html',
|
||||
styleUrls: ['./new-provision.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, ScenariosService])
|
||||
], NewProvisionConfirmComponent);
|
||||
return NewProvisionConfirmComponent;
|
||||
}());
|
||||
export { NewProvisionConfirmComponent };
|
||||
//# sourceMappingURL=new-provision.component.js.map
|
||||
1
dist/out-tsc/src/app/modals/new-provision.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/modals/new-provision.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"new-provision.component.js","sourceRoot":"","sources":["../../../../../src/app/modals/new-provision.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE;IAiBE,sCAAoB,QAAqB,EAAU,iBAAmC;QAAlE,aAAQ,GAAR,QAAQ,CAAa;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAdtF,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;QAErC,aAAQ,GAAG;YACT,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,IAAI;YACb,gBAAgB,EAAE,KAAK;SACxB,CAAC;QACF,2BAAsB,GAAQ,EAAE,CAAC;QACjC,mBAAc,GAAQ,EAAE,CAAC;QACzB,sBAAiB,GAAQ,EAAE,CAAC;QAC5B,uBAAkB,GAAQ,EAAE,CAAC;QAG7B,YAAO,GAAQ,EAAE,CAAC;IACwE,CAAC;IAE3F,+CAAQ,GAAR;QAAA,iBA0BC;QAzBC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,CAAC,SAAS,CAAG,UAAA,GAAG;YAC3E,KAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,UAAA,CAAC,IAAE,OAAA,CAAC,CAAC,CAAC,QAAQ,EAAX,CAAW,CAAC,CAAC;YAElD,IAAK,KAAI,CAAC,QAAQ,CAAC,wBAAwB,C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Ac,MAAM;QAClB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC;IAClD,CAAC;IAvFU,4BAA4B;QALxC,SAAS,CAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;SAC9C,CAAC;yCAkB8B,WAAW,EAA6B,gBAAgB;OAjB3E,4BAA4B,CAyFxC;IAAD,mCAAC;CAAA,AAzFD,IAyFC;SAzFY,4BAA4B"}
|
||||
@@ -15,8 +15,8 @@ import { AuthGuard } from '../services/auth.guard';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { AlertService } from '../services/alert.service';
|
||||
import { MDBModalService } from 'angular-bootstrap-md';
|
||||
import { ModalInfoComponent } from '../alert/modalinfo.component';
|
||||
import { ModalConfirmComponent } from '../alert/confirm.component';
|
||||
import { ModalInfoComponent } from '../modals/modalinfo.component';
|
||||
import { ModalConfirmComponent } from '../modals/confirm.component';
|
||||
var ProvisionsComponent = /** @class */ (function () {
|
||||
function ProvisionsComponent(modalService, _alertService, _provisionsService, _scenariosService, _auth) {
|
||||
var _this = this;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@ import { Component, Output, EventEmitter } from '@angular/core';
|
||||
import { ProvisionsService } from '../services/provisions.service';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { AuthGuard } from '../services/auth.guard';
|
||||
import { NewProvisionConfirmComponent } from '../alert/new-provision.component';
|
||||
import { NewProvisionConfirmComponent } from '../modals/new-provision.component';
|
||||
import { MDBModalService } from 'angular-bootstrap-md';
|
||||
var ScenariosComponent = /** @class */ (function () {
|
||||
function ScenariosComponent(modalService, _provisionsService, _scenariosService, _auth) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"scen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
|
||||
38
dist/out-tsc/src/app/services/deployopts.service.js
vendored
Normal file
38
dist/out-tsc/src/app/services/deployopts.service.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../environments/environment.prod';
|
||||
var SubscriptionsService = /** @class */ (function () {
|
||||
function SubscriptionsService(httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
SubscriptionsService.prototype.getSubscriptions = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/deployopts");
|
||||
};
|
||||
SubscriptionsService.prototype.addSubscription = function (data) {
|
||||
return this.httpClient.post(environment.apiVersionPath + "/deployopts", data);
|
||||
};
|
||||
SubscriptionsService.prototype.updateSubscription = function (id, patchData) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/deployopts/" + id, patchData);
|
||||
};
|
||||
SubscriptionsService.prototype.deleteScenario = function (id) {
|
||||
return this.httpClient.delete(environment.apiVersionPath + "/deployopts/" + id);
|
||||
};
|
||||
SubscriptionsService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
}),
|
||||
__metadata("design:paramtypes", [HttpClient])
|
||||
], SubscriptionsService);
|
||||
return SubscriptionsService;
|
||||
}());
|
||||
export { SubscriptionsService };
|
||||
//# sourceMappingURL=deployopts.service.js.map
|
||||
1
dist/out-tsc/src/app/services/deployopts.service.js.map
vendored
Normal file
1
dist/out-tsc/src/app/services/deployopts.service.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"deployopts.service.js","sourceRoot":"","sources":["../../../../../src/app/services/deployopts.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,8BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,+CAAgB,GAAhB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,gBAAa,CAAC,CAAC;IACzE,CAAC;IAED,8CAAe,GAAf,UAAgB,IAAI;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAI,WAAW,CAAC,cAAc,gBAAa,EAAE,IAAI,CAAC,CAAC;IAChF,CAAC;IAED,iDAAkB,GAAlB,UAAmB,EAAE,EAAE,SAAS;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,oBAAe,EAAI,EAAE,SAAS,CAAC,CAAC;IAC1F,CAAC;IAED,6CAAc,GAAd,UAAe,EAAE;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,WAAW,CAAC,cAAc,oBAAe,EAAI,CAAC,CAAC;IAClF,CAAC;IAlBU,oBAAoB;QAHhC,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,oBAAoB,CAoBhC;IAAD,2BAAC;CAAA,AApBD,IAoBC;SApBY,oBAAoB"}
|
||||
@@ -15,7 +15,7 @@ var ProvisionsService = /** @class */ (function () {
|
||||
function ProvisionsService(httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
this.RUNNING_PERIOD = 4;
|
||||
this.STOP_PERIOD = 10;
|
||||
this.STOP_PERIOD = 20;
|
||||
}
|
||||
ProvisionsService.prototype.getProvisionsAdmin = function (filter) {
|
||||
// Initialize Params Object
|
||||
@@ -78,6 +78,9 @@ var ProvisionsService = /** @class */ (function () {
|
||||
return this.selectedProv;
|
||||
};
|
||||
ProvisionsService.prototype.timeRunning = function (p) {
|
||||
if (!p.statusVms) {
|
||||
return;
|
||||
}
|
||||
var now = new Date();
|
||||
var runningFromTime = p.runningFrom ? new Date(p.runningFrom).getTime() : new Date(p.created).getTime();
|
||||
var totalRunningTime = p.timeRunning * 1000 * 60;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"provisions.service.js","sourceRoot":"","sources":["../../../../../src/app/services/provisions.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAMjC;IAME,2BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAH3C,mBAAc,GAAY,CAAC,CAAC;QAC5B,gBAAW,GAAY,EAAE,CAAC;IAEsB,CAAC;IAEjD,8CAAkB,GAAlB,UAAoB,MAAY;QAC9B,2BAA2B;QAC3B,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAK,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,g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G,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;YAC3C,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAChE,IAAI,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,aAAa,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC3C,CAAC,CAAC,eAAe,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC;SAChD;IAEH,CAAC;IA/HU,iBAAiB;QAH7B,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAOiC,UAAU;OANhC,iBAAiB,CAiI7B;IAAD,wBAAC;CAAA,AAjID,IAiIC;SAjIY,iBAAiB"}
|
||||
@@ -20,9 +20,6 @@ var ScenariosService = /** @class */ (function () {
|
||||
ScenariosService.prototype.getScenariosAll = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/scenarios/all");
|
||||
};
|
||||
ScenariosService.prototype.getScenarioVmtypes = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/scenarios/vmtypes");
|
||||
};
|
||||
ScenariosService.prototype.updateScenario = function (id, patchData) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/scenarios/" + id, patchData);
|
||||
};
|
||||
@@ -32,6 +29,18 @@ var ScenariosService = /** @class */ (function () {
|
||||
ScenariosService.prototype.deleteScenario = function (id) {
|
||||
return this.httpClient.delete(environment.apiVersionPath + "/scenarios/" + id);
|
||||
};
|
||||
ScenariosService.prototype.getScenarioVmtypes = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/scenarios/vmtypes");
|
||||
};
|
||||
ScenariosService.prototype.createScenarioVmtype = function (data) {
|
||||
return this.httpClient.post(environment.apiVersionPath + "/scenarios/vmtypes", data);
|
||||
};
|
||||
ScenariosService.prototype.updateScenarioVmtype = function (id, data) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/scenarios/vmtypes/" + id, data);
|
||||
};
|
||||
ScenariosService.prototype.deleteScenarioVmtype = function (id) {
|
||||
return this.httpClient.delete(environment.apiVersionPath + "/scenarios/vmtypes/" + id);
|
||||
};
|
||||
ScenariosService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"scenarios.service.js","sourceRoot":"","sources":["../../../../../src/app/services/scenarios.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,0BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,uCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,eAAY,CAAC,CAAC;IACxE,CAAC;IAED,0CAAe,GAAf;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAED,6CAAkB,GAAlB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,uBAAoB,CAAC,CAAC;IAChF,CAAC;IAED,yCAAc,GAAd,UAAe,EAAE,EAAE,SAAS;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAc,EAAI,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;IAED,sCAAW,GAAX,UAAY,IAAI;QACd,OAAO,IAAI,CAAC,UAAU,CA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d,UAAe,EAAE;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,WAAW,CAAC,cAAc,mBAAc,EAAI,CAAC,CAAC;IACjF,CAAC;IAGD,6CAAkB,GAAlB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,uBAAoB,CAAC,CAAC;IAChF,CAAC;IAED,+CAAoB,GAApB,UAAqB,IAAI;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAI,WAAW,CAAC,cAAc,uBAAoB,EAAE,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,+CAAoB,GAApB,UAAqB,EAAE,EAAE,IAAI;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,2BAAsB,EAAI,EAAE,IAAI,CAAC,CAAC;IAC5F,CAAC;IAED,+CAAoB,GAApB,UAAqB,EAAE;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,WAAW,CAAC,cAAc,2BAAsB,EAAI,CAAC,CAAC;IACzF,CAAC;IAvCU,gBAAgB;QAH5B,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,gBAAgB,CAyC5B;IAAD,uBAAC;CAAA,AAzCD,IAyCC;SAzCY,gBAAgB"}
|
||||
@@ -26,6 +26,15 @@ var UsersService = /** @class */ (function () {
|
||||
UsersService.prototype.getNotifications = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/notifications");
|
||||
};
|
||||
UsersService.prototype.getApiKeys = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/apikeys");
|
||||
};
|
||||
UsersService.prototype.addApikey = function (userId) {
|
||||
return this.httpClient.post(environment.apiVersionPath + "/apikeys/" + userId, null);
|
||||
};
|
||||
UsersService.prototype.delApikey = function (id) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/apikeys/" + id, null);
|
||||
};
|
||||
UsersService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../../../../src/app/services/users.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,sBAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,4BAAK,GAAL;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,cAAW,CAAC,CAAC;IACvE,CAAC;IAED,+BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,WAAQ,CAAC,CAAC;IACpE,CAAC;IAED,iCAAU,GAAV,UAAW,MAAM,EAAE,SAAS;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,eAAU,MAAQ,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;IAED,uCAAgB,GAAhB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAlBU,YAAY;QAHxB,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,YAAY,CAmBxB;IAAD,mBAAC;CAAA,AAnBD,IAmBC;SAnBY,YAAY"}
|
||||
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../../../../src/app/services/users.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,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sc/src/app/stats/stats.component.js
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import * as require from '../../assets/js/require.js';
|
||||
//import * as jquery from 'src/assets/js/jquery';
|
||||
var StatsComponent = /** @class */ (function () {
|
||||
//scripts : [ "../../assets/js/require.js" ];
|
||||
function StatsComponent() {
|
||||
this.sections = ['Overview', 'Historical'];
|
||||
this.tab = 'Overview';
|
||||
var config = {
|
||||
host: 'qmi-qs-72a4',
|
||||
prefix: 'office365',
|
||||
port: 443,
|
||||
isSecure: true
|
||||
};
|
||||
require.config({
|
||||
baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
|
||||
});
|
||||
require(["js/qlik"], function (qlik) {
|
||||
console.log("QLIK", qlik);
|
||||
//qlik.on( "error", function ( error ) {
|
||||
//$( '#popupText' ).append( error.message + "<br>" );
|
||||
//$( '#popup' ).fadeIn( 1000 );
|
||||
//} );
|
||||
//$( "#closePopup" ).click( function () {
|
||||
//$( '#popup' ).hide();
|
||||
/*var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
app.getObject('QV01','dEAEcX' );
|
||||
} );
|
||||
|
||||
//callbacks -- inserted here --
|
||||
//open apps -- inserted here --
|
||||
//get objects -- inserted here --
|
||||
//create cubes and lists -- inserted here --
|
||||
|
||||
//var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
//app.getObject('QV01','dEAEcX' );
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("I'm the TD BANK mashup", event);
|
||||
}
|
||||
|
||||
tabSelect($event, tab) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
this.tab = tab;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
//qlik.on( "error", function ( error ) {
|
||||
//$( '#popupText' ).append( error.message + "<br>" );
|
||||
//$( '#popup' ).fadeIn( 1000 );
|
||||
//} );
|
||||
//$( "#closePopup" ).click( function () {
|
||||
//$( '#popup' ).hide();
|
||||
/*var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
app.getObject('QV01','dEAEcX' );
|
||||
} );
|
||||
|
||||
//callbacks -- inserted here --
|
||||
//open apps -- inserted here --
|
||||
//get objects -- inserted here --
|
||||
//create cubes and lists -- inserted here --
|
||||
|
||||
//var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
//app.getObject('QV01','dEAEcX' );
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("I'm the TD BANK mashup", event);
|
||||
}
|
||||
|
||||
tabSelect($event, tab) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
this.tab = tab;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
StatsComponent = __decorate([
|
||||
Component({
|
||||
selector: 'app-stats',
|
||||
templateUrl: './stats.component.html',
|
||||
styleUrls: ['./stats.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [])
|
||||
], StatsComponent);
|
||||
return StatsComponent;
|
||||
}());
|
||||
export { StatsComponent };
|
||||
//qlik.on( "error", function ( error ) {
|
||||
//$( '#popupText' ).append( error.message + "<br>" );
|
||||
//$( '#popup' ).fadeIn( 1000 );
|
||||
//} );
|
||||
//$( "#closePopup" ).click( function () {
|
||||
//$( '#popup' ).hide();
|
||||
/*var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
app.getObject('QV01','dEAEcX' );
|
||||
} );
|
||||
|
||||
//callbacks -- inserted here --
|
||||
//open apps -- inserted here --
|
||||
//get objects -- inserted here --
|
||||
//create cubes and lists -- inserted here --
|
||||
|
||||
//var app = qlik.openApp('dae8a66d-facf-4554-9ca7-236680144b2c', config );
|
||||
//app.getObject('QV01','dEAEcX' );
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log("I'm the TD BANK mashup", event);
|
||||
}
|
||||
|
||||
tabSelect($event, tab) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
this.tab = tab;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//# sourceMappingURL=stats.component.js.map
|
||||
1
dist/out-tsc/src/app/stats/stats.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/stats/stats.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stats.component.js","sourceRoot":"","sources":["../../../../../src/app/stats/stats.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,iDAAiD;AAQjD;IAIE,6CAA6C;IAG7C;QALA,aAAQ,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QACtC,QAAG,GAAa,UAAU,CAAC;QAMzB,IAAI,MAAM,GAAG;YACX,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,OAAO,CAAC,MAAM,CAAE;YACZ,OAAO,EAAE,CAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAE,GAAG,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,WAAW;SAC7I,CAAE,CAAC;QAEJ,OAAO,CAAE,CAAC,SAAS,CAAC,EAAE,UAAW,IAAI;YAEnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1B,wCAAwC;YACxC,qDAAqD;YACrD,+BAA+B;YAC/B,MAAM;YACN,yCAAyC;YACzC,uBAAuB;YAEvB;;;;;;;;;;;;;;;;;;;;;;;;;YAyBN;QAAA,CAAC,AAjC+B,CAAA,CAAA;QAC1B,wCAAwC;QACxC,qDAAqD;QACrD,+BAA+B;QAC/B,MAAM;QACN,yCAAyC;QACzC,uBAAuB;QAEvB;;;;;;;;;;;;;;;;;;;;;;;;;QAyBN;IAAA,CAAC,AAjC+B;IAtBnB,cAAc;QAN1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;;OAEW,cAAc,CAsBK;IAiChC,qBAAC;CAjC+B,AAtBhC,IAsBgC;SAtBnB,cAAc;AAuBrB,wCAAwC;AACxC,qDAAqD;AACrD,+BAA+B;AAC/B,MAAM;AACN,yCAAyC;AACzC,uBAAuB;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;AAyBN"}
|
||||
21
dist/out-tsc/src/app/stats/stats.component.spec.js
vendored
Normal file
21
dist/out-tsc/src/app/stats/stats.component.spec.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { StatsComponent } from './stats.component';
|
||||
describe('StatsComponent', function () {
|
||||
var component;
|
||||
var fixture;
|
||||
beforeEach(async(function () {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [StatsComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
beforeEach(function () {
|
||||
fixture = TestBed.createComponent(StatsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('should create', function () {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=stats.component.spec.js.map
|
||||
1
dist/out-tsc/src/app/stats/stats.component.spec.js.map
vendored
Normal file
1
dist/out-tsc/src/app/stats/stats.component.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stats.component.spec.js","sourceRoot":"","sources":["../../../../../src/app/stats/stats.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE;IACzB,IAAI,SAAyB,CAAC;IAC9B,IAAI,OAAyC,CAAC;IAE9C,UAAU,CAAC,KAAK,CAAC;QACf,OAAO,CAAC,sBAAsB,CAAC;YAC7B,YAAY,EAAE,CAAE,cAAc,CAAE;SACjC,CAAC;aACD,iBAAiB,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC,CAAC;IAEJ,UAAU,CAAC;QACT,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;QAClD,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACtC,OAAO,CAAC,aAAa,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE;QAClB,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||
132
dist/out-tsc/src/app/tables/table-apikeys.component.js
vendored
Normal file
132
dist/out-tsc/src/app/tables/table-apikeys.component.js
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { UsersService } from '../services/users.service';
|
||||
import { ApikeyModalComponent } from '../modals/edit-apikey.component';
|
||||
import { ModalConfirmComponent } from '../modals/confirm.component';
|
||||
var TableApiKeysComponent = /** @class */ (function () {
|
||||
function TableApiKeysComponent(modalService, cdRef, _usersService) {
|
||||
this.modalService = modalService;
|
||||
this.cdRef = cdRef;
|
||||
this._usersService = _usersService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
}
|
||||
TableApiKeysComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableApiKeysComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableApiKeysComponent.prototype.ngOnInit = function () {
|
||||
this.refreshData();
|
||||
};
|
||||
TableApiKeysComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var sub = this._usersService.getApiKeys().subscribe(function (res) {
|
||||
sub.unsubscribe();
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableApiKeysComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableApiKeysComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableApiKeysComponent.prototype.openNewApiKeyModal = function (apiKey) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ApikeyModalComponent, {
|
||||
class: 'modal-lg modal-notify',
|
||||
containerClass: '',
|
||||
data: {
|
||||
apiKey: apiKey
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (data) {
|
||||
sub.unsubscribe();
|
||||
console.log("new api key data", data);
|
||||
_this.refreshData();
|
||||
});
|
||||
};
|
||||
TableApiKeysComponent.prototype.openConfirmDeleteModal = function (apiKey) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-danger',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm revoke?',
|
||||
icon: ''
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._usersService.delApikey(apiKey._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.refreshData();
|
||||
});
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableApiKeysComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableApiKeysComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableApiKeysComponent.prototype, "oninput", null);
|
||||
TableApiKeysComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-apikeys',
|
||||
templateUrl: './table-apikeys.component.html',
|
||||
styleUrls: ['./table-apikeys.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ChangeDetectorRef, UsersService])
|
||||
], TableApiKeysComponent);
|
||||
return TableApiKeysComponent;
|
||||
}());
|
||||
export { TableApiKeysComponent };
|
||||
//# sourceMappingURL=table-apikeys.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-apikeys.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-apikeys.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"table-apikeys.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-apikeys.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,eAAe,EAAE,MA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AzG2D;QAAzD,SAAS,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAqB,2BAA2B;qEAAC;IAC1D;QAA/C,SAAS,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAW,iBAAiB;2DAAC;IASrD;QAAtB,YAAY,CAAC,OAAO,CAAC;;;;wDAErB;IAdU,qBAAqB;QALjC,SAAS,CAAC;YACT,QAAQ,EAAE,eAAe;YACzB,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;SAC9C,CAAC;yCAiBkC,eAAe,EAAiB,iBAAiB,EAAyB,YAAY;OAhB7G,qBAAqB,CA6GjC;IAAD,4BAAC;CAAA,AA7GD,IA6GC;SA7GY,qBAAqB"}
|
||||
@@ -11,8 +11,8 @@ import { Component, HostListener, ViewChild, ChangeDetectorRef } from '@angular/
|
||||
import { MdbTableDirective, MdbTablePaginationComponent, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { ProvisionsService } from '../services/provisions.service';
|
||||
import { AlertService } from '../services/alert.service';
|
||||
import { ModalInfoComponent } from '../alert/modalinfo.component';
|
||||
import { ModalConfirmComponent } from '../alert/confirm.component';
|
||||
import { ModalInfoComponent } from '../modals/modalinfo.component';
|
||||
import { ModalConfirmComponent } from '../modals/confirm.component';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
var TableProvisionsAdminComponent = /** @class */ (function () {
|
||||
function TableProvisionsAdminComponent(modalService, _scenariosService, _alertService, cdRef, _provisionsService) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { ScenarioModalComponent } from '../alert/edit-scenario.component';
|
||||
import { ScenarioModalComponent } from '../modals/edit-scenario.component';
|
||||
var TableScenariosComponent = /** @class */ (function () {
|
||||
function TableScenariosComponent(modalService, cdRef, _scenariosService) {
|
||||
this.modalService = modalService;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"table-scenarios.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-scenarios.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvG,OAAO,EAAE,SAAS,EAAU,SAAS,EAAE,YAAY,EAAiB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAO1E;IAmBE,iCAAoB,YAA6B,EAAU,KAAwB,EAAU,iBAAmC;QAA5G,iBAAY,GAAZ,YAAY,CAAiB;QAAU,UAAK,GAAL,KAAK,CAAmB;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAdhI,aAAQ,GAAQ,EAAE,CAAC;QACnB,eAAU,GAAW,EAAE,CAAC;QACxB,oBAAe,GAAW,EAAE,CAAC;QAM7B,aAAQ,GAAG,EAAE,CAAC;IAOd,CAAC;IALsB,yCAAO,GAAP;QACrB,IAAI,CAAC,kBAAkB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACvD,CAAC;IAKO,+CAAa,GAArB;QACE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAEO,0CAAQ,GAAhB;QAAA,iB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AE,IAAI,CAAC,CAAC;YACvC,KAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IA3IyD;QAAzD,SAAS,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAqB,2BAA2B;uEAAC;IAC1D;QAA/C,SAAS,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAW,iBAAiB;6DAAC;IAYrD;QAAtB,YAAY,CAAC,OAAO,CAAC;;;;0DAErB;IAjBU,uBAAuB;QALnC,SAAS,CAAC;YACT,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,kCAAkC;YAC/C,SAAS,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;yCAoBkC,eAAe,EAAiB,iBAAiB,EAA6B,gBAAgB;OAnBrH,uBAAuB,CA+InC;IAAD,8BAAC;CAAA,AA/ID,IA+IC;SA/IY,uBAAuB"}
|
||||
111
dist/out-tsc/src/app/tables/table-subscriptions.component.js
vendored
Normal file
111
dist/out-tsc/src/app/tables/table-subscriptions.component.js
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { SubscriptionModalComponent } from '../modals/edit-subscription.component';
|
||||
import { SubscriptionsService } from '../services/deployopts.service';
|
||||
var TableSubsComponent = /** @class */ (function () {
|
||||
function TableSubsComponent(modalService, cdRef, _subscriptionsService) {
|
||||
this.modalService = modalService;
|
||||
this.cdRef = cdRef;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
}
|
||||
TableSubsComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableSubsComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableSubsComponent.prototype.ngOnInit = function () {
|
||||
this.refreshData();
|
||||
};
|
||||
TableSubsComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var usersSub = this._subscriptionsService.getSubscriptions().subscribe(function (res) {
|
||||
usersSub.unsubscribe();
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableSubsComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableSubsComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableSubsComponent.prototype.openNewSubsModal = function (subscription) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(SubscriptionModalComponent, {
|
||||
class: 'modal-md modal-notify',
|
||||
containerClass: '',
|
||||
data: {
|
||||
subscription: subscription
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (data) {
|
||||
sub.unsubscribe();
|
||||
console.log("new subs data", data);
|
||||
_this.refreshData();
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableSubsComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableSubsComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableSubsComponent.prototype, "oninput", null);
|
||||
TableSubsComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-subscriptions',
|
||||
templateUrl: './table-subscriptions.component.html',
|
||||
styleUrls: ['./table-subscriptions.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ChangeDetectorRef, SubscriptionsService])
|
||||
], TableSubsComponent);
|
||||
return TableSubsComponent;
|
||||
}());
|
||||
export { TableSubsComponent };
|
||||
//# sourceMappingURL=table-subscriptions.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-subscriptions.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-subscriptions.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"table-subscriptions.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-subscriptions.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvG,OAAO,EAAE,SAAS,EAAU,SAAS,EAAE,YAAY,EAAiB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAOtE;IAiBE,4BAAoB,YAA6B,EAAU,KAAwB,EAAU,qBAA2C;QAApH,iBAAY,GAAZ,YAAY,CAAiB;QAAU,UAAK,GAAL,KAAK,CAAmB;QAAU,0BAAqB,GAArB,qBAAqB,CAAsB;QAZxI,aAAQ,GAAQ,EAAE,CAAC;QACnB,eAAU,GAAW,EAAE,CAAC;QACxB,oBAAe,GAAW,EAAE,CAAC;QAG7B,YAAO,GAAY,KAAK,CAAC;QACzB,aAAQ,GAAG,EAAE,CAAC;IAOd,CAAC;IALsB,oCAAO,GAAP;QACrB,IAAI,CAAC,kBAAkB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACvD,CAAC;IAKO,0CAAa,GAArB;QACE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAED,qCAAQ,GAAR;QACE,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED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kB,CAyF9B;IAAD,yBAAC;CAAA,AAzFD,IAyFC;SAzFY,kBAAkB"}
|
||||
131
dist/out-tsc/src/app/tables/table-vmtypes.component.js
vendored
Normal file
131
dist/out-tsc/src/app/tables/table-vmtypes.component.js
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { ModalConfirmComponent } from '../modals/confirm.component';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { VmTypeModalComponent } from '../modals/edit-vmtype.component';
|
||||
var TableVmTypesComponent = /** @class */ (function () {
|
||||
function TableVmTypesComponent(modalService, cdRef, _scenariosService) {
|
||||
this.modalService = modalService;
|
||||
this.cdRef = cdRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
}
|
||||
TableVmTypesComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableVmTypesComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableVmTypesComponent.prototype.ngOnInit = function () {
|
||||
this.refreshData();
|
||||
};
|
||||
TableVmTypesComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var sub = this._scenariosService.getScenarioVmtypes().subscribe(function (res) {
|
||||
sub.unsubscribe();
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableVmTypesComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableVmTypesComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableVmTypesComponent.prototype.openNewVmTypeModal = function (apiKey) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(VmTypeModalComponent, {
|
||||
class: 'modal-lg modal-notify',
|
||||
containerClass: '',
|
||||
data: {
|
||||
item: apiKey
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (data) {
|
||||
sub.unsubscribe();
|
||||
console.log("new api key data", data);
|
||||
_this.refreshData();
|
||||
});
|
||||
};
|
||||
TableVmTypesComponent.prototype.openConfirmDeleteModal = function (apiKey) {
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-danger',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm revoke?',
|
||||
icon: ''
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
/*this._usersService.delApikey(apiKey._id).subscribe( res=> {
|
||||
console.log("done", res);
|
||||
this.refreshData();
|
||||
});*/
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableVmTypesComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableVmTypesComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableVmTypesComponent.prototype, "oninput", null);
|
||||
TableVmTypesComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-vmtypes',
|
||||
templateUrl: './table-vmtypes.component.html',
|
||||
styleUrls: ['./table-vmtypes.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ChangeDetectorRef, ScenariosService])
|
||||
], TableVmTypesComponent);
|
||||
return TableVmTypesComponent;
|
||||
}());
|
||||
export { TableVmTypesComponent };
|
||||
//# sourceMappingURL=table-vmtypes.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-vmtypes.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-vmtypes.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{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MAAM,EAAE,IAAI,EAAE,CAAC;kCAAqB,2BAA2B;qEAAC;IAC1D;QAA/C,SAAS,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAW,iBAAiB;2DAAC;IASrD;QAAtB,YAAY,CAAC,OAAO,CAAC;;;;wDAErB;IAdU,qBAAqB;QALjC,SAAS,CAAC;YACT,QAAQ,EAAE,eAAe;YACzB,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;SAC9C,CAAC;yCAiBkC,eAAe,EAAiB,iBAAiB,EAA6B,gBAAgB;OAhBrH,qBAAqB,CA6GjC;IAAD,4BAAC;CAAA,AA7GD,IA6GC;SA7GY,qBAAqB"}
|
||||
BIN
dist/qmi-cloud/3rdpartylicenses.txt
vendored
BIN
dist/qmi-cloud/3rdpartylicenses.txt
vendored
Binary file not shown.
135423
dist/qmi-cloud/assets/js/qdt-components.js
vendored
Normal file
135423
dist/qmi-cloud/assets/js/qdt-components.js
vendored
Normal file
File diff suppressed because one or more lines are too long
52
dist/qmi-cloud/assets/js/qlikMashupQCS.js
vendored
Normal file
52
dist/qmi-cloud/assets/js/qlikMashupQCS.js
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var qlikMashup = (function() {
|
||||
|
||||
const { qdtCapabilityApp, QdtViz } = QdtComponents;
|
||||
|
||||
const initMyQdt = async function(config, returnto) {
|
||||
|
||||
const urlLoggedIn = "/api/v1/users/me";//Use GET request to see if you are authenticated
|
||||
const urlLogin = "/login";
|
||||
|
||||
const response = await fetch(`https://${config.host}${urlLoggedIn}`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Qlik-Web-Integration-ID': config.webIntegrationId
|
||||
}
|
||||
})
|
||||
|
||||
if( response.status===401 ) {
|
||||
const url = new URL(`https://${config.host}${urlLogin}`);
|
||||
url.searchParams.append('returnto', returnto);
|
||||
url.searchParams.append('qlik-web-integration-id', config.webIntegrationId);
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
const user = await response.json();
|
||||
const capabilityApiAppPromise = qdtCapabilityApp(config);
|
||||
const app = await capabilityApiAppPromise;
|
||||
|
||||
return {app: app, user: user};
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
"initMyQdt": initMyQdt,
|
||||
|
||||
"myQdtViz": function(app, divId, qlikObjectId, height, type){
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById(divId),
|
||||
app,
|
||||
options: {
|
||||
type: type,
|
||||
id: qlikObjectId,
|
||||
height: height
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})(qlikMashup||{})
|
||||
|
||||
BIN
dist/qmi-cloud/assets/user1.png
vendored
Normal file
BIN
dist/qmi-cloud/assets/user1.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
4
dist/qmi-cloud/index.html
vendored
4
dist/qmi-cloud/index.html
vendored
@@ -6,8 +6,8 @@
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="assets/favicon.ico">
|
||||
<link rel="stylesheet" href="styles.5de5451578cdd1ad7eb0.css"></head>
|
||||
<link rel="stylesheet" href="styles.d596c43fc1f81eecfae1.css"></head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
<script src="runtime.689ba4fd6cadb82c1ac2.js" defer></script><script src="polyfills-es5.f752a17531a45fe93c1f.js" nomodule defer></script><script src="polyfills.06ba8d1a3d9dd3a8e8b9.js" defer></script><script src="scripts.5520a99f673924c17e00.js" defer></script><script src="main.e9f73c1cbb9915107acb.js" defer></script></body>
|
||||
<script src="runtime.689ba4fd6cadb82c1ac2.js" defer></script><script src="polyfills-es5.2f1b30b563fe6f309b2d.js" nomodule defer></script><script src="polyfills.60117177d3b4f4827ace.js" defer></script><script src="scripts.73c34722d75b092f2620.js" defer></script><script src="main.ece894ac50d4edc475b5.js" defer></script></body>
|
||||
</html>
|
||||
|
||||
1
dist/qmi-cloud/main.e9f73c1cbb9915107acb.js
vendored
1
dist/qmi-cloud/main.e9f73c1cbb9915107acb.js
vendored
File diff suppressed because one or more lines are too long
1
dist/qmi-cloud/main.ece894ac50d4edc475b5.js
vendored
Normal file
1
dist/qmi-cloud/main.ece894ac50d4edc475b5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
dist/qmi-cloud/scripts.73c34722d75b092f2620.js
vendored
Normal file
1
dist/qmi-cloud/scripts.73c34722d75b092f2620.js
vendored
Normal file
File diff suppressed because one or more lines are too long
74
dist/qmi-cloud/styles.5de5451578cdd1ad7eb0.css
vendored
74
dist/qmi-cloud/styles.5de5451578cdd1ad7eb0.css
vendored
File diff suppressed because one or more lines are too long
80
dist/qmi-cloud/styles.d596c43fc1f81eecfae1.css
vendored
Normal file
80
dist/qmi-cloud/styles.d596c43fc1f81eecfae1.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -56,6 +56,7 @@ services:
|
||||
target: config.json
|
||||
environment:
|
||||
- HOSTNAME_URL=http://localhost:3000
|
||||
- BACKEND_LOGS_URL=http://localhost:8888
|
||||
- REDIS_URL=redis://redis
|
||||
- MONGO_URI=mongodb://root:example@mongo/qmicloud?authSource=admin
|
||||
- CERT_PFX_FILENAME=
|
||||
@@ -75,6 +76,8 @@ services:
|
||||
# -------------------
|
||||
- ../qmi-cloud-provisions:/provisions
|
||||
- ./logs:/logs
|
||||
- ./costexport:/var/www/app/costexport
|
||||
- ./photos:/var/www/app/photos
|
||||
#- ./certs:/var/www/app/server/certs
|
||||
depends_on:
|
||||
- mongo
|
||||
@@ -93,9 +96,10 @@ services:
|
||||
container_name: qmi-cloud-worker
|
||||
restart: on-failure
|
||||
environment:
|
||||
- HOSTNAME_URL=http://localhost:3000
|
||||
- REDIS_URL=redis://redis
|
||||
- MONGO_URI=mongodb://root:example@mongo/qmicloud?authSource=admin
|
||||
- PROJECT_PATH=${PWD}
|
||||
- PROJECT_PATH=%PWD%
|
||||
- GIT_SCENARIOS=git::git@gitlab.com:qmi/qmi-cloud-scenarios.git
|
||||
- GIT_TAG=dev
|
||||
- SSHPATH=/Users/aor/.ssh
|
||||
@@ -104,7 +108,7 @@ services:
|
||||
command: "sh -c 'npm run start:dev'"
|
||||
volumes:
|
||||
# -- Dev only volumes
|
||||
- ./worker:/app/worker
|
||||
- ./qmi-cloud-worker:/app/worker
|
||||
# -------------------
|
||||
- ./logs:/logs
|
||||
- /var/run/docker.sock:/home/docker.sock
|
||||
@@ -129,3 +133,14 @@ services:
|
||||
ME_CONFIG_BASICAUTH_PASSWORD: Qlik1234
|
||||
networks:
|
||||
- backend
|
||||
|
||||
dozzle:
|
||||
image: amir20/dozzle:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
ports:
|
||||
- 8888:8080
|
||||
#environment:
|
||||
# DOZZLE_BASE: "/dozzle"
|
||||
networks:
|
||||
- backend
|
||||
@@ -22,7 +22,8 @@ echo "--- Building image: qlikgear/qmi-cloud-cli:$TAG_CLI"
|
||||
docker build -f ./qmi-cloud-cli/Dockerfile -t qlikgear/qmi-cloud-cli:$TAG_CLI ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-cli:$TAG_CLI"
|
||||
docker push qlikgear/qmi-cloud-cli:$TAG_CLI
|
||||
docker build -f ./qmi-cloud-cli/Dockerfile -t qlikgear/qmi-cloud-cli:$STABLE_TAG ./
|
||||
docker image tag qlikgear/qmi-cloud-cli:$TAG_CLI qlikgear/qmi-cloud-cli:$STABLE_TAG
|
||||
#docker build -f ./qmi-cloud-cli/Dockerfile -t qlikgear/qmi-cloud-cli:$STABLE_TAG ./
|
||||
docker push qlikgear/qmi-cloud-cli:$STABLE_TAG
|
||||
|
||||
|
||||
@@ -30,12 +31,14 @@ echo "--- Building image: qlikgear/qmi-cloud-worker:$TAG_WORKER"
|
||||
docker build -f ./qmi-cloud-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$TAG_WORKER ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-worker:$TAG_WORKER"
|
||||
docker push qlikgear/qmi-cloud-worker:$TAG_WORKER
|
||||
docker build -f ./qmi-cloud-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$STABLE_TAG ./
|
||||
docker image tag qlikgear/qmi-cloud-worker:$TAG_WORKER qlikgear/qmi-cloud-worker:$STABLE_TAG
|
||||
#docker build -f ./qmi-cloud-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$STABLE_TAG ./
|
||||
docker push qlikgear/qmi-cloud-worker:$STABLE_TAG
|
||||
|
||||
echo "--- Building image: qlikgear/qmi-cloud-app:$TAG_APP"
|
||||
docker build -f ./Dockerfile -t qlikgear/qmi-cloud-app:$TAG_APP ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-app:$TAG_APP"
|
||||
docker push qlikgear/qmi-cloud-app:$TAG_APP
|
||||
docker build -f ./Dockerfile -t qlikgear/qmi-cloud-app:$STABLE_TAG ./
|
||||
docker image tag qlikgear/qmi-cloud-app:$TAG_APP qlikgear/qmi-cloud-app:$STABLE_TAG
|
||||
#docker build -f ./Dockerfile -t qlikgear/qmi-cloud-app:$STABLE_TAG ./
|
||||
docker push qlikgear/qmi-cloud-app:$STABLE_TAG
|
||||
|
||||
89
mystatsmashup/index.html
Normal file
89
mystatsmashup/index.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<!doctype html>
|
||||
<!-- <html qva-bootstrap="false" lang="en"> -->
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Simple html with qdt-components</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="HandheldFriendly" content="True">
|
||||
<meta name="MobileOptimized" content="320">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta http-equiv="cleartype" content="on">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
|
||||
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<!-- <script type="text/javascript" src="https://qdt-apps.qlik.com/qdt-components/v3/3.0.0/qdt-components.js"></script> -->
|
||||
<script type="text/javascript" src="qdt-components.js"></script>
|
||||
<script type="text/javascript" src="index.js"></script>
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
div.qvobject {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.row {
|
||||
padding: 10px 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="currentselections" style="width: 100%;height: 40px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div id="filterstatus" style="width: 100%;height: 40px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div id="totalprovkpi" class="qvobject"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div id="costhismonth" class="qvobject"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div id="statusprov" class="qvobject"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="qdt1" class="qvobject"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div id="qdt1a" class="qvobject"></div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="qdt3" class="qvobject"></div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div id="qdt4" class="qvobject"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
119
mystatsmashup/index.js
Normal file
119
mystatsmashup/index.js
Normal file
@@ -0,0 +1,119 @@
|
||||
// https://help.qlik.com/en-US/sense-developer/June2020/Subsystems/Mashups/Content/Sense_Mashups/mashups-authentication-cloud.htm
|
||||
// https://qlik.dev/tutorials/build-a-simple-web-app
|
||||
const config = {
|
||||
host: "gear-presales.eu.qlikcloud.com",
|
||||
secure: true,
|
||||
port: 443,
|
||||
prefix: "",
|
||||
webIntegrationId: 'n4kMLH62hvXXC84q2vdfW15WUvrUw-HU',
|
||||
appId: "2d03e11f-f3d8-4ba7-a123-be5a282fb9f1"
|
||||
}
|
||||
const urlLoggedIn = "/api/v1/audits";//Use GET request to see if you are authenticated
|
||||
const urlLogin = "/login";
|
||||
|
||||
const init = async () => {
|
||||
const response = await fetch(`https://${config.host}${urlLoggedIn}`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Qlik-Web-Integration-ID': config.webIntegrationId
|
||||
}
|
||||
})
|
||||
if(response.status===401){
|
||||
const url = new URL(`https://${config.host}/login`);
|
||||
url.searchParams.append('returnto', 'http://localhost:3000/mystats');
|
||||
url.searchParams.append('qlik-web-integration-id', config.webIntegrationId);
|
||||
window.location.href = url;
|
||||
}
|
||||
const { qdtCapabilityApp, QdtViz } = QdtComponents;
|
||||
const capabilityApiAppPromise = qdtCapabilityApp(config);
|
||||
const app = await capabilityApiAppPromise;
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('currentselections'),
|
||||
app,
|
||||
options: {
|
||||
id: 'CurrentSelections',
|
||||
height: "40px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('qdt1'),
|
||||
app,
|
||||
options: {
|
||||
type: 'table',
|
||||
id: 'mCjaU',
|
||||
height: "300px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('qdt1a'),
|
||||
app,
|
||||
options: {
|
||||
type: "piechart",
|
||||
id: 'XrnNdj',
|
||||
height: "300px"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('qdt3'),
|
||||
app,
|
||||
options: {
|
||||
type: "linechart",
|
||||
id: 'QfYrJj',
|
||||
height: "300px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('qdt4'),
|
||||
app,
|
||||
options: {
|
||||
type: "barchart",
|
||||
id: 'JvSJCW',
|
||||
height: "300px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('totalprovkpi'),
|
||||
app,
|
||||
options: {
|
||||
id: 'zWDmhfq',
|
||||
height: "100px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('filterstatus'),
|
||||
app,
|
||||
options: {
|
||||
id: 'uznaVCC',
|
||||
height: "40px"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('costhismonth'),
|
||||
app,
|
||||
options: {
|
||||
type: "kpi",
|
||||
id: "GkRz",
|
||||
height: "100px"
|
||||
},
|
||||
});
|
||||
|
||||
QdtViz({
|
||||
element: document.getElementById('statusprov'),
|
||||
app,
|
||||
options: {
|
||||
id: 'kXyQPa',
|
||||
height: "150px"
|
||||
},
|
||||
});
|
||||
}
|
||||
135423
mystatsmashup/qdt-components.js
Normal file
135423
mystatsmashup/qdt-components.js
Normal file
File diff suppressed because one or more lines are too long
15490
package-lock.json
generated
Normal file
15490
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "qmi-cloud-app",
|
||||
"version": "1.1.5",
|
||||
"version": "1.3.0",
|
||||
"scripts": {
|
||||
"start": "node -r esm server/server.js",
|
||||
"start:dev": "nodemon -r esm server/server.js",
|
||||
@@ -8,23 +8,26 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"qmi-cloud-common": "./qmi-cloud-common",
|
||||
"@angular-devkit/build-angular": "^0.900.7",
|
||||
"@angular/animations": "~9.0.7",
|
||||
"@angular/cdk": "^9.0.0",
|
||||
"@angular/common": "~9.0.7",
|
||||
"@angular/compiler": "~9.0.7",
|
||||
"@angular/core": "~9.0.7",
|
||||
"@angular/forms": "~9.0.7",
|
||||
"@angular/http": "~7.0.0",
|
||||
"@angular/localize": "~9.0.7",
|
||||
"@angular/platform-browser": "~9.0.7",
|
||||
"@angular/platform-browser-dynamic": "~9.0.7",
|
||||
"@angular/router": "~9.0.7",
|
||||
"@fortawesome/fontawesome-free": "^5.12.1",
|
||||
"@hapi/boom": "^9.1.0",
|
||||
"@ng-bootstrap/ng-bootstrap": "6.2.0",
|
||||
"@types/chart.js": "^2.9.16",
|
||||
"adal-angular4": "^4.0.12",
|
||||
"angular-bootstrap-md": "^9.0.0",
|
||||
"angular-bootstrap-md": "9.0.0",
|
||||
"animate.css": "^3.7.2",
|
||||
"axios": "^0.21.1",
|
||||
"body-parser": "^1.19.0",
|
||||
"bootstrap": "^4.3.1",
|
||||
"bull-arena": "^2.6.4",
|
||||
@@ -41,11 +44,14 @@
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"leonardo-ui": "^1.7.1",
|
||||
"moment": "^2.24.0",
|
||||
"moment-timezone": "^0.5.31",
|
||||
"mongoose": "^5.7.4",
|
||||
"ngx-markdown": "^9.0.0",
|
||||
"nodemon": "^1.19.1",
|
||||
"passport": "^0.4.0",
|
||||
"passport-azure-ad": "^4.1.0",
|
||||
"qdt-components": "^2.5.5",
|
||||
"qmi-cloud-common": "./qmi-cloud-common",
|
||||
"rxjs": "~6.5.4",
|
||||
"swagger-jsdoc": "3.5.0",
|
||||
"swagger-ui-express": "4.1.3",
|
||||
|
||||
0
photos/.keep
Normal file
0
photos/.keep
Normal file
@@ -1,7 +1,7 @@
|
||||
# Stage 1: NOTE: context is actually ../
|
||||
FROM node:13.8-alpine AS sources
|
||||
FROM node:15.12.0-alpine AS sources
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
RUN apk --no-cache add yarn git
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -11,7 +11,7 @@ ADD ./qmi-cloud-common ../qmi-cloud-common
|
||||
RUN yarn install --production
|
||||
|
||||
# Stage 2:
|
||||
FROM node:13.8-alpine AS production
|
||||
FROM node:15.12.0-alpine AS production
|
||||
WORKDIR /app
|
||||
COPY --from=sources /app ./
|
||||
|
||||
|
||||
@@ -1,22 +1,36 @@
|
||||
# Examples
|
||||
|
||||
## Check Destroy
|
||||
```
|
||||
docker run --net=host \
|
||||
-e MONGO_URI="mongodb://root:example@localhost:27017/qmicloud?authSource=admin" \
|
||||
-e API_KEY="c229219ccdd72d11e8ea253fd3876d247e5f489c9c84922cabdfb0cc194d8ff398a8d8d6528d8241efc99add2207e0ec75122a1b2c5598cc340cbe6b7c3c0dbf" \
|
||||
qlikgear/qmi-cloud-cli:latest -s checkdestroy -t warning -p 4 -r test
|
||||
qlikgear/qmi-cloud-cli:latest -s checkdestroy -t warning -r test
|
||||
```
|
||||
|
||||
## Init DB
|
||||
```
|
||||
docker run --net=host \
|
||||
-e MONGO_URI="mongodb://root:example@localhost:27017/qmicloud?authSource=admin" \
|
||||
qlikgear/qmi-cloud-cli:latest -s initdb
|
||||
```
|
||||
|
||||
## Check Destroy
|
||||
```
|
||||
docker run --net=host -e MONGO_URI=$MONGO_URI -e API_KEY=$API_KEY qlikgear/qmi-cloud-cli:latest -s checkdestroy -t warning -p 20 -r test
|
||||
docker run --net=host -e MONGO_URI=$MONGO_URI -e API_KEY=$API_KEY qlikgear/qmi-cloud-cli:latest -s checkdestroy -t warning -r test
|
||||
```
|
||||
|
||||
## Check Stop
|
||||
```
|
||||
docker run --net=host -e MONGO_URI=$MONGO_URI -e API_KEY=$API_KEY qlikgear/qmi-cloud-cli:latest -s checkstop -t warning -p 4 -r test
|
||||
docker run --net=host -e SMTP_EMAIL_SENDER=http://172.20.16.4:9200/sendemail -e MONGO_URI=$MONGO_URI -e API_KEY=$API_KEY qlikgear/qmi-cloud-cli:latest -s checkstop -t warning -r test
|
||||
```
|
||||
|
||||
## Check Errors
|
||||
```
|
||||
docker run --net=host -e MONGO_URI=$MONGO_URI qlikgear/qmi-cloud-cli:latest -s checkerror -r test
|
||||
```
|
||||
|
||||
## Move Destroyed
|
||||
```
|
||||
docker run --net=host -e MONGO_URI=$MONGO_URI -v $PWD/qmi-cloud-provisions:/provisions qlikgear/qmi-cloud-cli:latest -s movedestroyed -r "2020-31-12T00:00:00.000Z"
|
||||
```
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
var myArgs = process.argv.slice(2);
|
||||
|
||||
if ( myArgs.length < 3 ) {
|
||||
if ( myArgs.length < 2 ) {
|
||||
console.log("Missing args", myArgs);
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -12,10 +12,11 @@ const moment = require('moment');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
|
||||
const IS_REAL = myArgs[2] !== 'test';
|
||||
const STOPPED_PERIOD = myArgs[1]; //Days
|
||||
const STOPPED_LIMIT_HOURS_WARNING = 24*(STOPPED_PERIOD-2); //Hours
|
||||
const STOPPED_LIMIT_HOURS_STOP = 24*STOPPED_PERIOD; //Hours
|
||||
const IS_REAL = myArgs[1] !== 'test';
|
||||
const WARNING_DAYS = 2;
|
||||
|
||||
//---
|
||||
|
||||
const API_KEY = process.env.API_KEY;
|
||||
const SERVER_URL = "http://localhost:3000";
|
||||
|
||||
@@ -56,18 +57,17 @@ async function asyncForEach(array, callback) {
|
||||
}
|
||||
|
||||
async function init(type) {
|
||||
var limit, cb;
|
||||
var cb;
|
||||
var filter = {
|
||||
"isDestroyed":false,
|
||||
"isDeleted": false,
|
||||
"statusVms": "Stopped"
|
||||
"statusVms": "Stopped",
|
||||
"vmImage": {"$exists": true}
|
||||
};
|
||||
if ( type === "warning" ) {
|
||||
limit = STOPPED_LIMIT_HOURS_WARNING;
|
||||
filter.pendingNextAction = {$ne: "destroy"};
|
||||
cb = doSendEmailDestroyWarning;
|
||||
} else if ( type === "exec" ) {
|
||||
limit = STOPPED_LIMIT_HOURS_STOP;
|
||||
filter.pendingNextAction = "destroy";
|
||||
cb = doDestroy;
|
||||
} else {
|
||||
@@ -76,44 +76,54 @@ async function init(type) {
|
||||
}
|
||||
|
||||
let provisions = await db.provision.get(filter);
|
||||
let scenarios = await db.scenario.get();
|
||||
|
||||
await asyncForEach(provisions.results, async function(p) {
|
||||
var _scenario = scenarios.results.filter(s=>{
|
||||
return s.name === p.scenario
|
||||
});
|
||||
if ( _scenario.length ){
|
||||
p._scenario = _scenario[0];
|
||||
var typeSchedule = "24x7";
|
||||
if ( p.schedule && !p.schedule.is24x7 ) {
|
||||
typeSchedule = 'OnSchedule';
|
||||
}
|
||||
timeRunning(p);
|
||||
if (!IS_REAL) {
|
||||
console.log(`${p._id} - limit: ${limit} hs - actual duration: ${p.duration.hours} hs`);
|
||||
|
||||
let stoppedPeriod = p._scenarioDoc.allowedInnactiveDays || 20;
|
||||
let stoppedPeriodExternal = Math.ceil(stoppedPeriod/2);
|
||||
|
||||
var limit;
|
||||
if ( type === "warning" ) {
|
||||
limit = p.isExternalAccess? 24*(stoppedPeriodExternal-WARNING_DAYS) : 24*(stoppedPeriod-WARNING_DAYS);
|
||||
} else if ( type === "exec" ) {
|
||||
limit = p.isExternalAccess? (24*stoppedPeriodExternal) : (24*stoppedPeriod);
|
||||
}
|
||||
if ( !IS_REAL ) {
|
||||
console.log(`${p._id} (${typeSchedule}) - limit: ${limit} hs - actual duration: ${p.duration.hours} hs`);
|
||||
}
|
||||
if ( p.duration && p.duration.hours >= limit) {
|
||||
await cb(p);
|
||||
await cb(p, limit, typeSchedule);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const doSendEmailDestroyWarning = async function(p) {
|
||||
const doSendEmailDestroyWarning = async function(p, limit, typeSchedule) {
|
||||
if ( p.pendingNextAction === 'destroy') {
|
||||
console.log(`Warning email Destroy already sent. Wait for pending action to complete.`);
|
||||
} else {
|
||||
let msg = `Send warning DESTROY email - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenario.title}' (${p._id}) being 'Inactive' more than ${STOPPED_LIMIT_HOURS_WARNING} hours (exactly ${p.duration.complete})`;
|
||||
let msg = `Send warning DESTROY email - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenarioDoc.title}' (${p._id} - ${typeSchedule}) being 'Inactive' more than ${limit} hours, (exactly ${p.duration.complete})`;
|
||||
console.log(msg);
|
||||
if ( IS_REAL ) {
|
||||
db.event.add({ user: p.user._id, provision: p._id, type: 'vms.warning-destroy' });
|
||||
await db.provision.update(p._id, {"pendingNextAction": "destroy"});
|
||||
await sendEmail.sendWillDestroyIn24(p, p._scenario);
|
||||
await db.notification.add({ provision: p._id.toString(), type: 'warningDestroy', message: msg });
|
||||
await sendEmail.sendWillDestroyIn24(p, p._scenarioDoc, Math.floor(limit/24), WARNING_DAYS);
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const doDestroy = async function(p) {
|
||||
const doDestroy = async function(p, limit, typeSchedule) {
|
||||
try {
|
||||
let msg = `Provision destroyed - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenario.title}' (${p._id}) being 'Inactive' more than ${STOPPED_LIMIT_HOURS_STOP} hours (exactly ${p.duration.complete})`
|
||||
let msg = `Provision destroyed - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenarioDoc.title}' (${p._id} - ${typeSchedule}) being 'Inactive' more than ${limit} hours (exactly ${p.duration.complete})`
|
||||
console.log(msg);
|
||||
if ( IS_REAL ) {
|
||||
db.event.add({ user: p.user._id, provision: p._id, type: 'vms.exec-destroy' });
|
||||
await postDestroy(p);
|
||||
await db.notification.add({ provision: p._id.toString(), type: 'destroy', message: msg });
|
||||
}
|
||||
|
||||
59
qmi-cloud-cli/jobs/error5.js
Normal file
59
qmi-cloud-cli/jobs/error5.js
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
var myArgs = process.argv.slice(2);
|
||||
|
||||
if ( myArgs.length < 1 ) {
|
||||
console.log("Missing args", myArgs);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const IS_REAL = myArgs[0] !== 'test';
|
||||
|
||||
|
||||
// ---
|
||||
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
const doSendEmailErrorProvision = async function(p) {
|
||||
let msg = `Send prrovision ERROR email - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenarioDoc.title}' (${p._id}) provisioned with 'Errors'`;
|
||||
console.log(msg);
|
||||
if ( IS_REAL ) {
|
||||
db.event.add({ user: p.user._id, provision: p._id, type: 'vms.warning-error' });
|
||||
await db.notification.add({ provision: p._id.toString(), type: 'warningError', message: msg });
|
||||
await sendEmail.sendProvisionError(p, p._scenarioDoc);
|
||||
}
|
||||
};
|
||||
|
||||
async function init() {
|
||||
let provisions = await db.provision.get({
|
||||
"isDestroyed":false,
|
||||
"isDeleted": false,
|
||||
"status": "error"
|
||||
});
|
||||
|
||||
await asyncForEach(provisions.results, async function(p) {
|
||||
await doSendEmailErrorProvision(p);
|
||||
});
|
||||
}
|
||||
|
||||
function check() {
|
||||
init().then(function(){
|
||||
db.mongoose.connection.close()
|
||||
process.exit(0);
|
||||
|
||||
}).catch(function(e){
|
||||
db.mongoose.connection.close()
|
||||
console.log("Error", e);
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------
|
||||
check();
|
||||
61
qmi-cloud-cli/jobs/move_destroyed.js
Normal file
61
qmi-cloud-cli/jobs/move_destroyed.js
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
var myArgs = process.argv.slice(2);
|
||||
|
||||
if ( myArgs.length < 1 ) {
|
||||
console.log("Missing args", myArgs);
|
||||
process.exit(0);
|
||||
}
|
||||
console.log("myArgs", myArgs);
|
||||
const ISODATE = new Date(myArgs[0]).toISOString();
|
||||
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const fs = require('fs-extra');
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
let provisions = await db.provision.get({
|
||||
"isDestroyed":true,
|
||||
"isDeleted": false,
|
||||
"created": { "$lt" : ISODATE }
|
||||
});
|
||||
await asyncForEach(provisions.results, async function(p) {
|
||||
await doMoveDestroyed(p);
|
||||
});
|
||||
}
|
||||
|
||||
const doMoveDestroyed = async function(provision) {
|
||||
var scenarioFolder = `${provision.scenario}_${provision._id}`;
|
||||
console.log(`Moving scenario: /provisions/${scenarioFolder}`);
|
||||
if (fs.existsSync(`/provisions/${scenarioFolder}`)) {
|
||||
fs.moveSync(`/provisions/${scenarioFolder}`, `/provisions/deleted/${scenarioFolder}`, { overwrite: true })
|
||||
console.log(`OK.`);
|
||||
} else {
|
||||
console.log(`NOK: It does not exist.`);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function check() {
|
||||
init().then(function(){
|
||||
db.mongoose.connection.close()
|
||||
process.exit(0);
|
||||
|
||||
}).catch(function(e){
|
||||
db.mongoose.connection.close()
|
||||
console.log("Error", e);
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------
|
||||
check();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,24 @@
|
||||
|
||||
var myArgs = process.argv.slice(2);
|
||||
|
||||
if ( myArgs.length < 3 ) {
|
||||
if ( myArgs.length < 2 ) {
|
||||
console.log("Missing args", myArgs);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const IS_REAL = myArgs[2] !== 'test';
|
||||
const RUNNING_PERIOD = myArgs[1]; //Days
|
||||
const RUNNING_LIMIT_HOURS_WARNING = 24*(RUNNING_PERIOD-1);
|
||||
const RUNNING_LIMIT_HOURS_STOP = 24*RUNNING_PERIOD;
|
||||
const IS_REAL = myArgs[1] !== 'test';
|
||||
const WARNING_DAYS = 1;
|
||||
|
||||
// ---
|
||||
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
const moment = require('moment');
|
||||
const azurecli = require('qmi-cloud-common/azurecli');
|
||||
const cli = require('qmi-cloud-common/cli');
|
||||
|
||||
function timeRunning(p) {
|
||||
function timeRunningIs24x7(p) {
|
||||
let runningFromTime = p.runningFrom? new Date(p.runningFrom).getTime() : new Date(p.created).getTime();
|
||||
let totalRunningFromTime;
|
||||
if (p.statusVms !== 'Stopped' && p.statusVms !== 'Starting' && !p.isDestroyed) {
|
||||
totalRunningFromTime = Math.abs(new Date().getTime() - runningFromTime);
|
||||
}
|
||||
let totalRunningFromTime = Math.abs(new Date().getTime() - runningFromTime);
|
||||
let duration = moment.duration(totalRunningFromTime);
|
||||
p.duration = {
|
||||
hours: Math.floor(duration.asHours()),
|
||||
@@ -29,6 +26,30 @@ function timeRunning(p) {
|
||||
};
|
||||
}
|
||||
|
||||
function timeRunningOnSchedule(p) {
|
||||
let runningFromTime = p.runningFrom? new Date(p.runningFrom).getTime() : new Date(p.created).getTime();
|
||||
let totalRunningTime = p.timeRunning*1000*60;
|
||||
let now = new Date();
|
||||
totalRunningTime = totalRunningTime + Math.abs(now.getTime() - runningFromTime);
|
||||
let duration = moment.duration(totalRunningTime);
|
||||
p.duration = {
|
||||
hours: Math.floor(duration.asHours()),
|
||||
complete: Math.floor(duration.asDays()) +"d "+duration.hours()+"h "+duration.minutes()
|
||||
};
|
||||
}
|
||||
|
||||
function timeRunningOnSchedule2(p) {
|
||||
|
||||
let startTimestamp = p.startDateOnSchedule? new Date(p.startDateOnSchedule).getTime() : 0;
|
||||
let endTimestamp = p.endDateOnSchedule? new Date(p.endDateOnSchedule).getTime() : 0;
|
||||
let totalTimeOnschedule = Math.abs(endTimestamp - startTimestamp);
|
||||
let duration = moment.duration(totalTimeOnschedule);
|
||||
p.duration = {
|
||||
hours: Math.floor(duration.asHours()),
|
||||
complete: Math.floor(duration.asDays()) +"d "+duration.hours()+"h "+duration.minutes()
|
||||
};
|
||||
}
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
@@ -36,18 +57,17 @@ async function asyncForEach(array, callback) {
|
||||
}
|
||||
|
||||
async function init(type) {
|
||||
var limit, cb;
|
||||
var cb;
|
||||
var filter = {
|
||||
"isDestroyed":false,
|
||||
"isDestroyed": false,
|
||||
"isDeleted": false,
|
||||
"statusVms": "Running"
|
||||
"statusVms": "Running",
|
||||
"vmImage": { "$exists": true }
|
||||
};
|
||||
if ( type === "warning" ) {
|
||||
limit = RUNNING_LIMIT_HOURS_WARNING;
|
||||
filter.pendingNextAction = {$ne: "stopVms"};
|
||||
filter.pendingNextAction = { $ne: "stopVms" };
|
||||
cb = doSendEmailWarning;
|
||||
} else if ( type === "exec" ) {
|
||||
limit = RUNNING_LIMIT_HOURS_STOP;
|
||||
filter.pendingNextAction = "stopVms";
|
||||
cb = doStop;
|
||||
} else {
|
||||
@@ -56,46 +76,69 @@ async function init(type) {
|
||||
}
|
||||
|
||||
let provisions = await db.provision.get(filter);
|
||||
let scenarios = await db.scenario.get();
|
||||
|
||||
await asyncForEach(provisions.results, async function(p) {
|
||||
var _scenario = scenarios.results.filter(s=>{
|
||||
return s.name === p.scenario
|
||||
});
|
||||
if ( _scenario.length ){
|
||||
p._scenario = _scenario[0];
|
||||
//Only if 24x7
|
||||
let typeSchedule = "24x7";
|
||||
let periodDays = p._scenarioDoc.allowed24x7RunningDays;
|
||||
if ( !p.schedule || p.schedule.is24x7 ) {
|
||||
// 24x7
|
||||
timeRunningIs24x7(p);
|
||||
periodDays = p._scenarioDoc.allowed24x7RunningDays;
|
||||
} else if ( p.schedule && !p.schedule.is24x7 ) {
|
||||
// OnSchedule
|
||||
timeRunningOnSchedule2(p);
|
||||
typeSchedule = 'OnSchedule';
|
||||
periodDays = p._scenarioDoc.allowedOnScheduleRunningDays;
|
||||
}
|
||||
let limit;
|
||||
if ( type === "warning" ) {
|
||||
limit = 24*(periodDays-WARNING_DAYS);
|
||||
} else if ( type === "exec" ) {
|
||||
limit = 24*periodDays;
|
||||
}
|
||||
timeRunning(p);
|
||||
if (!IS_REAL) {
|
||||
console.log(`${p._id} - limit: ${limit} hs - actual duration: ${p.duration.hours} hs`);
|
||||
console.log(`${p._id} - (${typeSchedule}) - limit: ${limit} hs - actual duration: ${p.duration.hours} hs`);
|
||||
}
|
||||
if ( p.duration && p.duration.hours >= limit) {
|
||||
await cb(p);
|
||||
await cb(p, limit, typeSchedule);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const doSendEmailWarning = async function(p) {
|
||||
const doSendEmailWarning = async function(p, limit, typeSchedule) {
|
||||
if ( p.pendingNextAction === 'stopVms') {
|
||||
console.log(`Warning email Stop already sent. Wait for pending action to complete.`);
|
||||
} else {
|
||||
let msg = `Send warning STOP email - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenario.title}' (${p._id}) being 'Running' more than ${RUNNING_LIMIT_HOURS_WARNING} hours (exactly ${p.duration.complete})`;
|
||||
let msg = `Send warning STOP email - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenarioDoc.title}' (${p._id} - ${typeSchedule}) being 'Running' more than ${limit} hours, (exactly ${p.duration.complete})`;
|
||||
console.log(msg);
|
||||
if ( IS_REAL ) {
|
||||
db.event.add({ user: p.user._id, provision: p._id, type: 'vms.warning-stop' });
|
||||
await db.provision.update(p._id, {"pendingNextAction": "stopVms"});
|
||||
await sendEmail.sendWillStopIn24(p, p._scenario);
|
||||
await db.notification.add({ provision: p._id.toString(), type: 'warningStop', message: msg });
|
||||
await sendEmail.sendWillStopIn24(p, p._scenarioDoc, Math.floor(limit/24), WARNING_DAYS);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const doStop = async function(p) {
|
||||
const doStop = async function(p, limit, typeSchedule) {
|
||||
try {
|
||||
let msg = `VMs stopped - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenario.title}' (${p._id}) being 'Running' more than ${RUNNING_LIMIT_HOURS_STOP} hours (exactly ${p.duration.complete})`
|
||||
let msg = `VMs stopped - ${p.user.displayName} (${p.user.upn}) about provision '${p._scenarioDoc.title}' (${p._id} - ${typeSchedule}) being 'Running' more than ${limit} hours, (exactly ${p.duration.complete})`
|
||||
console.log(msg);
|
||||
|
||||
if ( IS_REAL ) {
|
||||
await azurecli.deallocate(p, true);
|
||||
if (p.schedule){
|
||||
//Disable Divvy
|
||||
await db.schedule.update(p.schedule._id, {"isStartupTimeEnable": false});
|
||||
await cli.updateVmsTags(p._id, {
|
||||
"24x7": false,
|
||||
"StartupTime": false,
|
||||
"ShutdownTime": false
|
||||
});
|
||||
}
|
||||
//Stop VMs indefinitely
|
||||
db.event.add({ user: p.user._id, provision: p._id, type: 'vms.exec-stop' });
|
||||
await cli.deallocate(p._id, true);
|
||||
await db.notification.add({ provision: p._id.toString(), type: 'stop', message: msg });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
{
|
||||
"name": "qmi-cloud-cli",
|
||||
"version": "1.1.3",
|
||||
"version": "1.3.0",
|
||||
"scripts": {
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"qmi-cloud-common": "../qmi-cloud-common",
|
||||
"node-fetch": "^2.6.0",
|
||||
"moment": "^2.24.0"
|
||||
"moment": "^2.24.0",
|
||||
"axios": "^0.21.1",
|
||||
"fs-extra": "^8.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,33 @@ helpFunction()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s script"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | initdb )"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | checkerror | movedestroyed | initdb )"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
helpFunctionCheck()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s script -t type -p period -r realortest"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | initdb )"
|
||||
echo -e "\t-t Type of script (warning | exec)"
|
||||
echo -e "\t-p Period (number of days)"
|
||||
echo -e "\t-r Type of script (test | real)"
|
||||
echo "Usage: $0 -s script [-t type -r realortest]"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | checkerror )"
|
||||
echo -e "\t-t Type of script ( warning | exec )"
|
||||
echo -e "\t-r Indicate whether is for test or real execution ( test | real )"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
helpFunctionCheck2()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s checkerror [-r realortest]"
|
||||
echo -e "\t-r Indicate whether is for test or real execution ( test | real )"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
helpFunctionCheck3()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s movedestroyed [-r isodate]"
|
||||
echo -e "\t-r An ISODATE (ie: '2020-31-12T00:00:00.000Z') to movedestroyed backwards"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
@@ -25,7 +40,6 @@ do
|
||||
case "$opt" in
|
||||
s ) script="$OPTARG" ;;
|
||||
t ) type="$OPTARG" ;;
|
||||
p ) period="$OPTARG" ;;
|
||||
r ) realortest="$OPTARG" ;;
|
||||
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
|
||||
esac
|
||||
@@ -33,25 +47,25 @@ done
|
||||
|
||||
if [ -z "$script" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
echo "Script not recognised";
|
||||
helpFunction
|
||||
fi
|
||||
|
||||
if [ "$script" = "checkstop" ] || [ "$script" = "checkdestroy" ]
|
||||
then
|
||||
if [ -z "$type" ] || [ -z "$period" ] || [ -z "$realortest" ]
|
||||
if [ -z "$type" ] || [ -z "$realortest" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
helpFunctionCheck
|
||||
else
|
||||
if [ "$script" = "checkstop" ]
|
||||
then
|
||||
$BASEDIR/checkstop.sh $type $period $realortest
|
||||
$BASEDIR/checkstop.sh $type $realortest
|
||||
fi
|
||||
|
||||
if [ "$script" = "checkdestroy" ]
|
||||
then
|
||||
$BASEDIR/checkdestroy.sh $type $period $realortest
|
||||
$BASEDIR/checkdestroy.sh $type $realortest
|
||||
fi
|
||||
fi
|
||||
elif [ "$script" = "initdb" ]
|
||||
@@ -64,5 +78,24 @@ then
|
||||
echo "\$MONGO_URI=$MONGO_URI"
|
||||
node $BASEDIR/../jobs/db-init.js
|
||||
fi
|
||||
elif [ "$script" = "checkerror" ]
|
||||
then
|
||||
if [ -z "$realortest" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
helpFunctionCheck2
|
||||
else
|
||||
node $BASEDIR/../jobs/error5.js $realortest
|
||||
fi
|
||||
elif [ "$script" = "movedestroyed" ]
|
||||
then
|
||||
if [ -z "$realortest" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
helpFunctionCheck3
|
||||
else
|
||||
node $BASEDIR/../jobs/move_destroyed.js $realortest
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ SCRIPT: $0"
|
||||
echo "------ TYPE: $1"
|
||||
echo "------ PERIOD: $2"
|
||||
echo "------ TEST/REAL: $3"
|
||||
echo "------ TEST/REAL: $2"
|
||||
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
@@ -22,4 +21,4 @@ else
|
||||
echo "\$API_KEY=$API_KEY"
|
||||
fi
|
||||
|
||||
node $BASEDIR/../jobs/destroy5.js $1 $2 $3
|
||||
node $BASEDIR/../jobs/destroy5.js $1 $2
|
||||
|
||||
14
qmi-cloud-cli/shell-utils/checkerror.sh
Executable file
14
qmi-cloud-cli/shell-utils/checkerror.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
BASEDIR=$(dirname "$0")
|
||||
d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ SCRIPT: $0"
|
||||
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
echo "\$MONGO_URI is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$MONGO_URI=$MONGO_URI"
|
||||
fi
|
||||
|
||||
node $BASEDIR/../jobs/error5.js $1
|
||||
@@ -3,8 +3,7 @@ d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ SCRIPT: $0"
|
||||
echo "------ TYPE: $1"
|
||||
echo "------ PERIOD: $2"
|
||||
echo "------ TEST/REAL: $3"
|
||||
echo "------ TEST/REAL: $2"
|
||||
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
@@ -22,4 +21,4 @@ else
|
||||
echo "\$API_KEY=$API_KEY"
|
||||
fi
|
||||
|
||||
node $BASEDIR/../jobs/stop5.js $1 $2 $3
|
||||
node $BASEDIR/../jobs/stop5.js $1 $2
|
||||
24
qmi-cloud-cli/shell-utils/cost.sh
Normal file
24
qmi-cloud-cli/shell-utils/cost.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
# LOGIN
|
||||
az login --identity
|
||||
|
||||
BASEDIR=$(dirname "$0")
|
||||
SUBS="62ebff8f-c40b-41be-9239-252d6c0c8ad9"
|
||||
CONTAINER="exports"
|
||||
STORAGEACCOUNT="qmiexports"
|
||||
STORAGEACCOUNTKEY="6PI/qNoJ7UnX83lVcffN7p7X1TwYXv+jHKLIEcMKZWpWA01Vj75AAyjq4dXJdmUgCeSEIRefHnJzQeuPZRHInQ=="
|
||||
|
||||
# GET FILES
|
||||
az storage blob download-batch --destination . --source $CONTAINER --account-name $STORAGEACCOUNT --account-key $STORAGEACCOUNTKEY --pattern *.csv --subscription $SUBS
|
||||
|
||||
|
||||
# MOVE LATEST FILE PER MONTH TO FOLDER latest
|
||||
echo "BASEDIR=$BASEDIR"
|
||||
|
||||
for d in "$BASEDIR/qmicloud/qmicloud/"*
|
||||
do
|
||||
folderBase=$(basename "$d")
|
||||
ymn=$(echo $folderBase | cut -c1-6)
|
||||
lastFile=$(find $d -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
|
||||
echo $lastFile
|
||||
cp $lastFile $BASEDIR/$ymn.csv
|
||||
done
|
||||
@@ -2,6 +2,70 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@azure/abort-controller@^1.0.0":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@azure/abort-controller/-/abort-controller-1.0.4.tgz#fd3c4d46c8ed67aace42498c8e2270960250eafd"
|
||||
integrity sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==
|
||||
dependencies:
|
||||
tslib "^2.0.0"
|
||||
|
||||
"@azure/arm-compute@^15.0.0":
|
||||
version "15.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@azure/arm-compute/-/arm-compute-15.0.0.tgz#5d0d0c1db16adbb6db3d33ca376b120c68e6ae23"
|
||||
integrity sha512-ElV2MuYZ+B2+ygMx2iiM/u3C7WDRruZjkXzfk5p2O+UbWxjG6j/686OH3T+VSDqmzg+47AnIOTLu2v0u0H8FOw==
|
||||
dependencies:
|
||||
"@azure/ms-rest-azure-js" "^2.0.1"
|
||||
"@azure/ms-rest-js" "^2.0.4"
|
||||
tslib "^1.10.0"
|
||||
|
||||
"@azure/core-auth@^1.1.4":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.2.0.tgz#a5a181164e99f8446a3ccf9039345ddc9bb63bb9"
|
||||
integrity sha512-KUl+Nwn/Sm6Lw5d3U90m1jZfNSL087SPcqHLxwn2T6PupNKmcgsEbDjHB25gDvHO4h7pBsTlrdJAY7dz+Qk8GA==
|
||||
dependencies:
|
||||
"@azure/abort-controller" "^1.0.0"
|
||||
tslib "^2.0.0"
|
||||
|
||||
"@azure/ms-rest-azure-env@^2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz#45809f89763a480924e21d3c620cd40866771625"
|
||||
integrity sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw==
|
||||
|
||||
"@azure/ms-rest-azure-js@^2.0.1":
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-js/-/ms-rest-azure-js-2.1.0.tgz#8c90b31468aeca3146b06c7144b386fd4827f64c"
|
||||
integrity sha512-CjZjB8apvXl5h97Ck6SbeeCmU0sk56YPozPtTyGudPp1RGoHXNjFNtoOvwOG76EdpmMpxbK10DqcygI16Lu60Q==
|
||||
dependencies:
|
||||
"@azure/core-auth" "^1.1.4"
|
||||
"@azure/ms-rest-js" "^2.2.0"
|
||||
tslib "^1.10.0"
|
||||
|
||||
"@azure/ms-rest-js@^2.0.4", "@azure/ms-rest-js@^2.2.0":
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/@azure/ms-rest-js/-/ms-rest-js-2.2.3.tgz#8f0085f7768c69f17b3cdb20ce95728b452dc304"
|
||||
integrity sha512-sXOhOu/37Tr8428f32Jwuwga975Xw64pYg1UeUwOBMhkNgtn5vUuNRa3fhmem+I6f8EKoi6hOsYDFlaHeZ52jA==
|
||||
dependencies:
|
||||
"@azure/core-auth" "^1.1.4"
|
||||
"@types/node-fetch" "^2.3.7"
|
||||
"@types/tunnel" "0.0.1"
|
||||
abort-controller "^3.0.0"
|
||||
form-data "^2.5.0"
|
||||
node-fetch "^2.6.0"
|
||||
tough-cookie "^3.0.1"
|
||||
tslib "^1.10.0"
|
||||
tunnel "0.0.6"
|
||||
uuid "^3.3.2"
|
||||
xml2js "^0.4.19"
|
||||
|
||||
"@azure/ms-rest-nodeauth@^3.0.7":
|
||||
version "3.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.0.7.tgz#73c399b0aef45c75104324b6617aa4e0a6c27875"
|
||||
integrity sha512-7Q1MyMB+eqUQy8JO+virSIzAjqR2UbKXE/YQZe+53gC8yakm8WOQ5OzGfPP+eyHqeRs6bQESyw2IC5feLWlT2A==
|
||||
dependencies:
|
||||
"@azure/ms-rest-azure-env" "^2.0.0"
|
||||
"@azure/ms-rest-js" "^2.0.4"
|
||||
adal-node "^0.1.28"
|
||||
|
||||
"@hapi/boom@^9.1.0":
|
||||
version "9.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.0.tgz#0d9517657a56ff1e0b42d0aca9da1b37706fec56"
|
||||
@@ -14,11 +78,38 @@
|
||||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.0.4.tgz#e80ad4e8e8d2adc6c77d985f698447e8628b6010"
|
||||
integrity sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==
|
||||
|
||||
"@types/node-fetch@^2.3.7":
|
||||
version "2.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb"
|
||||
integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
form-data "^3.0.0"
|
||||
|
||||
"@types/node@*":
|
||||
version "14.14.35"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.35.tgz#42c953a4e2b18ab931f72477e7012172f4ffa313"
|
||||
integrity sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==
|
||||
|
||||
"@types/node@^8.0.47":
|
||||
version "8.10.61"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.61.tgz#d299136ce54bcaf1abaa4a487f9e4bedf6b0d393"
|
||||
integrity sha512-l+zSbvT8TPRaCxL1l9cwHCb0tSqGAGcjPJFItGGYat5oCTiq1uQQKYg5m7AF1mgnEBzFXGLJ2LRmNjtreRX76Q==
|
||||
|
||||
"@types/tunnel@0.0.1":
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.1.tgz#0d72774768b73df26f25df9184273a42da72b19c"
|
||||
integrity sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
abort-controller@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
|
||||
integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==
|
||||
dependencies:
|
||||
event-target-shim "^5.0.0"
|
||||
|
||||
adal-node@^0.1.28:
|
||||
version "0.1.28"
|
||||
resolved "https://registry.yarnpkg.com/adal-node/-/adal-node-0.1.28.tgz#468c4bb3ebbd96b1270669f4b9cba4e0065ea485"
|
||||
@@ -56,13 +147,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
async@2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
|
||||
integrity sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==
|
||||
dependencies:
|
||||
lodash "^4.14.0"
|
||||
|
||||
async@>=0.6.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720"
|
||||
@@ -83,13 +167,12 @@ aws4@^1.8.0:
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2"
|
||||
integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==
|
||||
|
||||
azure-arm-compute@^10.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/azure-arm-compute/-/azure-arm-compute-10.0.0.tgz#ce9ba2e4d6dd6b1174c34da2219700a8080f389b"
|
||||
integrity sha512-ehafNtcMKI6c00FT+xhPWPtzhYgHCZ675TUsaJ1FJ2bSpznih5EUrpir/4w519T4zbFBigszhnRK6eBkl78I9g==
|
||||
axios@^0.21.1:
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
|
||||
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
|
||||
dependencies:
|
||||
ms-rest "^2.5.0"
|
||||
ms-rest-azure "^2.5.5"
|
||||
follow-redirects "^1.10.0"
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
@@ -147,7 +230,7 @@ cluster-key-slot@^1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
|
||||
integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
||||
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
|
||||
@@ -215,11 +298,6 @@ denque@^1.1.0, denque@^1.4.1:
|
||||
resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf"
|
||||
integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==
|
||||
|
||||
duplexer@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
|
||||
integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
@@ -261,6 +339,11 @@ es-to-primitive@^1.2.1:
|
||||
is-date-object "^1.0.1"
|
||||
is-symbol "^1.0.2"
|
||||
|
||||
event-target-shim@^5.0.0:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
|
||||
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
@@ -286,11 +369,34 @@ fast-json-stable-stringify@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
||||
|
||||
follow-redirects@^1.10.0:
|
||||
version "1.13.3"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267"
|
||||
integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@^2.5.0:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
|
||||
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
form-data@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
|
||||
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.8"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
@@ -300,6 +406,15 @@ form-data@~2.3.2:
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs-extra@^8.1.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
|
||||
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
|
||||
dependencies:
|
||||
graceful-fs "^4.2.0"
|
||||
jsonfile "^4.0.0"
|
||||
universalify "^0.1.0"
|
||||
|
||||
function-bind@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||
@@ -317,6 +432,11 @@ getpass@^0.1.1:
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
|
||||
version "4.2.6"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
|
||||
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
@@ -371,10 +491,10 @@ ioredis@^4.14.1:
|
||||
redis-parser "^3.0.0"
|
||||
standard-as-callback "^2.0.1"
|
||||
|
||||
is-buffer@^1.1.6:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||
ip-regex@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
|
||||
integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=
|
||||
|
||||
is-callable@^1.1.4, is-callable@^1.1.5:
|
||||
version "1.2.0"
|
||||
@@ -400,11 +520,6 @@ is-regex@^1.0.5:
|
||||
dependencies:
|
||||
has-symbols "^1.0.1"
|
||||
|
||||
is-stream@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
||||
integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
|
||||
|
||||
is-symbol@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937"
|
||||
@@ -447,6 +562,13 @@ json-stringify-safe@~5.0.1:
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsonfile@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
|
||||
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.6"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
@@ -489,7 +611,7 @@ lodash.flatten@^4.4.0:
|
||||
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
|
||||
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
|
||||
|
||||
lodash@^4.14.0, lodash@^4.17.15:
|
||||
lodash@^4.17.15:
|
||||
version "4.17.15"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||
@@ -518,7 +640,7 @@ moment-timezone@^0.5.31:
|
||||
dependencies:
|
||||
moment ">= 2.9.0"
|
||||
|
||||
"moment@>= 2.9.0", moment@^2.21.0, moment@^2.22.2, moment@^2.24.0:
|
||||
"moment@>= 2.9.0", moment@^2.24.0:
|
||||
version "2.26.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.26.0.tgz#5e1f82c6bafca6e83e808b30c8705eed0dcbd39a"
|
||||
integrity sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==
|
||||
@@ -574,44 +696,6 @@ mquery@3.2.2:
|
||||
safe-buffer "5.1.2"
|
||||
sliced "1.0.1"
|
||||
|
||||
ms-rest-azure@^2.5.5:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest-azure/-/ms-rest-azure-2.6.0.tgz#2098efec529eecfa0c6e215b69143abcaba12140"
|
||||
integrity sha512-J6386a9krZ4VtU7CRt+Ypgo9RGf8+d3gjMBkH7zbkM4zzkhbbMOYiPRaZ+bHZcfihkKLlktTgA6rjshTjF329A==
|
||||
dependencies:
|
||||
adal-node "^0.1.28"
|
||||
async "2.6.0"
|
||||
moment "^2.22.2"
|
||||
ms-rest "^2.3.2"
|
||||
request "^2.88.0"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms-rest-azure@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest-azure/-/ms-rest-azure-3.0.0.tgz#54d0341c2aeef7b9f17f2a46258788740b2f0ec5"
|
||||
integrity sha512-cttN01/TtMDB4v3rt/WQ/slgffB6jcUYxcPzcL0VNSB+WFPE1j4y5ICNHMuD1RaNNekCYMI4Pv51BDQ/BXNq7Q==
|
||||
dependencies:
|
||||
adal-node "^0.1.28"
|
||||
async "2.6.0"
|
||||
moment "^2.22.2"
|
||||
ms-rest "^2.3.2"
|
||||
request "^2.88.0"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms-rest@^2.3.2, ms-rest@^2.5.0:
|
||||
version "2.5.4"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest/-/ms-rest-2.5.4.tgz#57b42299cf302e45d5e1a734220bf7d4a110167a"
|
||||
integrity sha512-VeqCbawxRM6nhw0RKNfj7TWL7SL8PB6MypqwgylXCi+u412uvYoyY/kSmO8n06wyd8nIcnTbYToCmSKFMI1mCg==
|
||||
dependencies:
|
||||
duplexer "^0.1.1"
|
||||
is-buffer "^1.1.6"
|
||||
is-stream "^1.1.0"
|
||||
moment "^2.21.0"
|
||||
request "^2.88.0"
|
||||
through "^2.3.8"
|
||||
tunnel "0.0.5"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
@@ -707,13 +791,14 @@ punycode@^2.1.0, punycode@^2.1.1:
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qmi-cloud-common@../qmi-cloud-common:
|
||||
version "1.1.2"
|
||||
version "1.1.6"
|
||||
dependencies:
|
||||
"@azure/arm-compute" "^15.0.0"
|
||||
"@azure/ms-rest-nodeauth" "^3.0.7"
|
||||
"@hapi/boom" "^9.1.0"
|
||||
azure-arm-compute "^10.0.0"
|
||||
axios "^0.21.1"
|
||||
bull "^3.11.0"
|
||||
mongoose "^5.7.4"
|
||||
ms-rest-azure "^3.0.0"
|
||||
nodemailer "^6.4.2"
|
||||
|
||||
qs@~6.5.2:
|
||||
@@ -756,7 +841,7 @@ regexp-clone@1.0.0, regexp-clone@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63"
|
||||
integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==
|
||||
|
||||
"request@>= 2.52.0", request@^2.88.0:
|
||||
"request@>= 2.52.0":
|
||||
version "2.88.2"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
|
||||
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
|
||||
@@ -817,6 +902,11 @@ saslprep@^1.0.0:
|
||||
dependencies:
|
||||
sparse-bitfield "^3.0.3"
|
||||
|
||||
sax@>=0.6.0:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
|
||||
|
||||
semver@^5.1.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||
@@ -905,10 +995,14 @@ string_decoder@~1.1.1:
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
through@^2.3.8:
|
||||
version "2.3.8"
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
|
||||
tough-cookie@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2"
|
||||
integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==
|
||||
dependencies:
|
||||
ip-regex "^2.1.0"
|
||||
psl "^1.1.28"
|
||||
punycode "^2.1.1"
|
||||
|
||||
tough-cookie@~2.5.0:
|
||||
version "2.5.0"
|
||||
@@ -918,6 +1012,16 @@ tough-cookie@~2.5.0:
|
||||
psl "^1.1.28"
|
||||
punycode "^2.1.1"
|
||||
|
||||
tslib@^1.10.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
|
||||
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
@@ -925,10 +1029,10 @@ tunnel-agent@^0.6.0:
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tunnel@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.5.tgz#d1532254749ed36620fcd1010865495a1fa9d0ae"
|
||||
integrity sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==
|
||||
tunnel@0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
|
||||
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
@@ -940,6 +1044,11 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.10.2.tgz#73d6aa3668f3188e4adb0f1943bd12cfd7efaaaf"
|
||||
integrity sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==
|
||||
|
||||
universalify@^0.1.0:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
|
||||
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
@@ -962,7 +1071,7 @@ util.promisify@^1.0.1:
|
||||
has-symbols "^1.0.1"
|
||||
object.getownpropertydescriptors "^2.1.0"
|
||||
|
||||
uuid@^3.1.0, uuid@^3.2.1, uuid@^3.3.2, uuid@^3.4.0:
|
||||
uuid@^3.1.0, uuid@^3.3.2, uuid@^3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
||||
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
||||
@@ -976,6 +1085,19 @@ verror@1.10.0:
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
xml2js@^0.4.19:
|
||||
version "0.4.23"
|
||||
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66"
|
||||
integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==
|
||||
dependencies:
|
||||
sax ">=0.6.0"
|
||||
xmlbuilder "~11.0.0"
|
||||
|
||||
xmlbuilder@~11.0.0:
|
||||
version "11.0.1"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
|
||||
integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==
|
||||
|
||||
"xmldom@>= 0.1.x":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.3.0.tgz#e625457f4300b5df9c2e1ecb776147ece47f3e5a"
|
||||
|
||||
108
qmi-cloud-common/awscli.js
Normal file
108
qmi-cloud-common/awscli.js
Normal file
@@ -0,0 +1,108 @@
|
||||
const AWS = require("aws-sdk");
|
||||
const db = require("./mongo");
|
||||
const utils = require("./utils");
|
||||
|
||||
|
||||
function _getRgName(provision) {
|
||||
let rgName = provision.scenario.toUpperCase();
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
return rgName;
|
||||
}
|
||||
|
||||
function _getRegion(provision) {
|
||||
let region = "eu-west-1";
|
||||
if ( provision.deployOpts.location === 'East US') {
|
||||
region = "us-east-1";
|
||||
} else if ( provision.deployOpts.location === 'Southeast Asia' ) {
|
||||
region = "ap-southeast-1";
|
||||
}
|
||||
return region;
|
||||
}
|
||||
|
||||
async function deallocate(provision, isSendEmailAfter) {
|
||||
|
||||
let rgName = _getRgName(provision);
|
||||
let region = _getRegion(provision);
|
||||
|
||||
console.log("AWSCLI# Stopping EC2s for resource group: "+rgName);
|
||||
|
||||
var ec2 = new AWS.EC2({apiVersion: '2016-11-15', region: region});
|
||||
var params = {
|
||||
DryRun: false,
|
||||
Filters: [
|
||||
{
|
||||
Name: 'tag:Name',
|
||||
Values: [ `fort-${provision._id}` ]
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
ec2.describeInstances(params, async function (err, data) {
|
||||
if (err) {
|
||||
console.log("AWSCLI# ERROR describing EC2s: "+rgName, err.stack);
|
||||
} else {
|
||||
|
||||
var ec2Ids = data.Reservations[0].Instances.map(ec2=> ec2.InstanceId);
|
||||
console.log("AWSCLI# Stopping EC2s ids", ec2Ids);
|
||||
params = {
|
||||
DryRun: false,
|
||||
InstanceIds: ec2Ids
|
||||
};
|
||||
|
||||
ec2.stopInstances(params, async function(err, data) {
|
||||
if (err) {
|
||||
console.log("AWSCLI# ERROR stopping EC2s: "+rgName, err.stack);
|
||||
} else {
|
||||
console.log("AWSCLI# EC2s stopped!");
|
||||
utils.afterStopVms( provision, isSendEmailAfter );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function start(provision) {
|
||||
|
||||
let rgName = _getRgName(provision);
|
||||
let region = _getRegion(provision);
|
||||
|
||||
console.log("AWSCLI# Stopping EC2s for resource group: "+rgName);
|
||||
|
||||
var ec2 = new AWS.EC2({apiVersion: '2016-11-15', region: region});
|
||||
var params = {
|
||||
DryRun: false,
|
||||
Filters: [
|
||||
{
|
||||
Name: 'tag:Name',
|
||||
Values: [ `fort-${provision._id}` ]
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
ec2.describeInstances(params, async function (err, data) {
|
||||
if (err) {
|
||||
console.log("AWSCLI# ERROR describing EC2s: "+rgName, err.stack);
|
||||
} else {
|
||||
|
||||
var ec2Ids = data.Reservations[0].Instances.map(ec2=> ec2.InstanceId);
|
||||
console.log("AWSCLI# Starting EC2s ids", ec2Ids);
|
||||
params = {
|
||||
DryRun: false,
|
||||
InstanceIds: ec2Ids
|
||||
};
|
||||
|
||||
ec2.startInstances(params, async function(err, data) {
|
||||
if (err) {
|
||||
console.log("AWSCLI# ERROR starting EC2s: "+rgName, err.stack);
|
||||
} else if (data) {
|
||||
console.log("AWSCLI# EC2s started!");
|
||||
utils.afterStartVms( provision );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.deallocate = deallocate;
|
||||
module.exports.start = start;
|
||||
@@ -1,17 +1,40 @@
|
||||
const MsRest = require('ms-rest-azure');
|
||||
const computeManagementClient = require('azure-arm-compute');
|
||||
const loginWithVmMSI = require("@azure/ms-rest-nodeauth").loginWithVmMSI;
|
||||
const computeManagementClient = require("@azure/arm-compute").ComputeManagementClient;
|
||||
const dnsManagementClient = require("@azure/arm-dns").DnsManagementClient;
|
||||
const db = require("./mongo");
|
||||
const sendEmail = require("./send-email");
|
||||
const utils = require("./utils");
|
||||
|
||||
const SUBSCRIPTION_ID = "62ebff8f-c40b-41be-9239-252d6c0c8ad9";
|
||||
|
||||
function _getRgName(provision) {
|
||||
let rgName = provision.scenario.toUpperCase();
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
return rgName;
|
||||
}
|
||||
|
||||
async function _getClient(scenarioName) {
|
||||
var id = SUBSCRIPTION_ID;
|
||||
if (scenarioName){
|
||||
var scenario = await db.scenario.getOne({"name": scenarioName});
|
||||
var id = scenario.subscription? scenario.subscription.subsId : SUBSCRIPTION_ID;
|
||||
var credentials = await MsRest.loginWithMSI({ port: 50342 });
|
||||
console.log("Azure CLI authenticated", credentials);
|
||||
id = scenario.subscription? scenario.subscription.subsId : SUBSCRIPTION_ID;
|
||||
}
|
||||
var credentials = await loginWithVmMSI({ port: 50342 });
|
||||
//console.log("AzureCLI# authenticated", credentials);
|
||||
return new computeManagementClient(credentials, id);
|
||||
}
|
||||
async function _getDNSClient(scenarioName) {
|
||||
var id = SUBSCRIPTION_ID;
|
||||
if (scenarioName){
|
||||
var scenario = await db.scenario.getOne({"name": scenarioName});
|
||||
id = scenario.subscription? scenario.subscription.subsId : SUBSCRIPTION_ID;
|
||||
}
|
||||
var credentials = await loginWithVmMSI({ port: 50342 });
|
||||
//console.log("AzureCLI# authenticated", credentials);
|
||||
return new dnsManagementClient(credentials, id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
@@ -20,60 +43,189 @@ async function asyncForEach(array, callback) {
|
||||
}
|
||||
|
||||
async function deallocate(provision, isSendEmailAfter ) {
|
||||
let rgName = provision.scenario.toUpperCase();
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
|
||||
console.log("Deallocating VMs for resource group: "+rgName);
|
||||
let rgName = _getRgName(provision);
|
||||
console.log("AzureCLI# Deallocating VMs for resource group: "+rgName);
|
||||
|
||||
var computeClient = await _getClient(provision.scenario);
|
||||
let finalResult = await computeClient.virtualMachines.list(rgName);
|
||||
if ( finalResult && finalResult.length > 0 ) {
|
||||
db.provision.update(provision._id, {"statusVms": "Stopping"});
|
||||
}
|
||||
|
||||
try {
|
||||
await asyncForEach(finalResult, async function(vm) {
|
||||
await computeClient.virtualMachines.deallocate(rgName, vm.name);
|
||||
});
|
||||
|
||||
let timeRunning = db.utils.getNewTimeRunning(provision);
|
||||
await db.provision.update(provision._id.toString(), {"statusVms": "Stopped", "timeRunning": timeRunning, "stoppedFrom": new Date(), "pendingNextAction": undefined});
|
||||
await utils.afterStopVms(provision, isSendEmailAfter);
|
||||
|
||||
if ( isSendEmailAfter && provision._scenario) {
|
||||
await sendEmail.sendVMsStopped(provision, provision._scenario);
|
||||
console.log("AzureCLI# All VMs DEALLOCATED for resource group: "+rgName);
|
||||
} catch ( error ) {
|
||||
console.log("AzureCLI# ERROR stopping VMs: "+rgName, error);
|
||||
await db.provision.update(provision._id.toString(), {"statusVms": "Running" });
|
||||
}
|
||||
|
||||
console.log("All VMs DEALLOCATED for resource group: "+rgName);
|
||||
}
|
||||
|
||||
async function start(provision){
|
||||
|
||||
let rgName = provision.scenario.toUpperCase();
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
let rgName = _getRgName(provision);
|
||||
console.log("AzureCLI# Starting VMs for resource group: "+rgName);
|
||||
|
||||
console.log("Starting VMs for resource group: "+rgName);
|
||||
var computeClient = await _getClient(provision.scenario);
|
||||
let finalResult = await computeClient.virtualMachines.list(rgName);
|
||||
|
||||
if ( finalResult && finalResult.length > 0 ) {
|
||||
db.provision.update(provision._id, {"statusVms": "Starting"});
|
||||
}
|
||||
|
||||
try {
|
||||
await asyncForEach(finalResult, async function(vm) {
|
||||
await computeClient.virtualMachines.start(rgName, vm.name);
|
||||
});
|
||||
let countExtend = db.utils.getNewCountExtend(provision);
|
||||
await db.provision.update(provision._id.toString(), {"statusVms": "Running", "runningFrom": new Date(), "countExtend": countExtend, "pendingNextAction": undefined});
|
||||
console.log("All VMs RUNNING for resource group: "+rgName);
|
||||
|
||||
await utils.afterStartVms( provision );
|
||||
|
||||
} catch ( error ) {
|
||||
console.log("AzureCLI# ERROR starting VMs: "+rgName, error);
|
||||
await db.provision.update(provision._id.toString(), {"statusVms": "Stopped" });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function getResourceGroupVms(rgName){
|
||||
let computeClient = await _getClient();
|
||||
return await computeClient.virtualMachines.list(rgName);
|
||||
}
|
||||
|
||||
async function getAllVms(){
|
||||
return await computeClient.virtualMachines.listAll(rgName);
|
||||
let computeClient = await _getClient();
|
||||
console.log("AzureCLI# Retrieving all VMS from subscription");
|
||||
return await computeClient.virtualMachines.listAll();
|
||||
}
|
||||
async function getAllVmsNext(nextLink){
|
||||
let computeClient = await _getClient();
|
||||
console.log("AzureCLI# Retrieving all VMS from subscription (next): " +nextLink);
|
||||
return await computeClient.virtualMachines.listAllNext(nextLink)
|
||||
}
|
||||
|
||||
async function updateVmsTags(provId, tagsEdit) {
|
||||
|
||||
if ( !tagsEdit ){ return {} ; }
|
||||
let provision = await db.provision.getById(provId);
|
||||
if ( !provision ){ return };
|
||||
|
||||
let rgName = _getRgName(provision);
|
||||
console.log("AzureCLI# Updating TAGS in VMs for resource group: "+rgName);
|
||||
|
||||
|
||||
var computeClient;
|
||||
var finalResult;
|
||||
try {
|
||||
computeClient = await _getClient(provision.scenario);
|
||||
finalResult = await computeClient.virtualMachines.list(rgName);
|
||||
} catch (e2) {
|
||||
console.log(`AzureCLI# ERROR: Resource group '${rgName}' could not be found`, e2);
|
||||
return {};
|
||||
}
|
||||
|
||||
if (finalResult && finalResult.length > 0) {
|
||||
var toDelete = [];
|
||||
var toAdd = [];
|
||||
for(let tag in tagsEdit ) {
|
||||
if ( !tagsEdit[tag] ) {
|
||||
toDelete.push(tag);
|
||||
} else {
|
||||
toAdd.push({"key": tag, "value": tagsEdit[tag]});
|
||||
}
|
||||
}
|
||||
var result = {};
|
||||
if ( toDelete.length > 0 || toAdd.length > 0 ) {
|
||||
|
||||
await asyncForEach(finalResult, async function(vm) {
|
||||
|
||||
var vmActualTags = JSON.stringify(vm.tags);
|
||||
var tags = vm.tags;
|
||||
toDelete.forEach(t=>{
|
||||
delete tags[t];
|
||||
});
|
||||
toAdd.forEach(t=>{
|
||||
tags[t.key] = t.value;
|
||||
});
|
||||
tags["ProvId"] = provision._id.toString();
|
||||
result[vm.name] = tags;
|
||||
|
||||
if ( JSON.stringify(tags) !== vmActualTags ) {
|
||||
try {
|
||||
console.log(`AzureCLI# setting new tags to VM ${vm.name} (${rgName})`);
|
||||
await computeClient.virtualMachines.update(rgName, vm.name, {"tags": tags} );
|
||||
} catch (e1) {
|
||||
console.log(`AzureCLI# ERROR setting tags to VM ${vm.name} (${rgName})`, e1);
|
||||
}
|
||||
} else {
|
||||
console.log(`AzureCLI# Same tags, no need to update tags for VM ${vm.name} (${rgName})`);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//db.event.add({ user: provision.user._id, provision: provision._id, type: 'provision.vms-tags-update' });
|
||||
|
||||
return result;
|
||||
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* DNS Records
|
||||
*/
|
||||
|
||||
const DNS_RESOURCE_GROUP = "QMI-Infra-DNS";
|
||||
const DNS_ZONE_NAME = "qmi.qlik-poc.com";
|
||||
|
||||
async function getDNSRecords(type = "CNAME") {
|
||||
let dnsClient = await _getDNSClient();
|
||||
console.log(`AzureCLI# Retrieving '${type}' DNS records`);
|
||||
return await dnsClient.recordSets.listByType(DNS_RESOURCE_GROUP, DNS_ZONE_NAME, type);
|
||||
}
|
||||
|
||||
async function createDNSRecord(provision, cname, type = "CNAME"){
|
||||
|
||||
if ( !provision ) return;
|
||||
|
||||
let rgName = _getRgName(provision).toLowerCase();
|
||||
|
||||
let dnsClient = await _getDNSClient();
|
||||
console.log(`AzureCLI# Creating '${type}' DNS record: ${rgName}.${DNS_ZONE_NAME} --> ${cname}`);
|
||||
let parameters = {
|
||||
"cnameRecord": {
|
||||
"cname": cname
|
||||
},
|
||||
"tTL": 60
|
||||
};
|
||||
return await dnsClient.recordSets.createOrUpdate(DNS_RESOURCE_GROUP, DNS_ZONE_NAME, rgName, type, parameters );
|
||||
}
|
||||
|
||||
async function deleteDNSRecord(provision, type = "CNAME"){
|
||||
|
||||
if ( !provision ) return;
|
||||
|
||||
let rgName = _getRgName(provision).toLowerCase();
|
||||
let dnsClient = await _getDNSClient();
|
||||
console.log(`AzureCLI# Deleting '${type}' DNS record: ${rgName}.${DNS_ZONE_NAME}`);
|
||||
return await dnsClient.recordSets.deleteMethod(DNS_RESOURCE_GROUP, DNS_ZONE_NAME, rgName, type );
|
||||
}
|
||||
|
||||
module.exports.start = start;
|
||||
module.exports.deallocate = deallocate;
|
||||
module.exports.getResourceGroupVms = getResourceGroupVms;
|
||||
module.exports.getAllVms = getAllVms;
|
||||
module.exports.getAllVmsNext = getAllVmsNext;
|
||||
module.exports.updateVmsTags = updateVmsTags;
|
||||
module.exports.getDNSRecords = getDNSRecords;
|
||||
module.exports.createDNSRecord = createDNSRecord;
|
||||
module.exports.deleteDNSRecord = deleteDNSRecord
|
||||
|
||||
85
qmi-cloud-common/barracuda.js
Normal file
85
qmi-cloud-common/barracuda.js
Normal file
@@ -0,0 +1,85 @@
|
||||
const BarracudaAPI = require('barracuda-api');
|
||||
const azurecli = require('./azurecli');
|
||||
const db = require('./mongo');
|
||||
|
||||
const DOMAIN = "qmi.qlik-poc.com";
|
||||
|
||||
async function createApp(prov) {
|
||||
|
||||
if ( !prov._scenarioDoc.barracudaTemplate || prov._scenarioDoc.barracudaTemplate === 'qs-only-443' ) {
|
||||
_createApp(prov, "443", "HTTPS");
|
||||
} else if ( prov._scenarioDoc.barracudaTemplate === 'qdc-only-8443' ) {
|
||||
_createApp(prov, "8443", "HTTPS");
|
||||
} else if (prov._scenarioDoc.barracudaTemplate) {
|
||||
var spl = prov._scenarioDoc.barracudaTemplate.split("-");
|
||||
_createApp(prov, spl[0], spl[1]);
|
||||
}
|
||||
}
|
||||
|
||||
async function _createApp(provision, backendPort, backendType) {
|
||||
|
||||
|
||||
if ( !provision || !provision.barracudaAzureFqdn ) {
|
||||
console.log(`Barracuda# Provision does not exist or does not have a barracudaAzureFqdn value. Do nothing.`);
|
||||
return;
|
||||
}
|
||||
|
||||
let appName = provision.scenario.toLowerCase();
|
||||
appName = appName.replace(/azqmi/g, 'qmi');
|
||||
appName = `${appName}-${provision._id}`
|
||||
|
||||
console.log(`Barracuda# Creating Barracuda App for provision (${appName})`);
|
||||
|
||||
const client = new BarracudaAPI.QlikSenseNPrintingApp();
|
||||
client.create(appName, `${appName}.${DOMAIN}`, provision.barracudaAzureFqdn, backendPort, backendType).then(function(result) {
|
||||
let bApp = result.app;
|
||||
console.log("Barracuda# Barracuda App created! ID: "+ bApp.id);
|
||||
let cname = bApp.waas_services && bApp.waas_services.length? bApp.waas_services[0].cname : null;
|
||||
db.provision.update(provision._id, {"barracudaAppId": bApp.id, "barracudaAppCname":cname});
|
||||
|
||||
console.log("Barracuda# Creating DNS record in Azure: "+cname);
|
||||
azurecli.createDNSRecord(provision, cname);
|
||||
|
||||
db.event.add({ user: provision.user._id, provision: provision._id, type: 'provision.is-public' });
|
||||
|
||||
}).catch(function(err){
|
||||
console.log("Barracuda# Error creating Barracuda App", err);
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteApp(provision) {
|
||||
|
||||
|
||||
if ( !provision || !provision.barracudaAppId ) {
|
||||
console.log(`Barracuda# Provision does not exist or does not have a barracudaAppId value. Do nothing.`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Barracuda# Deleting DNS record in Azure and Barracuda App ID (${provision.barracudaAppId}) for provision (${provision._id})`);
|
||||
|
||||
azurecli.deleteDNSRecord(provision);
|
||||
const client = new BarracudaAPI.QlikSenseNPrintingApp();
|
||||
client.delete(provision.barracudaAppId).then(function() {
|
||||
console.log("Barracuda# Barracuda App deleted! ID: "+ provision.barracudaAppId);
|
||||
|
||||
db.event.add({ user: provision.user._id, provision: provision._id, type: 'provision.is-private' });
|
||||
}).catch(function(err){
|
||||
console.log("Barracuda# Error deleting Barracuda App", err);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async function getApp(provision) {
|
||||
|
||||
if ( !provision || !provision.barracudaAppId ) {
|
||||
console.log(`Barracuda# Provision does not exist or does not have a barracudaAppId value. Do nothing.`);
|
||||
return;
|
||||
}
|
||||
const client = new BarracudaAPI.QlikSenseNPrintingApp();
|
||||
return await client.getDetails(provision.barracudaAppId);
|
||||
|
||||
}
|
||||
|
||||
module.exports.getApp = getApp;
|
||||
module.exports.createApp = createApp;
|
||||
module.exports.deleteApp = deleteApp;
|
||||
38
qmi-cloud-common/cli.js
Normal file
38
qmi-cloud-common/cli.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const awscli = require("./awscli");
|
||||
const azurecli = require("./azurecli");
|
||||
const db = require("./mongo");
|
||||
|
||||
|
||||
async function deallocate(provId, isSendEmailAfter ) {
|
||||
let provision = await db.provision.getById(provId);
|
||||
if ( !provision ) return;
|
||||
|
||||
azurecli.deallocate(provision, isSendEmailAfter);
|
||||
|
||||
if (provision.scenario === 'azqmi-fort'){
|
||||
awscli.stop(provision, isSendEmailAfter);
|
||||
} else {
|
||||
azurecli.deallocate(provision, isSendEmailAfter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function start(provId){
|
||||
|
||||
let provision = await db.provision.getById(provId);
|
||||
if ( !provision ) return;
|
||||
|
||||
if (provision.scenario === 'azqmi-fort'){
|
||||
awscli.start(provision);
|
||||
} else {
|
||||
azurecli.start(provision);
|
||||
}
|
||||
}
|
||||
|
||||
async function updateVmsTags(provId, tagsEdit) {
|
||||
azurecli.updateVmsTags(provId, tagsEdit);
|
||||
}
|
||||
|
||||
module.exports.deallocate = deallocate;
|
||||
module.exports.start = start;
|
||||
module.exports.updateVmsTags = updateVmsTags;
|
||||
4
qmi-cloud-common/config.js
Normal file
4
qmi-cloud-common/config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
DOCKERIMAGE_TERRAFORM: "qlikgear/terraform:0.13.4",
|
||||
PROVISION_VERSION: 20201124
|
||||
}
|
||||
31
qmi-cloud-common/models/Event.js
Normal file
31
qmi-cloud-common/models/Event.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const mongoose = require('mongoose');
|
||||
mongoose.set('useFindAndModify', false);
|
||||
const crypto = require("crypto");
|
||||
//mongoose.set('debug', true)
|
||||
|
||||
|
||||
const schema = new mongoose.Schema({
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
user: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'User',
|
||||
index : true
|
||||
},
|
||||
provision: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'Provision'
|
||||
},
|
||||
type: {
|
||||
type: String
|
||||
},
|
||||
message: {
|
||||
type: String
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = mongoose.model('Event', schema)
|
||||
@@ -4,7 +4,8 @@ mongoose.set('useFindAndModify', false);
|
||||
|
||||
const provisionSchema = new mongoose.Schema({
|
||||
user: {
|
||||
type: mongoose.Types.ObjectId, ref: 'User',
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'User',
|
||||
index: true
|
||||
},
|
||||
created: {
|
||||
@@ -16,7 +17,10 @@ const provisionSchema = new mongoose.Schema({
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
scenario: String,
|
||||
scenario: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
scenarioVersion: {
|
||||
type: String,
|
||||
default: "1.0"
|
||||
@@ -35,6 +39,15 @@ const provisionSchema = new mongoose.Schema({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
barracudaAppId: {
|
||||
type: String
|
||||
},
|
||||
barracudaAppCname: {
|
||||
type: String
|
||||
},
|
||||
barracudaAzureFqdn: {
|
||||
type: String
|
||||
},
|
||||
isDestroyed: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -63,14 +76,45 @@ const provisionSchema = new mongoose.Schema({
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
startDateOnSchedule: {
|
||||
type: Date
|
||||
},
|
||||
endDateOnSchedule: {
|
||||
type: Date
|
||||
},
|
||||
countExtend: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
pendingNextAction: {
|
||||
type: String
|
||||
},
|
||||
schedule: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'Schedule'
|
||||
},
|
||||
deployOpts: {
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: "Subscription"
|
||||
},
|
||||
terraformImage: {
|
||||
type: String
|
||||
},
|
||||
version: {
|
||||
type: Number
|
||||
}
|
||||
},{
|
||||
toObject: {virtuals:true},
|
||||
toJSON: {virtuals:true},
|
||||
});
|
||||
|
||||
// Foreign keys definitions
|
||||
|
||||
provisionSchema.virtual('_scenarioDoc', {
|
||||
ref: 'Scenario',
|
||||
localField: 'scenario',
|
||||
foreignField: 'name',
|
||||
justOne: true // for many-to-1 relationships
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Provision', provisionSchema)
|
||||
@@ -15,12 +15,12 @@ const scenarioSchema = new mongoose.Schema({
|
||||
},
|
||||
version: {
|
||||
type: String,
|
||||
requred: true
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
unique : true,
|
||||
requred: true,
|
||||
required: true,
|
||||
index: true
|
||||
},
|
||||
isAdminOnly: {
|
||||
@@ -35,21 +35,62 @@ const scenarioSchema = new mongoose.Schema({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isDivvyEnabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
numSimultaneousProvisions: {
|
||||
type: Number
|
||||
},
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
requred: true
|
||||
required: true
|
||||
},
|
||||
gitBranch: {
|
||||
type: String
|
||||
},
|
||||
description: String,
|
||||
availableProductVersions: Array,
|
||||
productVersionDefault: String,
|
||||
newImageName: String, //For Gen scenarios
|
||||
subscription: {
|
||||
type: mongoose.Types.ObjectId, ref: 'Subscription',
|
||||
requred: true
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'Subscription'
|
||||
},
|
||||
deployOpts: [{
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'Subscription',
|
||||
required: true
|
||||
}],
|
||||
labels: [{
|
||||
type: String
|
||||
}],
|
||||
allowedUsers: [{
|
||||
type: mongoose.Types.ObjectId,
|
||||
ref: 'User',
|
||||
required: true
|
||||
}],
|
||||
support: [{
|
||||
type: String
|
||||
}],
|
||||
barracudaTemplate: {
|
||||
type: String
|
||||
},
|
||||
allowedInnactiveDays: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
allowed24x7RunningDays: {
|
||||
type: Number,
|
||||
default: 7
|
||||
},
|
||||
allowedOnScheduleRunningDays: {
|
||||
type: Number,
|
||||
default: 4
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
41
qmi-cloud-common/models/Schedule.js
Normal file
41
qmi-cloud-common/models/Schedule.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const mongoose = require('mongoose');
|
||||
mongoose.set('useFindAndModify', false);
|
||||
//mongoose.set('debug', true)
|
||||
|
||||
|
||||
const sc = new mongoose.Schema({
|
||||
is24x7: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: true
|
||||
},
|
||||
isStartupTimeEnable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
localeShutdownTime: {
|
||||
type: String
|
||||
},
|
||||
localeStartupTime: {
|
||||
type: String
|
||||
},
|
||||
localTimezone: {
|
||||
type: String
|
||||
},
|
||||
utcTagShutdownTime: {
|
||||
type: String
|
||||
},
|
||||
utcTagStartupTime: {
|
||||
type: String
|
||||
},
|
||||
timezoneOffset: {
|
||||
type: Number
|
||||
},
|
||||
weekStartDay: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = mongoose.model('Schedule', sc)
|
||||
@@ -30,6 +30,15 @@ const subSchema = new mongoose.Schema({
|
||||
},
|
||||
appGwSubnetId: {
|
||||
type: String
|
||||
},
|
||||
location: {
|
||||
type: String
|
||||
},
|
||||
wafPolicyName: {
|
||||
type: String
|
||||
},
|
||||
wafPolicyRgName: {
|
||||
type: String
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -26,6 +26,12 @@ const userSchema = new mongoose.Schema({
|
||||
lastLogin: {
|
||||
type: Date
|
||||
},
|
||||
qcsUserId: {
|
||||
type: String
|
||||
},
|
||||
qcsUserSubject: {
|
||||
type: String
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -9,36 +9,40 @@ const options = {
|
||||
useUnifiedTopology: true
|
||||
};
|
||||
|
||||
console.log("--- MongoDB connecting... ", process.env.MONGO_URI);
|
||||
|
||||
// Connect to DB
|
||||
mongoose.connect(process.env.MONGO_URI, options);
|
||||
|
||||
// When successfully connected
|
||||
mongoose.connection.on('connected', () => {
|
||||
console.log('MongoDB connected...');
|
||||
console.log('--- MongoDB connected');
|
||||
});
|
||||
|
||||
// When successfully reconnected
|
||||
mongoose.connection.on('reconnected', () => {
|
||||
console.log('dbevent: reconnected');
|
||||
console.log('--- MongoDB dbevent: reconnected');
|
||||
});
|
||||
|
||||
// If the connection throws an error
|
||||
mongoose.connection.on('error', (err) => {
|
||||
console.log(`dbevent: error: ${err}`);
|
||||
console.log(`--- MongoDB dbevent: error: ${err}`);
|
||||
//console.log(`Retry mongo connect`);
|
||||
//mongoose.connect(process.env.MONGO_URI, options);
|
||||
});
|
||||
|
||||
|
||||
// Get Data Models
|
||||
const Scenario = require('./models/Scenario');
|
||||
const Schedule = require('./models/Schedule');
|
||||
const Provision = require('./models/Provision');
|
||||
const Destroy = require('./models/Destroy');
|
||||
const User = require('./models/User');
|
||||
const Scenario = require('./models/Scenario');
|
||||
const VmType = require('./models/VmType');
|
||||
const ApiKey = require('./models/ApiKey');
|
||||
const Notification = require('./models/Notification');
|
||||
const Subscription = require('./models/Subscription');
|
||||
const Event = require('./models/Event');
|
||||
|
||||
|
||||
const getNewCountExtend = function(provision) {
|
||||
@@ -61,13 +65,80 @@ const getNewTimeRunning = function (provision) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
const getPage = async ( model, filter, page, populates, select ) => {
|
||||
var sort = {};
|
||||
var modelAttributes = Object.keys(model.schema.tree);
|
||||
if ( modelAttributes.indexOf("created") !== -1) {
|
||||
sort = {created: -1};
|
||||
}
|
||||
|
||||
try {
|
||||
var exec = model.find(filter, select).sort(sort);
|
||||
var totalDocs = await model.countDocuments(filter);
|
||||
|
||||
var isPage = false;
|
||||
if ( page && page.page > 0 && page.size !== undefined ) {
|
||||
var skip = 0;
|
||||
skip = (page.page - 1) * page.size;
|
||||
exec = exec.skip(skip);
|
||||
exec = exec.limit(page.size);
|
||||
isPage = true;
|
||||
}
|
||||
|
||||
if ( populates ) {
|
||||
populates = JSON.parse(populates);
|
||||
populates.forEach(p=> {
|
||||
exec = exec.populate(p);
|
||||
});
|
||||
} else {
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate({path:'destroy', select: "-user -jobId"}).populate({path:'_scenarioDoc', select: "-availableProductVersions -updated -created"}).populate({path: "schedule"}).populate('deployOpts');
|
||||
}
|
||||
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription').populate('deployOpts');
|
||||
}
|
||||
}
|
||||
|
||||
const entity = await exec;
|
||||
|
||||
var out = {
|
||||
total: totalDocs,
|
||||
count: entity.length,
|
||||
results: entity
|
||||
}
|
||||
if ( isPage && (page.page * page.size < totalDocs)) {
|
||||
out.next = {
|
||||
page: page.page + 1,
|
||||
size: page.size
|
||||
};
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
} catch (err) {
|
||||
throw boom.boomify(err)
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
var sort = {};
|
||||
var modelAttributes = Object.keys(model.schema.tree);
|
||||
|
||||
if ( model === Scenario ) {
|
||||
if ( modelAttributes.indexOf("updated") !== -1) {
|
||||
sort.updated = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( modelAttributes.indexOf("created") !== -1) {
|
||||
sort.created = -1;
|
||||
}
|
||||
try {
|
||||
var exec = model.find(filter, select).sort(sort);
|
||||
var totalDocs = await model.countDocuments(filter);
|
||||
@@ -82,12 +153,12 @@ const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
|
||||
if ( populates ) {
|
||||
populates = JSON.parse(populates);
|
||||
populates.forEach(p=>{
|
||||
exec = exec.populate({path: p});
|
||||
populates.forEach(p=> {
|
||||
exec = exec.populate(p);
|
||||
});
|
||||
} else {
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate({path:'destroy', select: "-user -jobId"});
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate({path:'destroy', select: "-user -jobId"}).populate({path:'_scenarioDoc', select: "-availableProductVersions -updated -created"}).populate({path: "schedule"}).populate('deployOpts');
|
||||
}
|
||||
|
||||
if ( model === ApiKey ) {
|
||||
@@ -95,7 +166,7 @@ const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
}
|
||||
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
exec = exec.populate('subscription').populate('deployOpts').populate('allowedUsers');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,13 +191,13 @@ const getById = async (model, id, reply) => {
|
||||
try {
|
||||
var exec = model.findById(id);
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate('user').populate('destroy');
|
||||
exec = exec.populate('user').populate('destroy').populate('_scenarioDoc').populate("schedule").populate('deployOpts');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
exec = exec.populate('subscription').populate('deployOpts').populate('allowedUsers');
|
||||
}
|
||||
const entity = await exec;
|
||||
return entity;
|
||||
@@ -139,13 +210,13 @@ const getOne = async (model, filter, reply) => {
|
||||
try {
|
||||
var exec = model.findOne(filter);
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate('user').populate('destroy');
|
||||
exec = exec.populate('user').populate('destroy').populate('_scenarioDoc').populate("schedule").populate('deployOpts');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
exec = exec.populate('subscription').populate('deployOpts').populate('allowedUsers');
|
||||
}
|
||||
const entity = await exec;
|
||||
return entity;
|
||||
@@ -167,16 +238,16 @@ const update = async (model, id, body, reply) => {
|
||||
try {
|
||||
const { ...updateData } = body;
|
||||
updateData.updated = new Date();
|
||||
console.log("UPDATE", id, updateData);
|
||||
//console.log("UPDATE", id, updateData);
|
||||
var exec = model.findByIdAndUpdate(id, updateData, { new: true });
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate('user').populate('destroy');
|
||||
exec = exec.populate('user').populate('destroy').populate('_scenarioDoc').populate("schedule").populate('deployOpts');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
exec = exec.populate('subscription').populate('deployOpts');
|
||||
}
|
||||
const update = await exec;
|
||||
return update;
|
||||
@@ -185,6 +256,31 @@ const update = async (model, id, body, reply) => {
|
||||
}
|
||||
};
|
||||
|
||||
const updateMany = async (model, filter, body, reply) => {
|
||||
try {
|
||||
const { ...updateData } = body;
|
||||
|
||||
updateData.updated = new Date();
|
||||
|
||||
var exec = model.updateMany(filter, updateData);
|
||||
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate('user').populate('destroy').populate('_scenarioDoc').populate("schedule").populate('deployOpts');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription').populate('deployOpts');
|
||||
}
|
||||
|
||||
return await exec;
|
||||
|
||||
} catch (err) {
|
||||
throw boom.boomify(err)
|
||||
}
|
||||
};
|
||||
|
||||
const del = async (model, id, reply) => {
|
||||
try {
|
||||
const entity = await model.findByIdAndRemove(id)
|
||||
@@ -194,11 +290,23 @@ const del = async (model, id, reply) => {
|
||||
}
|
||||
}
|
||||
|
||||
const count = async (model, filter, reply) => {
|
||||
try {
|
||||
var totalDocs = await model.countDocuments(filter);
|
||||
return totalDocs;
|
||||
} catch (err) {
|
||||
throw boom.boomify(err)
|
||||
}
|
||||
}
|
||||
|
||||
function _m(model) {
|
||||
return {
|
||||
get: async (filter, select, skip, limit, populates, reply) => {
|
||||
return get(model, filter, select, skip, limit, populates, reply);
|
||||
},
|
||||
getPage: async (filter, page, populates, select, reply) => {
|
||||
return getPage(model, filter, page, populates, select, reply);
|
||||
},
|
||||
getById: async (id, reply) => {
|
||||
return getById(model, id, reply);
|
||||
},
|
||||
@@ -211,14 +319,21 @@ function _m(model) {
|
||||
update: async (id, data, reply) => {
|
||||
return update(model, id, data, reply);
|
||||
},
|
||||
updateMany: async(filter, data, reply) => {
|
||||
return updateMany(model, filter, data, reply);
|
||||
},
|
||||
del: async (id, reply) => {
|
||||
return del(model, id, reply);
|
||||
},
|
||||
count: async (filter, reply) => {
|
||||
return count(model, filter, reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
schedule: _m(Schedule),
|
||||
provision: _m(Provision),
|
||||
destroy: _m(Destroy),
|
||||
scenario: _m(Scenario),
|
||||
@@ -226,6 +341,7 @@ module.exports = {
|
||||
apiKey: _m(ApiKey),
|
||||
notification: _m(Notification),
|
||||
subscription: _m(Subscription),
|
||||
event: _m(Event),
|
||||
user: _m(User),
|
||||
utils: {
|
||||
getNewTimeRunning: getNewTimeRunning,
|
||||
@@ -237,10 +353,12 @@ module.exports = {
|
||||
Destroy: Destroy,
|
||||
Scenario: Scenario,
|
||||
User: User,
|
||||
Schedule: Schedule,
|
||||
VmType: VmType,
|
||||
Notification: Notification,
|
||||
ApiKey: ApiKey,
|
||||
Subscription: Subscription
|
||||
Subscription: Subscription,
|
||||
Event: Event
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user