| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586 |
- /**
- * $Id: mxKubernetes.js,v 1.5 2019/14/11 12:32:06 mate Exp $
- * Copyright (c) 2006-2020, JGraph Ltd
- */
- //**********************************************************************************************************************************************************
- // Kubernetes icon
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeKubernetesIcon(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeKubernetesIcon, mxShape);
- mxShapeKubernetesIcon.prototype.cst = {
- ICON : 'mxgraph.kubernetes.icon'
- };
- mxShapeKubernetesIcon.prototype.customProperties = [
- {name: 'prIcon', dispName: 'Type', defVal: 'api', type: 'enum',
- enumList: [{val: 'c_c_m', dispName: 'C-C-M'},
- {val: 'c_m', dispName: 'C-M'},
- {val: 'c_role', dispName: 'C-Role'},
- {val: 'cm', dispName: 'CM'},
- {val: 'crb', dispName: 'CRB'},
- {val: 'crd', dispName: 'CRD'},
- {val: 'cronjob', dispName: 'Cronjob'},
- {val: 'deploy', dispName: 'Deploy'},
- {val: 'ds', dispName: 'DS'},
- {val: 'ep', dispName: 'EP'},
- {val: 'etcd', dispName: 'ETCD'},
- {val: 'group', dispName: 'Group'},
- {val: 'hpa', dispName: 'HPA'},
- {val: 'ing', dispName: 'ING'},
- {val: 'job', dispName: 'Job'},
- {val: 'k_proxy', dispName: 'K-Proxy'},
- {val: 'kubelet', dispName: 'Kubelet'},
- {val: 'limits', dispName: 'Limits'},
- {val: 'master', dispName: 'Master'},
- {val: 'netpol', dispName: 'Netpol'},
- {val: 'node', dispName: 'Node'},
- {val: 'ns', dispName: 'NS'},
- {val: 'pod', dispName: 'Pod'},
- {val: 'psp', dispName: 'PSP'},
- {val: 'pv', dispName: 'PV'},
- {val: 'pvc', dispName: 'PVC'},
- {val: 'quota', dispName: 'Quota'},
- {val: 'rb', dispName: 'RB'},
- {val: 'role', dispName: 'Role'},
- {val: 'rs', dispName: 'RS'},
- {val: 'sa', dispName: 'SA'},
- {val: 'sc', dispName: 'SC'},
- {val: 'sched', dispName: 'Sched'},
- {val: 'secret', dispName: 'Secret'},
- {val: 'sts', dispName: 'STS'},
- {val: 'svc', dispName: 'SVC'},
- {val: 'user', dispName: 'User'},
- {val: 'vol', dispName: 'Vol'}]}
- ];
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeKubernetesIcon.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- var prIcon = mxUtils.getValue(this.state.style, 'prIcon', '');
-
- var fillColor = mxUtils.getValue(this.state.style, 'fillColor', '#ffffff');
- var strokeColor = mxUtils.getValue(this.state.style, 'strokeColor', '#ffffff');
- c.translate(x, y);
-
- var frame = mxStencilRegistry.getStencil('mxgraph.kubernetes.frame');
-
- c.setFillColor(strokeColor);
- frame.drawShape(c, this, 0, 0, w, h);
- c.setFillColor(fillColor);
- frame.drawShape(c, this, w * 0.03, h * 0.03, w * 0.94, h * 0.94);
-
- var prStencil = mxStencilRegistry.getStencil('mxgraph.kubernetes.' + prIcon);
-
- if (prStencil != null)
- {
- c.setFillColor(strokeColor);
- prStencil.drawShape(c, this, w * 0.2, h * 0.2, w * 0.6, h * 0.6);
- }
- };
- mxCellRenderer.registerShape(mxShapeKubernetesIcon.prototype.cst.ICON, mxShapeKubernetesIcon);
- mxShapeKubernetesIcon.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- var r = Math.min(h * 0.5, w * 0.5);
-
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
- return (constr);
- }
- /**
- * $Id: mxKubernetes.js,v 1.5 2019/14/11 12:32:06 mate Exp $
- * Copyright (c) 2006-2020, JGraph Ltd
- */
- //**********************************************************************************************************************************************************
- // Kubernetes icon 2
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeKubernetesIcon2(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeKubernetesIcon2, mxShape);
- mxShapeKubernetesIcon2.prototype.cst = {
- ICON2 : 'mxgraph.kubernetes.icon2'
- };
- mxShapeKubernetesIcon2.prototype.customProperties = [
- {name: 'kubernetesLabel', dispName: 'Label', type: 'boolean', defVal:0},
- {name: 'prIcon', dispName: 'Type', defVal: 'api', type: 'enum',
- enumList: [{val: 'api', dispName: 'API'},
- {val: 'c_c_m', dispName: 'C-C-M'},
- {val: 'cm', dispName: 'CM'},
- {val: 'c_m', dispName: 'C-M'},
- {val: 'c_role', dispName: 'C-Role'},
- {val: 'control_plane', dispName: 'Control Plane'},
- {val: 'crb', dispName: 'CRB'},
- {val: 'crd', dispName: 'CRD'},
- {val: 'cronjob', dispName: 'Cronjob'},
- {val: 'deploy', dispName: 'Deploy'},
- {val: 'ds', dispName: 'DS'},
- {val: 'ep', dispName: 'EP'},
- {val: 'etcd', dispName: 'ETCD'},
- {val: 'group', dispName: 'Group'},
- {val: 'hpa', dispName: 'HPA'},
- {val: 'ing', dispName: 'ING'},
- {val: 'job', dispName: 'Job'},
- {val: 'k_proxy', dispName: 'K-Proxy'},
- {val: 'kubelet', dispName: 'Kubelet'},
- {val: 'limits', dispName: 'Limits'},
- {val: 'netpol', dispName: 'Netpol'},
- {val: 'node', dispName: 'Node'},
- {val: 'ns', dispName: 'NS'},
- {val: 'pod', dispName: 'Pod'},
- {val: 'psp', dispName: 'PSP'},
- {val: 'pv', dispName: 'PV'},
- {val: 'pvc', dispName: 'PVC'},
- {val: 'quota', dispName: 'Quota'},
- {val: 'rb', dispName: 'RB'},
- {val: 'role', dispName: 'Role'},
- ]}
- ];
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeKubernetesIcon2.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- var prIcon = mxUtils.getValue(this.state.style, 'prIcon', '');
-
- var fillColor = mxUtils.getValue(this.state.style, 'fillColor', '#ffffff');
- var strokeColor = mxUtils.getValue(this.state.style, 'strokeColor', '#ffffff');
- var hasLabel = mxUtils.getValue(this.state.style, 'kubernetesLabel', 0);
- c.translate(x, y);
-
- var frame = mxStencilRegistry.getStencil('mxgraph.kubernetes.frame');
-
- c.setFillColor(strokeColor);
- frame.drawShape(c, this, 0, 0, w, h);
- c.setFillColor(fillColor);
- frame.drawShape(c, this, w * 0.03, h * 0.03, w * 0.94, h * 0.94);
-
- var prStencil = mxStencilRegistry.getStencil('mxgraph.kubernetes2.' + prIcon);
- c.setFillColor(strokeColor);
- c.setFontColor(strokeColor);
- c.setFontSize(Math.min(w, h) * 0.2);
-
- var w2 = Math.min(h, w);
- var h2 = w2;
-
- if (hasLabel == 1)
- {
- w2 = w2 * 0.8;
- h2 = w2 * 0.9;
- }
-
- if (prIcon == 'api')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'api', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'c_c_m')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'c-c-m', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'cm')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.25, w2 * 0.6, h2 * 0.5);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'cm', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'c_m')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'c-m', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'c_role')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.2, w2 * 0.5, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'c-role', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'control_plane')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.setFontSize(Math.min(w, h) * 0.12);
- c.text(w * 0.5, h * 0.78, 0, 0, 'control\nplane', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'crb')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.3, w2 * 0.5, h2 * 0.3);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'crb', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'crd')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'crd', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'cronjob')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'cronjob', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'deploy')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.27, h * 0.25, w2 * 0.6, h2 * 0.55);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'deploy', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'ds')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'ds', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'ep')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'ep', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'etcd')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'etcd', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'group')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'group', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'hpa')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.4, h * 0.1, w2 * 0.8, h2 * 0.8);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'hpa', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'ing')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'ing', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'job')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'job', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'k_proxy')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'k-proxy', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'kubelet')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'kubelet', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'limits')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'limits', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'netpol')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'netpol', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'node')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'node', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'ns')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'ns', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'pod')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'pod', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'psp')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'psp', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'pv')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'pv', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'pvc')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'pvc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'quota')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'quota', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'rb')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'rb', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'role')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'role', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'rs')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'rs', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'sa')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'sa', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'sc')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'sc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'sched')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'sched', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'secret')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'secret', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'sts')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'sts', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'svc')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'svc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'user')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'user', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prIcon == 'vol')
- {
- prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);
- if (hasLabel == 1)
- {
- c.text(w * 0.5, h * 0.75, 0, 0, 'vol', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
- }
- }
- else if (prStencil != null)
- {
- prStencil.drawShape(c, this, w * 0.2, h * 0.2, w * 0.6, h * 0.6);
- }
- };
- mxCellRenderer.registerShape(mxShapeKubernetesIcon2.prototype.cst.ICON2, mxShapeKubernetesIcon2);
- mxShapeKubernetesIcon2.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- var r = Math.min(h * 0.5, w * 0.5);
-
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
- return (constr);
- }
|