diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css new file mode 100644 index 00000000000..78fb728e0f7 --- /dev/null +++ b/ui/css/cloudstack3.css @@ -0,0 +1,5228 @@ +/*[fmt]1C20-1C0D-E*/ +/*Base*/ +/*+clearfix {*/ +div.toolbar:after, +.multi-wizard .progress ul li:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + font-size: 0; +} + +div.toolbar, +.multi-wizard .progress ul li { + display: inline-block; +} + +div.toolbar, +.multi-wizard .progress ul li { +/*\*/ + display: block; +/**/ + -height: 1px; +} + +/*+}*/ +body { + font-family: sans-serif; + max-height: 768px; + overflow: auto; +} + +#container { + width: 1024px; + height: 768px; + margin: auto; + overflow: hidden; + border: 1px solid #E2E2E2; + border-top: none; + position: relative; +} + +#sections { + display: none; +} + +table { + width: 740px; + max-width: 777px; + margin: 15px 15px 12px 12px; + font-size: 13px; + text-align: left; + text-indent: 10px; + border-bottom: 1px solid #C4C5C5; + border-collapse: collapse; +} + +table thead { + background: url(../images/bg-table-head.png) repeat-x; + cursor: pointer; +} + +table thead th { + border: 1px solid #C6C3C3; + color: #566677; + border-top: none; + border-bottom: 1px solid #CFC9C9; + text-align: left; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + /*+placement:shift;*/ + position: relative; + left: 0; + top: 0; +} + +table thead th.sorted { + color: #312F2F; + /*+text-shadow:0px 1px 1px #BFBFBF;*/ + -moz-text-shadow: 0px 1px 1px #BFBFBF; + -webkit-text-shadow: 0px 1px 1px #BFBFBF; + -o-text-shadow: 0px 1px 1px #BFBFBF; + text-shadow: 0px 1px 1px #BFBFBF; +} + +table thead th.sorted.desc { + background-position: 102% -111px; +} + +table thead th.sorted.asc { + background-position: 102% -157px; +} + +table tbody td, +table th { + padding: 9px 5px 8px 0px; + border-right: 1px solid #BFBFBF; + color: #495A76; + clear: none; + min-width: 88px; + font-size: 12px; + overflow: hidden; + vertical-align: middle; + position: relative; +} + +table tbody td.loading { + text-align: center; + background: #DBE2E9; + border-top: 1px solid #FBFBFB; +} + +table tbody td.actions { + width: 155px; + max-width: 155px !important; + min-width: 155px !important; + vertical-align: middle; +} + +table tbody tr { + border-left: 1px solid #C4C5C5; + border-right: 1px solid #C4C5C5; + border-top: 1px solid transparent; + cursor: pointer; +} + +table tbody tr.even { + background: #DFE1E3; +} + +table tbody tr.odd { + background: #F2F0F0; +} + +table tbody tr.selected { + background: #CBDDF3; + border-top: 1px solid #EDF0F7 !important; + border-bottom: 1px solid #BABFD9; + text-shadow: 0px 1px 1px #FCFBF7; +} + +table tbody tr.to-remove { + background: #E05959; + border-top: 1px solid #EDF0F7 !important; + border-bottom: 1px solid #BABFD9; + text-shadow: 0px 1px 1px #FCFBF7; +} + +table tbody tr.loading { + background: #E2E9F0; +} + +table tbody tr.loading td { + /*+opacity:50%;*/ + filter: alpha(opacity=50); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + -moz-opacity: 0.5; + opacity: 0.5; +} + +table tbody tr.loading td.loading.icon { + background: url(../images/ajax-loader.gif) no-repeat center; + height: 35px; + padding: 0; +} + +table tbody tr div.loading { + display: block; + width: 50px; + height: 14px; + background: transparent url(../images/ajax-loader-small.gif) no-repeat center; + margin: auto; +} + +table th.resizable { + position: relative; + cursor: col-resize; +} + +table th div.ui-resizable-handle { + position: relative; + top: -30px; + float: right; +} + +#header, +#navigation { + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +#template { + display: none; +} + +/*Login screen*/ +body.login { + background: #066CAA url(../images/bg-login.jpg) no-repeat 50% -82px; +} + +.login { + display: block; + width: 100%; + height: 245px; + margin: 166px auto auto; + background: #FFFFFF; +} + +.login .fields { + width: 409px; + float: left; + margin: 72px 0 0 88px; +} + +.login .fields .field { + position: relative; +} + +.login .fields .field label { + font-size: 11px; + color: #4E4F53; + /*+placement:displace 11px 12px;*/ + position: absolute; + margin-left: 11px; + margin-top: 12px; +} + +.login .fields .field label.error { + color: #FF0000; + float: right; +} + +.login .fields input { + width: 204px; + height: 20px; + margin: 5px 0 0; + text-indent: 7px; + border: none; + /*+border-radius:3px;*/ + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px 3px 3px 3px; + /*+box-shadow:inset 0px 1px 1px #4E4E4E;*/ + -moz-box-shadow: inset 0px 1px 1px #4E4E4E; + -webkit-box-shadow: inset 0px 1px 1px #4E4E4E; + -o-box-shadow: inset 0px 1px 1px #4E4E4E; + box-shadow: inset 0px 1px 1px #4E4E4E; + background: #ECECEC; +} + +.login .fields input.error { + border-color: #FF8080; + background: #FFEAEA; +} + +.login .fields input[type=submit] { + background: transparent url(../images/sprites.png) -563px -747px; + cursor: pointer; + border: none; + margin: 7px 0 0; + width: 68px; + height: 25px; + display: block; +} + +.login .fields input[type=submit]:hover { + background-position: -563px -772px; +} + +.login .logo { + width: 243px; + height: 31px; + float: left; + margin: 72px 0 0 209px; + background: url(../images/logo.png) no-repeat; +} + +.login form { + display: block; + width: 1000px; + height: 100%; + margin: auto; + background: #FFFFFF; +} + +/*Notifications*/ +div.notification-box { + width: 323px; + height: 354px; + background: url(../images/bg-notifications.png) no-repeat 0px 0px; +} + +div.notification-box h3 { + color: #FFFFFF; + /*+placement:shift 0px 35px;*/ + position: relative; + left: 0px; + top: 35px; + text-align: center; + font-size: 21px; + letter-spacing: 1px; + /*+text-shadow:0px 1px 2px #000000;*/ + -moz-text-shadow: 0px 1px 2px #000000; + -webkit-text-shadow: 0px 1px 2px #000000; + -o-text-shadow: 0px 1px 2px #000000; + text-shadow: 0px 1px 2px #000000; +} + +div.notification-box .container { + background: #FFFFFF; + width: 296px; + height: 241px; + margin: auto; + /*+placement:shift 3px 46px;*/ + position: relative; + left: 3px; + top: 46px; + /*+box-shadow:inset 0px 3px 7px #656565;*/ + -moz-box-shadow: inset 0px 3px 7px #656565; + -webkit-box-shadow: inset 0px 3px 7px #656565; + -o-box-shadow: inset 0px 3px 7px #656565; + box-shadow: inset 0px 3px 7px #656565; + /*+border-radius:8px;*/ + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px 8px 8px 8px; + border: 1px solid #8198AE; +} + +div.notification-box .container ul { + margin-top: 8px; + height: 229px; + overflow: auto; + width: 294px; +} + +div.notification-box .container ul li { + height: 40px; + border-bottom: 1px solid #CECECE; + overflow: auto; + text-indent: 0; + font-size: 12px; + color: #4D5E6E; + background: url(../images/icons.png) no-repeat 10px -213px; + cursor: pointer; +} + +div.notification-box .container ul li span { + float: left; + /*+placement:shift 48px 16px;*/ + position: relative; + left: 48px; + top: 16px; + max-width: 202px; + overflow: hidden; +} + +div.notification-box .container ul li span:hover { + color: #5FAAF7; + text-decoration: underline; +} + +div.notification-box .container ul div.remove { + width: 17px; + height: 21px; + background: url(../images/buttons.png) no-repeat -623px -8px; + float: right; + margin: -4px 8px 0px 0px; + cursor: pointer; + /*+placement:shift 0px 16px;*/ + position: relative; + left: 0px; + top: 16px; +} + +div.notification-box .container ul div.remove:hover { + background-position: -606px -8px; +} + +div.notification-box .container ul li.pending { + color: #7E96AC; + background: url(../images/ajax-loader.gif) no-repeat 8px 6px; +} + +div.notification-box .container ul li.first { + border-top: none; +} + +div.notification-box .container ul li.last { +} + +div.notification-box .button { + float: left; + background: url(../images/buttons.png) no-repeat; + cursor: pointer; + /*+placement:shift 0px 51px;*/ + position: relative; + left: 0px; + top: 51px; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + border-bottom: 1px solid #2B2B2B; + /*+box-shadow:0px 0px 2px #272727;*/ + -moz-box-shadow: 0px 0px 2px #272727; + -webkit-box-shadow: 0px 0px 2px #272727; + -o-box-shadow: 0px 0px 2px #272727; + box-shadow: 0px 0px 2px #272727; + padding: 5px 10px 6px; +} + +div.notification-box .button span { + color: #FFFFFF; + font-size: 11px; + font-weight: bold; + letter-spacing: 1px; + /*+text-shadow:0px -1px 2px #171717;*/ + -moz-text-shadow: 0px -1px 2px #171717; + -webkit-text-shadow: 0px -1px 2px #171717; + -o-text-shadow: 0px -1px 2px #171717; + text-shadow: 0px -1px 2px #171717; +} + +div.notification-box .button.clear-list { + background: url(../images/gradients.png) 0px -10px; + margin-left: 16px; +} + +div.notification-box .button.clear-list:hover { + background-position: 0px -51px; +} + +div.notification-box .button.close { + background: url(../images/gradients.png) 0px -317px; + float: right; + margin-right: 10px; + border-bottom: 1px solid #232323; +} + +div.notification-box .button.close:hover { + background-position: -4px -368px; +} + +/*** Corner alert*/ +div.notification.corner-alert { + background: #EBE8E8; + width: 260px; + height: 70px; + position: absolute; + text-indent: 10px; + font-size: 12px; + border: 1px solid #8F8A8A; + /*+opacity:70%;*/ + filter: alpha(opacity=70); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + -moz-opacity: 0.7; + opacity: 0.7; + overflow: hidden; + z-index: 100; + cursor: pointer; +} + +div.notification.corner-alert { +} + +div.notification.corner-alert div.title { + height: 33px; + background: url(../images/bg-dialog-header.png); + color: #FFFFFF; +} + +div.notification.corner-alert div.title span { + background: url(../images/icons.png) no-repeat -3px -225px; + /*+placement:shift 0px 10px;*/ + position: relative; + left: 0px; + top: 10px; + /*+text-shadow:0px 1px 1px #3A3A3A;*/ + -moz-text-shadow: 0px 1px 1px #3A3A3A; + -webkit-text-shadow: 0px 1px 1px #3A3A3A; + -o-text-shadow: 0px 1px 1px #3A3A3A; + text-shadow: 0px 1px 1px #3A3A3A; + padding: 3px 0 12px 24px; + font-weight: bold; +} + +div.notification.corner-alert div.message span { + position: relative; + padding-top: 6px; + display: block; +} + +div.notification.corner-alert:hover div.message span { + text-decoration: underline; + color: #5FAAF7; +} + +/*List view*/ +div.panel div.list-view { + overflow: auto; + height: 668px; + margin-top: 30px; + border-bottom: 1px solid #E7E7E7; +} + +div.panel div.list-view div.data-table table { + width: 755px; + margin-top: 44px; +} + +div.panel div.list-view div.fixed-header { + position: absolute; + top: 28px; + left: 12px; + width: 740px; + height: 47px; + display: table; + background-color: #F7F7F7; + margin: 0; + z-index: 1; +} + +div.panel div.list-view div.fixed-header table { + margin: 0; + /*+placement:shift 0px 18px;*/ + position: relative; + left: 0px; + top: 18px; + width: 755px; + /*+box-shadow:0px 4px 10px #DFE1E3;*/ + -moz-box-shadow: 0px 4px 10px #DFE1E3; + -webkit-box-shadow: 0px 4px 10px #DFE1E3; + -o-box-shadow: 0px 4px 10px #DFE1E3; + box-shadow: 0px 4px 10px #DFE1E3; +} + +div.list-view td.state { + width: 129px; + background: url(../images/sprites.png) no-repeat 10px -527px; +} + +div.list-view td.state span { + padding: 0 0 0 26px; + text-align: center; + width: 80px; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +div.list-view td.state.on { + color: #008000; + background-position: 10px -452px; +} + +div.list-view td.state.off { + color: #B90606; + background-position: 10px -488px; +} + +/*Details page*/ +.detail-view { + padding: 0 0 0 14px; +} + +.ui-tabs ul { + margin-top: 42px; + display: block; + height: 41px; + border: none; + overflow: hidden; + display: inline-block; + z-index: 2; + /*+placement:shift 0px 2px;*/ + position: relative; + left: 0px; + top: 2px; +} + +.ui-tabs .info { + background: #EFEFEF; + width: 91%; + height: auto; + overflow: visible; + padding: 14px 14px 0; + border: 1px dashed #D7D7D7; + /*+box-shadow:inset 0px 1px 2px #FFFFFF;*/ + -moz-box-shadow: inset 0px 1px 2px #FFFFFF; + -webkit-box-shadow: inset 0px 1px 2px #FFFFFF; + -o-box-shadow: inset 0px 1px 2px #FFFFFF; + box-shadow: inset 0px 1px 2px #FFFFFF; + margin: 10px; + display: inline-block; +} + +.ui-tabs .info li { + font-size: 12px; + color: #3E4C59; + margin: 0 0 18px; +} + +.ui-tabs .info li strong { + font-weight: bold; + color: #506273; +} + +.ui-tabs li { + display: block; +} + +.ui-tabs li a { + float: left; + padding: 15px; + width: 91px; + text-align: center; + font-size: 11px; + margin-right: 1px; + color: #4E6070; + text-decoration: none; + background: #DEE3E5; +} + +.ui-tabs ul li.ui-state-default a { + border-right: 1px solid #97AFC5; + border-top: 2px solid #D6DCDE; + background: url(../images/bg-details-tab-gradient.png); + /*+placement:shift;*/ + position: relative; + left: 0; + top: 0; + padding-bottom: 11px; +} + +.ui-tabs ul li.ui-state-hover a { + background: url(../images/gradients.png) -8px -1413px; +} + +.ui-tabs ul li.ui-state-active { + display: block; + width: 496px; +} + +.ui-tabs ul li.ui-state-active a { + border-right: 1px solid #D6DCDE; + background: #FFFFFF; + border-left: none; + padding-bottom: 12px; +} + +.ui-tabs li.ui-state-active.first a, +.ui-tabs li.ui-state-default.first a { + border-left: 1px solid #E2DDDD; + /*+placement:shift;*/ + position: relative; + left: 0; + top: 0; + /*+border-radius:4px 0 0;*/ + -moz-border-radius: 4px 0 0; + -webkit-border-radius: 4px 0 0; + -khtml-border-radius: 4px 0 0; + border-radius: 4px 0 0 0; +} + +.ui-tabs li.ui-state-active.last a, +.ui-tabs li.ui-state-default.last a { + /*+border-radius:0 4px 0 0;*/ + -moz-border-radius: 0 4px 0 0; + -webkit-border-radius: 0 4px 0 0; + -khtml-border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; +} + +.ui-tabs li.ui-state-active.first.last a, +.ui-tabs li.ui-state-default.first.last a { + /*+border-radius:4px 4px 0 0;*/ + -moz-border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + -khtml-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.ui-tabs .ui-tabs-hide { + display: none; +} + +.ui-tabs div.ui-tabs-panel { + border: 1px solid #E2DDDD; + clear: both; + height: 78%; + width: 97%; + padding-top: 7px; + overflow: auto; + height: 591px; + margin: -4px 0 0; +} + +.detail-group table { + width: 96%; + font-size: 12px; + border: 1px solid #CFC9C9; + background: #E4E6E7; + margin-top: 11px; +} + +.detail-group table tr, +.detail-group table td { + vertical-align: middle; + border: none; + cursor: default; +} + +.details.group-multiple table { + border: none; + border-top: none; +} + +.details.group-multiple table tbody { + border-top: 1px solid #F2F0F0; +} + +.detail-group table td.name { + width: 113px; + color: #6393F1; + padding: 14px 0 13px; + border: none; +} + +.detail-group.head table td.name { + padding: 20px 0px 17px; +} + +div.group-multiple div.detail-group table { + margin-top: -12px; +} + +div.group-multiple div.detail-group table.header { + border: none; + margin-top: 11px; +} + +div.group-multiple div.detail-group table.header thead th { + background: none; + border: none; +} + +div.ui-tabs-panel table span.none { + color: #9D9D9D; +} + +#user div.options .arrow { +} + +div.detail-group td.view-all div.view-all { + width: auto; + float: right; +} + +div.detail-group td.view-all a { + background: url(../images/gradients.png) repeat-x 0px -529px; + font-size: 11px; + display: block; + height: 25px; + text-decoration: none; + color: #4C5D6C; + /*+text-shadow:0px 1px 2px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 2px #FFFFFF; + -webkit-text-shadow: 0px 1px 2px #FFFFFF; + -o-text-shadow: 0px 1px 2px #FFFFFF; + text-shadow: 0px 1px 2px #FFFFFF; + float: left; + padding: 0 8px 0 5px; + border-left: 1px solid #9B9EA2; + /*+border-radius:5px 0 0 5px;*/ + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + -khtml-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} + +div.detail-group td.view-all:hover a { + background-position: 0px -566px; +} + +div.detail-group td.view-all a span { + /*+placement:shift -4px 8px;*/ + position: relative; + left: -4px; + top: 8px; +} + +div.detail-group td.view-all div.view-all div.end { + float: left; + width: 15px; + height: 25px; + background: url(../images/sprites.png) -617px -398px; +} + +div.detail-group td.view-all:hover div.view-all div.end { + background-position: -617px -431px; +} + +div.details div.detail-group td.value input, +div.details div.detail-group td.value select { + width: 282px; +} + +#browser div.panel div.detail-view .toolbar { + width: 594px; +} + +div.list-view table tbody td span { + display: block; + float: left; + max-width: 210px; + word-wrap: break-word; + text-indent: 0; + margin-left: 12px; + line-height: 15px; + overflow: auto; +} + +div.list-view div.toolbar div.section-switcher div.section-select label { + margin: 0 9px 0 0; +} + +.detail-view .loading-overlay { + position: absolute; + width: 100%; + height: 100%; + left: 0px; + top: 0px; + background: #E2E9F0 url(../images/ajax-loader.gif) no-repeat center; + z-index: 500; + /*+opacity:70%;*/ + filter: alpha(opacity=70); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + -moz-opacity: 0.7; + opacity: 0.7; +} + +.detail-view .ui-tabs-panel .loading-overlay { + background-position: 50% 250px; +} + +/*** Actions*/ +div.detail-group.actions { + padding: 0; + margin: 0; +} + +div.detail-group.actions table { + padding: 0; +} + +div.detail-group.actions tr { + margin: 0; +} + +div.detail-group.actions td { + height: 43px; + vertical-align: middle; +} + +.detail-group table td.detail-actions { + width: 55%; + height: 26px; +} + +.detail-group table td.detail-actions div.buttons { + /*+placement:shift 6px 0px;*/ + position: relative; + left: 6px; + top: 0px; +} + +.detail-group table td.detail-actions a { + display: block; + float: left; + text-indent: -9999px; + width: 30px; + height: 25px; + background: url(../images/sprites.png) -417px -11px; + margin: 0; +} + +.detail-group table td.detail-actions a:hover { + background-position: -417px -43px; +} + +.detail-group table td.detail-actions div.action.first a { + background-position: -385px -11px; + width: 32px; +} + +.detail-group table td.detail-actions div.action.first a:hover { + background-position: -385px -43px; +} + +.detail-group table td.detail-actions div.action.last a { + background-position: -596px -11px; + width: 30px; +} + +.detail-group table td.detail-actions div.action.last a:hover { + background-position: -596px -43px; +} + +.detail-group table td.detail-actions div.action.single a { + width: 31px; + height: 26px; + background-position: -414px -625px; +} + +.detail-group table td.detail-actions div.action.single a:hover { + background-position: -414px -587px; +} + +.detail-group table td.detail-actions a span.icon { + background-image: url(../images/sprites.png); + padding: 10px; + display: block; +} + +/*Header*/ +#header { + height: 41px; + background: #DFDFDF url(../images/bg-header.png) repeat-x; +} + +#header div.button { + font-size: 12px; + color: #65727F; + cursor: pointer; +} + +#header div.logo { + width: 35%; + height: 32px; + position: relative; + float: left; + margin: 4px 0 0 5px; + background: transparent url(../images/logo.png) no-repeat 5px 0px; +} + +#header div.controls { + height: 100%; + position: relative; + float: right; + width: 614px; +} + +.button { + float: left; + background: url(../images/buttons.png) no-repeat; +} + +#header div.notifications { + background: none; + height: 18px; + padding: 1px 0 0; + margin: 8px 36px 0 50px; +} + +#header div.notifications span { + position: relative; + top: 5px; + left: 7px; +} + +#header div.notifications:hover { + color: #5FAAF7; +} + +#header div.notifications div.total { + width: 20px; + height: 18px; + float: left; + margin: 3px; + background: url(../images/icons.png) no-repeat 0px 0px; + color: #FFFFFF; + font-size: 11px; + /*+text-shadow:0px -1px 0px #6C7283;*/ + -moz-text-shadow: 0px -1px 0px #6C7283; + -webkit-text-shadow: 0px -1px 0px #6C7283; + -o-text-shadow: 0px -1px 0px #6C7283; + text-shadow: 0px -1px 0px #6C7283; +} + +#header div.notifications div.total.pending { + background-position: 0px -129px; + font-weight: bold; +} + +#header div.notifications div.total span { + /*+placement:shift 4px 2px;*/ + position: relative; + left: 4px; + top: 2px; + text-align: center; + display: block; + width: 12px; +} + +#header div.view-switcher { + width: 256px; + height: 39px; + background-position: 0px -5px; + /*+placement:shift 0px 1px;*/ + position: relative; + left: 0px; + top: 1px; +} + +#header div.view-switcher.alt { + background-position: 0px -41px; +} + +#header div.view-switcher div { + float: left; + padding: 13px 12px 13px 24px; + /*[empty]display:;*/ +} + +#header div.view-switcher div:hover { + color: #64ACF7; + /*+text-shadow:0px 1px 1px #F5F5F5;*/ + -moz-text-shadow: 0px 1px 1px #F5F5F5; + -webkit-text-shadow: 0px 1px 1px #F5F5F5; + -o-text-shadow: 0px 1px 1px #F5F5F5; + text-shadow: 0px 1px 1px #F5F5F5; +} + +#header div.view-switcher div span.icon { + background: url(../images/icons.png) no-repeat; + padding: 4px 14px 0px 6px; + /*+placement:shift -8px 3px;*/ + position: relative; + left: -8px; + top: 3px; +} + +#header div.view-switcher div.default-view span.icon { + background-position: -23px 0px; +} + +#header div.view-switcher div.select span.icon { + background-position: -47px 0px; +} + +#header div.view-switcher.alt div.select span.icon { + background-position: -73px 0px; +} + +#header div.view-switcher.alt div.select { + color: #FFFFFF; + /*+text-shadow:0px -1px 0px #787878;*/ + -moz-text-shadow: 0px -1px 0px #787878; + -webkit-text-shadow: 0px -1px 0px #787878; + -o-text-shadow: 0px -1px 0px #787878; + text-shadow: 0px -1px 0px #787878; +} + +#user { + height: 30px; + margin: 5px 6px 0 0; + position: relative; + cursor: default !important; + float: right; + background: none; +} + +#user div.name { + background: url(../images/bg-gradients.png) 0px -349px; + float: left; + padding: 9px 22px 7px 23px; + border: 1px solid #AA9A9A; + border-bottom: 1px solid #EBEAEA; + /*+box-shadow:inset 0px -1px 1px #BBBBBB;*/ + -moz-box-shadow: inset 0px -1px 1px #BBBBBB; + -webkit-box-shadow: inset 0px -1px 1px #BBBBBB; + -o-box-shadow: inset 0px -1px 1px #BBBBBB; + box-shadow: inset 0px -1px 1px #BBBBBB; + /*+border-radius:3px 0 0 3px;*/ + -moz-border-radius: 3px 0 0 3px; + -webkit-border-radius: 3px 0 0 3px; + -khtml-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; + border-right: none; + min-width: 54px; + text-align: center; + max-width: 80px; +} + +#user div.options { + float: right; + width: 35px; + height: 31px; + /*+placement:shift 0px -1px;*/ + position: relative; + left: 0px; + top: -1px; + background: url(../images/buttons.png) no-repeat; + background-position: -356px -11px; + cursor: pointer; +} + +#user div.options:hover { + background-position: -356px -44px; +} + +#user div.options .arrow { + width: 11px; + height: 8px; + background: url(../images/buttons.png) -402px -23px; + /*+placement:shift 10px 13px;*/ + position: relative; + left: 10px; + top: 13px; +} + +/*Sample project view*/ +.sample-project-view { + position: absolute; + background: url(../images/sample-project-view.png) no-repeat 0px 0px; + top: 25%; + left: 33%; + width: 421px; + height: 389px; + z-index: 200; + cursor: pointer; +} + +/*Navigation*/ +#navigation, +#browser { + height: 728px; +} + +#navigation { + width: 230px; + position: relative; + float: left; + background: #EDE8E8; +} + +#navigation ul { + border-right: 1px solid #CECCCC; + height: 100%; +} + +#navigation ul li { + background: url(../images/bg-nav-item.png) repeat-x; + height: 50px; + cursor: pointer; +} + +#navigation ul li:hover, +#navigation ul li.active { + background: url(../images/bg-nav-item-active.png); + background-position: 0px 0px; + width: 230px; +} + +.project-view #navigation ul li:hover, +.project-view #navigation ul li.active { + background: url(../images/bg-nav-item-active-project-view.png); + background-position: 0px 0px; + width: 230px; +} + +#navigation ul li:hover span, +#navigation ul li.active span { + color: #FFFFFF; + /*+text-shadow:1px 2px 1px #5D5F6D;*/ + -moz-text-shadow: 1px 2px 1px #5D5F6D; + -webkit-text-shadow: 1px 2px 1px #5D5F6D; + -o-text-shadow: 1px 2px 1px #5D5F6D; + text-shadow: 1px 2px 1px #5D5F6D; +} + +#navigation ul li.last { + background-repeat: repeat; + background-position: 0px 0px; + height: 57px; + /*[empty]color:;*/ +} + +#navigation ul li span { + /*+placement:shift 14px 18px;*/ + position: relative; + left: 14px; + top: 18px; + font-size: 13px; + color: #596D7F; + padding-left: 19px; +} + +#navigation ul li span.icon { + background: url(../images/icons.png) no-repeat 0px 0px; + padding: 16px 16px 12px; + /*+placement:shift 17px 18px;*/ + position: relative; + left: 17px; + top: 18px; +} + +#navigation ul li.last.active, +#navigation ul li.last:hover { + height: 52px; +} + +/*Navigation icons*/ +#navigation ul li.dashboard span.icon, +#navigation ul li.dashboard-user span.icon { + background-position: -14px -18px; +} + +#navigation ul li.instances span.icon { + background-position: -73px -23px; +} + +#navigation ul li.storage span.icon { + background-position: -127px -23px; +} + +#navigation ul li.network span.icon { + background-position: -180px -23px; +} + +#navigation ul li.templates span.icon { + background-position: -233px -23px; +} + +#navigation ul li.projects span.icon { + background-position: -294px -23px; +} + +#navigation ul li.events span.icon { + background-position: -351px -23px; +} + +#navigation ul li.configuration span.icon, +#navigation ul li.global-settings span.icon { + background-position: -400px -24px; +} + +#navigation ul li.accounts span.icon { + background-position: -458px -24px; +} + +#navigation ul li.system span.icon { + background-position: -565px -24px; +} + +#navigation ul li.domains span.icon { + background-position: -519px -24px; +} + +/*Browser*/ +#browser { + width: 794px; + max-width: 794px; + position: relative; + float: left; + background: #FFFFFF; + overflow: hidden; +} + +#browser div.panel { + height: 698px; + background: #F7F7F7; + border-right: 1px solid #A5A5A5; + overflow: visible; +} + +.ui-tabs div.ui-tabs-panel { + background: #FFFFFF; + position: relative; +} + +#browser div.panel .shadow { + width: 10px; + height: 100%; + top: 0px; + left: -10px; + position: absolute; + background: url(../images/bg-panel-shadow.png) repeat-y 0px 0px; +} + +/*Toolbar*/ +/*[clearfix]*/div.toolbar { + width: 793px; + height: 32px; + background: #A8AFB6; + border-top: 1px solid #D0D5DA; + border-bottom: 1px solid #43586B; + border-right: 1px solid #43586B; + border-left: 1px solid #43586B; + /*+border-radius:2px;*/ + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px 2px 2px 2px; + /*+placement:shift 0px -1px;*/ + position: relative; + left: 0px; + top: -1px; + z-index: 6; + position: absolute; +} + +div.toolbar div.filters { + margin: 5px 0px 0 12px; +} + +div.toolbar div.filters label { + color: #4E5C6B; + font-size: 12px; + font-weight: bold; + /*+text-shadow:0px 1px 1px #CDCDCD;*/ + -moz-text-shadow: 0px 1px 1px #CDCDCD; + -webkit-text-shadow: 0px 1px 1px #CDCDCD; + -o-text-shadow: 0px 1px 1px #CDCDCD; + text-shadow: 0px 1px 1px #CDCDCD; + display: block; + float: left; + padding: 5px 11px 0 0; +} + +div.toolbar div.filters select { + width: 142px; + border: 1px solid #808080; +} + +div.toolbar div.text-search { + float: right; +} + +div.toolbar div.text-search div.search-bar { + float: left; + width: 145px; + height: 20px; + margin: 5px 0 0 12px; + background: #FFFFFF; + border: 1px solid #8B7E7E; + z-index: 4; + position: relative; + border-right: 1px solid #8B8989; + /*+border-radius:3px 0 0 3px;*/ + -moz-border-radius: 3px 0 0 3px; + -webkit-border-radius: 3px 0 0 3px; + -khtml-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} + +div.toolbar div.text-search div.search-bar input { + float: left; + border: none; + margin: 3px; + width: 90%; + height: 70%; +} + +div.toolbar div.text-search div.search-bar div.filter { + background: #FFFFFF; + width: 74px; + height: 15px; + float: left; + font-size: 12px; + text-align: center; + border-left: 1px solid #6D6D6D; + margin: 2px 0 0px; + padding: 1px; +} + +div.toolbar div.button.search { + background: url(../images/sprites.png) no-repeat -592px -328px; + width: 33px; + height: 22px; + /*+placement:shift -10px 5px;*/ + position: relative; + left: -10px; + top: 5px; + z-index: 3; + cursor: pointer; +} + +div.toolbar div.button.search:hover { + background-position: -592px -359px; +} + +div.toolbar div.button.add, +div.toolbar div.button.refresh { + /*+placement:shift 0px 5px;*/ + position: relative; + left: 0px; + top: 5px; + background: url(../images/gradients.png) 0px -98px; + font-size: 11px; + font-weight: bold; + color: #4A5A6D; + margin: 0 14px 0 0; + cursor: pointer; + /*+text-shadow:0px 1px 1px #DEE5EA;*/ + -moz-text-shadow: 0px 1px 1px #DEE5EA; + -webkit-text-shadow: 0px 1px 1px #DEE5EA; + -o-text-shadow: 0px 1px 1px #DEE5EA; + text-shadow: 0px 1px 1px #DEE5EA; + padding: 5px 7px 5px 6px; + border-left: 1px solid #808080; + border-right: 1px solid #808080; + float: right; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; +} + +div.toolbar div.button.add:hover, +div.toolbar div.button.refresh:hover { + background-position: 0 -132px; + border-left: 1px solid #585D60; +} + +div.toolbar div.button.refresh { + float: right; + margin: 0 15px 0 0; +} + +div.toolbar div.button.refresh span { + background-position: -628px -234px; +} + +div.toolbar div.button span { + padding: 0px 0 0px 18px; + background: url(../images/icons.png) no-repeat -626px -209px; + /*+placement:shift 0px 1px;*/ + position: relative; + left: 0px; + top: 1px; +} + +#browser div.panel.selected div.toolbar { + border-right: 1px solid #43586B; +} + +/*** Panel controls*/ +#browser div.panel div.toolbar div.panel-controls { + float: right; + width: 42px; + height: 23px; + display: none; +} + +#browser div.panel.reduced div.toolbar div.panel-controls { + display: block; + float: left; + width: 194px; +} + +#browser div.panel.maximized div.toolbar div.panel-controls { + display: block; +} + +#browser div.panel div.toolbar div.panel-controls div.control { + width: 25px; + height: 26px; + background: url(../images/buttons.png) no-repeat -599px -335px; + float: right; + cursor: pointer; + margin-right: 6px; +} + +#browser div.panel.maximized.single div.toolbar div.panel-controls div.control { + display: none; +} + +#browser div.panel div.toolbar div.panel-controls div.control:hover { + background-position: -593px -309px; +} + +#browser div.panel.maximized div.toolbar div.panel-controls div.control { + background-position: -621px -334px; +} + +#browser div.panel.maximized div.toolbar div.panel-controls div.control:hover { + background-position: -617px -308px; +} + +/*** Section switcher*/ +div.list-view div.toolbar div.section-switcher { + margin-top: 6px; + margin-left: 10px; + float: left; +} + +#browser div.panel.maximize-if-selected.selected div.toolbar div.panel-controls div.control { + display: none; +} + +div.list-view div.toolbar div.section-switcher div.section-select { + float: right; + background: #A8AFB6; +} + +div.list-view div.toolbar div.section-switcher div.section { + float: left; + font-size: 11px; + font-weight: bold; + /*+border-radius:10px;*/ + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + border-radius: 10px 10px 10px 10px; + /*+text-shadow:0px 1px 1px #EDEDED;*/ + -moz-text-shadow: 0px 1px 1px #EDEDED; + -webkit-text-shadow: 0px 1px 1px #EDEDED; + -o-text-shadow: 0px 1px 1px #EDEDED; + text-shadow: 0px 1px 1px #EDEDED; +} + +div.list-view div.toolbar div.section-switcher div.section a { + background: url(../images/bg-section-switcher.png) repeat-x 0px -22px; + text-decoration: none; + display: block; + color: #516374; + padding: 5px 10px 3px; + border: 1px solid #979FA4; +} + +div.list-view div.toolbar div.section-switcher div.section a.active { + background: url(../images/bg-section-switcher.png) repeat-x 0px -21px; + background-position: 0px 0px; + border: none; + border-bottom: 1px solid #CCD1D4; + padding-bottom: 2px; + padding-top: 6px; + /*+box-shadow:inset 0px 1px 5px #546874;*/ + -moz-box-shadow: inset 0px 1px 5px #546874; + -webkit-box-shadow: inset 0px 1px 5px #546874; + -o-box-shadow: inset 0px 1px 5px #546874; + box-shadow: inset 0px 1px 5px #546874; +} + +div.list-view div.toolbar div.section-switcher div.section.first a { + /*+border-radius:4px 0 0 5px;*/ + -moz-border-radius: 4px 0 0 5px; + -webkit-border-radius: 4px 0 0 5px; + -khtml-border-radius: 4px 0 0 5px; + border-radius: 4px 0 0 5px; +} + +div.list-view div.toolbar div.section-switcher div.section.last a { + /*+border-radius:0 5px 5px 0px;*/ + -moz-border-radius: 0 5px 5px 0px; + -webkit-border-radius: 0 5px 5px 0px; + -khtml-border-radius: 0 5px 5px 0px; + border-radius: 0 5px 5px 0px; +} + +div.list-view div.toolbar div.section-switcher div.section.first.last a { + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; +} + +div.list-view div.toolbar div.section-switcher div.section-select { + float: left; + background: #A8AFB6 none; + height: 26px; +} + +div.list-view div.toolbar div.section-switcher div.section-select select { + width: 146px; + margin-right: 13px; +} + +div.list-view div.toolbar div.section-switcher div.section-select label { + margin: 0 9px 0 0; +} + +/*Breadcrumbs*/ +div.toolbar div.filters { + margin: 5px 0px 0 12px; + width: 211px; + float: left; +} + +div.toolbar label { + color: #4E5C6B; + font-size: 12px; + font-weight: bold; + /*+text-shadow:0px 1px 1px #CDCDCD;*/ + -moz-text-shadow: 0px 1px 1px #CDCDCD; + -webkit-text-shadow: 0px 1px 1px #CDCDCD; + -o-text-shadow: 0px 1px 1px #CDCDCD; + text-shadow: 0px 1px 1px #CDCDCD; +} + +div.toolbar div.filters select { + width: 136px; + height: 21px; + font-size: 12px; + border: 1px solid #808080; + /*+border-radius:3px;*/ + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px 3px 3px 3px; + padding: 0px 0 0; +} + +#breadcrumbs { + height: 29px; + max-height: 29px; + background: transparent url(../images/bg-breadcrumbs.png) repeat-x; + overflow: hidden; + width: 100%; +} + +.project-view #breadcrumbs { + background-image: url(../images/bg-breadcrumbs-project-view.png); + background-position: 0px 1px; +} + +#breadcrumbs div.home { + width: 41px; + height: 32px; + float: left; + background: url(../images/buttons.png) -9px -96px; + /*+placement:shift -1px -1px;*/ + position: relative; + left: -1px; + top: -1px; + cursor: pointer; + z-index: 5; +} + +.project-view #breadcrumbs div.home { + background-position: -61px -98px; +} + +.project-view #breadcrumbs div.end { + background-position: -89px -98px; +} + +#breadcrumbs ul li, +#breadcrumbs div.active-project { + background: url(../images/gradients.png) repeat-x -522px -10px; + height: 21px; + float: left; + font-size: 12px; + /*+text-shadow:0px 1px 1px #2A3640;*/ + -moz-text-shadow: 0px 1px 1px #2A3640; + -webkit-text-shadow: 0px 1px 1px #2A3640; + -o-text-shadow: 0px 1px 1px #2A3640; + text-shadow: 0px 1px 1px #2A3640; + color: #FFFFFF; + padding: 8px 5px 0px 8px; + cursor: pointer; + /*+placement:shift -13px 0px;*/ + position: relative; + left: -13px; + top: 0px; + position: relative; + margin: 0 0 0 2px; +} + +.project-view #breadcrumbs ul li { + background: url(../images/bg-breadcrumb-project-view.png) 0px -2px; +} + +#breadcrumbs ul li, +#breadcrumbs div.active-project { + /*+placement:shift 0px 0px;*/ + position: relative; + left: 0px; + top: 0px; + color: #CED4D9; + /*+text-shadow:none;*/ + -moz-text-shadow: none; + -webkit-text-shadow: none; + -o-text-shadow: none; + text-shadow: none; + font-weight: bold; +} + +#breadcrumbs ul li:hover, +#breadcrumbs ul li.active, +#breadcrumbs ul li.maximized { + color: #FFFFFF; + /*+text-shadow:0px 1px 1px #000000;*/ + -moz-text-shadow: 0px 1px 1px #000000; + -webkit-text-shadow: 0px 1px 1px #000000; + -o-text-shadow: 0px 1px 1px #000000; + text-shadow: 0px 1px 1px #000000; + font-size: 12px; +} + +#breadcrumbs div.end { + background: url(../images/buttons.png) no-repeat -10px -130px; + height: 35px; + width: 13px; + float: left; + /*+placement:shift -13px -1px;*/ + position: relative; + left: -13px; + top: -1px; + z-index: 5; + margin-right: 23px; +} + +#breadcrumbs ul div.end { + /*+placement:shift -37px -1px;*/ + position: relative; + left: -37px; + top: -1px; + margin-right: 0px; +} + +#breadcrumbs ul li { + position: relative; + /*+placement:shift -36px 0px;*/ + position: relative; + left: -36px; + top: 0px; + margin-left: -10px; + text-indent: 13px; + font-weight: bold; +} + +#breadcrumbs div.active-project { + z-index: 2; + text-indent: 9px; + display: none; +} + +/*Group View*/ +div.panel div.view.group-thumbnail ul.groups li { + float: left; + width: 142px; + height: 80px; + background: url(../images/buttons.png) no-repeat -1px -399px; + margin: 16px -1px -5px 16px; + cursor: pointer; + position: relative; +} + +div.panel div.view.group-thumbnail ul.groups li.active { + background-position: -1px -489px; +} + +div.panel div.view.group-thumbnail ul.groups li.drop-hover { + background-position: -1px -310px !important; +} + +div.panel div.view.group-thumbnail ul.groups li.new { + background-position: -147px -401px; +} + +div.panel div.view.group-thumbnail ul.groups li.new.drop-hover { + background-position: -148px -312px !important; +} + +div.panel div.view.group-thumbnail ul.groups li span.name { + font-size: 12px; + color: #49596B; + /*+placement:shift 9px 7px;*/ + position: relative; + left: 9px; + top: 7px; + font-weight: bold; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + position: absolute; +} + +div.panel div.view.group-thumbnail ul.groups li span.vm-count { + font-size: 21px; + /*+placement:displace 54px 27px;*/ + position: absolute; + margin-left: 54px; + margin-top: 27px; + position: absolute; + color: #3A4857; +} + +/*Reduced view*/ +#browser div.panel.reduced .reduced-hide { + color: #BBB8B8; +} + +#browser div.panel.reduced div.toolbar .reduced-hide { + display: none; +} + +/*List view -- edit field*/ +div.view table td.editable div.edit { + width: 106%; + height: 20px; + /*+placement:shift 6px 0px;*/ + position: relative; + left: 6px; + top: 0px; +} + +div.view table td.editable div.edit input { + float: left; + width: 70%; + height: 17px; + border: none; + position: relative; + z-index: 1; +} + +div.view table td.editable div.action { + float: left; + width: 16px; + height: 19px; + background: #FFFFFF url(../images/buttons.png) -614px -684px; + padding-left: 2px; + /*+placement:shift -2px 0px;*/ + position: relative; + left: -2px; + top: 0px; + cursor: pointer; +} + +div.view table td.editable div.action.save { + margin-left: 2px; +} + +div.view table td.editable div.action.cancel { + background-position: -628px -684px; +} + +/*** Actions*/ +table td.actions { + cursor: default; +/*Make fixed*/ + width: 200px; + min-width: 200px; + max-width: 200px; +} + +table td.actions span { + margin: 0 0 0 2px !important; +} + +table td.actions div.action span.icon { + background-image: url(../images/sprites.png); + cursor: pointer; + width: 28px; + height: 21px; + float: left; +} + +/*** Action icons +Dialogs*/ +.ui-dialog { + background: #E9E9E9 url(../images/bg-dialog-body.png) repeat-x 0px 0px; + text-align: left; + /*+border-radius:10px;*/ + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + border-radius: 10px 10px 10px 10px; + /*+box-shadow:0px -4px 15px #4C4A4A;*/ + -moz-box-shadow: 0px -4px 15px #4C4A4A; + -webkit-box-shadow: 0px -4px 15px #4C4A4A; + -o-box-shadow: 0px -4px 15px #4C4A4A; + box-shadow: 0px -4px 15px #4C4A4A; +} + +.ui-dialog .ui-widget-content { + padding: 10px; + text-align: center; +} + +.ui-dialog-buttonset { + width: 285px; +} + +.ui-dialog .ui-button { + display: block; + cursor: pointer; + float: left; + width: 82px; + height: 31px; + border: none; + background: url(../images/gradients.png) -2px -481px; + border: 1px solid #BFBCBC; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; + /*+placement:shift 0px -35px;*/ + position: relative; + left: 0px; + top: -35px; +} + +.ui-dialog .ui-button:hover { + background-position: -4px -426px; +} + +.ui-dialog.notice .close.ui-button { + background: none; + display: inline; + padding: 0; + float: right; + text-decoration: underline; + color: #516374; + /*+text-shadow:0px -1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px -1px 1px #FFFFFF; + -webkit-text-shadow: 0px -1px 1px #FFFFFF; + -o-text-shadow: 0px -1px 1px #FFFFFF; + text-shadow: 0px -1px 1px #FFFFFF; +} + +.ui-dialog .ui-button.ok { + background-position: 0px -317px; + border: 1px solid #0065C5; + color: #FFFFFF; + /*+text-shadow:0px -1px 1px #011238;*/ + -moz-text-shadow: 0px -1px 1px #011238; + -webkit-text-shadow: 0px -1px 1px #011238; + -o-text-shadow: 0px -1px 1px #011238; + text-shadow: 0px -1px 1px #011238; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; +} + +.ui-dialog .ui-button.ok:hover { + background-position: -3px -368px; + border: 1px solid #004FF7; +} + +.ui-dialog.confirm .ui-button { + margin-top: -24px; + margin-left: 11px; +} + +.ui-dialog.confirm .ui-button.cancel { + margin-left: 50px; +} + +.ui-dialog span.message { + display: block; + text-align: center; + margin: 0 0 30px; + color: #445361; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +.ui-dialog-titlebar { + background: #4C5F70 url(../images/bg-dialog-header.png); + color: #FFFFFF; + height: 33px; + /*+border-radius:7px 7px 0 0;*/ + -moz-border-radius: 7px 7px 0 0; + -webkit-border-radius: 7px 7px 0 0; + -khtml-border-radius: 7px 7px 0 0; + border-radius: 7px 7px 0 0; + margin: auto; +} + +.ui-dialog-titlebar .ui-icon-closethick { + display: none; +} + +.ui-dialog-title { + /*+placement:shift 8px 9px;*/ + position: relative; + left: 8px; + top: 9px; + font-size: 14px; + padding: 2px 0 5px 30px; + /*+text-shadow:0px -1px 1px #495968;*/ + -moz-text-shadow: 0px -1px 1px #495968; + -webkit-text-shadow: 0px -1px 1px #495968; + -o-text-shadow: 0px -1px 1px #495968; + text-shadow: 0px -1px 1px #495968; +} + +.ui-dialog.confirm .ui-dialog-title { + background: url(../images/icons.png) no-repeat 0px -225px; +} + +.ui-dialog.create-form .ui-dialog-title { + background: url(../images/icons.png) no-repeat 0px -256px; +} + +.ui-dialog.confirm .ui-button { + /*+placement:shift 0px -8px;*/ + position: relative; + left: 0px; + top: -8px; +} + +/*** Create form*/ +.ui-dialog div.form-container { + height: 106px; + width: 100%; + overflow: hidden; + display: block; + padding-bottom: 37px; + text-align: left; +} + +.ui-dialog div.form-container span.message { + text-align: left; + padding: 0 0 23px 5px; + font-size: 15px; +} + +.ui-dialog div.form-container div.form-item { + display: inline-block; + height: 38px; +} + +.ui-dialog div.form-container div.name { + float: left; + clear: both; + width: 115px; + font-size: 15px; + color: #485867; + /*+text-shadow:0px 2px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 2px 1px #FFFFFF; + -webkit-text-shadow: 0px 2px 1px #FFFFFF; + -o-text-shadow: 0px 2px 1px #FFFFFF; + text-shadow: 0px 2px 1px #FFFFFF; + margin: 3px 0 0; +} + +.ui-dialog div.form-container div.name label { + display: block; + width: 100%; + text-align: right; + font-size: 14px; + margin-top: 2px; +} + +.ui-dialog div.form-container div.value { + width: 232px; + overflow: hidden; + float: right; + margin: 0 0 0 15px; +} + +.ui-dialog div.form-container div.value input { + width: 226px; + font-size: 14px; + background: #F6F6F6; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + float: left; +} + +.ui-dialog div.form-container div.value select { + width: 231px; + float: right; +} + +.ui-dialog div.form-container div.value input[type=checkbox] { + width: 14px; +} + +.ui-dialog div.form-container div.value label.error { + display: block; + clear: both; + font-size: 10px; + color: #FA0000; + display: none; +} + +.ui-dialog.create-form .ui-button.ok { + margin-left: 0; + float: right; +} + +.ui-dialog.create-form .ui-button.cancel { + background: #B6B6B6 url(../images/gradients.png) 0px -480px; + float: right; + margin-right: 13px; + border: 1px solid #AAAAAA; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; +} + +.ui-dialog.create-form .ui-button.cancel:hover { + background-position: -4px -426px; + border-color: #878787; +} + +/*User options*/ +#user-options { + width: 128px; + height: 33px; + background: #EDE8E8; + display: none; + position: absolute; + z-index: 5000; + /*+placement:shift 883px 34px;*/ + position: relative; + left: 883px; + top: 34px; + border-top: 1px solid #FFFFFF; + border-bottom: 1px solid #C6C4C5; + /*+box-shadow:0px 8px 17px #9A9A9A;*/ + -moz-box-shadow: 0px 8px 17px #9A9A9A; + -webkit-box-shadow: 0px 8px 17px #9A9A9A; + -o-box-shadow: 0px 8px 17px #9A9A9A; + box-shadow: 0px 8px 17px #9A9A9A; + padding: 0; + border: 1px solid #8A8888; +} + +#user-options a { + position: relative; + background: #E7E4E4; + width: 100%; + display: block; + clear: both; + text-indent: 13px; + color: #4C5C6C; + text-decoration: none; + font-size: 12px; + /*+placement:shift 0px -41px;*/ + position: relative; + left: 0px; + top: -41px; + padding: 11px 0 9px; + border-bottom: 1px solid #C5C5C5; + border-top: 1px solid #FFFFFF; + /*+text-shadow:0px 2px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 2px 1px #FFFFFF; + -webkit-text-shadow: 0px 2px 1px #FFFFFF; + -o-text-shadow: 0px 2px 1px #FFFFFF; + text-shadow: 0px 2px 1px #FFFFFF; +} + +#user-options a:hover { + background: #5E7488; + color: #FFFFFF; + /*+text-shadow:0px 1px 2px #5B6372;*/ + -moz-text-shadow: 0px 1px 2px #5B6372; + -webkit-text-shadow: 0px 1px 2px #5B6372; + -o-text-shadow: 0px 1px 2px #5B6372; + text-shadow: 0px 1px 2px #5B6372; +} + +/*Dashboard +** Admin*/ +.dashboard.admin { + background: #F2F0F0; + height: 100%; + padding: 10px; + font-size: 13px; + color: #3D5873; +} + +.dashboard.admin .dashboard-container { + background: #FFFFFF; + border: 1px solid #C8C2C2; + /*+border-radius:6px;*/ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + -khtml-border-radius: 6px; + border-radius: 6px 6px 6px 6px; + padding: 14px 14px 18px; + margin: 0 0 11px; +} + +.dashboard.admin .dashboard-container.sub { + width: 45%; +} + +.dashboard.admin .dashboard-container.sub .button.view-all { + font-size: 10px; + float: right; + clear: none; + padding: 3px 6px; + background: url(../images/bg-gradients.png) repeat-x 0px -164px; + border: 1px solid #B2B7BB; + /*+border-radius:6px;*/ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + -khtml-border-radius: 6px; + border-radius: 6px 6px 6px 6px; + /*+box-shadow:0px 1px 1px #CBCBCB;*/ + -moz-box-shadow: 0px 1px 1px #CBCBCB; + -webkit-box-shadow: 0px 1px 1px #CBCBCB; + -o-box-shadow: 0px 1px 1px #CBCBCB; + box-shadow: 0px 1px 1px #CBCBCB; + cursor: pointer; +} + +.dashboard.admin .dashboard-container.sub .title { + float: left; +} + +/**** Head*/ +.dashboard.admin .dashboard-container.head { +} + +.dashboard.admin .dashboard-container.head .top { + width: 100%; + float: left; + margin: 0 0 9px; +} + +.dashboard.admin .dashboard-container.head .title { + float: left; + padding: 5px 0 0; +} + +.dashboard.admin .dashboard-container.head .title span { +} + +.dashboard.admin .dashboard-container.head .selects { + float: right; +} + +.dashboard.admin .dashboard-container.head .selects .select { + float: left; + padding: 0; + margin: 0 0 0 21px; +} + +.dashboard.admin .dashboard-container.head .selects .select label { + display: block; + float: left; + padding: 5px 0px 0px; +} + +.dashboard.admin .dashboard-container.head .selects .select select { + width: 124px; + margin: 3px 0 0 10px; + padding: 0px; +} + +/**** Charts / stats*/ +.dashboard.admin .dashboard-container .stats ul li { + display: block; + width: 97%; + height: 49px; + background: url(../images/bg-gradients.png) 0px -29px; + clear: both; + border: 1px solid #C8C2C2; + /*+border-radius:10px;*/ + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + border-radius: 10px 10px 10px 10px; + padding: 0 12px 0px; + margin: 0 0 10px; +} + +.dashboard.admin .dashboard-container .stats ul li .name { + width: 132px; + float: left; + margin: 19px 40px 0 0; +} + +.dashboard.admin .dashboard-container .stats ul li div.value { + float: left; + background: url(../images/bg-gradients.png) 0px -51px; + width: 179px; + height: 100%; + border-left: 1px solid #C8C2C2; + border-right: 1px solid #C8C2C2; + margin: 0 9px 0 0; +} + +.dashboard.admin .dashboard-container .stats ul li .value .content { + background: url(../images/bg-gradients.png) repeat-x 0px 0px; + margin: 9px; + padding: 9px; + color: #FFFFFF; + font-size: 11px; + border-left: 1px solid #6A6A6A; + border-right: 1px solid #6A6A6A; + border-bottom: 1px solid #FFFFFF; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + /*+text-shadow:0px -1px 1px #6F6F6F;*/ + -moz-text-shadow: 0px -1px 1px #6F6F6F; + -webkit-text-shadow: 0px -1px 1px #6F6F6F; + -o-text-shadow: 0px -1px 1px #6F6F6F; + text-shadow: 0px -1px 1px #6F6F6F; +} + +.dashboard.admin .dashboard-container .stats ul li .chart { + float: left; + width: 290px; + height: 17px; + padding: 0px 1px; + background: url(../images/bg-gradients.png) 0px -130px; + margin: 14px 23px 0 0; + /*+border-radius:7px;*/ + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + -khtml-border-radius: 7px; + border-radius: 7px 7px 7px 7px; + border-bottom: 1px solid #FFFFFF; + border-top: 1px solid #727272; +} + +.dashboard.admin .dashboard-container .stats ul li .chart .chart-line { + height: 15px; + background: url(../images/bg-gradients.png) 0px -149px; + /*+border-radius:10px;*/ + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + border-radius: 10px 10px 10px 10px; + margin: 1px 0px 0; +} + +.dashboard.admin .dashboard-container .stats ul li .percentage { + float: left; + font-size: 20px; + font-weight: bold; + margin: 13px 0 0; + /*+text-shadow:0px -2px 1px #FFFFFF;*/ + -moz-text-shadow: 0px -2px 1px #FFFFFF; + -webkit-text-shadow: 0px -2px 1px #FFFFFF; + -o-text-shadow: 0px -2px 1px #FFFFFF; + text-shadow: 0px -2px 1px #FFFFFF; +} + +/**** Alerts*/ +.dashboard.admin .dashboard-container.sub.alerts { + float: left; + margin: 0 17px 0 0; +} + +.dashboard.admin .dashboard-container.sub.alerts.last { + margin-right: 0; +} + +.dashboard.admin .dashboard-container.sub.alerts ul { +} + +.dashboard.admin .dashboard-container.sub.alerts ul li { + display: block; + width: 340px; + height: 42px; + color: #000000; + background: url(../images/bg-gradients.png) 0px -48px; + border: 1px solid #D4D0D0; + clear: both; + /*+placement:shift 0px 15px;*/ + position: relative; + left: 0px; + top: 15px; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; + margin: 0px 0 12px; + /*[empty]color:;*/ + padding: 0; +} + +.dashboard.admin .dashboard-container.sub.alerts ul li .content { + height: 43px; + padding: 0 0 0 62px; + background: url(../images/icons.png) no-repeat -601px -428px; +} + +.dashboard.admin .dashboard-container.sub.alerts ul li { +} + +.dashboard.admin .dashboard-container.sub.alerts ul li span.title { + font-weight: bold; + font-size: 11px; + margin: 12px 0 0; +} + +.dashboard.admin .dashboard-container.sub.alerts ul li p { + display: block; + clear: both; + font-size: 11px; +} + +/*** User*/ +.dashboard.user { +} + +#browser div.panel .dashboard.user .toolbar { + height: 60px; + position: relative; +} + +/**** Actions*/ +.dashboard.user .dashboard-actions { +} + +.dashboard.user .dashboard-actions ul { + padding: 11px; +} + +.dashboard.user .dashboard-actions ul li { + float: left; + width: 123px; + cursor: pointer; + height: 40px; + margin: 0 9px 0 0; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + /*+box-shadow:inset 0px 0px 1px #DDE3EC;*/ + -moz-box-shadow: inset 0px 0px 1px #DDE3EC; + -webkit-box-shadow: inset 0px 0px 1px #DDE3EC; + -o-box-shadow: inset 0px 0px 1px #DDE3EC; + box-shadow: inset 0px 0px 1px #DDE3EC; + border: 1px solid #395268; + border-right: 1px solid #556778; + background: url(../images/bg-gradients.png) repeat-x 0px -181px; +} + +.dashboard.user .dashboard-actions ul li span { + color: #FFFFFF; + font-size: 11px; + /*+text-shadow:0px 1px 2px #444444;*/ + -moz-text-shadow: 0px 1px 2px #444444; + -webkit-text-shadow: 0px 1px 2px #444444; + -o-text-shadow: 0px 1px 2px #444444; + text-shadow: 0px 1px 2px #444444; + background: url(../images/icons.png) no-repeat -613px -309px; + padding: 8px 12px 11px 34px; + /*+placement:shift 4px 10px;*/ + position: relative; + left: 4px; + top: 10px; +} + +.dashboard.user .dashboard-actions ul li.add-iso span { + background-position: -613px -352px; +} + +.dashboard.user .dashboard-actions ul li.add-volume span { + background-position: -613px -264px; +} + +.dashboard.user .dashboard-actions ul li.acquire-ip span { + background-position: -613px -389px; +} + +/**** VM Status*/ +.dashboard.user .vm-status { + width: 98%; + margin: 19px auto auto; + border: 1px solid #D2CDCD; + /*+border-radius:9px;*/ + -moz-border-radius: 9px; + -webkit-border-radius: 9px; + -khtml-border-radius: 9px; + border-radius: 9px 9px 9px 9px; +} + +.dashboard.user .vm-status .title { + width: 100%; + background: url(../images/bg-gradients.png) 0px -53px; + /*+border-radius:10px 10px 0 0;*/ + -moz-border-radius: 10px 10px 0 0; + -webkit-border-radius: 10px 10px 0 0; + -khtml-border-radius: 10px 10px 0 0; + border-radius: 10px 10px 0 0; + font-size: 13px; + color: #4A5967; + padding: 13px 0 12px; + border-bottom: 1px solid #C8C2C2; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +.dashboard.user .vm-status .title span { + padding: 0 0 0 8px; +} + +.dashboard.user .vm-status .content { + padding: 9px 0px; +} + +.dashboard.user .vm-status .content ul { + display: inline-block; + margin: auto; +} + +.dashboard.user .vm-status .content ul li { + float: left; + width: 243px; + height: 237px; + border: 1px solid #E6EBEE; + border-top: 2px solid #D3D9DE; + /*+border-radius:10px;*/ + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + border-radius: 10px 10px 10px 10px; + margin: 0 0 0 11px; + background: #EBEDF1; +} + +.dashboard.user .vm-status .content ul li .name { + font-size: 28px; + color: #5C7082; + padding: 0 0 0 35px; + margin: 14px 0 0; + /*+text-shadow:0px 2px 2px #FFFFFF;*/ + -moz-text-shadow: 0px 2px 2px #FFFFFF; + -webkit-text-shadow: 0px 2px 2px #FFFFFF; + -o-text-shadow: 0px 2px 2px #FFFFFF; + text-shadow: 0px 2px 2px #FFFFFF; + background: url(../images/icons.png) -617px -488px; +} + +.dashboard.user .vm-status .content ul li .value { + background: #DFE9CC; + width: 229px; + color: #5D7C98; + /*+text-shadow:0px 1px 2px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 2px #FFFFFF; + -webkit-text-shadow: 0px 1px 2px #FFFFFF; + -o-text-shadow: 0px 1px 2px #FFFFFF; + text-shadow: 0px 1px 2px #FFFFFF; + font-size: 58px; + margin: 12px auto auto; + text-align: center; + padding: 59px 0px; +} + +.dashboard.user .vm-status .content ul li.stopped .name { + background-position: -617px -524px; +} + +.dashboard.user .vm-status .content ul li.stopped .value { + background: #EDCBCE; +} + +.dashboard.user .vm-status .content ul li.total .name { + background-position: -617px -559px; +} + +.dashboard.user .vm-status .content ul li.total .value { + background: #DFE4E9; +} + +/***** Tables / status list*/ +.dashboard.user .status-lists { + margin: 15px 0 0 8px; +} + +.dashboard.user .status-lists ul li { + float: left; + margin: 0 10px 0 0; +} + +.dashboard.user .status-lists table { + width: 252px; + margin: 0; + cursor: default; +} + +.dashboard.user .status-lists table th { + padding: 8px 0px 6px; +} + +.dashboard.user .status-lists table tbody { + height: 150px; + display: block; + overflow: auto; + padding: 0 0px; +} + +.dashboard.user .status-lists table td.value { + cursor: default; +} + +.dashboard.user .status-lists table td.desc { + width: 151px; + overflow: hidden; + cursor: default; +} + +.dashboard.user .status-lists table thead { + background: url(../images/bg-gradients.png) 0px -351px; + border-top: 1px solid #C4C5C5; +} + +.dashboard.user .status-lists table tr.odd { + background: #DFE1E3; +} + +.dashboard.user .status-lists table td { + vertical-align: middle; +} + +/****** IP addresses*/ +.dashboard.user .status-lists li.ip-addresses { +} + +.dashboard.user .status-lists li.ip-addresses td { + padding: 13px 0; + width: 250px; +} + +.dashboard.user .status-lists li.ip-addresses .desc { + color: #3F5468; +} + +.dashboard.user .status-lists li.ip-addresses .value { + font-size: 29px; + margin: 7px 0 0; + /*+text-shadow:0px 1px 2px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 2px #FFFFFF; + -webkit-text-shadow: 0px 1px 2px #FFFFFF; + -o-text-shadow: 0px 1px 2px #FFFFFF; + text-shadow: 0px 1px 2px #FFFFFF; +} + +/*System chart*/ +.system-chart-view .zone-chart .resources { + background: #EEEEEE; + width: 95%; + margin: 18px auto 0 22px; + padding: 0 0 11px; + clear: both; + display: inline-block; + /*+placement:shift;*/ + position: relative; + left: 0; + top: 0; +} + +.system-chart-view .zone-chart .toolbar { + position: relative; +} + +.system-chart-view .zone-chart .resources .head { + padding: 14px 0 44px 9px; + color: #4A5B6A; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +.system-chart-view .zone-chart .resources .head span { + float: left; +} + +.system-chart-view .zone-chart .resources .head .add { + float: right; + background: #AFBDC6 url(../images/bg-gradients.png) repeat-x 0px -810px; + border: 1px solid #A2A9AC; + padding: 4px 26px; + margin: 6px 16px 0 0; + cursor: pointer; + /*+box-shadow:0px 1px 2px #FFFFFF;*/ + -moz-box-shadow: 0px 1px 2px #FFFFFF; + -webkit-box-shadow: 0px 1px 2px #FFFFFF; + -o-box-shadow: 0px 1px 2px #FFFFFF; + box-shadow: 0px 1px 2px #FFFFFF; + font-size: 12px; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; +} + +.system-chart-view .zone-chart .resources .head .add:hover { + background-position: 0px -831px; + /*+box-shadow:inset 0px 1px 0px #6B6B6B;*/ + -moz-box-shadow: inset 0px 1px 0px #6B6B6B; + -webkit-box-shadow: inset 0px 1px 0px #6B6B6B; + -o-box-shadow: inset 0px 1px 0px #6B6B6B; + box-shadow: inset 0px 1px 0px #6B6B6B; +} + +.system-chart-view .zone-chart ul { + width: 98%; + margin: auto auto auto 9px; + padding: 0px 0 4px; + background: #E2E2E2; + display: inline-block; +} + +.system-chart-view .zone-chart li { + display: block; + float: left; + width: 147px; + margin: 10px 18px 6px; + height: 86px; + overflow: hidden; + position: relative; + background: url(../images/buttons.png) no-repeat 0px -399px; +} + +.system-chart-view .zone-chart ul li .name { + color: #4E5F6F; + width: 130px; + /*+text-shadow:0px 1px 1px #FCFCFC;*/ + -moz-text-shadow: 0px 1px 1px #FCFCFC; + -webkit-text-shadow: 0px 1px 1px #FCFCFC; + -o-text-shadow: 0px 1px 1px #FCFCFC; + text-shadow: 0px 1px 1px #FCFCFC; + /*+placement:shift 10px 11px;*/ + position: relative; + left: 10px; + top: 11px; +} + +.system-chart-view .zone-chart ul li .view-all, +.system-chart-view .zone-chart ul li .view-details { + /*+placement:anchor-bottom-right 11px 11px;*/ + position: absolute; + right: 11px; + bottom: 11px; + cursor: pointer; + color: #FFFFFF; + background: url(../images/buttons.png) no-repeat -457px -503px; + font-size: 11px; + padding: 6px 24px 6px 9px; + /*+text-shadow:0px 1px 1px #395065;*/ + -moz-text-shadow: 0px 1px 1px #395065; + -webkit-text-shadow: 0px 1px 1px #395065; + -o-text-shadow: 0px 1px 1px #395065; + text-shadow: 0px 1px 1px #395065; +} + +.system-chart-view .zone-chart ul li .view-details { + text-indent: 4px; +} + +/*Form validation*/ +input.error { + background: #FEE5E5; +} + +label.error { + color: #FF0000; +} + +/*Multi-step wizard*/ +.multi-wizard { + width: 500px; + height: 550px; + display: inline-block; +} + +/*** Progress bar*/ +.multi-wizard .progress { + color: #FFFFFF; + font-size: 11px; +} + +.multi-wizard .progress ul { + width: 780px; + height: 40px; + float: left; + clear: both; +} + +/*[clearfix]*/.multi-wizard .progress ul li { + float: left; + width: 128px; + height: 40px; + border: 1px solid #5B7084; + border-left: 1px solid #000000; + border-right: none; + background: url(../images/bg-gradients.png) 0px -261px; + padding: 0 0px; + position: relative; +} + +.multi-wizard .progress ul li.first { + /*+border-radius:5px 0 0 5px;*/ + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + -khtml-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} + +.multi-wizard .progress ul li.last { + /*+border-radius:0 5px 5px 0;*/ + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + -khtml-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; + border-right: 1px solid #5B7084; +} + +.multi-wizard .progress ul li.active { + background: url(../images/bg-gradients.png) 0px -221px; + height: 40px; +} + +.multi-wizard .progress ul li span { + display: block; + /*+placement:shift 46px 17px;*/ + position: relative; + left: 46px; + top: 17px; + text-align: left; + color: #656565; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + float: right; + position: absolute; + width: 62px; + text-align: center; +} + +.multi-wizard .progress ul li span.multiline { + /*+placement:shift -22px 12px;*/ + position: relative; + left: -22px; + top: 12px; +} + +.multi-wizard .progress ul li span.arrow { + width: 17px; + height: 15px; + /*+placement:shift 120px 13px;*/ + position: relative; + left: 120px; + top: 13px; + z-index: 10; + position: absolute; + background: url(../images/icons.png) no-repeat 0px -422px; +} + +.multi-wizard .progress ul li.active span.arrow { + background-position: -1px -396px; +} + +.multi-wizard .progress ul li span.number { + width: auto; + position: absolute; + top: 8px; + left: 26px; + font-size: 27px; + font-weight: bold; + color: #E8E8E8; + /*+text-shadow:0px -1px 1px #C2BDBD;*/ + -moz-text-shadow: 0px -1px 1px #C2BDBD; + -webkit-text-shadow: 0px -1px 1px #C2BDBD; + -o-text-shadow: 0px -1px 1px #C2BDBD; + text-shadow: 0px -1px 1px #C2BDBD; + background: none; +} + +.multi-wizard .progress ul li.active span { + /*+text-shadow:0px -1px 1px #004AFF;*/ + -moz-text-shadow: 0px -1px 1px #004AFF; + -webkit-text-shadow: 0px -1px 1px #004AFF; + -o-text-shadow: 0px -1px 1px #004AFF; + text-shadow: 0px -1px 1px #004AFF; + color: #FFFFFF; +} + +.multi-wizard .progress ul li.active span.number { + /*+opacity:26%;*/ + filter: alpha(opacity=26); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=26); + -moz-opacity: 0.26; + opacity: 0.26; + /*+text-shadow:0px -1px 1px #000000;*/ + -moz-text-shadow: 0px -1px 1px #000000; + -webkit-text-shadow: 0px -1px 1px #000000; + -o-text-shadow: 0px -1px 1px #000000; + text-shadow: 0px -1px 1px #000000; +} + +/*** Content*/ +.multi-wizard .main-desc { + font-size: 11px; + text-align: left; + width: 437px; + /*+placement:shift 3px 17px;*/ + position: relative; + left: 3px; + top: 17px; + line-height: 17px; +} + +.multi-wizard .content { + background: #FFFFFF; + width: 430px; + height: 366px; + margin: 24px 0 0; + /*+border-radius:6px;*/ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + -khtml-border-radius: 6px; + border-radius: 6px 6px 6px 6px; + float: left; +} + +.multi-wizard .content .section { + width: 416px; + background: #E9E9E9; + margin: 16px auto auto; + overflow: hidden; + text-align: left; + font-size: 12px; + color: #505A62; + border: 1px solid #E0DFDF; +} + +.multi-wizard .content .section .select-area { + width: 334px; + height: 45px; + margin: 9px auto auto; + background: #D6D6D6; +} + +.multi-wizard .content .section .select-area .desc { + text-align: left; + width: 155px; + float: right; + padding: 9px 0 0; + font-size: 12px; + color: #989898; +} + +.multi-wizard .content .section .select-area input { + float: left; + margin: 0; + padding: 9px; +} + +.multi-wizard .content .section .select-area select { + padding: 0; + width: 158px; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + margin: 11px 0px 0 14px; + float: left; +} + +.multi-wizard .content .section .select-area input[type=radio] { + margin: 14px 16px 0; +} + +.multi-wizard .content .section .select-area label { + float: left; + text-align: left; + font-size: 18px; + color: #62798E; + /*+text-shadow:0px 2px 2px #EFEFEF;*/ + -moz-text-shadow: 0px 2px 2px #EFEFEF; + -webkit-text-shadow: 0px 2px 2px #EFEFEF; + -o-text-shadow: 0px 2px 2px #EFEFEF; + text-shadow: 0px 2px 2px #EFEFEF; + margin: 12px 12px 12px 2px; +} + +.multi-wizard .content .section .select-area label.error { + font-size: 10px; + color: #FF0000; + margin: 2px 0 0 14px; +} + +.multi-wizard .content .section p { + font-size: 11px; + text-align: left; + color: #808080; + padding: 0 0 0 40px; +} + +.multi-wizard .content .section h3 { + text-align: left; + color: #62798E; + font-weight: bold; + padding: 14px 14px 3px 39px; + /*+text-shadow:0px 1px 1px #EFEFEF;*/ + -moz-text-shadow: 0px 1px 1px #EFEFEF; + -webkit-text-shadow: 0px 1px 1px #EFEFEF; + -o-text-shadow: 0px 1px 1px #EFEFEF; + text-shadow: 0px 1px 1px #EFEFEF; + margin: 0; +} + +.multi-wizard .content .section.select-zone { + height: 117px; +} + +.multi-wizard .content .section.select-template { + height: 206px; +} + +.multi-wizard .content.tab-view { + margin: 31px 0px 0px; + background: none; + padding: 0px 8px; +} + +.multi-wizard .content.tab-view div.ui-tabs-panel { + border: 1px solid #E2DDDD; + clear: both; + height: 72% !important; + width: 94%; + margin: auto; + overflow: auto; + height: 591px; + /*+border-radius:0 3px 10px 10px;*/ + -moz-border-radius: 0 3px 10px 10px; + -webkit-border-radius: 0 3px 10px 10px; + -khtml-border-radius: 0 3px 10px 10px; + border-radius: 0 3px 10px 10px; + background: #FFFFFF; +} + +.multi-wizard.instance-wizard .select-iso .content .select .hypervisor { + float: left; + display: block; + clear: both; + margin: 0 0 0 58px; + /*+placement:shift 0px -6px;*/ + position: relative; + left: 0px; + top: -6px; +} + +.multi-wizard.instance-wizard .select-iso .content .select .hypervisor select { + width: 160px; +} + +.multi-wizard.instance-wizard .select-iso .content .select .hypervisor label { + color: #000000; + font-size: 11px; + margin-right: 9px; + margin-left: 2px; +} + +.multi-wizard.instance-wizard .select-iso .wizard-step-conditional.select-iso .content .select.selected { + height: 90px; +} + +/*** UI widgets*/ +.multi-wizard .ui-tabs ul { + margin-left: 2px; + margin-top: 7px; + display: block; + height: 41px; + border: none; + /*+placement:shift 0px 5px;*/ + position: relative; + left: 0px; + top: 5px; + overflow: hidden; + display: inline-block; + z-index: 10; +} + +.multi-wizard .ui-tabs ul li.first a { + border-left: 1px solid #E2DDDD; +} + +.multi-wizard .ui-tabs ul li.last a { + border-right: 1px solid #E2DDDD; +} + +.multi-wizard .ui-tabs li.ui-state-default a { + float: left; + padding: 15px; + width: 110px; + text-align: center; + font-size: 11px; + margin-right: 1px; + color: #4E6070; + text-decoration: none; + background: #DEE3E5; +} + +.multi-wizard .ui-tabs li.ui-state-active a { + background: #FFFFFF; +} + +.multi-wizard .ui-slider { + width: 136px; + padding: 0; + margin: 8px -2px 3px; + background: url(../images/bg-gradients.png) 0px -307px; + float: left; +} + +.multi-wizard .ui-slider .ui-slider-handle { + display: block; + background: url(../images/buttons.png) -622px -274px; + width: 18px; + height: 18px; + position: relative; + outline: none; +} + +/*** Select container*/ +.multi-wizard .select-container { + height: 94%; + overflow: auto; + border: 1px solid #D9DFE1; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; + margin: 10px 10px 0px; +} + +.multi-wizard .select-container .select { + width: 100%; + font-size: 13px; + height: 61px; + text-align: left; + border-bottom: 1px solid #EBEFF4; + background: #FFFFFF; +} + +.multi-wizard .select-container .select.odd { + background: #EBEFF4; +} + +.multi-wizard .select-container .select input { + float: left; + margin: 24px 24px 0; +} + +.multi-wizard .select-container .select .select-desc { + max-width: 335px; + height: 34px; + overflow: hidden; + float: left; + clear: none; + margin: 15px 0 0; +} + +.multi-wizard .select-container .select .select-desc .name { + font-weight: bold; + margin: 0 0 5px; +} + +.multi-wizard .select-container .select .select-desc .desc { + font-size: 11px; + color: #808080; +} + +/*** Buttons*/ +.multi-wizard .buttons { + width: 100%; + position: absolute; + top: 519px; + left: 25px; +} + +.multi-wizard .buttons .button { + width: 88px; + height: 16px; + padding: 11px 0 8px; + /*+box-shadow:0px 1px 1px #FFFFFF;*/ + -moz-box-shadow: 0px 1px 1px #FFFFFF; + -webkit-box-shadow: 0px 1px 1px #FFFFFF; + -o-box-shadow: 0px 1px 1px #FFFFFF; + box-shadow: 0px 1px 1px #FFFFFF; + border: 1px solid #78818F; + cursor: pointer; + font-weight: bold; + font-size: 12px; + /*+border-radius:8px;*/ + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px 8px 8px 8px; +} + +.multi-wizard .buttons .button.next { + /*+placement:float-right 37px 0px;*/ + float: right; + position: relative; + left: 37px; + top: 0px; + color: #FFFFFF; + /*+text-shadow:0px -1px 1px #465259;*/ + -moz-text-shadow: 0px -1px 1px #465259; + -webkit-text-shadow: 0px -1px 1px #465259; + -o-text-shadow: 0px -1px 1px #465259; + text-shadow: 0px -1px 1px #465259; + background: #0049FF url(../images/gradients.png) 0px -317px; + font-weight: bold; + border: 1px solid #0069CF; + border-top: 1px solid #0070FC; +} + +.multi-wizard .buttons .button.next:hover { + background-position: -3px -368px; + border: 1px solid #0035B8; + border-bottom: 1px solid #0062FA; +} + +.multi-wizard .buttons .button.next.final { + padding: 4px 0px 9px; + width: 115px; + margin: 3px 0 0; +} + +.multi-wizard .buttons .button.next.final span { + background: url(../images/icons.png) 0px -349px; + /*+placement:shift 0px 5px;*/ + position: relative; + left: 0px; + top: 5px; + padding: 5px 0px 5px 30px; +} + +.multi-wizard .buttons .button.cancel { + border: none; + /*+placement:float-right -153px 0px;*/ + float: right; + position: relative; + left: -153px; + top: 0px; + color: #808080; + /*+border-radius:0;*/ + -moz-border-radius: 0; + -webkit-border-radius: 0; + -khtml-border-radius: 0; + border-radius: 0 0 0 0; + background: none; + /*+box-shadow:inherit;*/ + -moz-box-shadow: inherit; + -webkit-box-shadow: inherit; + -o-box-shadow: inherit; + box-shadow: inherit; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + padding: 14px 0 0px 0px; +} + +.multi-wizard .buttons .button.cancel:hover { + color: #5E5E5E; +} + +.multi-wizard .buttons .button.previous { + background: #D6D6D6; + color: #62798E; +} + +.multi-wizard .buttons .button.previous:hover { + background: #C6C6C6; +} + +/** Instance wizard +** Select ISO*/ +.multi-wizard.instance-wizard .select-iso .select-container { + height: 260px; + margin: 0; + /*+border-radius:0 0 5px 5px;*/ + -moz-border-radius: 0 0 5px 5px; + -webkit-border-radius: 0 0 5px 5px; + -khtml-border-radius: 0 0 5px 5px; + border-radius: 0 0 5px 5px; +} + +/*** Data disk offering*/ +.multi-wizard.instance-wizard .data-disk-offering .content .section { + padding: 9px 0 16px; + margin: 12px 0 15px 8px; +} + +.multi-wizard.instance-wizard .data-disk-offering .select-container { + height: 280px; + margin: -7px 6px 0 8px; + /*+border-radius:6px;*/ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + -khtml-border-radius: 6px; + border-radius: 6px 6px 6px 6px; +} + +.multi-wizard.instance-wizard .data-disk-offering.required .select-container { + height: 344px; + position: relative; + margin-top: 9px !important; +} + +.multi-wizard.instance-wizard .data-disk-offering.required.custom-disk-size .select-container { + height: 279px; +} + +.multi-wizard.instance-wizard .data-disk-offering.custom-disk-size .select-container { + height: 213px; + margin: -7px 6px 0 8px; + /*+border-radius:6px;*/ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + -khtml-border-radius: 6px; + border-radius: 6px 6px 6px 6px; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section input { + float: left; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section input[type=radio] { + margin: 8px 2px 0 17px; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section label { + display: block; + float: left; + margin: 10px 7px 7px; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section label.size { + color: #647A8E; + font-weight: bold; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section.custom-size input[type=radio] { + float: left; +} + +.multi-wizard.instance-wizard .data-disk-offering .content .section.custom-size input[type=text] { + float: left; + width: 28px; + margin: 6px -1px 0 8px; +} + +/*** Network*/ +.multi-wizard.instance-wizard .no-network { + background: #FFFFFF; + width: 773px; + height: 52px; + position: absolute; + top: 98px; + left: 11px; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; + z-index: 1; + padding: 162px 0 194px; +} + +.multi-wizard.instance-wizard .no-network p { + font-size: 22px; + line-height: 25px; +} + +.multi-wizard.instance-wizard .select-network .select table { + width: 405px; + margin: 21px 12px 0; +} + +.multi-wizard.instance-wizard .select-network .select table thead { + margin: 0; + padding: 0; +} + +.multi-wizard.instance-wizard .select-network .select table td { + padding: 0; + margin: 0; +} + +.multi-wizard.instance-wizard .select-network .select table .select-container { + margin: 0px; + border: 0; + height: 117px; +} + +.multi-wizard.instance-wizard .select-network .main-desc { + top: 7px; + left: 12px; +} + +.multi-wizard.instance-wizard .select-network .select-container .select { + width: 100%; + height: 38px; + float: left; +} + +.multi-wizard.instance-wizard .select-network .select-container .select input { + margin: 14px 15px 0px; +} + +.multi-wizard.instance-wizard .select-network .select-container .select .select-desc .desc { + font-size: 11px; + color: #808080; + float: left; +} + +.multi-wizard.instance-wizard .select-network .select-container .select .select-desc .name { + font-size: 11px; + font-weight: normal; + float: left; + color: #000000; + margin: 0 16px 0 0; +} + +/*** Confirmation*/ +.multi-wizard .review { +} + +.multi-wizard .review .select-container { +} + +.multi-wizard .review .select-container .select { + height: 35px; +} + +.multi-wizard .review .select-container .select .name { + float: left; + margin: 13px 22px 0 14px; + width: 127px; + font-size: 11px; +} + +.multi-wizard .review .select-container .select .value { + float: left; + margin: 9px 21px 0; + width: 136px; +} + +.multi-wizard .review .select-container .select .value span { + font-size: 10px; +} + +.multi-wizard .review .select-container .select .edit { + float: right; + cursor: pointer; + height: 18px; + margin: 11px 20px 0 0px; + background: url(../images/icons.png) -10px -452px; + padding: 0px 0px 0 20px; +} + +.multi-wizard .review .select-container .select.odd .edit a { + background: #EBEFF4; +} + +.multi-wizard .review .select-container .select .edit a { + font-size: 10px; + color: #0000FF; + text-decoration: none; + padding: 5px 0 8px; + background: #FFFFFF; +} + +.multi-wizard .review .select-container .select input, +.multi-wizard .review .select-container .select select { + margin: 0; + width: 151px; + float: left; +} + +/*** Diagram*/ +.multi-wizard.instance-wizard .diagram { + width: 325px; + height: 502px; + position: absolute; + top: 109px; + left: 465px; +} + +.multi-wizard.instance-wizard .diagram .part { + background: url(../images/instance-wizard-parts.png) no-repeat 0px 0px; +} + +.multi-wizard.instance-wizard .diagram .part.zone-plane { + width: 354px; + height: 117px; + background-position: 0px -55px; + /*+placement:displace -38px 259px;*/ + position: absolute; + margin-left: -38px; + margin-top: 259px; +} + +.multi-wizard.instance-wizard .diagram .part.computer-tower-front { + width: 95px; + height: 254px; + background-position: -54px -210px; + /*+placement:displace 44px 92px;*/ + position: absolute; + margin-left: 44px; + margin-top: 92px; +} + +.multi-wizard.instance-wizard .diagram .part.computer-tower-back { + width: 194px; + height: 271px; + background-position: -148px -192px; + /*+placement:displace 138px 74px;*/ + position: absolute; + margin-left: 138px; + margin-top: 74px; +} + +.multi-wizard.instance-wizard .diagram .part.os-drive { + width: 194px; + height: 86px; + background-position: -348px -192px; + /*+placement:displace 138px 74px;*/ + position: absolute; + margin-left: 138px; + margin-top: 74px; +} + +.multi-wizard.instance-wizard .diagram .part.cpu { + width: 194px; + height: 49px; + background-position: -344px -278px; + /*+placement:displace 138px 156px;*/ + position: absolute; + margin-left: 138px; + margin-top: 156px; +} + +.multi-wizard.instance-wizard .diagram .part.hd { + width: 194px; + height: 44px; + background-position: -344px -331px; + /*+placement:displace 138px 208px;*/ + position: absolute; + margin-left: 138px; + margin-top: 208px; +} + +.multi-wizard.instance-wizard .diagram .part.network-card { + width: 194px; + height: 44px; + background-position: -344px -380px; + /*+placement:displace 138px 260px;*/ + position: absolute; + margin-left: 138px; + margin-top: 260px; +} + +/** Add zone wizard*/ +.multi-wizard.zone-wizard { + width: 647px; + display: block; + height: 675px; +} + +.multi-wizard.zone-wizard .buttons { + top: 584px; +} + +.multi-wizard.zone-wizard .progress ul { + width: 646px; +} + +.multi-wizard.zone-wizard .progress ul li { + width: 128px; + padding: 0 32px 0 0; +} + +.multi-wizard.zone-wizard .progress ul li span.arrow { + margin: 0 0 0 32px; +} + +.multi-wizard.zone-wizard .select-network .content .section { + width: 606px; + height: 430px; + /*+placement:shift 0px 14px;*/ + position: relative; + left: 0px; + top: 14px; +} + +.multi-wizard.zone-wizard .select-network .content { + width: 100%; + height: 461px; + float: none; + margin: 64px auto auto; +} + +.multi-wizard.zone-wizard .select-network-model .select-area { + height: 131px; + width: 586px; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .isolation-mode { + height: 169px; + overflow: hidden; + float: left; + margin: 5px 0 0; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .desc { + width: 373px; + color: #727272; + background: #EFEFEF; + padding: 18px; + /*+placement:shift -27px 12px;*/ + position: relative; + left: -27px; + top: 12px; + /*+border-radius:7px;*/ + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + -khtml-border-radius: 7px; + border-radius: 7px 7px 7px 7px; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .desc em { + font-weight: bold; + text-decoration: underline; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .isolation-mode .select-area { + width: 586px; + height: 41px; + overflow: hidden; + margin: 0; + padding: 0px 0 9px; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .isolation-mode .select-area label { + font-size: 11px; + margin: 18px 0 0 11px; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .isolation-mode .select-area input { + margin: 17px 0 0 39px; +} + +.multi-wizard.zone-wizard .select-network-model .select-area .isolation-mode .select-area .desc { + padding: 7px; + width: 388px; + font-size: 11px; + background: #E6E6E6; + float: right; + /*+placement:shift -27px 11px;*/ + position: relative; + left: -27px; + top: 11px; +} + +.multi-wizard.zone-wizard .content.input-area { + width: 505px; + height: 391px; + margin: 45px auto auto 71px; +} + +.multi-wizard.zone-wizard .select-container .field { + width: 100%; + height: 40px; + float: left; +} + +.multi-wizard.zone-wizard .select-container .field.odd { + background: #EBEFF5; +} + +.multi-wizard.zone-wizard .select-container .field .name { + float: left; + margin: 18px 0 0 12px; + width: 90px; + font-size: 11px; + text-align: left; + line-height: 13px; +} + +.multi-wizard.zone-wizard .select-container .field .value { + float: left; + position: relative; +} + +.multi-wizard.zone-wizard .select-container .field .value label.error { + color: #FF0000; + font-size: 10px; + position: absolute; + display: block; + text-align: left; + margin: 2px 0 0 16px; + float: right; + /*+placement:shift 1px 31px;*/ + position: relative; + left: 1px; + top: 31px; + position: absolute; +} + +.multi-wizard.zone-wizard .select-container .field .value input, +.multi-wizard.zone-wizard .select-container .field .value select { + width: 316px; + height: 12px; + margin: 13px 18px 0; + float: left; +} + +.multi-wizard.zone-wizard .select-container .field .value select { + width: 139px; +} + +.multi-wizard.zone-wizard .select-container .field .value input[type=checkbox] { + float: left; + display: block; + width: 13px; +} + +.multi-wizard.zone-wizard .select-container .field .value.multi-range input { + float: left; + width: 137px; +} + +.multi-wizard.zone-wizard .select-container .field .value.multi-range span { + float: left; + margin: 19px 0 0; +} + +/*Tree view*/ +.tree-view { + height: 100%; + overflow: auto; +} + +#browser .tree-view div.toolbar { +} + +.tree-view ul { + display: block; + width: 85px; +} + +.tree-view ul li { + position: relative; + left: 21px; + font-size: 12px; + display: block; + margin: 7px 0 0; + clear: both; + width: 100%; +} + +.tree-view > ul { + /*+placement:shift 3px 40px;*/ + position: relative; + left: 3px; + top: 40px; +} + +.tree-view > ul > li { + left: 5px; +} + +.tree-view ul li .name { + float: left; + margin: 0 0 13px 11px; + padding: 6px 9px 6px 4px; + cursor: pointer; +} + +.tree-view ul li .name:hover { + text-decoration: underline; +} + +.tree-view ul li .name.selected { + background: #DDDCDD; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; +} + +.tree-view ul li .expand { + width: 10px; + height: 10px; + float: left; + background: url(../images/buttons.png) -630px -245px; + margin: 4px 5px 0 0; + float: left; + cursor: pointer; + position: absolute; +} + +.tree-view ul li.expanded > .expand { + background-position: -631px -228px; +} + +#browser .tree-view div.toolbar div.text-search { + float: left; +} + +#navigation ul li.last.active { + height: 52px; +} + +.detail-group table tbody { + border: none; +} + +div.detail-group td.view-all div.view-all div.end { +} + +/*Dialog-based list view*/ +.ui-dialog .list-view { + height: 515px !important; + overflow: auto; +} + +.ui-dialog .list-view .toolbar { + top: 33px; + width: 824px; +} + +div.panel.ui-dialog div.list-view div.fixed-header { + top: 33px; + left: 22px; + width: 759px; + height: 49px; + background-color: #EAECEF; + margin: 0; + z-index: 1; +} + +.ui-dialog .list-view table { + top: 9px !important; +} + +.ui-dialog.panel div.list-view div.data-table table { + width: 778px; + margin-top: 39px; +} + +.ui-dialog.panel div.list-view div.data-table table tbody tr.multi-edit-selected { + background: #C3E0FC; +} + +/*Multi-edit*/ +.multi-edit { +} + +.multi-edit table.multi-edit { + border-top: none; +} + +.detail-group .multi-edit table td { + border-left: 1px solid #CDCCCC; +} + +.detail-view .multi-edit input { + width: 70%; +} + +.multi-edit input { + width: 85%; +} + +.multi-edit .range { + position: relative; +} + +.multi-edit .range .range-item { + float: left; +} + +.multi-edit .range input { + width: 70px; + margin-left: 13px; + position: relative; +} + +.multi-edit .range label { + display: block; + clear: both; + /*+placement:shift 3px 2px;*/ + position: relative; + left: 3px; + top: 2px; +} + +.multi-edit label.error { + font-size: 10px; + margin: 0 0 0 10px; +} + +.multi-edit .data-table td span { + float: left; +} + +.multi-edit .data-table td.add-vm { + cursor: pointer; +} + +.multi-edit th.add-rule, +.multi-edit td.add-rule { + min-width: 45px !important; + max-width: 45px !important; + width: 45px !important; +} + +.multi-edit .data-table td.add-vm:hover { + color: #5FAAF7; +} + +.multi-edit .data-table .fixed-header { + display: none; +} + +.multi-edit .button.add-vm { + font-size: 10px; + font-weight: bold; + cursor: pointer; + color: #FFFFFF; + /*+text-shadow:0px 1px 1px #000000;*/ + -moz-text-shadow: 0px 1px 1px #000000; + -webkit-text-shadow: 0px 1px 1px #000000; + -o-text-shadow: 0px 1px 1px #000000; + text-shadow: 0px 1px 1px #000000; + /*+box-shadow:0px 1px 1px #FFFFFF;*/ + -moz-box-shadow: 0px 1px 1px #FFFFFF; + -webkit-box-shadow: 0px 1px 1px #FFFFFF; + -o-box-shadow: 0px 1px 1px #FFFFFF; + box-shadow: 0px 1px 1px #FFFFFF; + border: 1px solid #858585; + border-top: none; + /*+border-radius:5px;*/ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px 5px 5px 5px; + padding: 6px 9px 4px 0px; + background: url(../images/bg-gradients.png) repeat-x 0px -220px; + /*+placement:shift 4px 0px;*/ + position: relative; + left: 4px; + top: 0px; +} + +.multi-edit .button.add-vm:hover { + background-position: 0px -241px; + /*+box-shadow:inset 0px 1px 1px #000000;*/ + -moz-box-shadow: inset 0px 1px 1px #000000; + -webkit-box-shadow: inset 0px 1px 1px #000000; + -o-box-shadow: inset 0px 1px 1px #000000; + box-shadow: inset 0px 1px 1px #000000; +} + +.multi-edit-add-list .ui-button.ok, +.multi-edit-add-list .ui-button.cancel { + float: right; + /*+placement:shift 506px -18px;*/ + position: relative; + left: 506px; + top: -18px; + height: 23px; +} + +.multi-edit-add-list .ui-button.cancel { + /*+placement:shift 492px -18px;*/ + position: relative; + left: 492px; + top: -18px; + border: none; + background: none; + color: #808B95; + font-weight: bold; +} + +.multi-edit .data .data-body { + width: 96%; + margin: auto auto auto 11px; + overflow: hidden; +} + +.panel.always-maximized .multi-edit .data .data-body { + width: 96%; + margin: 0 0 0 12px; +} + +.multi-edit .data .data-body .data-item { + margin-bottom: 14px; + border: 1px solid #CDCCCC; +} + +.multi-edit .data .data-body .data-item.loading { + height: 28px; + background: #FFFFFF url(../images/ajax-loader.gif) no-repeat center; + border: 1px solid #DDDDDD; +} + +.multi-edit .data .data-body .data-item.loading .label { + color: #808080; + font-size: 12px; + text-align: center; + text-indent: 19%; + margin: 12px 0 0; +} + +.multi-edit .data .data-body .data-item table { + margin: 0; + border: none; + width: 100%; + overflow: hidden; + background: #F0F1F2; +} + +.multi-edit .data .data-body .data-item tr { + background: #EFEFEF; + border: none; + display: block; + width: 115%; +} + +.multi-edit .data .data-body .data-item table tbody tr td { + background: #F0F1F2; + border-left: none; + border-right: 1px solid #CFC9C9; + height: 15px; + float: left; + overflow: hidden; + padding-right: 0; + padding-bottom: 4px; +} + +.multi-edit .data .data-body .data-item table tbody tr td.blank { +} + +.multi-edit .data .data-body .data-item table tbody tr td.name { + padding-top: 9px; +} + +.multi-edit .data .data-body .data-item table tbody tr td.name span { + color: #4C5D78; + font-weight: bold; +} + +.multi-edit .data .data-body .data-item table tbody tr td.multi-actions { + border-right: none; +} + +.multi-edit .data .data-body .data-item table tbody tr td.multi-actions .action { + cursor: pointer; + width: 28px; + height: 21px; + float: left; +} + +.multi-edit .data .data-body .data-item table tbody tr td.multi-actions .action span.icon { + background-image: url(../images/sprites.png); + cursor: pointer; + width: 28px; + height: 21px; + float: left; +} + +.multi-edit .data .data-body .data-item tr td .expand { + width: 14px; + height: 15px; + cursor: pointer; + background: #FFFFFF url(../images/sprites.png) -541px -499px; + border: 1px solid #D0D0D0; + /*+border-radius:9px;*/ + -moz-border-radius: 9px; + -webkit-border-radius: 9px; + -khtml-border-radius: 9px; + border-radius: 9px 9px 9px 9px; + float: left; + margin: -3px 0 0 11px; +} + +.multi-edit .data .data-body .data-item tr td.add-vm, +.multi-edit tr th.add-vm { + cursor: pointer; +} + +.multi-edit .data .data-body .data-item tr td.add-vm:hover { + color: #0060FF; + font-weight: bold; +} + +.multi-edit .data .data-body .data-item tr td.multi-actions .icon { + /*+placement:shift -3px -8px;*/ + position: relative; + left: -3px; + top: -8px; +} + +.multi-edit .data .data-body .data-item .expandable-listing { + width: 99.8%; + border: 1px solid #CFC9C9; + max-height: 161px; + overflow: auto; +} + +.multi-edit .data .data-body .data-item .expandable-listing tr { + width: 100%; + border: none; + margin: 0; + padding: 0; +} + +.multi-edit .data .data-body .data-item .expandable-listing tr td { + background: #DDE0E2; + border: none; + width: 100%; + margin: 0; +} + +.multi-edit .data .data-body .data-item .expandable-listing tr.odd td { + background: #F2F0F0; +} + +/*Security Rules*/ +.security-rules .add-by { + font-size: 12px; + color: #536474; + width: 94%; + margin: 13px 0 0 14px; +} + +.security-rules .add-by .selection { + width: 236px; + margin: 8px 0 0; +} + +.security-rules .add-by .selection input { + margin: 0 6px 0 0; +} + +.security-rules .add-by .selection label { + margin: 0 22px 0 0; +} + +.security-rules .multi-edit input { + width: 69px; + margin: 0 0 0 9px; +} + +.security-rules .multi-edit .range input { + width: 44px; + margin: 0 0 0 8px; +} + +/*Recurring snapshots*/ +.recurring-snapshots { + display: inline-block; +} + +.recurring-snapshots .schedule { +} + +.recurring-snapshots .schedule .add-snapshot-actions { + width: 581px; + clear: both; + float: left; + font-size: 13px; + margin-bottom: 13px; + border-top: 1px solid #FFFFFF; +} + +.recurring-snapshots .schedule .add-snapshot-action { + /*+placement:shift -7px -34px;*/ + position: relative; + left: -7px; + top: -34px; + float: right; + cursor: pointer; + padding: 10px; +} + +.recurring-snapshots .schedule .add-snapshot-action.add { + color: #0000FF; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + font-weight: bold; +} + +.recurring-snapshots .schedule .add-snapshot-action.add:hover { + color: #1A85F4; +} + +.recurring-snapshots .schedule p { + float: left; + font-size: 13px; + padding: 0; + margin: 5px 0 0 14px; +} + +.recurring-snapshots .schedule .forms { + width: 436px; + float: left; + /*+placement:shift 24px 2px;*/ + position: relative; + left: 24px; + top: 2px; +} + +.recurring-snapshots .schedule .forms form { + font-size: 12px; + color: #4F6171; +} + +.recurring-snapshots .schedule .forms form select { + float: left; + margin: 3px 10px 3px 3px; +} + +.recurring-snapshots .schedule .forms form input { + /*+placement:shift 1px 4px;*/ + position: relative; + left: 1px; + top: 4px; +} + +.recurring-snapshots .schedule .forms form label { + /*+placement:shift 5px 4px;*/ + position: relative; + left: 5px; + top: 4px; +} + +.recurring-snapshots .schedule .forms form label.error { + width: 100%; + float: left; + font-size: 10px; +} + +.recurring-snapshots .schedule .forms form .field { + width: 100%; + float: left; + margin: 8px 0 0; +} + +.recurring-snapshots .schedule .forms form .name { + float: left; + text-align: right; + width: 72px; + padding: 4px 0 0; + margin: 3px 14px 0 0; +} + +.recurring-snapshots .schedule .forms form .value { + width: 370px; + float: left; + text-align: left; +} + +.ui-dialog .recurring-snapshots .ui-widget-content { + padding: 0; + margin: 0; +} + +.recurring-snapshots .ui-button { + float: right; + /*+placement:shift 294px -30px;*/ + position: relative; + left: 294px; + top: -30px; +} + +.recurring-snapshots .scheduled-snapshots { + clear: both; + display: inline-block; + /*+placement:shift 0px -26px;*/ + position: relative; + left: 0px; + top: -26px; +} + +.recurring-snapshots .scheduled-snapshots p { + font-weight: bold; + font-size: 12px; + /*+text-shadow:0px 2px 2px #FFFFFF;*/ + -moz-text-shadow: 0px 2px 2px #FFFFFF; + -webkit-text-shadow: 0px 2px 2px #FFFFFF; + -o-text-shadow: 0px 2px 2px #FFFFFF; + text-shadow: 0px 2px 2px #FFFFFF; + text-indent: 12px; + padding-bottom: 8px; +} + +.recurring-snapshots .scheduled-snapshots table { + border: none; + /*+placement:shift 0px -14px;*/ + position: relative; + left: 0px; + top: -14px; + width: 564px; +} + +.recurring-snapshots .scheduled-snapshots table td.actions div.action span.icon { + /*+placement:shift -3px -4px;*/ + position: relative; + left: -3px; + top: -4px; +} + +.recurring-snapshots .scheduled-snapshots tr { + padding: 0; + border: 0; + display: block; + width: 100%; + height: 38px; + margin: 22px 0 0; + display: none; +} + +.recurring-snapshots .scheduled-snapshots tr td { + border: none; + min-width: 102px; + padding: 5px 0px 0 14px; + font-size: 12px; + word-break: keep-all; + word-wrap: normal; + text-indent: 0px; +} + +.recurring-snapshots .scheduled-snapshots tr td.keep { + min-width: 60px; +} + +.recurring-snapshots .scheduled-snapshots tr td.timezone { + min-width: 168px; + font-size: 12px; +} + +.recurring-snapshots .scheduled-snapshots tr td.timezone span { + font-size: 10px; +} + +.recurring-snapshots .scheduled-snapshots table tbody tr td.actions { + max-width: 22px !important; + min-width: 22px; +} + +.recurring-snapshots .scheduled-snapshots tr td.time { + min-width: 144px; + background: url(../images/sprites.png) no-repeat -536px -533px; + text-indent: 0.7em; +} + +.recurring-snapshots .scheduled-snapshots tr.daily td.time { + background-position: -537px -569px; +} + +.recurring-snapshots .scheduled-snapshots tr.weekly td.time { + background-position: -537px -605px; +} + +.recurring-snapshots .scheduled-snapshots tr.monthly td.time { + background-position: -537px -648px; +} + +.recurring-snapshots p { + text-align: left; + font-size: 14px; + line-height: 18px; + padding: 0 47px 0 0; + color: #475765; + margin-bottom: 16px; + /*+text-shadow:0px 3px 3px #FFFFFF;*/ + -moz-text-shadow: 0px 3px 3px #FFFFFF; + -webkit-text-shadow: 0px 3px 3px #FFFFFF; + -o-text-shadow: 0px 3px 3px #FFFFFF; + text-shadow: 0px 3px 3px #FFFFFF; + max-width: 550px; + display: block; +} + +.recurring-snapshots .ui-tabs ul { + margin: 0; + width: 100%; + padding: 0; + margin: 0; +} + +.recurring-snapshots .ui-tabs ul li a { + width: 76px; + text-indent: 28px; + margin: 0 32px 0 0; + padding: 8px 0 5px; + background: url(../images/sprites.png) no-repeat -521px -540px; + border: none; +} + +.recurring-snapshots .ui-tabs ul li.disabled a { + /*+opacity:50%;*/ + filter: alpha(opacity=50); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + -moz-opacity: 0.5; + opacity: 0.5; +} + +.recurring-snapshots .ui-tabs ul li.disabled:hover a { + border: none; + background-color: transparent; + border: none; + /*+box-shadow:none;*/ + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; + cursor: default; +} + +.recurring-snapshots .ui-tabs ul li.ui-state-active a, +.recurring-snapshots .ui-tabs ul li:hover a { + background-color: #DFDFDF; + /*+border-radius:8px;*/ + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px 8px 8px 8px; + /*+box-shadow:inset 0px 1px 2px #4E4E4E;*/ + -moz-box-shadow: inset 0px 1px 2px #4E4E4E; + -webkit-box-shadow: inset 0px 1px 2px #4E4E4E; + -o-box-shadow: inset 0px 1px 2px #4E4E4E; + box-shadow: inset 0px 1px 2px #4E4E4E; +} + +.recurring-snapshots .ui-tabs ul li.daily a { + background-position: -522px -577px; +} + +.recurring-snapshots .ui-tabs ul li.weekly a { + background-position: -526px -612px; +} + +.recurring-snapshots .ui-tabs ul li.monthly a { + background-position: -528px -656px; +} + +.recurring-snapshots .ui-tabs div.ui-tabs-panel { + height: 144px; + width: 576px; + border: none; + border-bottom: 1px solid #C3C3C3; + background: inherit; + margin: 0; + padding: 0; + /*+placement:shift -89px 0px;*/ + position: relative; + left: -89px; + top: 0px; +} + +/*Network detail chat*/ +.network-chart { + width: 100%; + height: 100%; + position: relative; + background: url(../images/bg-network.png) no-repeat 38% 70px; +} + +.network-chart.static-nat { + background: url(../images/bg-network-nat.png) no-repeat 31% 62px; +} + +.network-chart ul { + width: 536px; + height: 421px; + position: absolute; + top: 0px; + left: 0px; +} + +.network-chart li { + display: block; + width: 147px; + height: 86px; + background: url(../images/buttons.png) no-repeat 0px -399px; +} + +.network-chart li.static-nat-enabled { + /*+placement:shift 31px 44px;*/ + position: relative; + left: 31px; + top: 44px; +} + +.network-chart li.static-nat-enabled .name { + background: url(../images/sprites.png) no-repeat -6px -460px; +} + +.network-chart li.static-nat-enabled .name span { + font-size: 11px; + padding: 0 0 0 25px; +} + +.network-chart li.disabled { + /*+opacity:100%;*/ + filter: alpha(opacity=100); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + -moz-opacity: 1; + opacity: 1; +} + +.network-chart li.firewall { + /*+placement:shift 209px 174px;*/ + position: relative; + left: 209px; + top: 174px; + position: absolute; +} + +.network-chart li.loadBalancing { + /*+placement:shift 92px 308px;*/ + position: relative; + left: 92px; + top: 308px; + position: absolute; +} + +.network-chart li.portForwarding { + /*+placement:shift 332px 308px;*/ + position: relative; + left: 332px; + top: 308px; + position: absolute; +} + +.network-chart li .name { + color: #4E5F6F; + width: 130px; + /*+text-shadow:0px 1px 1px #FCFCFC;*/ + -moz-text-shadow: 0px 1px 1px #FCFCFC; + -webkit-text-shadow: 0px 1px 1px #FCFCFC; + -o-text-shadow: 0px 1px 1px #FCFCFC; + text-shadow: 0px 1px 1px #FCFCFC; + /*+placement:shift 10px 11px;*/ + position: relative; + left: 10px; + top: 11px; +} + +.network-chart li.disabled .name { + color: #8695A5; + /*+placement:shift 5px 32px;*/ + position: relative; + left: 5px; + top: 32px; + text-decoration: line-through; + text-align: center; +} + +.network-chart li .view-details { + /*+placement:anchor-bottom-right 11px 11px;*/ + position: absolute; + right: 11px; + bottom: 11px; + cursor: pointer; + color: #FFFFFF; + background: url(../images/buttons.png) no-repeat -457px -503px; + font-size: 11px; + padding: 6px 24px 6px 9px; + /*+text-shadow:0px 1px 1px #395065;*/ + -moz-text-shadow: 0px 1px 1px #395065; + -webkit-text-shadow: 0px 1px 1px #395065; + -o-text-shadow: 0px 1px 1px #395065; + text-shadow: 0px 1px 1px #395065; +} + +.network-chart li.disabled .view-details { + display: none; +} + +/*System Dashboard*/ +.system-dashboard { + height: 258px; + width: 781px; + display: block; + background: #8DA4B9 url(../images/bg-gradients.png) repeat-x 0px -475px; + /*+border-radius:8px;*/ + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px 8px 8px 8px; + /*+box-shadow:inset 0px 0px 1px #FFFFFF;*/ + -moz-box-shadow: inset 0px 0px 1px #FFFFFF; + -webkit-box-shadow: inset 0px 0px 1px #FFFFFF; + -o-box-shadow: inset 0px 0px 1px #FFFFFF; + box-shadow: inset 0px 0px 1px #FFFFFF; + border: 1px solid #BFD4E1; + position: relative; + margin: 18px 0 0 6px; +} + +.system-dashboard-view .toolbar { + position: relative; +} + +.system-dashboard .head { + color: #505F6F; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + text-indent: 11px; + padding: 12px 0 11px; + border-bottom: 1px solid #728EA7; + /*+box-shadow:0px 0px 1px #FFFFFF;*/ + -moz-box-shadow: 0px 0px 1px #FFFFFF; + -webkit-box-shadow: 0px 0px 1px #FFFFFF; + -o-box-shadow: 0px 0px 1px #FFFFFF; + box-shadow: 0px 0px 1px #FFFFFF; +} + +.system-dashboard .head .view-more { + float: right; + padding: 5px 21px 5px 9px; + margin: -4px 19px 0 0; + cursor: pointer; + font-size: 11px; + font-weight: bold; + background: #4B5B6A url(../images/bg-gradients.png) repeat-x 0px -735px; + color: #FFFFFF; + /*+border-radius:3px;*/ + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px 3px 3px 3px; + border: 1px solid #5A5A5A; + /*+box-shadow:inset 0px 0px 1px #FFFFFF;*/ + -moz-box-shadow: inset 0px 0px 1px #FFFFFF; + -webkit-box-shadow: inset 0px 0px 1px #FFFFFF; + -o-box-shadow: inset 0px 0px 1px #FFFFFF; + box-shadow: inset 0px 0px 1px #FFFFFF; + /*+text-shadow:0px 1px 1px #000000;*/ + -moz-text-shadow: 0px 1px 1px #000000; + -webkit-text-shadow: 0px 1px 1px #000000; + -o-text-shadow: 0px 1px 1px #000000; + text-shadow: 0px 1px 1px #000000; +} + +.system-dashboard .head .view-more:hover { + background-position: 0px -763px; + /*+box-shadow:inset 0px 1px 1px #313131;*/ + -moz-box-shadow: inset 0px 1px 1px #313131; + -webkit-box-shadow: inset 0px 1px 1px #313131; + -o-box-shadow: inset 0px 1px 1px #313131; + box-shadow: inset 0px 1px 1px #313131; +} + +.system-dashboard .status_box { + font-size: 14px; + margin: 28px 0 0; + background: transparent; + border: none; +} + +.system-dashboard .status_box li { + width: 180px; + height: 178px; + padding: 0; + background: url(../images/bg-status_box.png) no-repeat 0px 1px; + margin: 0 0 0 12px; + position: relative; + border: none; + float: left; +} + +.system-dashboard .status_box li span { + color: #FFFFFF; + /*+text-shadow:0px 1px 1px #000000;*/ + -moz-text-shadow: 0px 1px 1px #000000; + -webkit-text-shadow: 0px 1px 1px #000000; + -o-text-shadow: 0px 1px 1px #000000; + text-shadow: 0px 1px 1px #000000; +} + +.system-dashboard .status_box li span.label { + color: #CCCFD4; + font-size: 12px; +} + +.system-dashboard .status_box li span.total { + font-size: 25px; +} + +.system-dashboard .status_box li span.label { + color: #CCCFD4; + font-size: 12px; +} + +.system-dashboard .status_box li span.unit { + color: #C1C4C9; + font-size: 13px; +} + +.system-dashboard .status_box li span.header { + margin: 1px 0 0; + /*+placement:shift 13px 5px;*/ + position: relative; + left: 13px; + top: 5px; + /*+text-shadow:0px 1px 2px #000000;*/ + -moz-text-shadow: 0px 1px 2px #000000; + -webkit-text-shadow: 0px 1px 2px #000000; + -o-text-shadow: 0px 1px 2px #000000; + text-shadow: 0px 1px 2px #000000; +} + +.system-dashboard .status_box li span.status { + font-size: 27px; + /*+placement:shift 13px 141px;*/ + position: relative; + left: 13px; + top: 141px; + position: absolute; + color: #25FF25; + /*+text-shadow:0px 1px 1px #000000;*/ + -moz-text-shadow: 0px 1px 1px #000000; + -webkit-text-shadow: 0px 1px 1px #000000; + -o-text-shadow: 0px 1px 1px #000000; + text-shadow: 0px 1px 1px #000000; +} + +.system-dashboard .status_box li span.instance.total { + /*+placement:shift 12px 32px;*/ + position: relative; + left: 12px; + top: 32px; + position: absolute; +} + +.system-dashboard .status_box li span.instance.label { + /*+placement:shift 15px 53px;*/ + position: relative; + left: 15px; + top: 53px; + position: absolute; +} + +.system-dashboard .status_box li span.vcpu-hours.total { + /*+placement:shift 13px 76px;*/ + position: relative; + left: 13px; + top: 76px; + position: absolute; +} + +.system-dashboard .status_box li span.vcpu-hours.label { + /*+placement:shift 14px 95px;*/ + position: relative; + left: 14px; + top: 95px; + position: absolute; +} + +.system-dashboard .status_box li span.gb-hours.total { + /*+placement:shift 106px 77px;*/ + position: relative; + left: 106px; + top: 77px; + position: absolute; +} + +.system-dashboard .status_box li span.gb-hours.label { + /*+placement:shift 106px 95px;*/ + position: relative; + left: 106px; + top: 95px; + position: absolute; +} + +.system-dashboard .status_box li span.overview.total { + font-size: 71px; + /*+placement:shift 8px 26px;*/ + position: relative; + left: 8px; + top: 26px; + position: absolute; +} + +.system-dashboard .status_box li span.overview.label { + /*+placement:shift 52px 79px;*/ + position: relative; + left: 52px; + top: 79px; + position: absolute; +} + +.system-dashboard .status_box li span.used.total { + /*+placement:shift 14px 130px;*/ + position: relative; + left: 14px; + top: 130px; + font-size: 30px; + position: absolute; +} + +.system-dashboard .status_box li span.used.label { + /*+placement:shift 14px 153px;*/ + position: relative; + left: 14px; + top: 153px; + position: absolute; +} + +.system-dashboard .status_box li span.used.unit { + /*+placement:shift 67px 135px;*/ + position: relative; + left: 67px; + top: 135px; + position: absolute; +} + +.system-dashboard .status_box li span.available.unit { + /*+placement:shift 159px 135px;*/ + position: relative; + left: 159px; + top: 135px; + position: absolute; +} + +.system-dashboard .status_box li span.available.total { + /*+placement:shift 97px 130px;*/ + position: relative; + left: 97px; + top: 130px; + font-size: 30px; + position: absolute; +} + +.system-dashboard .status_box li span.available.label { + /*+placement:shift 97px 153px;*/ + position: relative; + left: 97px; + top: 153px; + position: absolute; +} + +.add-zone-resource .form-container { + height: auto !important; + display: inline-block; + overflow: visible; +} + +.add-zone-resource .form-container form { + display: inline-block; + height: auto; +} + +.add-zone-resource { +} + +.add-zone-resource .head { + width: 100%; + margin-bottom: 7px; + display: inline-block; + border-bottom: 1px solid #AFBDCA; + /*+box-shadow:0px 1px #FFFFFF;*/ + -moz-box-shadow: 0px 1px #FFFFFF; + -webkit-box-shadow: 0px 1px #FFFFFF; + -o-box-shadow: 0px 1px #FFFFFF; + box-shadow: 0px 1px #FFFFFF; +} + +.add-zone-resource .head span { + float: left; + font-size: 14px; + text-indent: 5px; + padding: 10px 0 18px; +} + +.add-zone-resource .head select { + float: left; + margin: -3px 0 6px 13px; + margin: 8px 0 0 9px; +} + +/*Action icons*/ +.action.edit .icon { + background-position: 1px -1px; +} + +.action.edit:hover .icon { + background-position: 1px -583px; +} + +.start .icon { + background-position: -169px -1px; +} + +.start:hover .icon { + background-position: -169px -583px; +} + +.stop .icon { + background-position: 0px -31px; +} + +.stop:hover .icon { + background-position: 0px -613px; +} + +.restart .icon { + background-position: 0px -63px; +} + +.restart:hover .icon { + background-position: 0px -645px; +} + +.destroy .icon, +.delete .icon { + background-position: 1px -92px; +} + +.destroy:hover .icon, +.delete:hover .icon { + background-position: 1px -674px; +} + +.migrate .icon { + background-position: 0px -125px; +} + +.migrate:hover .icon { + background-position: 0px -707px; +} + +.attach .icon, +.attachISO .icon, +.attachDisk .icon { + background-position: -101px -3px; +} + +.attach:hover .icon, +.attachISO:hover .icon, +.attachDisk:hover .icon { + background-position: -101px -585px; +} + +.detach .icon, +.detachISO .icon, +.detachDisk .icon { + background-position: -101px -65px; +} + +.detach:hover .icon, +.detachISO:hover .icon, +.detachDisk:hover .icon { + background-position: -101px -647px; +} + +.resetPassword .icon, +.changePassword .icon { + background-position: -68px -30px; +} + +.resetPassword:hover .icon, +.changePassword:hover .icon { + background-position: -68px -612px; +} + +.changeService .icon { + background-position: -38px -33px; +} + +.changeService:hover .icon { + background-position: -38px -615px; +} + +.snapshot .icon, +.takeSnapshot .icon { + background-position: -36px -91px; +} + +.snapshot:hover .icon, +.takeSnapshot:hover .icon { + background-position: -36px -673px; +} + +.recurringSnapshot .icon { + background-position: -69px -95px; +} + +.recurringSnapshot:hover .icon { + background-position: -69px -677px; +} + +.downloadVolume .icon, +.downloadTemplate .icon, +.downloadISO .icon { + background-position: -35px -125px; +} + +.downloadVolume:hover .icon, +.downloadTemplate:hover .icon, +.downloadISO:hover .icon { + background-position: -35px -707px; +} + +.createVolume .icon { + background-position: -70px -124px; +} + +.createVolume:hover .icon { + background-position: -70px -706px; +} + +.enable .icon, +.enableStaticNAT .icon { + background-position: -104px -94px; +} + +.enable:hover .icon, +.enableStaticNAT:hover .icon { + background-position: -104px -676px; +} + +.disable .icon, +.disableStaticNAT .icon { + background-position: -138px -96px; +} + +.disable .icon:hover, +.disableStaticNAT:hover .icon { + background-position: -138px -678px; +} + +.add .icon, +.addNew .icon { + background-position: -37px -61px; +} + +.add:hover .icon, +.addNew:hover .icon { + background-position: -37px -643px; +} + +.create .icon, +.createTemplate .icon { + background-position: -69px -63px; +} + +.create:hover .icon, +.createTemplate:hover .icon { + background-position: -69px -645px; +} + +.copyTemplate .icon, +.copyISO .icon { + background-position: -138px -2px; +} + +.copyTemplate:hover .icon, +.copyISO:hover .icon { + background-position: -138px -584px; +} + +.createVM .icon { + background-position: -137px -32px; +} + +.createVM:hover .icon { + background-position: -137px -614px; +} + +.enableMaintenanceMode .icon { + background-position: -138px -65px; +} + +.enableMaintenanceMode:hover .icon { + background-position: -138px -647px; +} + +.cancelMaintenanceMode .icon { + background-position: -138px -123px; +} + +.cancelMaintenanceMode:hover .icon { + background-position: -138px -705px; +} + +.lock .icon { + background-position: -104px -124px; +} + +.lock:hover .icon { + background-position: -104px -706px; +} + +.updateResourceLimits .icon { + background-position: -100px -32px; +} + +.updateResourceLimits:hover .icon { + background-position: -100px -614px; +} + +.updateResourceCount .icon { + background-position: -167px -66px; +} + +.updateResourceCount:hover .icon { + background-position: -167px -648px; +} + +.generateKeys .icon { + background-position: -167px -95px; +} + +.generateKeys:hover .icon { + background-position: -167px -677px; +} + +.restoreVM .icon, +.restore .icon { + background-position: -168px -31px; +} + +.restoreVM:hover .icon, +.restore:hover .icon { + background-position: -168px -613px; +} + +.enableVPN .icon { + background-position: -202px 0px; +} + +.enableVPN:hover .icon { + background-position: -199px -585px; +} + +.disableVPN .icon { + background-position: -202px -30px; +} + +.disableVPN:hover .icon { + background-position: -199px -615px; +} + +.addIpRange .icon { + background-position: -197px -65px; +} + +.addIpRange:hover .icon { + background-position: -197px -647px; +} + +.forceReconnect .icon { + background-position: -196px -95px; +} + +.forceReconnect:hover .icon { + background-position: -196px -677px; +} + +.manage .icon { + background-position: -165px -122px; +} + +.manage:hover .icon { + background-position: -165px -704px; +} + +.unmanage .icon { + background-position: -196px -122px; +} + +.unmanage:hover .icon { + background-position: -196px -704px; +} + diff --git a/ui/images/ajax-loader-small.gif b/ui/images/ajax-loader-small.gif new file mode 100644 index 00000000000..5b33f7e54f4 Binary files /dev/null and b/ui/images/ajax-loader-small.gif differ diff --git a/ui/images/ajax-loader.gif b/ui/images/ajax-loader.gif index 5b33f7e54f4..332ce46c009 100644 Binary files a/ui/images/ajax-loader.gif and b/ui/images/ajax-loader.gif differ diff --git a/ui/images/bg-breadcrumb-project-view.png b/ui/images/bg-breadcrumb-project-view.png new file mode 100644 index 00000000000..eebecefd19a Binary files /dev/null and b/ui/images/bg-breadcrumb-project-view.png differ diff --git a/ui/images/bg-breadcrumb.png b/ui/images/bg-breadcrumb.png new file mode 100644 index 00000000000..796b5982a9e Binary files /dev/null and b/ui/images/bg-breadcrumb.png differ diff --git a/ui/images/bg-breadcrumbs-project-view.png b/ui/images/bg-breadcrumbs-project-view.png new file mode 100644 index 00000000000..da51194dad7 Binary files /dev/null and b/ui/images/bg-breadcrumbs-project-view.png differ diff --git a/ui/images/bg-breadcrumbs.png b/ui/images/bg-breadcrumbs.png new file mode 100644 index 00000000000..c6ea1fe7d29 Binary files /dev/null and b/ui/images/bg-breadcrumbs.png differ diff --git a/ui/images/bg-button-view-more.png b/ui/images/bg-button-view-more.png new file mode 100644 index 00000000000..7fd9ef85326 Binary files /dev/null and b/ui/images/bg-button-view-more.png differ diff --git a/ui/images/bg-details-tab-gradient.png b/ui/images/bg-details-tab-gradient.png new file mode 100644 index 00000000000..e506e54ebd5 Binary files /dev/null and b/ui/images/bg-details-tab-gradient.png differ diff --git a/ui/images/bg-dialog-body.png b/ui/images/bg-dialog-body.png new file mode 100644 index 00000000000..a807f993f9a Binary files /dev/null and b/ui/images/bg-dialog-body.png differ diff --git a/ui/images/bg-dialog-header.png b/ui/images/bg-dialog-header.png new file mode 100644 index 00000000000..cf547443e38 Binary files /dev/null and b/ui/images/bg-dialog-header.png differ diff --git a/ui/images/bg-gradients.png b/ui/images/bg-gradients.png new file mode 100644 index 00000000000..53d0e05c697 Binary files /dev/null and b/ui/images/bg-gradients.png differ diff --git a/ui/images/bg-header.png b/ui/images/bg-header.png new file mode 100644 index 00000000000..9810b6f4c45 Binary files /dev/null and b/ui/images/bg-header.png differ diff --git a/ui/images/bg-login.jpg b/ui/images/bg-login.jpg new file mode 100644 index 00000000000..7a21002a207 Binary files /dev/null and b/ui/images/bg-login.jpg differ diff --git a/ui/images/bg-nav-item-active-project-view.png b/ui/images/bg-nav-item-active-project-view.png new file mode 100644 index 00000000000..652df62688e Binary files /dev/null and b/ui/images/bg-nav-item-active-project-view.png differ diff --git a/ui/images/bg-nav-item-active.png b/ui/images/bg-nav-item-active.png new file mode 100644 index 00000000000..811c24adb89 Binary files /dev/null and b/ui/images/bg-nav-item-active.png differ diff --git a/ui/images/bg-nav-item.png b/ui/images/bg-nav-item.png new file mode 100644 index 00000000000..46ee8ef6333 Binary files /dev/null and b/ui/images/bg-nav-item.png differ diff --git a/ui/images/bg-network-nat.png b/ui/images/bg-network-nat.png new file mode 100644 index 00000000000..532a4e7264c Binary files /dev/null and b/ui/images/bg-network-nat.png differ diff --git a/ui/images/bg-network.png b/ui/images/bg-network.png new file mode 100644 index 00000000000..1a3e378b49c Binary files /dev/null and b/ui/images/bg-network.png differ diff --git a/ui/images/bg-notifications.png b/ui/images/bg-notifications.png new file mode 100644 index 00000000000..0fa02edf14c Binary files /dev/null and b/ui/images/bg-notifications.png differ diff --git a/ui/images/bg-panel-shadow.png b/ui/images/bg-panel-shadow.png new file mode 100644 index 00000000000..afcbe372796 Binary files /dev/null and b/ui/images/bg-panel-shadow.png differ diff --git a/ui/images/bg-section-switcher.png b/ui/images/bg-section-switcher.png new file mode 100644 index 00000000000..5864c14b5a8 Binary files /dev/null and b/ui/images/bg-section-switcher.png differ diff --git a/ui/images/bg-status_box.png b/ui/images/bg-status_box.png new file mode 100644 index 00000000000..7d54776668c Binary files /dev/null and b/ui/images/bg-status_box.png differ diff --git a/ui/images/bg-system-chart-lines.png b/ui/images/bg-system-chart-lines.png new file mode 100644 index 00000000000..e551e48ffce Binary files /dev/null and b/ui/images/bg-system-chart-lines.png differ diff --git a/ui/images/bg-table-head.png b/ui/images/bg-table-head.png new file mode 100644 index 00000000000..bafe24548c2 Binary files /dev/null and b/ui/images/bg-table-head.png differ diff --git a/ui/images/buttons.png b/ui/images/buttons.png new file mode 100644 index 00000000000..06e21c64c7c Binary files /dev/null and b/ui/images/buttons.png differ diff --git a/ui/images/destroy-anim.gif b/ui/images/destroy-anim.gif new file mode 100644 index 00000000000..437876a68f7 Binary files /dev/null and b/ui/images/destroy-anim.gif differ diff --git a/ui/images/gradients.png b/ui/images/gradients.png new file mode 100644 index 00000000000..8d1de9d0f39 Binary files /dev/null and b/ui/images/gradients.png differ diff --git a/ui/images/icons.png b/ui/images/icons.png new file mode 100644 index 00000000000..7bb0cb0672b Binary files /dev/null and b/ui/images/icons.png differ diff --git a/ui/images/instance-wizard-parts.png b/ui/images/instance-wizard-parts.png new file mode 100644 index 00000000000..70c10985b3d Binary files /dev/null and b/ui/images/instance-wizard-parts.png differ diff --git a/ui/images/logo.png b/ui/images/logo.png index 5e8513fef72..e91be3b29ad 100644 Binary files a/ui/images/logo.png and b/ui/images/logo.png differ diff --git a/ui/images/sample-project-view.png b/ui/images/sample-project-view.png new file mode 100644 index 00000000000..866273ec634 Binary files /dev/null and b/ui/images/sample-project-view.png differ diff --git a/ui/images/sample-wizard/step1.png b/ui/images/sample-wizard/step1.png new file mode 100644 index 00000000000..1e0d40d2687 Binary files /dev/null and b/ui/images/sample-wizard/step1.png differ diff --git a/ui/images/sample-wizard/step2.png b/ui/images/sample-wizard/step2.png new file mode 100644 index 00000000000..955ee7eb276 Binary files /dev/null and b/ui/images/sample-wizard/step2.png differ diff --git a/ui/images/sample-wizard/step3.png b/ui/images/sample-wizard/step3.png new file mode 100644 index 00000000000..b04a0eac1e0 Binary files /dev/null and b/ui/images/sample-wizard/step3.png differ diff --git a/ui/images/sample-wizard/step4.png b/ui/images/sample-wizard/step4.png new file mode 100644 index 00000000000..a5857bc7296 Binary files /dev/null and b/ui/images/sample-wizard/step4.png differ diff --git a/ui/images/sample-wizard/step5.png b/ui/images/sample-wizard/step5.png new file mode 100644 index 00000000000..036a0c832b9 Binary files /dev/null and b/ui/images/sample-wizard/step5.png differ diff --git a/ui/images/sample-wizard/step6.png b/ui/images/sample-wizard/step6.png new file mode 100644 index 00000000000..0e681d57591 Binary files /dev/null and b/ui/images/sample-wizard/step6.png differ diff --git a/ui/images/screens/Dashboard.jpg b/ui/images/screens/Dashboard.jpg new file mode 100644 index 00000000000..a793cf2d780 Binary files /dev/null and b/ui/images/screens/Dashboard.jpg differ diff --git a/ui/images/screens/Dashboard2.jpg b/ui/images/screens/Dashboard2.jpg new file mode 100644 index 00000000000..dd14eeb5cf3 Binary files /dev/null and b/ui/images/screens/Dashboard2.jpg differ diff --git a/ui/images/screens/Events-Details.jpg b/ui/images/screens/Events-Details.jpg new file mode 100644 index 00000000000..3adfa09f5d7 Binary files /dev/null and b/ui/images/screens/Events-Details.jpg differ diff --git a/ui/images/screens/Events.jpg b/ui/images/screens/Events.jpg new file mode 100644 index 00000000000..df22149816d Binary files /dev/null and b/ui/images/screens/Events.jpg differ diff --git a/ui/images/screens/Network-Details.jpg b/ui/images/screens/Network-Details.jpg new file mode 100644 index 00000000000..32f374e51dd Binary files /dev/null and b/ui/images/screens/Network-Details.jpg differ diff --git a/ui/images/screens/Network.jpg b/ui/images/screens/Network.jpg new file mode 100644 index 00000000000..f33f54cd70d Binary files /dev/null and b/ui/images/screens/Network.jpg differ diff --git a/ui/images/screens/ProjectDashboard.png b/ui/images/screens/ProjectDashboard.png new file mode 100644 index 00000000000..c23ea30a221 Binary files /dev/null and b/ui/images/screens/ProjectDashboard.png differ diff --git a/ui/images/screens/Projects-Details.jpg b/ui/images/screens/Projects-Details.jpg new file mode 100644 index 00000000000..9f457cb1390 Binary files /dev/null and b/ui/images/screens/Projects-Details.jpg differ diff --git a/ui/images/screens/Projects.jpg b/ui/images/screens/Projects.jpg new file mode 100644 index 00000000000..0684a89d689 Binary files /dev/null and b/ui/images/screens/Projects.jpg differ diff --git a/ui/images/screens/Storage-Details.jpg b/ui/images/screens/Storage-Details.jpg new file mode 100644 index 00000000000..9f5d6321968 Binary files /dev/null and b/ui/images/screens/Storage-Details.jpg differ diff --git a/ui/images/screens/Storage.jpg b/ui/images/screens/Storage.jpg new file mode 100644 index 00000000000..3f8789ce658 Binary files /dev/null and b/ui/images/screens/Storage.jpg differ diff --git a/ui/images/screens/Templates-Details.jpg b/ui/images/screens/Templates-Details.jpg new file mode 100644 index 00000000000..a2ffd6c3721 Binary files /dev/null and b/ui/images/screens/Templates-Details.jpg differ diff --git a/ui/images/screens/Templates.jpg b/ui/images/screens/Templates.jpg new file mode 100644 index 00000000000..35985cc88ce Binary files /dev/null and b/ui/images/screens/Templates.jpg differ diff --git a/ui/images/sprites.png b/ui/images/sprites.png new file mode 100644 index 00000000000..6b07153e93b Binary files /dev/null and b/ui/images/sprites.png differ diff --git a/ui/images/vm-instance-screen-sample.png b/ui/images/vm-instance-screen-sample.png new file mode 100644 index 00000000000..76b63b73d3a Binary files /dev/null and b/ui/images/vm-instance-screen-sample.png differ diff --git a/ui/index-test.html b/ui/index-test.html new file mode 100644 index 00000000000..9b9174b9d7d --- /dev/null +++ b/ui/index-test.html @@ -0,0 +1,1430 @@ + + + + CloudStack + + + + + +
+ + +
+ +
+
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+
+
+ + +
+
+
    +
  • 1Setup
  • +
  • 2Select a template
  • +
  • 3Service Offering
  • +
  • 4Data Disk Offering
  • +
  • 5Network
  • +
  • 6Review
  • +
+
+
+
+ +
+
+ +
+

Select a zone

+

Descriptive text of what a zone is goes here.

+
+
Description of this select area goes here.
+ +
+
+ + +
+

Select ISO or template

+

Descriptive text goes here.

+
+
Description of a template goes here.
+ + +
+
+
Description of a template goes here.
+ + +
+
+
+
+ + +
+ +
+
+

+ Please select a template for your new virtual instance. +

+
+
+ + + +
+
+
+
+
+
+
+
+
+
+ + +
+
+

+ Please select an ISO for your new virtual instance. + You can also choose to upload your own iso as well. +

+
+
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ + +
+ + +
+
+ + +
+ + + + +
+ + + + +
+
+
+ + +
+ +
+

Either your selected hypervisor does not have any additional network features or you don't have any zone that has security group enabled.

+

Thus, no additional network features.

+

Please proceed to the next step.

+
+ + +
+
+
+ Please select networks for your virtual machine +
+
+ + + + + + + + + + + +
Default network
+
+
+
+
+
+ + + + + + + + + + + +
Optional networks
+
+
+
+
+
+
+ + +
+
+ Please select security group(s) for your new virtual instance +
+
+
+
+
+
+
+ + +
+
+ Please review the following information and confirm that your virtual instance is correct before launch +
+
+
+ +
+
+ Name (optional) +
+
+ +
+
+ + +
+
+ Add to group (optional) +
+
+ +
+
+ + +
+
+ Zone +
+
+ +
+
+ Edit +
+
+ + +
+
+ Hypervisor +
+
+ +
+
+ Edit +
+
+ + +
+
+ Template +
+
+ +
+
+ Edit +
+
+ + +
+
+ Service offering +
+
+ +
+
+ Edit +
+
+ + +
+
+ Data disk offering +
+
+ +
+
+ Edit +
+
+ + +
+
+ Primary network +
+
+ +
+
+ Edit +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ + +
+ +
Cancel
+ +
+
+ + +
+
+
    +
  • 1Select Network
  • +
  • 2Setup Zone
  • +
  • 3Setup Pod
  • +
  • 4Setup IP Range
  • +
+
+
+ +
+
+
+ +
+

Setup network model

+

Please select a network model for your zone.

+
+
Choose this network model if you do not want to enable any VLAN support. All virtual instances created under this network model will be assigned an IP directly from the network and security groups are used to provide security and segregation.
+ + +
+
+
Choose this network model if you wish to enable VLAN support. This network model provides the most flexibility in allowing administrators to provide custom network offerings such as providing firewall, vpn, or load balancer support as well as enabling direct vs virtual networking.
+ + + +
+

Isolation mode

+
+ + +
Choose this if you wish to use zone-wide VLANs to provide guest VM isolation.
+
+
+ + +
Choose this if you wish to use security groups to provide guest VM isolation.
+
+
+
+
+
+
+
+ + +
+
Please enter in the information to make a new zone.
+
+
+
+ +
+
+ Name +
+
+ +
+
+ + +
+
+ DNS 1 +
+
+ +
+
+ + +
+
+ DNS 2 +
+
+ +
+
+ + +
+
+ Internal DNS 1 +
+
+ +
+
+ + +
+
+ Internal DNS 2 +
+
+ +
+
+ +
+ +
+
+ VLAN Range +
+
+ + - + +
+
+ + +
+
+ Guest CIDR +
+
+ +
+
+
+ + +
+
+ Public +
+
+ +
+
+ +
+ +
+
+ Domain +
+
+ +
+
+
+
+
+
+
+ + +
+
+
Please enter the following information to add a new pod
+
+
+ +
+
+ Name +
+
+ +
+
+ + +
+
+ Gateway +
+
+ +
+
+ + +
+
+ Netmask +
+
+ +
+
+ + +
+
+ Reserved IP +
+
+ + - + +
+
+
+
+
+
+ + +
+
+
Please add an IP range for your zone
+
+
+ +
+
+ VLAN +
+
+ +
+
+ + +
+
+ VLAN ID +
+
+ +
+
+ + +
+
+ Scope +
+
+ +
+
+ + +
+
+ Scope +
+
+ +
+
+ + + + + + + + +
+
+ Guest Gateway +
+
+ +
+
+ + +
+
+ Guest Netmask +
+
+ +
+
+ + +
+
+ Guest IP Range +
+
+ + - + +
+
+
+
+
+
+
+ + +
+ +
Cancel
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ Zones +
View more
+
+
    +
  • + Number of Zones + 0 +
  • +
  • + Number of Pods + 0 +
  • +
  • + Number of Clusters + 0 +
  • +
  • + Number of Hosts + 0 +
  • +
+
+ + +
+
+ Hosts +
View more
+
+
    +
  • + Total Hosts + 0 +
  • +
  • + Total CPU + 500 +
  • +
  • + Total Memory + 60 +
  • +
  • + Total Storage + 10 +
  • +
+
+
+ + +
+
+ + +
+
+ Network Resources +
Add
+
+
    +
  • +
    Zone:
    +
    Details
    +
  • +
  • +
    Pods
    +
    View All
    +
  • +
  • +
    Clusters
    +
    View All
    +
  • +
  • +
    Hosts
    +
    View All
    +
  • +
  • +
    Primary Storage
    +
    View All
    +
  • +
  • +
    Network
    +
    View All
    +
  • +
  • +
    Secondary Storage
    +
    View All
    +
  • +
+
+ + +
+
+ Service Resources +
Add
+
+
    +
  • +
    Item 1
    +
    Details
    +
  • +
  • +
    Item 2
    +
    View All
    +
  • +
  • +
    Item 3
    +
    View All
    +
  • +
  • +
    Item 4
    +
    View All
    +
  • +
+
+
+ + +
+ +
+
+
+ System-wide capacity +
+
+
+ + +
+
+ + +
+
+
+
+
    +
  • +
    Public IP Addresses
    +
    +
    + Allocated: 35 / 100 +
    +
    +
    +
    +
    +
    35%
    +
  • +
  • +
    Private IP Addresses
    +
    +
    + Allocated: 15 / 100 +
    +
    +
    +
    +
    +
    15%
    +
  • +
  • +
    Memory Allocated
    +
    +
    + Allocated: 23mb / 100mb +
    +
    +
    +
    +
    +
    23%
    +
  • +
  • +
    CPU Allocated
    +
    +
    + Allocated: 75 / 100 +
    +
    +
    +
    +
    +
    75%
    +
  • +
+
+
+ + +
+
+
General Alerts
+
view all
+
+
    +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
+
+ + +
+
+
Host Alerts
+
view all
+
+
    +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
  • +
    + Monitoring - Console Proxy +

    Unable to restart v-14-VM

    +
    +
  • +
+
+
+ + +
+
+
Virtual Machines
+ +
+
    +
  • +
    Running VMs
    +
    110
    +
  • +
  • +
    Stopped VMs
    +
    10
    +
  • +
  • +
    Total VMs
    +
    120
    +
  • +
+
+
+ +
+
    +
  • + + + + + + +
    Recent Errors
    +
    + + + + + + + + + + + + +
    Error 1Desc
    Error 2Desc
    Error 3Desc
    Error 4Desc
    Error 5Desc
    Error 6Desc
    Error 7Desc
    Error 7Desc
    Error 9Desc
    +
    +
  • + +
  • + + + + + + +
    IP Addresses
    + + + + + + + + + +
    +
    Available public IP addresses:
    +
    18
    +
    +
    Owned public IP addresses:
    +
    03
    +
    +
  • +
+
+
+ + +
+

Description

+ +
+

Schedule:

+ +
+ + + +
+
+ + + +
+
Time
+
+ + +
+
+ + +
+
Timezone
+
+ +
+
+ + +
+
Keep
+
+ + +
+
+
+
+ + +
+
+ + + +
+
Time
+
+ + + +
+
+ + +
+
Timezone
+
+ +
+
+ + +
+
Keep
+
+ + +
+
+
+
+ + +
+
+ + + +
+
Time
+
+ + + +
+
+ + +
+
Day of week
+
+ +
+
+ + +
+
Timezone
+
+ +
+
+ + +
+
Keep
+
+ + +
+
+
+
+ + +
+
+ + + +
+
Time
+
+ + + +
+
+ + +
+
Day of month
+
+ +
+
+ + +
+
Timezone
+
+ +
+
+ + +
+
Keep
+
+ + +
+
+
+
+
+ +
+
Add
+
+
+ + +
+

Scheduled Snapshots

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Time: min past the hrTimezone:
Keep:
 
Time: Timezone:
Keep:
 
Time: Every Timezone:
Keep:
 
Time: Day of monthTimezone:
Keep:
 
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/index.jsp b/ui/index.jsp index a22fdc4d589..a0d27f522a9 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1,972 +1,1451 @@ -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - -<% long now = System.currentTimeMillis(); %> - - + - - - - - - - - - + + CloudStack + + + + + +
- - - - - - - + +
+ + ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}); +c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c, +a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments); +a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%", +"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d* +((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/= +e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/= +e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h
").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.14 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.14 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], +10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.14 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.14 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/ui/lib/jquery.cookies.js b/ui/lib/jquery.cookies.js new file mode 100644 index 00000000000..6df1faca25f --- /dev/null +++ b/ui/lib/jquery.cookies.js @@ -0,0 +1,96 @@ +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // CAUTION: Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } +}; \ No newline at end of file diff --git a/ui/lib/jquery.easing.js b/ui/lib/jquery.easing.js new file mode 100644 index 00000000000..ef743210795 --- /dev/null +++ b/ui/lib/jquery.easing.js @@ -0,0 +1,205 @@ +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright © 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ \ No newline at end of file diff --git a/ui/lib/jquery.js b/ui/lib/jquery.js new file mode 100644 index 00000000000..5d5a1d58ee5 --- /dev/null +++ b/ui/lib/jquery.js @@ -0,0 +1,8936 @@ +/*! + * jQuery JavaScript Library v1.6.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu May 12 15:04:36 2011 -0400 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.6.1", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.done( fn ); + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery._Deferred(); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return (new Function( "return " + data ))(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + // (xml & tmp used internally) + parseXML: function( data , xml , tmp ) { + + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + + tmp = xml.documentElement; + + if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { + jQuery.error( "Invalid XML: " + data ); + } + + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + + if ( indexOf ) { + return indexOf.call( array, elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return jQuery; + +})(); + + +var // Promise methods + promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), + // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + // Create a simple deferred (one callbacks list) + _Deferred: function() { + var // callbacks list + callbacks = [], + // stored [ context , args ] + fired, + // to avoid firing when already doing so + firing, + // flag to know if the deferred has been cancelled + cancelled, + // the deferred itself + deferred = { + + // done( f1, f2, ...) + done: function() { + if ( !cancelled ) { + var args = arguments, + i, + length, + elem, + type, + _fired; + if ( fired ) { + _fired = fired; + fired = 0; + } + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + deferred.done.apply( deferred, elem ); + } else if ( type === "function" ) { + callbacks.push( elem ); + } + } + if ( _fired ) { + deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); + } + } + return this; + }, + + // resolve with given context and args + resolveWith: function( context, args ) { + if ( !cancelled && !fired && !firing ) { + // make sure args are available (#8421) + args = args || []; + firing = 1; + try { + while( callbacks[ 0 ] ) { + callbacks.shift().apply( context, args ); + } + } + finally { + fired = [ context, args ]; + firing = 0; + } + } + return this; + }, + + // resolve with this as context and given arguments + resolve: function() { + deferred.resolveWith( this, arguments ); + return this; + }, + + // Has this deferred been resolved? + isResolved: function() { + return !!( firing || fired ); + }, + + // Cancel + cancel: function() { + cancelled = 1; + callbacks = []; + return this; + } + }; + + return deferred; + }, + + // Full fledged deferred (two callbacks list) + Deferred: function( func ) { + var deferred = jQuery._Deferred(), + failDeferred = jQuery._Deferred(), + promise; + // Add errorDeferred methods, then and promise + jQuery.extend( deferred, { + then: function( doneCallbacks, failCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ); + return this; + }, + always: function() { + return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); + }, + fail: failDeferred.done, + rejectWith: failDeferred.resolveWith, + reject: failDeferred.resolve, + isRejected: failDeferred.isResolved, + pipe: function( fnDone, fnFail ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject ); + } else { + newDefer[ action ]( returned ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + if ( promise ) { + return promise; + } + promise = obj = {}; + } + var i = promiseMethods.length; + while( i-- ) { + obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; + } + return obj; + } + }); + // Make sure only one callback list will be used + deferred.done( failDeferred.cancel ).fail( deferred.cancel ); + // Unexpose cancel + delete deferred.cancel; + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = arguments, + i = 0, + length = args.length, + count = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + // Strange bug in FF4: + // Values changed onto the arguments object sometimes end up as undefined values + // outside the $.when method. Cloning the object into a fresh array solves the issue + deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); + } + }; + } + if ( length > 1 ) { + for( ; i < length; i++ ) { + if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return deferred.promise(); + } +}); + + + +jQuery.support = (function() { + + var div = document.createElement( "div" ), + documentElement = document.documentElement, + all, + a, + select, + opt, + input, + marginDiv, + support, + fragment, + body, + bodyStyle, + tds, + events, + eventName, + i, + isSupported; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName( "tbody" ).length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName( "link" ).length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + div.detachEvent( "onclick", click ); + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains it's value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + div.innerHTML = ""; + + // Figure out if the W3C box model works as expected + div.style.width = div.style.paddingLeft = "1px"; + + // We use our own, invisible, body + body = document.createElement( "body" ); + bodyStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + // Set background to avoid IE crashes when removing (#9028) + background: "none" + }; + for ( i in bodyStyle ) { + body.style[ i ] = bodyStyle[ i ]; + } + body.appendChild( div ); + documentElement.insertBefore( body, documentElement.firstChild ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); + } + + div.innerHTML = "
t
"; + tds = div.getElementsByTagName( "td" ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + div.innerHTML = ""; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( document.defaultView && document.defaultView.getComputedStyle ) { + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + // Remove the body element we added + body.innerHTML = ""; + documentElement.removeChild( body ); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for( i in { + submit: 1, + change: 1, + focusin: 1 + } ) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + return support; +})(); + +// Keep track of boxModel +jQuery.boxModel = jQuery.support.boxModel; + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([a-z])([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } else { + id = jQuery.expando; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); + } else { + cache[ id ] = jQuery.extend(cache[ id ], name); + } + } + + thisCache = cache[ id ]; + + // Internal jQuery data is stored in a separate object inside the object's data + // cache in order to avoid key collisions between internal data and user-defined + // data + if ( pvt ) { + if ( !thisCache[ internalKey ] ) { + thisCache[ internalKey ] = {}; + } + + thisCache = thisCache[ internalKey ]; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should + // not attempt to inspect the internal events object using jQuery.data, as this + // internal data object is undocumented and subject to change. + if ( name === "events" && !thisCache[name] ) { + return thisCache[ internalKey ] && thisCache[ internalKey ].events; + } + + return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; + + if ( thisCache ) { + delete thisCache[ name ]; + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !isEmptyDataObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( pvt ) { + delete cache[ id ][ internalKey ]; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + var internalCache = cache[ id ][ internalKey ]; + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + if ( jQuery.support.deleteExpando || cache != window ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the entire user cache at once because it's faster than + // iterating through each key, but we need to continue to persist internal + // data if it existed + if ( internalCache ) { + cache[ id ] = {}; + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + + cache[ id ][ internalKey ] = internalCache; + + // Otherwise, we need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + } else if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } else { + elem[ jQuery.expando ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 ) { + var attr = this[0].attributes, name; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( this[0], name, data[ name ] ); + } + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON +// property to be considered empty objects; this property always exists in +// order to make sure JSON.stringify does not expose internal metadata +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery.data( elem, deferDataKey, undefined, true ); + if ( defer && + ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && + ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery.data( elem, queueDataKey, undefined, true ) && + !jQuery.data( elem, markDataKey, undefined, true ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.resolve(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = (type || "fx") + "mark"; + jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); + if ( count ) { + jQuery.data( elem, key, count, true ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + if ( elem ) { + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type, undefined, true ); + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data), true ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + defer; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { + count++; + tmp.done( resolve ); + } + } + resolve(); + return defer.promise(); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + rinvalidChar = /\:/, + formHook, boolHook; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.prop ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class") || "") ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + return (elem.value || "").replace(rreturn, ""); + } + + return undefined; + } + + var isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attrFix: { + // Always normalize to ensure hook usage + tabindex: "tabIndex" + }, + + attr: function( elem, name, value, pass ) { + var nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( !("getAttribute" in elem) ) { + return jQuery.prop( elem, name, value ); + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // Normalize the name if needed + name = notxml && jQuery.attrFix[ name ] || name; + + hooks = jQuery.attrHooks[ name ]; + + if ( !hooks ) { + // Use boolHook for boolean attributes + if ( rboolean.test( name ) && + (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) { + + hooks = boolHook; + + // Use formHook for forms and if the name contains certain characters + } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { + hooks = formHook; + } + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return undefined; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml ) { + return hooks.get( elem, name ); + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, name ) { + var propName; + if ( elem.nodeType === 1 ) { + name = jQuery.attrFix[ name ] || name; + + if ( jQuery.support.getSetAttribute ) { + // Use removeAttribute in browsers that support it + elem.removeAttribute( name ); + } else { + jQuery.attr( elem, name, "" ); + elem.removeAttributeNode( elem.getAttributeNode( name ) ); + } + + // Set corresponding property to false for boolean attributes + if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { + elem[ propName ] = false; + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabIndex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // Try to normalize/fix the name + name = notxml && jQuery.propFix[ name ] || name; + + hooks = jQuery.propHooks[ name ]; + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return (elem[ name ] = value); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: {} +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + return elem[ jQuery.propFix[ name ] || name ] ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = value; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// Use the value property for back compat +// Use the formHook for button elements in IE6/7 (#1954) +jQuery.attrHooks.value = { + get: function( elem, name ) { + if ( formHook && jQuery.nodeName( elem, "button" ) ) { + return formHook.get( elem, name ); + } + return elem.value; + }, + set: function( elem, value, name ) { + if ( formHook && jQuery.nodeName( elem, "button" ) ) { + return formHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !jQuery.support.getSetAttribute ) { + + // propFix is more comprehensive and contains all fixes + jQuery.attrFix = jQuery.propFix; + + // Use this for any attribute on a form in IE6/7 + formHook = jQuery.attrHooks.name = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + // Return undefined if nodeValue is empty string + return ret && ret.nodeValue !== "" ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Check form objects in IE (multiple bugs related) + // Only use nodeValue if the attribute node exists on the form + var ret = elem.getAttributeNode( name ); + if ( ret ) { + ret.nodeValue = value; + return value; + } + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return (elem.style.cssText = "" + value); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }); +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); + } + } + }); +}); + + + + +var hasOwn = Object.prototype.hasOwnProperty, + rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspaces = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery._data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events, + eventHandle = elemData.handle; + + if ( !events ) { + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem, undefined, true ); + } + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Event object or event type + var type = event.type || event, + namespaces = [], + exclusive; + + if ( type.indexOf("!") >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.exclusive = exclusive; + event.namespace = namespaces.join("."); + event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); + + // triggerHandler() and global events don't bubble or run the default action + if ( onlyHandlers || !elem ) { + event.preventDefault(); + event.stopPropagation(); + } + + // Handle a global trigger + if ( !elem ) { + // TODO: Stop taunting the data cache; remove global events and always attach to document + jQuery.each( jQuery.cache, function() { + // internalKey variable is just used to make it easier to find + // and potentially change this stuff later; currently it just + // points to jQuery.expando + var internalKey = jQuery.expando, + internalCache = this[ internalKey ]; + if ( internalCache && internalCache.events && internalCache.events[ type ] ) { + jQuery.event.trigger( event, data, internalCache.handle.elem ); + } + }); + return; + } + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + event.target = elem; + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + var cur = elem, + // IE doesn't like method names with a colon (#3533, #8272) + ontype = type.indexOf(":") < 0 ? "on" + type : ""; + + // Fire event on the current element, then bubble up the DOM tree + do { + var handle = jQuery._data( cur, "handle" ); + + event.currentTarget = cur; + if ( handle ) { + handle.apply( cur, data ); + } + + // Trigger an inline bound script + if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { + event.result = false; + event.preventDefault(); + } + + // Bubble up to document, then to window + cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; + } while ( cur && !event.isPropagationStopped() ); + + // If nobody prevented the default action, do it now + if ( !event.isDefaultPrevented() ) { + var old, + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction)() check here because IE6/7 fails that test. + // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. + try { + if ( ontype && elem[ type ] ) { + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + jQuery.event.triggered = type; + elem[ type ](); + } + } catch ( ieError ) {} + + if ( old ) { + elem[ ontype ] = old; + } + + jQuery.event.triggered = undefined; + } + } + + return event.result; + }, + + handle: function( event ) { + event = jQuery.event.fix( event || window.event ); + // Snapshot the handlers list since a called handler may add/remove events. + var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), + run_all = !event.exclusive && !event.namespace, + args = Array.prototype.slice.call( arguments, 0 ); + + // Use the fix-ed Event rather than the (read-only) native event + args[0] = event; + event.currentTarget = this; + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Triggered event must 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event. + if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var eventDocument = event.target.ownerDocument || document, + doc = eventDocument.documentElement, + body = eventDocument.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // set the correct event type + event.type = event.data; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + + // Chrome does something similar, the parentNode property + // can be accessed but is null. + if ( parent && parent !== document && !parent.parentNode ) { + return; + } + + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( !jQuery.nodeName( this, "form" ) ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( jQuery.nodeName( elem, "select" ) ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery._data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery._data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { + testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery._data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + // Don't pass args or remember liveFired; they apply to the donor event. + var event = jQuery.extend( {}, args[ 0 ] ); + event.type = type; + event.originalEvent = {}; + event.liveFired = undefined; + jQuery.event.handle.call( elem, event ); + if ( event.isDefaultPrevented() ) { + args[ 0 ].preventDefault(); + } +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( donor ) { + // Donor event is always a native one; fix it and switch its type. + // Let focusin/out handler cancel the donor focus/blur event. + var e = jQuery.event.fix( donor ); + e.type = fix; + e.originalEvent = {}; + jQuery.event.trigger( e, null, e.target ); + if ( e.isDefaultPrevented() ) { + donor.preventDefault(); + } + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + var handler; + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( arguments.length === 2 || data === false ) { + fn = data; + data = undefined; + } + + if ( name === "one" ) { + handler = function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }; + handler.guid = fn.guid || jQuery.guid++; + } else { + handler = fn; + } + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( name === "die" && !types && + origSelector && origSelector.charAt(0) === "." ) { + + context.unbind( origSelector ); + + return this; + } + + if ( data === false || jQuery.isFunction( data ) ) { + fn = data || returnFalse; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( liveMap[ type ] ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery._data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) + if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + + // Make sure not to accidentally match a child element with the same selector + if ( related && jQuery.contains( elem, related ) ) { + related = elem; + } + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( typeof selector === "string" ? + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[ selector ] ) { + matches[ selector ] = POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[ selector ]; + + if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ), + // The variable 'args' was introduced in + // https://github.com/jquery/jquery/commit/52a0238 + // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. + // http://code.google.com/p/v8/issues/detail?id=1050 + args = slice.call(arguments); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, args.join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <fmt:message key="label.cloud.console"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/jsp/account.jsp b/ui/old/jsp/account.jsp similarity index 100% rename from ui/jsp/account.jsp rename to ui/old/jsp/account.jsp diff --git a/ui/jsp/alert.jsp b/ui/old/jsp/alert.jsp similarity index 100% rename from ui/jsp/alert.jsp rename to ui/old/jsp/alert.jsp diff --git a/ui/jsp/cluster.jsp b/ui/old/jsp/cluster.jsp similarity index 100% rename from ui/jsp/cluster.jsp rename to ui/old/jsp/cluster.jsp diff --git a/ui/jsp/dashboard.jsp b/ui/old/jsp/dashboard.jsp similarity index 100% rename from ui/jsp/dashboard.jsp rename to ui/old/jsp/dashboard.jsp diff --git a/ui/jsp/diskoffering.jsp b/ui/old/jsp/diskoffering.jsp similarity index 100% rename from ui/jsp/diskoffering.jsp rename to ui/old/jsp/diskoffering.jsp diff --git a/ui/jsp/domain.jsp b/ui/old/jsp/domain.jsp similarity index 100% rename from ui/jsp/domain.jsp rename to ui/old/jsp/domain.jsp diff --git a/ui/jsp/event.jsp b/ui/old/jsp/event.jsp similarity index 100% rename from ui/jsp/event.jsp rename to ui/old/jsp/event.jsp diff --git a/ui/jsp/globalsetting.jsp b/ui/old/jsp/globalsetting.jsp similarity index 100% rename from ui/jsp/globalsetting.jsp rename to ui/old/jsp/globalsetting.jsp diff --git a/ui/jsp/host.jsp b/ui/old/jsp/host.jsp similarity index 100% rename from ui/jsp/host.jsp rename to ui/old/jsp/host.jsp diff --git a/ui/jsp/instance.jsp b/ui/old/jsp/instance.jsp similarity index 100% rename from ui/jsp/instance.jsp rename to ui/old/jsp/instance.jsp diff --git a/ui/jsp/ipaddress.jsp b/ui/old/jsp/ipaddress.jsp similarity index 100% rename from ui/jsp/ipaddress.jsp rename to ui/old/jsp/ipaddress.jsp diff --git a/ui/jsp/iso.jsp b/ui/old/jsp/iso.jsp similarity index 100% rename from ui/jsp/iso.jsp rename to ui/old/jsp/iso.jsp diff --git a/ui/jsp/network.jsp b/ui/old/jsp/network.jsp similarity index 100% rename from ui/jsp/network.jsp rename to ui/old/jsp/network.jsp diff --git a/ui/jsp/networkoffering.jsp b/ui/old/jsp/networkoffering.jsp similarity index 100% rename from ui/jsp/networkoffering.jsp rename to ui/old/jsp/networkoffering.jsp diff --git a/ui/jsp/pod.jsp b/ui/old/jsp/pod.jsp similarity index 100% rename from ui/jsp/pod.jsp rename to ui/old/jsp/pod.jsp diff --git a/ui/jsp/primarystorage.jsp b/ui/old/jsp/primarystorage.jsp similarity index 100% rename from ui/jsp/primarystorage.jsp rename to ui/old/jsp/primarystorage.jsp diff --git a/ui/jsp/resource.jsp b/ui/old/jsp/resource.jsp similarity index 100% rename from ui/jsp/resource.jsp rename to ui/old/jsp/resource.jsp diff --git a/ui/jsp/router.jsp b/ui/old/jsp/router.jsp similarity index 100% rename from ui/jsp/router.jsp rename to ui/old/jsp/router.jsp diff --git a/ui/jsp/secondarystorage.jsp b/ui/old/jsp/secondarystorage.jsp similarity index 100% rename from ui/jsp/secondarystorage.jsp rename to ui/old/jsp/secondarystorage.jsp diff --git a/ui/jsp/securitygroup.jsp b/ui/old/jsp/securitygroup.jsp similarity index 100% rename from ui/jsp/securitygroup.jsp rename to ui/old/jsp/securitygroup.jsp diff --git a/ui/jsp/serviceoffering.jsp b/ui/old/jsp/serviceoffering.jsp similarity index 100% rename from ui/jsp/serviceoffering.jsp rename to ui/old/jsp/serviceoffering.jsp diff --git a/ui/jsp/snapshot.jsp b/ui/old/jsp/snapshot.jsp similarity index 100% rename from ui/jsp/snapshot.jsp rename to ui/old/jsp/snapshot.jsp diff --git a/ui/jsp/systemserviceoffering.jsp b/ui/old/jsp/systemserviceoffering.jsp similarity index 100% rename from ui/jsp/systemserviceoffering.jsp rename to ui/old/jsp/systemserviceoffering.jsp diff --git a/ui/jsp/systemvm.jsp b/ui/old/jsp/systemvm.jsp similarity index 100% rename from ui/jsp/systemvm.jsp rename to ui/old/jsp/systemvm.jsp diff --git a/ui/jsp/template.jsp b/ui/old/jsp/template.jsp similarity index 100% rename from ui/jsp/template.jsp rename to ui/old/jsp/template.jsp diff --git a/ui/jsp/volume.jsp b/ui/old/jsp/volume.jsp similarity index 100% rename from ui/jsp/volume.jsp rename to ui/old/jsp/volume.jsp diff --git a/ui/jsp/zone.jsp b/ui/old/jsp/zone.jsp similarity index 100% rename from ui/jsp/zone.jsp rename to ui/old/jsp/zone.jsp diff --git a/ui/scripts/cloud.core.account.js b/ui/old/scripts/cloud.core.account.js similarity index 100% rename from ui/scripts/cloud.core.account.js rename to ui/old/scripts/cloud.core.account.js diff --git a/ui/scripts/cloud.core.alert.js b/ui/old/scripts/cloud.core.alert.js similarity index 100% rename from ui/scripts/cloud.core.alert.js rename to ui/old/scripts/cloud.core.alert.js diff --git a/ui/old/scripts/cloud.core.callbacks.js b/ui/old/scripts/cloud.core.callbacks.js new file mode 100644 index 00000000000..42ebaf75209 --- /dev/null +++ b/ui/old/scripts/cloud.core.callbacks.js @@ -0,0 +1,75 @@ + /** + * Copyright (C) 2010 Cloud.com, Inc. All rights reserved. + * + * This software is licensed under the GNU General Public License v3 or later. + * + * It is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +$.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;} + +/* +This file is meant to help with implementing single signon integration. If you are using the +cloud.com default UI, there is no need to touch this file. +*/ + +/* +This callback function is called when either the session has timed out for the user, +the session ID has been changed (i.e. another user logging into the UI via a different tab), +or it's the first time the user has come to this page. +*/ +function onLogoutCallback() { + // Returning true means the LOGIN page will be show. If you wish to redirect the user + // to different login page, this is where you would do that. + g_loginResponse = null; + return true; +} + +var g_loginResponse = null; + +/* +For single signon purposes, you just need to make sure that after a successful login, you set the +global variable "g_loginResponse" + +You can also pass in a special param called loginUrl that is pregenerated and sent to the CloudStack, it will +automatically log you in. + +Below is a sample login attempt +*/ + +var clientApiUrl = "/client/api"; +var clientConsoleUrl = "/client/console"; + +$(document).ready(function() { + + var url = $.urlParam("loginUrl"); + if (url != undefined && url != null && url.length > 0) { + url = unescape(clientApiUrl+"?"+url); + $.ajax({ + url: url, + dataType: "json", + async: false, + success: function(json) { + g_loginResponse = json.loginresponse; + }, + error: function() { + onLogoutCallback(); + // This means the login failed. You should redirect to your login page. + }, + beforeSend: function(XMLHttpRequest) { + return true; + } + }); + } +}); + + diff --git a/ui/scripts/cloud.core.cluster.js b/ui/old/scripts/cloud.core.cluster.js similarity index 100% rename from ui/scripts/cloud.core.cluster.js rename to ui/old/scripts/cloud.core.cluster.js diff --git a/ui/scripts/cloud.core.dashboard.js b/ui/old/scripts/cloud.core.dashboard.js similarity index 100% rename from ui/scripts/cloud.core.dashboard.js rename to ui/old/scripts/cloud.core.dashboard.js diff --git a/ui/scripts/cloud.core.diskoffering.js b/ui/old/scripts/cloud.core.diskoffering.js similarity index 100% rename from ui/scripts/cloud.core.diskoffering.js rename to ui/old/scripts/cloud.core.diskoffering.js diff --git a/ui/scripts/cloud.core.domain.js b/ui/old/scripts/cloud.core.domain.js similarity index 100% rename from ui/scripts/cloud.core.domain.js rename to ui/old/scripts/cloud.core.domain.js diff --git a/ui/scripts/cloud.core.event.js b/ui/old/scripts/cloud.core.event.js similarity index 100% rename from ui/scripts/cloud.core.event.js rename to ui/old/scripts/cloud.core.event.js diff --git a/ui/scripts/cloud.core.globalsetting.js b/ui/old/scripts/cloud.core.globalsetting.js similarity index 100% rename from ui/scripts/cloud.core.globalsetting.js rename to ui/old/scripts/cloud.core.globalsetting.js diff --git a/ui/scripts/cloud.core.host.js b/ui/old/scripts/cloud.core.host.js similarity index 100% rename from ui/scripts/cloud.core.host.js rename to ui/old/scripts/cloud.core.host.js diff --git a/ui/scripts/cloud.core.init.js b/ui/old/scripts/cloud.core.init.js similarity index 100% rename from ui/scripts/cloud.core.init.js rename to ui/old/scripts/cloud.core.init.js diff --git a/ui/scripts/cloud.core.instance.js b/ui/old/scripts/cloud.core.instance.js similarity index 100% rename from ui/scripts/cloud.core.instance.js rename to ui/old/scripts/cloud.core.instance.js diff --git a/ui/scripts/cloud.core.ipaddress.js b/ui/old/scripts/cloud.core.ipaddress.js similarity index 100% rename from ui/scripts/cloud.core.ipaddress.js rename to ui/old/scripts/cloud.core.ipaddress.js diff --git a/ui/scripts/cloud.core.iso.js b/ui/old/scripts/cloud.core.iso.js similarity index 100% rename from ui/scripts/cloud.core.iso.js rename to ui/old/scripts/cloud.core.iso.js diff --git a/ui/scripts/cloud.core.js b/ui/old/scripts/cloud.core.js similarity index 100% rename from ui/scripts/cloud.core.js rename to ui/old/scripts/cloud.core.js diff --git a/ui/scripts/cloud.core.network.js b/ui/old/scripts/cloud.core.network.js similarity index 100% rename from ui/scripts/cloud.core.network.js rename to ui/old/scripts/cloud.core.network.js diff --git a/ui/scripts/cloud.core.networkoffering.js b/ui/old/scripts/cloud.core.networkoffering.js similarity index 100% rename from ui/scripts/cloud.core.networkoffering.js rename to ui/old/scripts/cloud.core.networkoffering.js diff --git a/ui/scripts/cloud.core.pod.js b/ui/old/scripts/cloud.core.pod.js similarity index 100% rename from ui/scripts/cloud.core.pod.js rename to ui/old/scripts/cloud.core.pod.js diff --git a/ui/scripts/cloud.core.primarystorage.js b/ui/old/scripts/cloud.core.primarystorage.js similarity index 100% rename from ui/scripts/cloud.core.primarystorage.js rename to ui/old/scripts/cloud.core.primarystorage.js diff --git a/ui/scripts/cloud.core.resource.js b/ui/old/scripts/cloud.core.resource.js similarity index 100% rename from ui/scripts/cloud.core.resource.js rename to ui/old/scripts/cloud.core.resource.js diff --git a/ui/scripts/cloud.core.router.js b/ui/old/scripts/cloud.core.router.js similarity index 100% rename from ui/scripts/cloud.core.router.js rename to ui/old/scripts/cloud.core.router.js diff --git a/ui/scripts/cloud.core.secondarystorage.js b/ui/old/scripts/cloud.core.secondarystorage.js similarity index 100% rename from ui/scripts/cloud.core.secondarystorage.js rename to ui/old/scripts/cloud.core.secondarystorage.js diff --git a/ui/scripts/cloud.core.securitygroup.js b/ui/old/scripts/cloud.core.securitygroup.js similarity index 100% rename from ui/scripts/cloud.core.securitygroup.js rename to ui/old/scripts/cloud.core.securitygroup.js diff --git a/ui/scripts/cloud.core.serviceoffering.js b/ui/old/scripts/cloud.core.serviceoffering.js similarity index 100% rename from ui/scripts/cloud.core.serviceoffering.js rename to ui/old/scripts/cloud.core.serviceoffering.js diff --git a/ui/scripts/cloud.core.snapshot.js b/ui/old/scripts/cloud.core.snapshot.js similarity index 100% rename from ui/scripts/cloud.core.snapshot.js rename to ui/old/scripts/cloud.core.snapshot.js diff --git a/ui/scripts/cloud.core.systemserviceoffering.js b/ui/old/scripts/cloud.core.systemserviceoffering.js similarity index 100% rename from ui/scripts/cloud.core.systemserviceoffering.js rename to ui/old/scripts/cloud.core.systemserviceoffering.js diff --git a/ui/scripts/cloud.core.systemvm.js b/ui/old/scripts/cloud.core.systemvm.js similarity index 100% rename from ui/scripts/cloud.core.systemvm.js rename to ui/old/scripts/cloud.core.systemvm.js diff --git a/ui/scripts/cloud.core.template.js b/ui/old/scripts/cloud.core.template.js similarity index 100% rename from ui/scripts/cloud.core.template.js rename to ui/old/scripts/cloud.core.template.js diff --git a/ui/scripts/cloud.core.volume.js b/ui/old/scripts/cloud.core.volume.js similarity index 100% rename from ui/scripts/cloud.core.volume.js rename to ui/old/scripts/cloud.core.volume.js diff --git a/ui/scripts/cloud.core.zone.js b/ui/old/scripts/cloud.core.zone.js similarity index 100% rename from ui/scripts/cloud.core.zone.js rename to ui/old/scripts/cloud.core.zone.js diff --git a/ui/scripts/cloud.logger.js b/ui/old/scripts/cloud.logger.js similarity index 100% rename from ui/scripts/cloud.logger.js rename to ui/old/scripts/cloud.logger.js diff --git a/ui/scripts/cloud.widget.tab.js b/ui/old/scripts/cloud.widget.tab.js similarity index 100% rename from ui/scripts/cloud.widget.tab.js rename to ui/old/scripts/cloud.widget.tab.js diff --git a/ui/scripts/date.js b/ui/old/scripts/date.js similarity index 100% rename from ui/scripts/date.js rename to ui/old/scripts/date.js diff --git a/ui/scripts/jquery-ui.custom.min.js b/ui/old/scripts/jquery-ui.custom.min.js similarity index 100% rename from ui/scripts/jquery-ui.custom.min.js rename to ui/old/scripts/jquery-ui.custom.min.js diff --git a/ui/scripts/jquery.cookies.js b/ui/old/scripts/jquery.cookies.js similarity index 100% rename from ui/scripts/jquery.cookies.js rename to ui/old/scripts/jquery.cookies.js diff --git a/ui/scripts/jquery.md5.js b/ui/old/scripts/jquery.md5.js similarity index 100% rename from ui/scripts/jquery.md5.js rename to ui/old/scripts/jquery.md5.js diff --git a/ui/scripts/jquery.min.js b/ui/old/scripts/jquery.min.js similarity index 100% rename from ui/scripts/jquery.min.js rename to ui/old/scripts/jquery.min.js diff --git a/ui/old/scripts/jquery.timers.js b/ui/old/scripts/jquery.timers.js new file mode 100755 index 00000000000..bb51157d405 --- /dev/null +++ b/ui/old/scripts/jquery.timers.js @@ -0,0 +1,138 @@ +/** + * jQuery.timers - Timer abstractions for jQuery + * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) + * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). + * Date: 2009/10/16 + * + * @author Blair Mitchelmore + * @version 1.2 + * + **/ + +jQuery.fn.extend({ + everyTime: function(interval, label, fn, times) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, times); + }); + }, + oneTime: function(interval, label, fn) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, 1); + }); + }, + stopTime: function(label, fn) { + return this.each(function() { + jQuery.timer.remove(this, label, fn); + }); + } +}); + +jQuery.extend({ + timer: { + global: [], + guid: 1, + dataKey: "jQuery.timer", + regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, + powers: { + // Yeah this is major overkill... + 'ms': 1, + 'cs': 10, + 'ds': 100, + 's': 1000, + 'das': 10000, + 'hs': 100000, + 'ks': 1000000 + }, + timeParse: function(value) { + if (value == undefined || value == null) + return null; + var result = this.regex.exec(jQuery.trim(value.toString())); + if (result[2]) { + var num = parseFloat(result[1]); + var mult = this.powers[result[2]] || 1; + return num * mult; + } else { + return value; + } + }, + add: function(element, interval, label, fn, times) { + var counter = 0; + + if (jQuery.isFunction(label)) { + if (!times) + times = fn; + fn = label; + label = interval; + } + + interval = jQuery.timer.timeParse(interval); + + if (typeof interval != 'number' || isNaN(interval) || interval < 0) + return; + + if (typeof times != 'number' || isNaN(times) || times < 0) + times = 0; + + times = times || 0; + + var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); + + if (!timers[label]) + timers[label] = {}; + + fn.timerID = fn.timerID || this.guid++; + + var handler = function() { + if ((++counter > times && times !== 0) || fn.call(element, counter) === false) + jQuery.timer.remove(element, label, fn); + }; + + handler.timerID = fn.timerID; + + if (!timers[label][fn.timerID]) + timers[label][fn.timerID] = window.setInterval(handler,interval); + + this.global.push( element ); + + }, + remove: function(element, label, fn) { + var timers = jQuery.data(element, this.dataKey), ret; + + if ( timers ) { + + if (!label) { + for ( label in timers ) + this.remove(element, label, fn); + } else if ( timers[label] ) { + if ( fn ) { + if ( fn.timerID ) { + window.clearInterval(timers[label][fn.timerID]); + delete timers[label][fn.timerID]; + } + } else { + for ( var fn in timers[label] ) { + window.clearInterval(timers[label][fn]); + delete timers[label][fn]; + } + } + + for ( ret in timers[label] ) break; + if ( !ret ) { + ret = null; + delete timers[label]; + } + } + + for ( ret in timers ) break; + if ( !ret ) + jQuery.removeData(element, this.dataKey); + } + } + } +}); + +jQuery(window).bind("unload", function() { + jQuery.each(jQuery.timer.global, function(index, item) { + jQuery.timer.remove(item); + }); +}); diff --git a/ui/test/content/tab_test.html b/ui/old/test/content/tab_test.html similarity index 100% rename from ui/test/content/tab_test.html rename to ui/old/test/content/tab_test.html diff --git a/ui/test/css/cloud_custom.css b/ui/old/test/css/cloud_custom.css similarity index 100% rename from ui/test/css/cloud_custom.css rename to ui/old/test/css/cloud_custom.css diff --git a/ui/test/css/images/alert_icon.png b/ui/old/test/css/images/alert_icon.png similarity index 100% rename from ui/test/css/images/alert_icon.png rename to ui/old/test/css/images/alert_icon.png diff --git a/ui/test/css/images/clr_button.gif b/ui/old/test/css/images/clr_button.gif similarity index 100% rename from ui/test/css/images/clr_button.gif rename to ui/old/test/css/images/clr_button.gif diff --git a/ui/test/css/images/clr_button_hover.gif b/ui/old/test/css/images/clr_button_hover.gif similarity index 100% rename from ui/test/css/images/clr_button_hover.gif rename to ui/old/test/css/images/clr_button_hover.gif diff --git a/ui/test/css/images/comment_loader.gif b/ui/old/test/css/images/comment_loader.gif similarity index 100% rename from ui/test/css/images/comment_loader.gif rename to ui/old/test/css/images/comment_loader.gif diff --git a/ui/test/css/images/grid_headerbg.gif b/ui/old/test/css/images/grid_headerbg.gif similarity index 100% rename from ui/test/css/images/grid_headerbg.gif rename to ui/old/test/css/images/grid_headerbg.gif diff --git a/ui/test/css/images/groupbox_top.gif b/ui/old/test/css/images/groupbox_top.gif similarity index 100% rename from ui/test/css/images/groupbox_top.gif rename to ui/old/test/css/images/groupbox_top.gif diff --git a/ui/test/css/images/minimize_button.gif b/ui/old/test/css/images/minimize_button.gif similarity index 100% rename from ui/test/css/images/minimize_button.gif rename to ui/old/test/css/images/minimize_button.gif diff --git a/ui/test/css/images/minimize_button_hover.gif b/ui/old/test/css/images/minimize_button_hover.gif similarity index 100% rename from ui/test/css/images/minimize_button_hover.gif rename to ui/old/test/css/images/minimize_button_hover.gif diff --git a/ui/test/css/images/play_button.gif b/ui/old/test/css/images/play_button.gif similarity index 100% rename from ui/test/css/images/play_button.gif rename to ui/old/test/css/images/play_button.gif diff --git a/ui/test/css/images/play_button_hover.gif b/ui/old/test/css/images/play_button_hover.gif similarity index 100% rename from ui/test/css/images/play_button_hover.gif rename to ui/old/test/css/images/play_button_hover.gif diff --git a/ui/test/css/images/shrink_button.gif b/ui/old/test/css/images/shrink_button.gif similarity index 100% rename from ui/test/css/images/shrink_button.gif rename to ui/old/test/css/images/shrink_button.gif diff --git a/ui/test/css/images/shrink_button_hover.gif b/ui/old/test/css/images/shrink_button_hover.gif similarity index 100% rename from ui/test/css/images/shrink_button_hover.gif rename to ui/old/test/css/images/shrink_button_hover.gif diff --git a/ui/test/css/images/sortable_groupbox.gif b/ui/old/test/css/images/sortable_groupbox.gif similarity index 100% rename from ui/test/css/images/sortable_groupbox.gif rename to ui/old/test/css/images/sortable_groupbox.gif diff --git a/ui/test/css/images/sortable_leftarrow.gif b/ui/old/test/css/images/sortable_leftarrow.gif similarity index 100% rename from ui/test/css/images/sortable_leftarrow.gif rename to ui/old/test/css/images/sortable_leftarrow.gif diff --git a/ui/test/css/images/sortable_leftarrow_hover.gif b/ui/old/test/css/images/sortable_leftarrow_hover.gif similarity index 100% rename from ui/test/css/images/sortable_leftarrow_hover.gif rename to ui/old/test/css/images/sortable_leftarrow_hover.gif diff --git a/ui/test/css/images/sortable_rightarrow.gif b/ui/old/test/css/images/sortable_rightarrow.gif similarity index 100% rename from ui/test/css/images/sortable_rightarrow.gif rename to ui/old/test/css/images/sortable_rightarrow.gif diff --git a/ui/test/css/images/sortable_rightarrow_hover.gif b/ui/old/test/css/images/sortable_rightarrow_hover.gif similarity index 100% rename from ui/test/css/images/sortable_rightarrow_hover.gif rename to ui/old/test/css/images/sortable_rightarrow_hover.gif diff --git a/ui/test/css/images/stop_button.gif b/ui/old/test/css/images/stop_button.gif similarity index 100% rename from ui/test/css/images/stop_button.gif rename to ui/old/test/css/images/stop_button.gif diff --git a/ui/test/css/images/stop_button_hover.gif b/ui/old/test/css/images/stop_button_hover.gif similarity index 100% rename from ui/test/css/images/stop_button_hover.gif rename to ui/old/test/css/images/stop_button_hover.gif diff --git a/ui/test/css/images/ui-bg_errorglass_30_ffffff_1x400.png b/ui/old/test/css/images/ui-bg_errorglass_30_ffffff_1x400.png similarity index 100% rename from ui/test/css/images/ui-bg_errorglass_30_ffffff_1x400.png rename to ui/old/test/css/images/ui-bg_errorglass_30_ffffff_1x400.png diff --git a/ui/old/test/css/images/ui-bg_flat_0_aaaaaa_40x100.png b/ui/old/test/css/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 00000000000..5b5dab2ab7b Binary files /dev/null and b/ui/old/test/css/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/ui/old/test/css/images/ui-bg_flat_75_ffffff_40x100.png b/ui/old/test/css/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 00000000000..ac8b229af95 Binary files /dev/null and b/ui/old/test/css/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/ui/test/css/images/ui-bg_glass_30_393939_1x400.png b/ui/old/test/css/images/ui-bg_glass_30_393939_1x400.png similarity index 100% rename from ui/test/css/images/ui-bg_glass_30_393939_1x400.png rename to ui/old/test/css/images/ui-bg_glass_30_393939_1x400.png diff --git a/ui/test/css/images/ui-bg_glass_30_ffffff_1x400.png b/ui/old/test/css/images/ui-bg_glass_30_ffffff_1x400.png similarity index 100% rename from ui/test/css/images/ui-bg_glass_30_ffffff_1x400.png rename to ui/old/test/css/images/ui-bg_glass_30_ffffff_1x400.png diff --git a/ui/old/test/css/images/ui-bg_glass_55_fbf9ee_1x400.png b/ui/old/test/css/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 00000000000..ad3d6346e00 Binary files /dev/null and b/ui/old/test/css/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/ui/old/test/css/images/ui-bg_glass_65_ffffff_1x400.png b/ui/old/test/css/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 00000000000..42ccba269b6 Binary files /dev/null and b/ui/old/test/css/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/ui/test/css/images/ui-bg_glass_75_000000_1x400.png b/ui/old/test/css/images/ui-bg_glass_75_000000_1x400.png similarity index 100% rename from ui/test/css/images/ui-bg_glass_75_000000_1x400.png rename to ui/old/test/css/images/ui-bg_glass_75_000000_1x400.png diff --git a/ui/test/css/images/ui-bg_glass_75_212121_1x400.png b/ui/old/test/css/images/ui-bg_glass_75_212121_1x400.png similarity index 100% rename from ui/test/css/images/ui-bg_glass_75_212121_1x400.png rename to ui/old/test/css/images/ui-bg_glass_75_212121_1x400.png diff --git a/ui/old/test/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/ui/old/test/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png new file mode 100644 index 00000000000..0e05810fffe Binary files /dev/null and b/ui/old/test/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png differ diff --git a/ui/test/css/images/ui-icons_222222_256x240.png b/ui/old/test/css/images/ui-icons_222222_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_222222_256x240.png rename to ui/old/test/css/images/ui-icons_222222_256x240.png diff --git a/ui/test/css/images/ui-icons_2e83ff_256x240.png b/ui/old/test/css/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_2e83ff_256x240.png rename to ui/old/test/css/images/ui-icons_2e83ff_256x240.png diff --git a/ui/test/css/images/ui-icons_454545_256x240.png b/ui/old/test/css/images/ui-icons_454545_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_454545_256x240.png rename to ui/old/test/css/images/ui-icons_454545_256x240.png diff --git a/ui/test/css/images/ui-icons_FFF_256x240.png b/ui/old/test/css/images/ui-icons_FFF_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_FFF_256x240.png rename to ui/old/test/css/images/ui-icons_FFF_256x240.png diff --git a/ui/test/css/images/ui-icons_cd0a0a_256x240.png b/ui/old/test/css/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_cd0a0a_256x240.png rename to ui/old/test/css/images/ui-icons_cd0a0a_256x240.png diff --git a/ui/test/css/images/ui-icons_ffffff_256x240.png b/ui/old/test/css/images/ui-icons_ffffff_256x240.png similarity index 100% rename from ui/test/css/images/ui-icons_ffffff_256x240.png rename to ui/old/test/css/images/ui-icons_ffffff_256x240.png diff --git a/ui/test/css/jquery-ui-1.7.2.custom.css b/ui/old/test/css/jquery-ui-1.7.2.custom.css similarity index 100% rename from ui/test/css/jquery-ui-1.7.2.custom.css rename to ui/old/test/css/jquery-ui-1.7.2.custom.css diff --git a/ui/test/css/jquery-ui-1.8.2.custom.css b/ui/old/test/css/jquery-ui-1.8.2.custom.css similarity index 100% rename from ui/test/css/jquery-ui-1.8.2.custom.css rename to ui/old/test/css/jquery-ui-1.8.2.custom.css diff --git a/ui/test/css/logger.css b/ui/old/test/css/logger.css similarity index 100% rename from ui/test/css/logger.css rename to ui/old/test/css/logger.css diff --git a/ui/test/css/main.css b/ui/old/test/css/main.css similarity index 100% rename from ui/test/css/main.css rename to ui/old/test/css/main.css diff --git a/ui/test/images/add_domainbutton.gif b/ui/old/test/images/add_domainbutton.gif similarity index 100% rename from ui/test/images/add_domainbutton.gif rename to ui/old/test/images/add_domainbutton.gif diff --git a/ui/test/images/add_domainbutton_hover.gif b/ui/old/test/images/add_domainbutton_hover.gif similarity index 100% rename from ui/test/images/add_domainbutton_hover.gif rename to ui/old/test/images/add_domainbutton_hover.gif diff --git a/ui/test/images/add_userbutton.gif b/ui/old/test/images/add_userbutton.gif similarity index 100% rename from ui/test/images/add_userbutton.gif rename to ui/old/test/images/add_userbutton.gif diff --git a/ui/test/images/add_userbutton_hover.gif b/ui/old/test/images/add_userbutton_hover.gif similarity index 100% rename from ui/test/images/add_userbutton_hover.gif rename to ui/old/test/images/add_userbutton_hover.gif diff --git a/ui/test/images/cloud_logo.gif b/ui/old/test/images/cloud_logo.gif similarity index 100% rename from ui/test/images/cloud_logo.gif rename to ui/old/test/images/cloud_logo.gif diff --git a/ui/test/images/pagination_bg.gif b/ui/old/test/images/pagination_bg.gif similarity index 100% rename from ui/test/images/pagination_bg.gif rename to ui/old/test/images/pagination_bg.gif diff --git a/ui/test/images/submenu_bg.gif b/ui/old/test/images/submenu_bg.gif similarity index 100% rename from ui/test/images/submenu_bg.gif rename to ui/old/test/images/submenu_bg.gif diff --git a/ui/test/images/submenu_linkbg.gif b/ui/old/test/images/submenu_linkbg.gif similarity index 100% rename from ui/test/images/submenu_linkbg.gif rename to ui/old/test/images/submenu_linkbg.gif diff --git a/ui/test/images/v1_popupbuttonbg.gif b/ui/old/test/images/v1_popupbuttonbg.gif similarity index 100% rename from ui/test/images/v1_popupbuttonbg.gif rename to ui/old/test/images/v1_popupbuttonbg.gif diff --git a/ui/test/images/v1_popupbuttonbg_hover.gif b/ui/old/test/images/v1_popupbuttonbg_hover.gif similarity index 100% rename from ui/test/images/v1_popupbuttonbg_hover.gif rename to ui/old/test/images/v1_popupbuttonbg_hover.gif diff --git a/ui/test/images/v1_popupheaderbg.gif b/ui/old/test/images/v1_popupheaderbg.gif similarity index 100% rename from ui/test/images/v1_popupheaderbg.gif rename to ui/old/test/images/v1_popupheaderbg.gif diff --git a/ui/test/images/v1_vmopoup_left.png b/ui/old/test/images/v1_vmopoup_left.png similarity index 100% rename from ui/test/images/v1_vmopoup_left.png rename to ui/old/test/images/v1_vmopoup_left.png diff --git a/ui/test/images/v1_vmopoup_mid.png b/ui/old/test/images/v1_vmopoup_mid.png similarity index 100% rename from ui/test/images/v1_vmopoup_mid.png rename to ui/old/test/images/v1_vmopoup_mid.png diff --git a/ui/test/images/v1admin_menutab_off.gif b/ui/old/test/images/v1admin_menutab_off.gif similarity index 100% rename from ui/test/images/v1admin_menutab_off.gif rename to ui/old/test/images/v1admin_menutab_off.gif diff --git a/ui/test/images/v1admin_menutab_on.gif b/ui/old/test/images/v1admin_menutab_on.gif similarity index 100% rename from ui/test/images/v1admin_menutab_on.gif rename to ui/old/test/images/v1admin_menutab_on.gif diff --git a/ui/test/images/v1gridheader_bg.gif b/ui/old/test/images/v1gridheader_bg.gif similarity index 100% rename from ui/test/images/v1gridheader_bg.gif rename to ui/old/test/images/v1gridheader_bg.gif diff --git a/ui/test/images/v1header_bg.gif b/ui/old/test/images/v1header_bg.gif similarity index 100% rename from ui/test/images/v1header_bg.gif rename to ui/old/test/images/v1header_bg.gif diff --git a/ui/test/images/v1menutab_off.gif b/ui/old/test/images/v1menutab_off.gif similarity index 100% rename from ui/test/images/v1menutab_off.gif rename to ui/old/test/images/v1menutab_off.gif diff --git a/ui/test/images/v1menutab_off_hover.gif b/ui/old/test/images/v1menutab_off_hover.gif similarity index 100% rename from ui/test/images/v1menutab_off_hover.gif rename to ui/old/test/images/v1menutab_off_hover.gif diff --git a/ui/test/images/v1menutab_on.gif b/ui/old/test/images/v1menutab_on.gif similarity index 100% rename from ui/test/images/v1menutab_on.gif rename to ui/old/test/images/v1menutab_on.gif diff --git a/ui/test/images/v1stepbox_slected.gif b/ui/old/test/images/v1stepbox_slected.gif similarity index 100% rename from ui/test/images/v1stepbox_slected.gif rename to ui/old/test/images/v1stepbox_slected.gif diff --git a/ui/test/images/v1stepcontainer_bg.gif b/ui/old/test/images/v1stepcontainer_bg.gif similarity index 100% rename from ui/test/images/v1stepcontainer_bg.gif rename to ui/old/test/images/v1stepcontainer_bg.gif diff --git a/ui/test/images/vm_actionbg.gif b/ui/old/test/images/vm_actionbg.gif similarity index 100% rename from ui/test/images/vm_actionbg.gif rename to ui/old/test/images/vm_actionbg.gif diff --git a/ui/test/index.html b/ui/old/test/index.html similarity index 100% rename from ui/test/index.html rename to ui/old/test/index.html diff --git a/ui/test/scripts/cloud.core.test.js b/ui/old/test/scripts/cloud.core.test.js similarity index 100% rename from ui/test/scripts/cloud.core.test.js rename to ui/old/test/scripts/cloud.core.test.js diff --git a/ui/test/widget/tab-template.html b/ui/old/test/widget/tab-template.html similarity index 100% rename from ui/test/widget/tab-template.html rename to ui/old/test/widget/tab-template.html diff --git a/ui/scripts-test/accounts.js b/ui/scripts-test/accounts.js new file mode 100644 index 00000000000..f4380bd2102 --- /dev/null +++ b/ui/scripts-test/accounts.js @@ -0,0 +1,69 @@ +(function(cloudStack) { + cloudStack.sections.accounts = { + title: 'Accounts', + id: 'accounts', + sectionSelect: { + label: 'Select view' + }, + sections: { + accounts: { + type: 'select', + title: 'Accounts', + listView: { + id: 'accounts', + fields: { + name: { label: 'Name', editable: true }, + domain: { label: 'Domain' }, + state: { label: 'State' } + }, + filters: { + mine: { label: 'My Accounts' }, + all: { label: 'All Accounts' } + }, + dataProvider: testData.dataProvider.listView('accounts'), + + detailView: { + name: 'Account details', + viewAll: { path: 'accounts.users', label: 'Users' }, + + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + domain: { label: 'Domain' }, + vmlimit: { label: 'VM Limit' }, + vmtotal: { label: 'Total VMs' }, + iplimit: { label: 'IP Limit' }, + iptotal: { label: 'Total IPs' } + } + ], + dataProvider: testData.dataProvider.detailView('accounts') + } + } + } + } + }, + users: { + type: 'select', + title: 'Users', + listView: { + id: 'users', + fields: { + username: { label: 'Username', editable: true }, + email: { label: 'E-mail' }, + state: { label: 'State' } + }, + filters: { + mine: { label: 'My Accounts' }, + all: { label: 'All Accounts' } + }, + dataProvider: testData.dataProvider.listView('users') + } + } + } + }; +})(cloudStack); diff --git a/ui/scripts-test/cloudStack.js b/ui/scripts-test/cloudStack.js new file mode 100644 index 00000000000..0f205eb4dae --- /dev/null +++ b/ui/scripts-test/cloudStack.js @@ -0,0 +1,77 @@ +(function(cloudStack, $, testData) { + $.extend(cloudStack, testData, { + home: 'dashboard', + + sectionPreFilter: function(args) { + var user = args.context.users[0]; + + if (user.role == 'admin') + return args.context.sections; + + return ['dashboard', 'instances', 'storage', 'templates', 'events']; + }, + sections: { + dashboard: {}, + instances: {}, + storage: {}, + network: {}, + templates: {}, + accounts: {}, + domains: {}, + events: {}, + system: {}, + 'global-settings': {}, + configuration: {} + } + }); + + $(function() { + var $container = $('#cloudStack3-container'); + + cloudStack.uiCustom.login({ + $container: $container, + + // Use this for checking the session, to bypass login screen + bypassLoginCheck: function(args) { + var disabledLogin = document.location.href.split('?')[1] == 'login=disabled'; + + if (disabledLogin) + return { + user: { + login: 'wchan', + name: 'Will Chan', + role: 'admin' + } + }; + else + return false; + }, + + // Actual login process, via form + loginAction: function(args) { + if (args.data.username != 'invalid'){ + return args.response.success({ + data: { + user: { + username: args.data.username, + name: args.data.name ? args.data.name : args.data.username, + role: args.data.username == 'jdoe' ? 'user' : 'admin' + } + } + }); + } + + return args.response.error(); + }, + + // Show cloudStack main UI widget + complete: function(args) { + $container.cloudStack($.extend(cloudStack, { + context: { + users: [args.user] + } + })); + } + }); + }); +})(cloudStack, jQuery, testData); diff --git a/ui/scripts-test/configuration.js b/ui/scripts-test/configuration.js new file mode 100644 index 00000000000..9922c4821b1 --- /dev/null +++ b/ui/scripts-test/configuration.js @@ -0,0 +1,264 @@ +(function(cloudStack, testData) { + cloudStack.sections.configuration = { + title: 'Configuration', + id: 'configuration', + sectionSelect: { + label: 'Select Offering' + }, + sections: { + serviceOfferings: { + type: 'select', + title: 'Service', + listView: { + label: 'Service Offerings', + fields: { + name: { label: 'Name', editable: true }, + storagetype: { label: 'Storage Type' }, + cpuspeed: { label: 'CPU' }, + memory: { label: 'Memory' }, + domain: { label: 'Domain'} + }, + actions: { + add: { + label: 'Add service offering', + + action: function(args) { + args.response.success(); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + success: function(args) { + return 'Your new service offering is being created.'; + }, + notification: function(args) { + return 'Created service offering'; + }, + complete: function(args) { + return 'Service offering has been created'; + } + }, + + createForm: { + title: 'New service offering', + desc: 'Please fill in the following data to add a new service offering.', + fields: { + name: { label: 'Name', editable: true }, + displayText: { label: 'Display Text' }, + storageType: { + label: 'Storage Type', + select: [ + { id: 'shared', description: 'Shared' }, + { id: 'local', description: 'Local' } + ] + }, + cpuCores: { label: '# of CPU cores' }, + cpuSpeed: { label: 'CPU Speed (in MHz)'}, + memory: { label: 'Memory (in MB)' }, + tags: { label: 'Tags' }, + offerHA: { label: 'Offer HA', isBoolean: true }, + isPublic: { label: 'Public', isBoolean: true } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: testData.data.serviceOfferings + }); + }); + } + } + }, + + systemServiceOfferings: { + type: 'select', + title: 'System Service', + listView: { + label: 'System Service Offerings', + fields: { + name: { label: 'Name', editable: true }, + storagetype: { label: 'Storage Type' }, + cpuspeed: { label: 'CPU' }, + memory: { label: 'Memory' }, + domain: { label: 'Domain'} + }, + actions: { + add: { + label: 'Add system service offering', + + action: function(args) { + args.response.success(); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + success: function(args) { + return 'Your new system service offering is being created.'; + }, + notification: function(args) { + return 'Created system service offering'; + }, + complete: function(args) { + return 'Sysmte service offering has been created'; + } + }, + + createForm: { + title: 'New system service offering', + desc: 'Please fill in the following data to add a new service offering.', + fields: { + name: { label: 'Name', editable: true }, + displayText: { label: 'Display Text' }, + storageType: { + label: 'Storage Type', + select: [ + { id: 'shared', description: 'Shared' }, + { id: 'local', description: 'Local' } + ] + }, + cpuCores: { label: '# of CPU cores' }, + cpuSpeed: { label: 'CPU Speed (in MHz)'}, + memory: { label: 'Memory (in MB)' }, + tags: { label: 'Tags' }, + offerHA: { label: 'Offer HA', isBoolean: true }, + isPublic: { label: 'Public', isBoolean: true } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: testData.data.systemServiceOfferings + }); + }); + } + } + }, + + diskOfferings: { + type: 'select', + title: 'Disk', + listView: { + label: 'Disk Offerings', + fields: { + displaytext: { label: 'Name' }, + disksize: { label: 'Disk Size' }, + domain: { label: 'Domain'} + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: testData.data.diskOfferings + }); + }); + }, + + actions: { + add: { + label: 'Add disk offering', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a disk offering?'; + }, + success: function(args) { + return 'Your new disk offering is being created.'; + }, + notification: function(args) { + return 'Creating new disk offering'; + }, + complete: function(args) { + return 'Disk offering has been created successfully!'; + } + }, + + createForm: { + title: 'Add disk offering', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + isCustomized: { + label: 'Custom disk size', + isBoolean: true, + isReverse: true, + isChecked: true + }, + disksize: { + label: 'Disk size (in GB)', + dependsOn: 'isCustomized', + validation: { required: true, number: true }, + isHidden: true + }, + tags: { + label: 'Storage tags' + }, + isDomainSpecific: { + label: 'Domain specific', + isBoolean: true + }, + domainId: { + label: 'Domain', + dependsOn: 'isDomainSpecific', + select: function(args) { + setTimeout(function() { + args.response.success({ + descriptionField: 'name', + data: testData.data.domains + }); + }); + }, + isHidden: true + } + } + }, + + action: function(args) { + args.response.success(); + } + } + } + } + }, + networkOfferings: { + type: 'select', + title: 'Network', + listView: { + label: 'Network Offerings', + fields: { + name: { label: 'Name', editable: true }, + networkrate: { label: 'Network Rate' }, + traffictype: { label: 'Traffic Type'} + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: testData.data.networkOfferings + }); + }); + } + } + } + } + }; +})(cloudStack, testData); diff --git a/ui/scripts-test/dashboard.js b/ui/scripts-test/dashboard.js new file mode 100644 index 00000000000..70e56f4eb44 --- /dev/null +++ b/ui/scripts-test/dashboard.js @@ -0,0 +1,11 @@ +(function(cloudStack) { + // Admin dashboard + cloudStack.sections.dashboard = { + title: 'Dashboard', + show: function() { + return $('').attr({ + src: 'images/screens/Dashboard2.jpg' + }); + } + }; +})(cloudStack); diff --git a/ui/scripts-test/domains.js b/ui/scripts-test/domains.js new file mode 100644 index 00000000000..fc0cdc257de --- /dev/null +++ b/ui/scripts-test/domains.js @@ -0,0 +1,160 @@ +(function(cloudStack) { + cloudStack.sections.domains = { + title: 'Domains', + id: 'domains', + + // Domain tree + treeView: { + // Details + detailView: { + name: 'Domain details', + viewAll: { + label: 'Accounts', + path: 'accounts.accounts' + }, + + // Detail actions + actions: { + // Destroy + destroy: { + label: 'Remove domain', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy this domain?'; + }, + notification: function(args) { + return 'Removed domain: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success(); + }, 200); + }, + notification: { + poll: testData.notifications.testPoll + } + }, + + // Edit domain + edit: { + label: 'Edit domain details', + messages: { + notification: function(args) { + return 'Edited domain: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success(); + }, 200); + } + }, + + // Add domain + create: { + label: 'Add domain', + + action: function(args) { + args.response.success(); + }, + + messages: { + notification: function(args) { + return 'Created domain' + } + }, + + createForm: { + title: 'Add subdomain', + desc: 'Please specify the domain you want to create.', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + parent: { + label: 'Parent Domain', + validation: { required: true } + } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + } + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name', isEditable: true } + }, + { + accounts: { label: 'Accounts' }, + instances: { label: 'Instances' }, + volumes: { label: 'Volumes' } + } + ], + dataProvider: function(args) { + args.response.success({ + data: { + name: 'Domain name', + accounts: 12, + volumes: 23 + } + }); + } + }, + adminAccounts: { + title: 'Admin Accounts', + multiple: true, + fields: [ + { + name: { label: 'Name' }, + vmtotal: { label: 'VMs' }, + iptotal: { label: 'IPs' }, + receivedbytes: { label: 'Bytes received' }, + sentbytes: { label: 'Bytes sent' }, + state: { label: 'State' } + } + ], + dataProvider: function(args) { + args.response.success({ + data: $.grep(testData.data.accounts, function(item, index) { + return item.domain === 'ROOT' && index <= 5; + }) + }); + } + }, + resourceLimits: { + title: 'Resource Limits', + fields: { + vmlimit: { label: 'Instance Limit' }, + iplimit: { label: 'Public IP Limit' }, + volumelimit: { label: 'Volume Limit' }, + snapshotlimit: { label: 'Snapshot Limit' }, + templatelimit: { label: 'Template Limit' } + }, + dataProvider: function(args) { + args.response.success({ + data: testData.data.accounts[4] + }); + } + } + } + }, + labelField: 'name', + dataProvider: function(args) { + args.response.success({ + data: [ + { id: 'domainA', name: 'Domain A' }, + { id: 'domainB', name: 'Domain B' } + ] + }); + } + } + }; +})(cloudStack); diff --git a/ui/scripts-test/events.js b/ui/scripts-test/events.js new file mode 100644 index 00000000000..20e2b9417ad --- /dev/null +++ b/ui/scripts-test/events.js @@ -0,0 +1,64 @@ +(function(cloudStack) { + cloudStack.sections.events = { + title: 'Events', + id: 'events', + sectionSelect: { + preFilter: function(args) { + var user = args.context.users[0]; + + if (user.role == 'admin') + return args.context.sections; + + return ['events']; + }, + label: 'Select view' + }, + sections: { + events: { + type: 'select', + title: 'Events', + listView: { + id: 'events', + label: 'Events', + fields: { + type: { label: 'Type' }, + description: { label: 'Description' }, + username: { label: 'Initiated By' }, + created: { label: 'Date' } + }, + dataProvider: testData.dataProvider.listView('events') + } + }, + alerts: { + type: 'select', + title: 'Alerts', + listView: { + id: 'alerts', + label: 'Alerts', + fields: { + type: { label: 'Type' }, + description: { label: 'Description' }, + sent: { label: 'Date' } + }, + dataProvider: testData.dataProvider.listView('alerts'), + detailView: { + name: 'Alert details', + tabs: { + details: { + title: 'Details', + fields: [ + { + type: { label: 'Type' }, + description: { label: 'Description' }, + created: { label: 'Sent' } + } + ], + dataProvider: testData.dataProvider.detailView('alerts') + } + } + } + } + } + } + }; +})(cloudStack); diff --git a/ui/scripts-test/globalSettings.js b/ui/scripts-test/globalSettings.js new file mode 100644 index 00000000000..b6d0c52ec14 --- /dev/null +++ b/ui/scripts-test/globalSettings.js @@ -0,0 +1,26 @@ +(function(cloudStack) { + cloudStack.sections['global-settings'] = { + title: 'Global Settings', + id: 'global-settings', + listView: { + label: 'Global Settings', + actions: { + edit: { + label: 'Change value', + action: function(args) { + args.response.success(); + }, + notification: { + poll: testData.notifications.testPoll + } + } + }, + fields: { + name: { label: 'Name', id: true }, + description: { label: 'Description' }, + value: { label: 'Value', editable: true } + }, + dataProvider: testData.dataProvider.listView('globalSettings') + } + }; +})(cloudStack); diff --git a/ui/scripts-test/instances.js b/ui/scripts-test/instances.js new file mode 100644 index 00000000000..b7805e58024 --- /dev/null +++ b/ui/scripts-test/instances.js @@ -0,0 +1,483 @@ +(function($, cloudStack) { + cloudStack.sections.instances = { + title: 'Instances', + id: 'instances', + listView: { + section: 'instances', + filters: { + mine: { label: 'My instances' }, + all: { label: 'All instances' }, + running: { label: 'Running instances' }, + destroyed: { label: 'Destroyed instances' } + }, + fields: { + name: { label: 'Name', editable: true }, + account: { label: 'Account' }, + zonename: { label: 'Zone' }, + state: { + label: 'Status', + indicator: { + 'Running': 'on', + 'Stopped': 'off', + 'Destroyed': 'off' + } + } + }, + + // List view actions + actions: { + // Add instance wizard + add: { + label: 'Add instance', + + action: { + custom: cloudStack.instanceWizard({ + steps: [ + // Step 1: Setup + function(args) { + args.response.success({ + data: { + zones: testData.data.zones + } + }); + }, + + // Step 2: Select template + function(args) { + args.response.success({ + hypervisor: { + idField: 'id', + nameField: 'displayname' + }, + data: { + templates: { + featuredtemplates: $.grep(testData.data.isos, function(elem) { + return elem.isfeatured === true; + }), + communitytemplates: [], + mytemplates: $.grep(testData.data.isos, function(elem) { + return elem.isfeatured === true; + }), + isos: $.grep(testData.data.isos, function(elem) { + return elem.isfeatured === false; + }) + }, + hypervisors: [ + { id: 123, displayname: 'KVM' }, + { id: 124, displayname: 'Xen' }, + { id: 125, displayname: 'VMWare' } + ] + } + }); + }, + + // Step 3: Service offering + function(args) { + args.response.success({ + data: { + serviceOfferings: testData.data.serviceOfferings + } + }); + }, + + // Step 4: Data disk offering + function(args) { + args.response.success({ + required: true, + customFlag: 'iscustomized', // Field determines if custom slider is shown + data: { + diskOfferings: testData.data.diskOfferings + } + }); + }, + + // Step 5: Network + function(args) { + args.response.success({ + type: 'select-network', + data: { + defaultNetworks: $.grep(testData.data.networks, function(elem) { + return elem.isdefault === true; + }), + optionalNetworks: $.grep(testData.data.networks, function(elem) { + return elem.isdefault === false; + }), + securityGroups: testData.data.securityGroups + } + }); + }, + + // Step 6: Review + function(args) { + args.response.success({}); + } + ], + action: function(args) { + args.response.success({ + _custom: { jobID: 12345 } + }); + } + }) + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + notification: function(args) { + return 'Creating new VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll( + testData.data.instances[1] + ) + } + }, + + edit: { + label: 'Edit instance name', + action: function(args) { + args.response.success(args.data[0]); + } + }, + + restart: { + label: 'Restart instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { + state: 'Restarting' + } + }); + }, 1000); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to restart ' + args.name + '?'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Running' + }) + } + }, + stop: { + label: 'Stop instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { state: 'Stopping' } + }); + }, 500); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to shutdown ' + args.name + '?'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Stopped' + }) + } + }, + start: { + label: 'Start instance', + action: function(args) { + setTimeout(function() { + args.response.success({ + data: { state: 'Starting' } + }); + }, 500); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to start ' + args.name + '?'; + }, + notification: function(args) { + return 'Starting VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Running' + }) + } + }, + destroy: { + label: 'Destroy instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + args.name + '?'; + }, + notification: function(args) { + return 'Destroyed VM: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success({ data: { state: 'Destroying' }}); + }, 200); + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Destroyed' + }) + } + } + }, + dataProvider: testData.dataProvider.listView('instances'), + detailView: { + name: 'Instance details', + viewAll: { path: 'storage.volumes', label: 'Volumes' }, + + // Detail view actions + actions: { + edit: { + label: 'Edit VM details', action: function(args) { + setTimeout(function() { + args.response.success(); + }, 500); + }, + notification: { + poll: testData.notifications.testPoll + } + }, + viewConsole: { + label: 'View VM console', + action: { + externalLink: { + url: function(args) { + return 'http://localhost:8080/client/console?cmd=access&vm=' + + args.context.instances[0].id; + }, + title: function(args) { + return args.context.instances[0].displayname + ' console'; + }, + width: 800, + height: 600 + } + } + }, + stop: { + label: 'Stop VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to stop ' + args.name + '?'; + }, + notification: function(args) { + return 'Stopping VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Stopped' + }) + }, + action: function(args) { + setTimeout(function() { + args.response.success({ + _custom: { jobID: args.data.id } + }); + }, 1000); + } + }, + start: { + label: 'Start VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to start ' + args.name + '?'; + }, + notification: function(args) { + return 'Starting VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Running' + }) + }, + action: function(args) { + setTimeout(function() { + args.response.success({ + _custom: { jobID: args.data.id } + }); + }, 1000); + } + }, + restart: { + label: 'Restart VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to restart ' + args.name + '?'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.testPoll + }, + action: function(args) { + setTimeout(function() { + args.response.success({ + _custom: { jobID: args.data.id } + }); + }, 1000); + } + }, + destroy: { + label: 'Destroy VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + args.name + '?'; + }, + notification: function(args) { + return 'Destroying VM: ' + args.name; + } + }, + notification: { + poll: testData.notifications.testPoll + }, + action: function(args) { + setTimeout(function() { + args.response.success(); + }, 1000); + } + }, + migrate: { + notification: { + desc: 'Migrated VM', + poll: testData.notifications.testPoll + }, + label: 'Migrate VM', action: function(args) { + args.response.success(); + } + }, + attachISO: { + label: 'Attach ISO', action: function(args) { + args.response.success(); + } + }, + resetPassword: { + label: 'Reset password', + action: function(args) { + args.response.success({}); + }, + messages: { + confirm: function(args) { + return 'Do you really want to reset your password?'; + }, + notification: function(args) { + return 'Resetting VM password'; + }, + complete: function(args) { + return 'VM password reset. New password is: ' + args.password; + } + }, + notification: { + poll: testData.notifications.customPoll({ + password: '1284018jaj#' + }) + } + }, + changeService: { + label: 'Change Service', action: function(args) { + args.response.success(); + } + } + }, + tabs: { + // Details tab + details: { + title: 'Details', + fields: [ + { + name: { + label: 'Name', isEditable: true + } + }, + { + id: { label: 'ID', isEditable: false }, + zonename: { label: 'Zone', isEditable: false }, + templateid: { + label: 'Template type', + isEditable: true, + select: function(args) { + var items = []; + + $(testData.data.templates).each(function() { + items.push({ id: this.id, description: this.name }); + }); + setTimeout(function() { + args.response.success({ data: items }); + }, 500); + } + }, + serviceofferingname: { label: 'Service offering', isEditable: false }, + group: { label: 'Group', isEditable: true } + } + ], + dataProvider: testData.dataProvider.detailView('instances') + }, + + /** + * NICs tab + */ + nics: { + title: 'NICs', + isMultiple: true, + preFilter: function(args) { + return ['type']; + }, + fields: [ + { + name: { label: 'Name', header: true }, + ipaddress: { label: 'IP Address' }, + gateway: { label: 'Default gateway' }, + netmask: { label: 'Netmask' }, + type: { label: 'Type' } + } + ], + dataProvider: function(args) { + setTimeout(function() { + var instance = $.grep(testData.data.instances, function(elem) { + return elem.id == args.id; + }); + args.response.success({ + data: $.map(instance[0].nic, function(item, index) { + item.name = 'NIC ' + (index + 1); + return item; + }) + }); + }, 500); + } + }, + + /** + * Statistics tab + */ + stats: { + title: 'Statistics', + fields: { + cpuspeed: { label: 'Total CPU' }, + cpuused: { label: 'CPU Utilized' }, + networkkbsread: { label: 'Network Read' }, + networkkbswrite: { label: 'Network Write' } + }, + dataProvider: testData.dataProvider.detailView('instances') + } + } + } + } + }; +})(jQuery, cloudStack); diff --git a/ui/scripts-test/network.js b/ui/scripts-test/network.js new file mode 100644 index 00000000000..9b8f91c9692 --- /dev/null +++ b/ui/scripts-test/network.js @@ -0,0 +1,829 @@ +(function(cloudStack, testData, $) { + cloudStack.sections.network = { + title: 'Network', + id: 'network', + sectionSelect: { + label: 'Select view' + }, + sections: { + ipAddresses: { + type: 'select', + title: 'IP Addresses', + listView: { + id: 'ipAddresses', + label: 'IPs', + filters: { + allocated: { label: 'Allocated ' }, + mine: { label: 'My network' } + }, + fields: { + ipaddress: { + label: 'IP', + converter: function(text, item) { + if (item.issourcenat) { + return text + ' [Source NAT]'; + } + + return text; + } + }, + zonename: { label: 'Zone' }, + vlanname: { label: 'VLAN' }, + networkid: { label: 'Network Type' }, + state: { label: 'State', indicator: { 'Allocated': 'on' } } + }, + + actions: { + add: { + label: 'Acquire new IP', + + action: function(args) { + args.response.success(); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add this new IP?'; + }, + notification: function(args) { + return 'Allocated IP'; + } + }, + + createForm: { + title: 'Acquire new IP', + desc: 'Please select a zone from which you want to acquire your new IP from.', + fields: { + zonename: { + label: 'Zone', + select: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { id: 'San Jose', description: 'San Jose' }, + { id: 'Chicago', description: 'Chicago' } + ] + }); + }, 10); + } + } + } + }, + + notification: { + poll: testData.notifications.customPoll(testData.data.network[0]) + } + }, + enableStaticNAT: { + label: 'Enable static NAT', + action: { + noAdd: true, + custom: cloudStack.uiCustom.enableStaticNAT({ + listView: cloudStack.sections.instances, + action: function(args) { + args.response.success(); + } + }) + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to enable static NAT?'; + }, + notification: function(args) { + return 'Enabled Static NAT'; + } + }, + notification: { + poll: testData.notifications.customPoll({ isstaticnat: true }) + } + }, + disableStaticNAT: { + label: 'Disable static NAT', + action: function(args) { + args.response.success(); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable static NAT?'; + }, + notification: function(args) { + return 'Disabled Static NAT'; + } + }, + notification: { + poll: testData.notifications.customPoll({ isstaticnat: false }) + } + }, + enableVPN: { + label: 'Enable VPN', + action: function(args) { + args.response.success(); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want VPN enabled for this IP address.'; + }, + notification: function(args) { + return 'Enabled VPN'; + }, + complete: function(args) { + return 'VPN is now enabled for IP ' + args.publicip + '.' + + '
Your IPsec pre-shared key is:
' + args.presharedkey; + } + }, + notification: { + poll: testData.notifications.customPoll({ + publicip: '10.2.2.1', + presharedkey: '23fudh881ssx88199488PP!#Dwdw', + vpnenabled: true + }) + } + }, + disableVPN: { + label: 'Disable VPN', + action: function(args) { + args.response.success(); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable VPN?'; + }, + notification: function(args) { + return 'Disabled VPN'; + } + }, + notification: { + poll: testData.notifications.customPoll({ vpnenabled: false }) + } + } + }, + dataProvider: testData.dataProvider.listView('network'), + + // Detail view + detailView: { + name: 'IP address detail', + // Example tab filter + tabFilter: function(args) { + var disabledTabs = []; + var ipAddress = args.context.ipAddresses[0]; + + if (!ipAddress.issourcenat || + (ipAddress.issourcenat && !ipAddress.vpnenabled)) { + disabledTabs.push('vpn'); + } + + return disabledTabs; + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + ipaddress: { label: 'IP' } + }, + { + state: { label: 'State' }, + zonename: { label: 'Zone' }, + vlanname: { label: 'VLAN' }, + issourcenat: { label: 'Source NAT' } + } + ], + dataProvider: testData.dataProvider.detailView('network') + }, + + ipRules: { + title: 'Configuration', + custom: cloudStack.ipRules({ + preFilter: function(args) { + if (args.context.ipAddresses[0].isstaticnat) { + return args.items; // All items filtered means static NAT + } + + return []; + }, + + // Firewall rules + firewall: { + noSelect: true, + fields: { + 'cidrlist': { edit: true, label: 'Source CIDR' }, + 'protocol': { + label: 'Protocol', + select: function(args) { + args.$select.change(function() { + var $inputs = args.$form.find('input'); + var $icmpFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return $.inArray(name, [ + 'icmptype', + 'icmpcode' + ]) > -1; + }); + var $otherFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return name != 'icmptype' && name != 'icmpcode' && name != 'cidrlist'; + }); + + if ($(this).val() == 'icmp') { + $icmpFields.attr('disabled', false); + $otherFields.attr('disabled', 'disabled'); + } else { + $otherFields.attr('disabled', false); + $icmpFields.attr('disabled', 'disabled'); + } + }); + + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' }, + { name: 'icmp', description: 'ICMP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'icmptype': { edit: true, label: 'ICMP Type', isDisabled: true }, + 'icmpcode': { edit: true, label: 'ICMP Code', isDisabled: true }, + 'add-rule': { + label: 'Add', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add firewall rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove firewall rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + "id": 11, + "protocol": "icmp", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/0", + "icmptype": 2, + "icmpcode": 22 + }, + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + } + ] + }); + }, 100); + } + }, + + staticNAT: { + noSelect: true, + fields: { + 'protocol': { + label: 'Protocol', + select: function(args) { + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'add-rule': { + label: 'Add', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add static NAT rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove static NAT rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + "id": 10, + "protocol": "udp", + "startport": "500", + "endport": "10000", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + }, + { + "id": 9, + "protocol": "tcp", + "startport": "20", + "endport": "200", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "0.0.0.0/24" + } + ] + }); + }, 100); + } + }, + + // Load balancing rules + loadBalancing: { + listView: cloudStack.sections.instances, + multipleAdd: true, + fields: { + 'name': { edit: true, label: 'Name' }, + 'publicport': { edit: true, label: 'Public Port' }, + 'privateport': { edit: true, label: 'Private Port' }, + 'algorithm': { + label: 'Algorithm', + select: function(args) { + args.response.success({ + data: [ + { name: 'roundrobin', description: 'Round-robin' }, + { name: 'leastconn', description: 'Least connections' }, + { name: 'source', description: 'Source' } + ] + }); + } + }, + 'add-vm': { + label: 'Add VMs', + addButton: true + } + }, + add: { + label: 'Add VMs', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add load balancing rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove load balancing rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove load balancing rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + "id": 13, + "name": "HTTP", + "publicipid": 4, + "publicip": "10.223.71.23", + "publicport": "80", + "privateport": "80", + "algorithm": "roundrobin", + "cidrlist": "", + "account": "admin", + "domainid": 1, + "domain": "ROOT", + "state": "Active", + "zoneid": 1, + _itemData: [ + testData.data.instances[0], + testData.data.instances[1], + testData.data.instances[2], + testData.data.instances[3] + ] + } + ] + }); + }, 100); + } + }, + + // Port forwarding rules + portForwarding: { + listView: cloudStack.sections.instances, + fields: { + 'private-ports': { + edit: true, + label: 'Private Ports', + range: ['privateport', 'privateendport'] + }, + 'public-ports': { + edit: true, + label: 'Public Ports', + range: ['publicport', 'publicendport'] + }, + 'protocol': { + label: 'Protocol', + select: function(args) { + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' } + ] + }); + } + }, + 'add-vm': { + label: 'Add VM', + addButton: true + } + }, + add: { + label: 'Add VM', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add port forwarding rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove port forwarding rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove port forwarding rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + "id": 12, + "privateport": "22", + "privateendport": "22", + "protocol": "tcp", + "publicport": "22", + "publicendport": "22", + "virtualmachineid": 10, + "virtualmachinename": "i-2-10-TEST", + "virtualmachinedisplayname": "i-2-10-TEST", + "ipaddressid": 4, + "ipaddress": "10.223.71.23", + "state": "Active", + "cidrlist": "", + _itemData: [ + testData.data.instances[5] + ] + } + ] + }); + }, 100); + } + } + }) + }, + vpn: { + title: 'VPN', + custom: function(args) { + var ipAddress = args.context.ipAddresses[0].ipaddress; + var psk = '081XufGFmEDBAEfsfdXTNpramSZ'; + + return $('
').append( + $('
    ').addClass('info') + .append( + // VPN IP + $('
  • ').addClass('ip').html('Your VPN access is currently enabled and can be accessed via the IP: ') + .append($('').html(ipAddress)) + ) + .append( + // PSK + $('
  • ').addClass('psk').html('Your IPSec pre-shared key is: ') + .append($('').html(psk)) + ) + ).multiEdit({ + noSelect: true, + fields: { + 'username': { edit: true, label: 'Username' }, + 'password': { edit: true, label: 'Password' }, + 'add-user': { addButton: true, label: 'Add user' } + }, + add: { + label: 'Add user', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add user to VPN', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove user', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove user from VPN', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [] + }); + }, 100); + } + }); + } + } + } + } + } + }, + securityGroups: { + type: 'select', + title: 'Security Groups', + listView: { + id: 'securityGroups', + label: 'Security Groups', + fields: { + name: { label: 'Name', editable: true }, + description: { label: 'Description' }, + domain: { label: 'Domain' }, + account: { label: 'Account' } + }, + actions: { + add: { + label: 'Add security group', + + action: function(args) { + args.response.success(); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + notification: function(args) { + return 'Created security group'; + } + }, + + createForm: { + title: 'New security group', + desc: 'Please name your security group.', + fields: { + name: { label: 'Name' }, + description: { label: 'Description' } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + }, + destroy: { + label: 'Delete security group', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete ' + args.name + '?'; + }, + notification: function(args) { + return 'Deleted security group: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success(); + }, 200); + }, + notification: { + poll: testData.notifications.testPoll + } + } + }, + dataProvider: testData.dataProvider.listView('securityGroups'), + detailView: { + name: 'Security group details', + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + domain: { label: 'Domain' }, + account: { label: 'Account' } + } + ], + dataProvider: testData.dataProvider.detailView('securityGroups') + }, + ingressRules: { + title: 'Ingress Rules', + custom: cloudStack.uiCustom.securityRules({ + noSelect: true, + noHeaderActionsColumn: true, + fields: { + 'protocol': { + label: 'Protocol', + select: function(args) { + args.$select.change(function() { + var $inputs = args.$form.find('th, td'); + var $icmpFields = $inputs.filter(function() { + var name = $(this).attr('rel'); + + return $.inArray(name, [ + 'icmptype', + 'icmpcode' + ]) > -1; + }); + var $otherFields = $inputs.filter(function() { + var name = $(this).attr('rel'); + + return name != 'icmptype' && + name != 'icmpcode' && + name != 'protocol' && + name != 'add-rule' && + name != 'cidr' && + name != 'accountname' && + name != 'securitygroupname'; + }); + + if ($(this).val() == 'icmp') { + $icmpFields.show(); + $otherFields.hide(); + } else { + $icmpFields.hide(); + $otherFields.show(); + } + }); + + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' }, + { name: 'icmp', description: 'ICMP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'icmptype': { edit: true, label: 'ICMP Type', isHidden: true }, + 'icmpcode': { edit: true, label: 'ICMP Code', isHidden: true }, + 'cidr': { edit: true, label: 'CIDR', isHidden: true }, + 'accountname': { + edit: true, + label: 'Account, Security Group', + isHidden: true, + range: ['accountname', 'securitygroupname'] + }, + 'add-rule': { + label: 'Add', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Add ingress rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + setTimeout(function() { + args.response.success({ + notification: { + label: 'Remove ingress rule', + poll: testData.notifications.testPoll + } + }); + }, 500); + } + } + }, + ignoreEmptyFields: true, + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [] + }); + }, 100); + } + }) + } + } + } + } + } + } + }; +})(cloudStack, testData, jQuery); diff --git a/ui/scripts-test/storage.js b/ui/scripts-test/storage.js new file mode 100644 index 00000000000..4ffb07bf8ef --- /dev/null +++ b/ui/scripts-test/storage.js @@ -0,0 +1,539 @@ +(function(cloudStack, $, testData) { + cloudStack.sections.storage = { + title: 'Storage', + id: 'storage', + sectionSelect: { + label: 'Select view' + }, + sections: { + /** + * Volumes + */ + volumes: { + type: 'select', + title: 'Volumes', + listView: { + id: 'volumes', + label: 'Volumes', + fields: { + name: { label: 'Name', editable: true }, + type: { label: 'Type' }, + zonename: { label: 'Zone' }, + size: { label: 'Size' }, + state: { + label: 'Status', + indicator: { + 'Ready': 'on' + } + } + }, + + filters: { + mine: { label: 'My volumes' }, + large: { label: 'Large volumes' }, + small: { label: 'Small volumes' } + }, + + // List view actions + actions: { + // Add volume + add: { + label: 'Add volume', + + action: function(args) { + args.response.success({ + _custom: { jobID: new Date() } + }); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + notification: function(args) { + return 'Creating new volume'; + } + }, + + createForm: { + title: 'Add volume', + desc: 'Please fill in the following data to add a new volume.', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + availabilityZone: { + label: 'Availability Zone', + select: function(args) { + args.response.success({ + descriptionField: 'displayname', + data: [ + { id: 'sanjose', displayname: 'San Jose' }, + { id: 'Chicago', displayname: 'Chicago' } + ] + }); + } + }, + diskOffering: { + label: 'Disk Offering', + dependsOn: 'availabilityZone', + select: function(args) { + /** + * Example to show/hide fields + * + * -Select Pod2 to show conditional fields + * -Select any other field to hide conditional fields + */ + args.$select.change(function() { + var $input = $(this); + var $form = $input.closest('form'); + + // Note: need to actually select the .form-item div containing the input + var $diskSize = $form.find('.form-item[rel=diskSize]'); + + $diskSize.hide(); + + if ($input.val() == 'custom') { + // Note: need to show by setting display=inline-block, not .show() + $diskSize.css('display', 'inline-block'); + } + }); + + args.response.success({ + descriptionField: 'description', + data: [ + { id: 'small', description: 'Small Disk, 5GB' }, + { id: 'medium', description: 'Medium Disk, 20GB' }, + { id: 'large', description: 'Large Disk, 100GB' }, + { id: 'custom', description: 'Custom Disk Size' } + ] + }); + } + }, + diskSize: { + label: 'Disk size (in GB)', + validation: { required: true, number: true }, + hidden: true + } + } + }, + + notification: { + poll: testData.notifications.customPoll( + testData.data.storage[0] + ) + } + }, + edit: { + label: 'Edit volume name', + action: function(args) { + args.response.success(args.data[0]); + } + }, + snapshot: { + label: 'Take snapshot', + messages: { + confirm: function(args) { + return 'Please confirm that you want to take a snapshot of ' + args.name; + }, + notification: function(args) { + return 'Made snapshot of volume: ' + args.name; + } + }, + action: function(args) { + args.response.success({ + data: { state: 'Shapshotting' } + }); + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Ready' + }) + } + }, + recurringSnapshot: { + label: 'Setup recurring snapshots', + action: { + custom: cloudStack.uiCustom.recurringSnapshots({ + desc: 'You can setup recurring snapshot schedules by selecting from the available options below and applying your policy preference.', + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: [ + { + type: 0, + time: 10, + timezone: 'Pacific/Samoa', + keep: 23 + }, + { + type: 3, + time: '12:33 AM', + timezone: 'Pacific/Samoa', + keep: 23, + 'day-of-month': 31 + } + ] + }); + }, 100); + }, + actions: { + add: function(args) { + var snap = args.snapshot; + + var data = { + keep: snap.maxsnaps, + timezone: snap.timezone + }; + + switch (snap['snapshot-type']) { + case 'hourly': // Hourly + $.extend(data, { + type: 0, + time: snap.schedule + }); break; + + case 'daily': // Daily + $.extend(data, { + type: 1, + time: snap['time-hour'] + ':' + snap['time-minute'] + ' ' + snap['time-meridiem'] + }); break; + + case 'weekly': // Weekly + $.extend(data, { + type: 2, + time: snap['time-hour'] + ':' + snap['time-minute'] + ' ' + snap['time-meridiem'], + 'day-of-week': snap['day-of-week'] + }); break; + + case 'monthly': // Monthly + $.extend(data, { + type: 3, + time: snap['time-hour'] + ':' + snap['time-minute'] + ' ' + snap['time-meridiem'], + 'day-of-month': snap['day-of-month'] + }); break; + } + + setTimeout(function() { + args.response.success({ + data: data + }); + }, 300); + }, + remove: function(args) { + args.response.success(); + } + }, + + // Select data + selects: { + schedule: function(args) { + var time = []; + + for (var i = 1; i <= 59; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + timezone: function(args) { + args.response.success({ + data: [ + { + id: 'Etc/GMT+12', + name: '[UTC-12:00] GMT-12:00' + }, + { + id: 'Pacific/Samoa', + name: '[UTC-11:00] Samoa Standard Time' + } + ] + }); + }, + 'day-of-week': function(args) { + args.response.success({ + data: [ + { id: 1, name: 'Sunday' }, + { id: 2, name: 'Monday' }, + { id: 3, name: 'Tuesday' }, + { id: 4, name: 'Wednesday' }, + { id: 5, name: 'Thursday' }, + { id: 6, name: 'Friday' }, + { id: 7, name: 'Saturday' } + ] + }); + }, + + 'day-of-month': function(args) { + var time = []; + + for (var i = 1; i <= 31; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-hour': function(args) { + var time = []; + + for (var i = 1; i <= 12; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-minute': function(args) { + var time = []; + + for (var i = 0; i <= 59; i++) { + time.push({ + id: i < 10 ? '0' + i : i, + name: i < 10 ? '0' + i : i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-meridiem': function(args) { + args.response.success({ + data: [ + { id: 'AM', name: 'AM' }, + { id: 'PM', name: 'PM' } + ] + }); + } + } + }) + }, + messages: { + notification: function(args) { + return 'Setup recurring snapshot'; + } + }, + notification: { + poll: testData.notifications.testPoll + } + }, + create: { + label: 'Create template', + addRow: 'false', + messages: { + notification: function(args) { + return 'Making new template: ' + args.name; + } + }, + action: function(args) { + args.response.success({ + data: { + state: 'Templating' + } + }); + }, + createForm: { + title: 'Create a template', + desc: 'To create a template from the selected volume, please complete the fields below.', + fields: { + name: { label: 'Name' }, + displayText: { label: 'Display text' }, + 'public': { + label: 'Public', isBoolean: true + }, + osType: { + label: 'OS Type', + dependsOn: 'public', + hidden: true, + select: function(args) { + args.response.success({ + descriptionField: 'description', + data: [ + { id: 'centos53-64', description: 'CentOS 5.3 (64-bit)' }, + { id: 'rhel5-64', description: 'Red Hat Enterprise Linux 5.0 (64-bit)' }, + { id: 'deb6-32', description: 'Debian GNU/Linux 6.0 (32-bit)' } + ] + }); + } + }, + usePassword: { + label: 'Use Password?', + isBoolean: true, + hidden: true, + dependsOn: 'public' + }, + password: { + label: 'Password', + hidden: true, + dependsOn: 'usePassword', + password: true + } + } + }, + notification: { + poll: testData.notifications.customPoll({ + state: 'Ready' + }) + } + } + }, + dataProvider: testData.dataProvider.listView('storage'), + detailView: { + name: 'Volume details', + viewAll: { path: 'storage.snapshots', label: 'Snapshots' }, + actions: { + edit: { + label: 'Edit volume details', + action: function(args) { + args.response.success(); + }, + notification: { + poll: testData.notifications.testPoll + } + }, + snapshot: { + label: 'Take snapshot', + messages: { + confirm: function(args) { + return 'Please confirm that you want to take a snapshot of ' + args.name; + }, + notification: function(args) { + return 'Made snapshot of volume: ' + args.name; + } + }, + action: function(args) { + args.response.success(); + }, + notification: { + poll: testData.notifications.testPoll + } + }, + createTemplate: { + label: 'Create template', + messages: { + success: function(args) { + return 'Your new template ' + args.name + ' is being created.'; + }, + notification: function(args) { + return 'Making new template: ' + args.name; + } + }, + action: function(args) { + args.response.success(); + }, + createForm: { + title: 'Create a template', + desc: 'To create a template from the selected volume, please complete the fields below.', + fields: { + name: { label: 'Name', validation: { required: true } }, + displayText: { label: 'Display text' }, + osType: { + label: 'OS Type', + select: function(args) { + args.response.success({ + descriptionField: 'description', + data: [ + { id: 'centos53-64', description: 'CentOS 5.3 (64-bit)' }, + { id: 'rhel5-64', description: 'Red Hat Enterprise Linux 5.0 (64-bit)' }, + { id: 'deb6-32', description: 'Debian GNU/Linux 6.0 (32-bit)' } + ] + }); + } + }, + 'public': { + label: 'Public', isBoolean: true + }, + usePassword: { + label: 'Use password?', isBoolean: true + } + } + }, + notification: { + poll: testData.notifications.testPoll + } + } + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name', isEditable: true } + }, + { + id: { label: 'ID' }, + type: { label: 'Type' }, + zone: { label: 'Zone' } + } + ], + dataProvider: testData.dataProvider.detailView('storage') + } + } + } + } + }, + + /** + * Snapshots + */ + snapshots: { + type: 'select', + title: 'Snapshots', + listView: { + id: 'snapshots', + label: 'Snapshots', + fields: { + volumename: { label: 'Volume' }, + state: { label: 'State' }, + intervaltype: { label: 'Interval Type' }, + created: { label: 'Date' } + }, + filters: { + mine: { label: 'My snapshots' } + }, + dataProvider: testData.dataProvider.listView('snapshots'), + detailView: { + name: 'Snapshot detail', + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + id: { label: 'ID' }, + volume: { label: 'Volume' }, + state: { label: 'State' }, + intervalType: { label: 'Interval Type' }, + account: { label: 'Account' }, + domain: { label: 'Domain' } + } + ], + dataProvider: testData.dataProvider.detailView('snapshots') + } + } + } + } + } + } + }; +})(cloudStack, jQuery, testData); diff --git a/ui/scripts-test/system.js b/ui/scripts-test/system.js new file mode 100644 index 00000000000..87c15b054e0 --- /dev/null +++ b/ui/scripts-test/system.js @@ -0,0 +1,930 @@ +(function($, cloudStack) { + cloudStack.sections.system = { + title: 'System', + id: 'system', + show: cloudStack.uiCustom.physicalResources({ + sections: { + physicalResources: { + type: 'select', + title: 'Physical Resources', + listView: { + id: 'physicalResources', + label: 'Physical Resources', + fields: { + name: { label: 'Zone' }, + dns1: { label: 'DNS' }, + internaldns1: { label: 'Internal DNS' }, + networktype: { label: 'Network Type' }, + allocationstate: { label: 'State' } + }, + actions: { + destroy: testData.actions.destroy('zone'), + add: { + label: 'Add zone', + action: { + custom: cloudStack.zoneWizard({ + steps: [ + // Step 1: Setup + null, + + // Step 2: Setup Zone + function(args) { + args.response.success({ + domains: [ + { + id: '1', + name: 'Domain A' + }, + { + id: '2', + name: 'Domain B' + }, + { + id: '3', + name: 'Domain C' + } + ] + }); + }, + + // Step 3: Setup Pod + null, + + // Step 4: Setup IP Range + function(args) { + args.response.success({ + domains: [ + { + id: '1', + name: 'Domain A' + }, + { + id: '2', + name: 'Domain B' + }, + { + id: '3', + name: 'Domain C' + } + ] + }); + } + ], + action: function(args) { + args.response.success({ + _custom: { jobID: new Date() } + }); + } + }) + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + notification: function(args) { + return 'Created new zone'; + } + }, + notification: { + poll: testData.notifications.customPoll(testData.data.zones[0]) + } + } + }, + dataProvider: testData.dataProvider.listView('zones'), + detailView: { + isMaximized: true, + pageGenerator: cloudStack.zoneChart({ + dataProvider: testData.dataProvider.detailView('zones'), + detailView: { + name: 'Zone details', + viewAll: { path: '_zone.pods', label: 'Pods' }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Zone' } + }, + { + dns1: { label: 'DNS 1' }, + dns2: { label: 'DNS 2' }, + internaldns1: { label: 'Internal DNS 1' }, + internaldns2: { label: 'Internal DNS 2' } + }, + { + networktype: { label: 'Network Type' }, + allocationstate: { label: 'State' }, + vlan: { label: 'VLAN' }, + networktype: { label: 'Network Type' }, + securitygroupenabled: { label: 'Security Group?' } + } + ], + dataProvider: testData.dataProvider.detailView('zones') + }, + resources: { + title: 'Resources', + fields: [ + { + iptotal: { label: 'Total IPs' }, + cputotal: { label: 'Total CPU' }, + bandwidthout: { label: 'Bandwidth (Out)'}, + bandwidthin: { label: 'Bandwidth (In)'} + } + ], + dataProvider: function(args) { + setTimeout(function() { + args.response.success({ + data: { + iptotal: 1000, + cputotal: '500 Ghz', + bandwidthout: '14081 mb', + bandwidthin: '31000 mb' + } + }); + }, 500); + } + } + } + } + }) + } + } + }, + virtualAppliances: { + type: 'select', + title: 'Virtual Appliances', + id: 'virtualAppliances', + listView: { + label: 'Virtual Appliances', + fields: { + name: { label: 'Name' }, + hostname: { label: 'Hostname' }, + publicip: { label: 'Public IP' }, + publicmacaddress: { label: 'Public MAC' }, + state: { label: 'Status' } + }, + dataProvider: testData.dataProvider.listView('virtualAppliances') + } + }, + systemVMs: { + type: 'select', + title: 'System VMs', + listView: { + label: 'System VMs', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + hostname: { label: 'Hostname' }, + privateip: { label: 'Private IP' }, + publicip: { label: 'Public IP' }, + state: { label: 'Status' } + }, + dataProvider: testData.dataProvider.listView('systemVMs') + } + } + } + }), + subsections: { + networks: { + sectionSelect: { label: 'Network type' }, + sections: { + publicNetwork: { + type: 'select', + title: 'Public network', + listView: { + section: 'networks', + id: 'networks', + fields: { + name: { label: 'Name' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + type: { label: 'Type' } + }, + dataProvider: testData.dataProvider.listView('networks'), + detailView: { + viewAll: { label: 'Hosts', path: 'instances' }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'name' }, + displaytext: { label: 'displaytext' } + }, + { + broadcastdomaintype: { label: 'broadcastdomaintype' }, + traffictype: { label: 'traffictype' }, + gateway: { label: 'gateway' }, + netmask: { label: 'netmask' }, + startip: { label: 'startip' }, + endip: { label: 'endip' }, + zoneid: { label: 'zoneid' }, + networkofferingid: { label: 'networkofferingid' }, + networkofferingname: { label: 'networkofferingname' }, + networkofferingdisplaytext: { label: 'networkofferingdisplaytext' }, + networkofferingavailability: { label: 'networkofferingavailability' }, + isshared: { label: 'isshared' }, + issystem: { label: 'issystem' }, + state: { label: 'state' }, + related: { label: 'related' }, + broadcasturi: { label: 'broadcasturi' }, + dns1: { label: 'dns1' }, + type: { label: 'type' } + } + ], + dataProvider: testData.dataProvider.detailView('networks') + } + } + } + } + }, + directNetwork: { + title: 'Direct network', + type: 'select', + listView: { + section: 'networks', + id: 'networks', + fields: { + name: { label: 'Name' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + type: { label: 'Type' } + }, + dataProvider: testData.dataProvider.listView('networks'), + detailView: { + viewAll: { label: 'Hosts', path: 'instances' }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'name' }, + displaytext: { label: 'displaytext' } + }, + { + broadcastdomaintype: { label: 'broadcastdomaintype' }, + traffictype: { label: 'traffictype' }, + gateway: { label: 'gateway' }, + netmask: { label: 'netmask' }, + startip: { label: 'startip' }, + endip: { label: 'endip' }, + zoneid: { label: 'zoneid' }, + networkofferingid: { label: 'networkofferingid' }, + networkofferingname: { label: 'networkofferingname' }, + networkofferingdisplaytext: { label: 'networkofferingdisplaytext' }, + networkofferingavailability: { label: 'networkofferingavailability' }, + isshared: { label: 'isshared' }, + issystem: { label: 'issystem' }, + state: { label: 'state' }, + related: { label: 'related' }, + broadcasturi: { label: 'broadcasturi' }, + dns1: { label: 'dns1' }, + type: { label: 'type' } + } + ], + dataProvider: testData.dataProvider.detailView('networks') + } + } + } + } + } + } + }, + pods: { + title: 'Pod', + listView: { + id: 'pods', + section: 'pods', + fields: { + name: { label: 'Name' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + allocationstate: { label: 'Status' } + }, + dataProvider: testData.dataProvider.listView('pods'), + actions: { + destroy: testData.actions.destroy('pod') + }, + detailView: { + viewAll: { path: '_zone.clusters', label: 'Clusters' }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + allocationstate: { label: 'State' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' } + } + ], + dataProvider: testData.dataProvider.detailView('pods') + } + } + }, + actions: { + add: { + label: 'Add pod', + + createForm: { + title: 'Add new pod', + desc: 'Please fill in the following information to add a new pod', + + preFilter: function(args) { + var $guestFields = args.$form.find('.form-item[rel=guestGateway], .form-item[rel=guestNetmask], .form-item[rel=startGuestIp], .form-item[rel=endGuestIp]'); + if (args.context.zones[0].networktype == "Basic") { + $guestFields.css('display', 'inline-block'); + } + else if(args.context.zones[0].networktype == "Advanced") { //advanced-mode network (zone-wide VLAN) + $guestFields.hide(); + } + }, + + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + gateway: { + label: 'Gateway', + validation: { required: true } + }, + netmask: { + label: 'Netmask', + validation: { required: true } + }, + startip: { + label: 'Start IP', + validation: { required: true } + }, + endip: { + label: 'End IP', + validation: { required: false } + }, + + //only basic zones show guest fields (begin) + guestGateway: { + label: 'Guest Gateway', + validation: { required: true }, + isHidden: true + }, + guestNetmask: { + label: 'Guest Netmask', + validation: { required: true }, + isHidden: true + }, + startGuestIp: { + label: 'Start Guest IP', + validation: { required: true }, + isHidden: true + }, + endGuestIp: { + label: 'End Guest IP', + validation: { required: false }, + isHidden: true + } + //only basic zones show guest fields (end) + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: testData.notifications.testPoll + }, + + messages: { + notification: function(args) { + return 'Added new pod'; + } + } + } + } + } + }, + clusters: { + title: 'Cluster', + listView: { + id: 'clusters', + section: 'clusters', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' } + }, + dataProvider: testData.dataProvider.listView('clusters'), + actions: { + add: { + label: 'Add cluster', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a cluster?'; + }, + success: function(args) { + return 'Your new cluster is being created.'; + }, + notification: function(args) { + return 'Creating new cluster'; + }, + complete: function(args) { + return 'Cluster has been created successfully!'; + } + }, + + createForm: { + title: 'Add cluster', + desc: 'Please fill in the following data to add a new cluster.', + fields: { + hypervisor: { + label: 'Hypervisor', + select: function(args) { + args.response.success({ data: testData.data.hypervisors }); + args.$select.bind("change", function(event) { + var $form = $(this).closest('form'); + if($(this).val() == "VMware") { + //$('li[input_sub_group="external"]', $dialogAddCluster).show(); + $form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterDatacenter]').css('display', 'inline-block'); + + //$("#cluster_name_label", $dialogAddCluster).text("vCenter Cluster:"); + } + else { + //$('li[input_group="vmware"]', $dialogAddCluster).hide(); + $form.find('.form-item[rel=vCenterHost]').css('display', 'none'); + $form.find('.form-item[rel=vCenterUsername]').css('display', 'none'); + $form.find('.form-item[rel=vCenterPassword]').css('display', 'none'); + $form.find('.form-item[rel=vCenterDatacenter]').css('display', 'none'); + + //$("#cluster_name_label", $dialogAddCluster).text("Cluster:"); + } + }); + } + }, + podId: { + label: 'Pod', + select: function(args) { + args.response.success({ descriptionField: 'name', data: testData.data.pods }); + } + }, + name: { + label: 'Cluster Name', + validation: { required: true } + }, + + //hypervisor==VMWare begins here + vCenterHost: { + label: 'vCenter Host', + validation: { required: true } + }, + vCenterUsername: { + label: 'vCenter Username', + validation: { required: true } + }, + vCenterPassword: { + label: 'vCenter Password', + validation: { required: true }, + isPassword: true + }, + vCenterDatacenter: { + label: 'vCenter Datacenter', + validation: { required: true } + } + //hypervisor==VMWare ends here + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: testData.notifications.testPoll + } + }, + destroy: testData.actions.destroy('cluster') + }, + detailView: { + viewAll: { path: '_zone.hosts', label: 'Hosts' }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + allocationstate: { label: 'State' }, + podname: { label: 'Pod' }, + hypervisortype: { label: 'Hypervisor' }, + clustertype: { label: 'Cluster' } + } + ], + + dataProvider: testData.dataProvider.detailView('clusters') + } + } + } + } + }, + hosts: { + title: 'Host', + id: 'hosts', + listView: { + section: 'hosts', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' } + }, + dataProvider: testData.dataProvider.listView('hosts'), + actions: { + add: { + label: 'Add host', + + createForm: { + title: 'Add new host', + desc: 'Please fill in the following information to add a new host fro the specified zone configuration.', + preFilter: function(args) { + var $form = args.$form; + var $guestFields = $form.find('.form-item[rel=guestGateway], ' + + '.form-item[rel=guestNetmask], ' + + '.form-item[rel=guestIPRange]'); + + if (args.context.zones[0].name == 'Chicago') { + $guestFields.css('display', 'inline-block'); + } + }, + fields: { + pod: { + label: 'Pod', + + select: function(args) { + /** + * Example to show/hide fields + * + * -Select Pod2 to show conditional fields + * -Select any other field to hide conditional fields + */ + args.$select.change(function() { + var $input = $(this); + var $form = $input.closest('form'); + + // Note: need to actually select the .form-item div containing the input + var $condTestA = $form.find('.form-item[rel=condTestA]'); + var $condTestB = $form.find('.form-item[rel=condTestB]'); + + $condTestA.hide(); + $condTestB.hide(); + + if ($input.val() == 2) { + // Note: need to show by setting display=inline-block, not .show() + $condTestA.css('display', 'inline-block'); + $condTestB.css('display', 'inline-block'); + } + }); + + setTimeout(function() { + args.response.success({ + descriptionField: 'name', + data: testData.data.pods + }); + }, 100); + } + }, + cluster: { + label: 'Cluster', + + dependsOn: 'pod', + + select: function(args) { + setTimeout(function() { + args.response.success({ + descriptionField: 'name', + data: testData.data.clusters + }); + }, 20); + } + }, + + hostname: { + label: 'Host name', + validation: { required: true } + }, + + username: { + label: 'User name', + validation: { required: true } + }, + + password: { + label: 'Password', + validation: { required: true } + }, + + /** + * Test for conditional fields + * note that these are hidden by default + */ + condTestA: { + // Hidden by default + hidden: true, + + label: 'Conditional A', + validation: { required: true } + }, + + condTestB: { + // Hidden by default + hidden: true, + + label: 'Conditional B', + validation: { required: true } + }, + + guestGateway: { + hidden: true, + label: 'Guest Gateway', + validation: { required: true } + }, + + guestNetmask: { + hidden: true, + label: 'Guest Netmask', + validation: { required: true } + }, + + guestIPRange: { + hidden: true, + label: 'Guest IP Range', + validation: { required: true } + } + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: testData.notifications.customPoll(testData.data.hosts[0]) + }, + + messages: { + notification: function(args) { + return 'Added new host'; + } + } + }, + destroy: testData.actions.destroy('host') + }, + detailView: { + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' }, + }, + { + type: { label: 'Type' }, + zonename: { label: 'Zone' }, + } + ], + + dataProvider: testData.dataProvider.detailView('hosts') + }, + } + } + } + }, + 'primary-storage': { + title: 'Primary Storage', + id: 'primaryStorage', + listView: { + section: 'primary-storage', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' } + }, + dataProvider: testData.dataProvider.listView('clusters'), + actions: { + add: { + label: 'Add primary storage', + + createForm: { + title: 'Add new primary storage', + desc: 'Please fill in the following information to add a new primary storage', + fields: { + //always appear (begin) + podId: { + label: 'Pod', + validation: { required: true }, + select: function(args) { + args.response.success({ + descriptionField: 'name', + data: testData.data.pods + }); + } + }, + + clusterId: { + label: 'Cluster', + validation: { required: true }, + dependsOn: 'podId', + select: function(args) { + args.response.success({ + descriptionField: 'name', + data: testData.data.clusters + }); + } + }, + + name: { + label: 'Name', + validation: { required: true } + }, + + protocol: { + label: 'Protocol', + validation: { required: true }, + dependsOn: 'clusterId', + select: function(args) { + args.response.success({ + data: [ + { + id: 'nfs', + description: 'NFS' + }, + { + id: 'iscsi', + description: 'iSCSI' + } + ] + }); + } + }, + //always appear (end) + + server: { + label: 'Server', + validation: { required: true }, + isHidden: true + }, + + //nfs + path: { + label: 'Path', + validation: { required: true }, + isHidden: true + }, + + //iscsi + iqn: { + label: 'Target IQN', + validation: { required: true }, + isHidden: true + }, + lun: { + label: 'LUN #', + validation: { required: true }, + isHidden: true + }, + + //vmfs + vCenterDataCenter: { + label: 'vCenter Datacenter', + validation: { required: true }, + isHidden: true + }, + vCenterDataStore: { + label: 'vCenter Datastore', + validation: { required: true }, + isHidden: true + }, + + //always appear (begin) + storageTags: { + label: 'Storage Tags', + validation: { required: false } + } + //always appear (end) + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: function(args){ + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new primary storage'; + } + } + }, + destroy: testData.actions.destroy('cluster') + }, + detailView: { + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + zonename: { label: 'Zone' }, + hostname: { label: 'Host' } + } + ], + + dataProvider: testData.dataProvider.detailView('clusters') + } + } + } + } + }, + 'secondary-storage': { + title: 'Secondary Storage', + id: 'secondary-storage', + listView: { + section: 'seconary-storage', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' } + }, + dataProvider: testData.dataProvider.listView('clusters'), + actions: { + add: { + label: 'Add secondary storage', + + createForm: { + title: 'Add new secondary storage', + desc: 'Please fill in the following information to add a new secondary storage', + fields: { + nfsServer: { + label: 'NFS Server', + validation: { required: true } + }, + path: { + label: 'Path', + validation: { required: true } + } + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: function(args) { + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new secondary storage'; + } + } + }, + destroy: testData.actions.destroy('cluster') + }, + detailView: { + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + zonename: { label: 'Zone' }, + hostname: { label: 'Host' } + } + ], + + dataProvider: testData.dataProvider.detailView('clusters') + } + } + } + } + } + } + }; +})($, cloudStack); diff --git a/ui/scripts-test/templates.js b/ui/scripts-test/templates.js new file mode 100644 index 00000000000..0035a243e09 --- /dev/null +++ b/ui/scripts-test/templates.js @@ -0,0 +1,78 @@ +(function(cloudStack) { + cloudStack.sections.templates = { + title: 'Templates', + id: 'templates', + sectionSelect: { + label: 'Select view' + }, + sections: { + templates: { + type: 'select', + title: 'Templates', + listView: { + id: 'templates', + label: 'Templates', + fields: { + displaytext: { label: 'Name', editable: true }, + desc: { label: 'Details' }, + zonename: { label: 'Zone' }, + hypervisor: { label: 'Hypervisor' } + }, + actions: { + // Add template + add: { + label: 'Add template', + + action: function(args) { + args.response.success(); + }, + + messages: { + notification: function(args) { + return 'Created template'; + } + }, + + createForm: { + title: 'Add new template', + desc: 'Please enter the following data to create your new template', + + fields: { + name: { label: 'Name', validation: { required: true } }, + displayText: { label: 'Display Text', validation: { required: true } }, + url: { label: 'URL', validation: { required: true } }, + passwordEnabled: { label: 'Password', isBoolean: true } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + }, + edit: { + label: 'Edit template name', + action: function(args) { + args.response.success(args.data[0]); + } + } + }, + dataProvider: testData.dataProvider.listView('templates') + } + }, + isos: { + type: 'select', + title: 'ISOs', + listView: { + label: 'ISOs', + fields: { + displaytext: { label: 'Name' }, + desc: { label: 'Details' }, + size: { label: 'Size' }, + zonename: { label: 'Zone' } + }, + dataProvider: testData.dataProvider.listView('isos') + } + } + } + }; +})(cloudStack); diff --git a/ui/scripts-test/test-data.js b/ui/scripts-test/test-data.js new file mode 100644 index 00000000000..590897f9426 --- /dev/null +++ b/ui/scripts-test/test-data.js @@ -0,0 +1,5811 @@ +(function(window) { + var testRestartPoll; + + window.testData = { + actionFilter: function(args) { + var allowedActions = args.context.actions; + var disallowedActions = []; + var item = args.context.item; + var status = item.state; + + if (status == 'Running' || status == 'Starting') { + disallowedActions.push('start'); + } else if (status == 'Stopped' || status == 'Stopping') { + disallowedActions.push('stop'); + disallowedActions.push('restart'); + } else if (status == 'Destroyed') { + disallowedActions = allowedActions; + } + + if (item.isstaticnat) { + disallowedActions.push('enableStaticNAT'); + } else { + disallowedActions.push('disableStaticNAT'); + } + + if (item.vpnenabled) { + disallowedActions.push('enableVPN'); + } else { + disallowedActions.push('disableVPN'); + } + + if (item.issourcenat){ + disallowedActions.push('enableStaticNAT'); + disallowedActions.push('disableStaticNAT'); + } else { + disallowedActions.push('enableVPN'); + disallowedActions.push('disableVPN'); + } + + allowedActions = $.grep(allowedActions, function(item) { + return $.inArray(item, disallowedActions) == -1; + }); + + return allowedActions; + }, + notifications: { + testPoll: function(args) { + if (!testRestartPoll) testRestartPoll = 0; + if (testRestartPoll == 1) { + args.complete(); + testRestartPoll = 0; + return true; + } + + testRestartPoll++; + + return true; + }, + customPoll: function(data, actionFilter) { + return function(args) { + if (!testRestartPoll) testRestartPoll = 0; + if (testRestartPoll == 1) { + args.complete({ + data: data, + actionFilter: actionFilter ? actionFilter : testData.actionFilter + }); + testRestartPoll = 0; + return true; + } + + testRestartPoll++; + + return true; + }; + } + }, + actions: { + destroy: function(label) { + return { + label: 'Destroy ' + label, + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + label + '
    ' + args.name + '?'; + }, + notification: function(args) { + return 'Destroyed ' + label + ': ' + args.name; + } + }, + action: function(args) { + args.response.success(); + }, + notification: { + poll: testData.notifications.testPoll + } + }; + } + }, + dataProvider: { + listView: function(section) { + return function(args) { + setTimeout(function() { + var data; + if (args.page <= 5) data = testData.data[section]; + args.response.success({ + actionFilter: testData.actionFilter, + data: data + }); + }, 300); + }; + }, + detailView: function(section) { + return function(args) { + setTimeout(function() { + var item = $.grep(testData.data[section], function(elem) { + return elem.id == args.id; + }); + + args.response.success({ + actionFilter: function(args) { + var allowedActions = args.context.actions; + var disallowedActions = []; + var item = args.context.item; + var status = item.state; + + if (status == 'Running' || status == 'Starting') { + disallowedActions.push('start'); + } else if (status == 'Stopped' || status == 'Stopping') { + disallowedActions.push('stop'); + disallowedActions.push('restart'); + } + + allowedActions = $.grep(allowedActions, function(item) { + return $.inArray(item, disallowedActions) == -1; + }); + + return allowedActions; + }, + data: item[0] + }); + }, 300); + }; + }, + instanceWizard: function(args) { + setTimeout(function() { + args.response.success(); + }); + } + }, + data: { + instances: [ + { + "id": 440, + "name": "i-8-440-VM", + "displayname": "i-8-440-VM", + "account": "TEST", + "domainid": 4, + "domain": "TEST", + "created": "2011-06-14T07:39:12-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "templateid": 256, + "templatename": "CentOS 5.3 (64 bit) Xenserver", + "templatedisplaytext": "CentOS 5.3 (64 bit) Xenserver Password enabled", + "passwordenabled": true, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0.76%", + "networkkbsread": 297109, + "networkkbswrite": 351816, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "PreSetup", + "nic": [ + { + "id": 489, + "networkid": 205, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.155", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + }, + { + "id": 489, + "networkid": 206, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.156", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": false + }, + { + "id": 490, + "networkid": 207, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.157", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": false + } + ], + "hypervisor": "XenServer" + }, + { + "id": 449, + "name": "i-15-449-VM", + "displayname": "DomsTest6", + "account": "RS4", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-14T11:11:58-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 229, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.32", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.32", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.74%", + "networkkbsread": 87141, + "networkkbswrite": 3533, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 498, + "networkid": 231, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.92", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 595, + "name": "i-29-595-VM", + "displayname": "Demo", + "account": "JamieLong", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-21T11:56:34-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 7, + "hostname": "192.168.21.214", + "templateid": 259, + "templatename": "CentOS 5.3 (64 bit) vSphere", + "templatedisplaytext": "CentOS 5.3 (64 bit) vSphere Password enabled", + "passwordenabled": true, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 648, + "networkid": 241, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.95", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 622, + "name": "i-20-622-VM", + "displayname": "structure", + "account": "cloud", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-22T10:14:45-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "templateid": 266, + "templatename": "CentOS 5.3 (64 bit) Xenserver", + "templatedisplaytext": "CentOS 5.3 (64 bit) Xenserver", + "passwordenabled": false, + "serviceofferingid": 2, + "serviceofferingname": "Medium Instance", + "cpunumber": 1, + "cpuspeed": 1000, + "memory": 1024, + "cpuused": "0.05%", + "networkkbsread": 43183, + "networkkbswrite": 26496, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "PreSetup", + "nic": [ + { + "id": 677, + "networkid": 227, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.254", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "XenServer" + }, + { + "id": 665, + "name": "i-35-665-VM", + "displayname": "sumi-virtiual-vm-1", + "account": "sumi", + "domainid": 7, + "domain": "sumita", + "created": "2011-06-23T14:41:17-0700", + "state": "Stopped", + "haenable": false, + "groupid": 22, + "group": "sumi", + "zoneid": 1, + "zonename": "San Jose", + "templateid": 259, + "templatename": "CentOS 5.3 (64 bit) vSphere", + "templatedisplaytext": "CentOS 5.3 (64 bit) vSphere Password enabled", + "passwordenabled": true, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 720, + "networkid": 243, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.224", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 777, + "name": "i-23-777-VM", + "displayname": "QA_RSpec_CloudStack2_2_4_instance_1309417955", + "account": "RS3", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-30T03:20:40-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 229, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.32", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.32", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.67%", + "networkkbsread": 78074, + "networkkbswrite": 2641, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 834, + "networkid": 233, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.202", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 786, + "name": "i-23-786-VM", + "displayname": "QA_RSpec_CloudStack2_2_4_Server_Array_1309417955 #2", + "account": "RS3", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-30T05:16:56-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 229, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.32", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.32", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.63%", + "networkkbsread": 79738, + "networkkbswrite": 75978, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 843, + "networkid": 233, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.244", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 805, + "name": "i-23-805-VM", + "displayname": "dshank_test_CloudStack2_2_4_instance_1309468441", + "account": "RS3", + "domainid": 1, + "domain": "ROOT", + "created": "2011-06-30T14:17:45-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 229, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.32", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.32", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.58%", + "networkkbsread": 77647, + "networkkbswrite": 2668, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 864, + "networkid": 233, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.85", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 861, + "name": "i-15-861-VM", + "displayname": "kd-test", + "account": "RS4", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-05T11:31:08-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 272, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.34_Dev1", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.34_Dev1", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.71%", + "networkkbsread": 62545, + "networkkbswrite": 2361, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 922, + "networkid": 231, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.88", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 901, + "name": "i-16-901-VM", + "displayname": "jf: tester", + "account": "RS5", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-06T07:36:24-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 291, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.34", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.34", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.65%", + "networkkbsread": 30199, + "networkkbswrite": 243354, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 962, + "networkid": 225, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.122", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 972, + "name": "i-32-972-VM", + "displayname": "web1", + "account": "sumita-user", + "domainid": 7, + "domain": "sumita", + "created": "2011-07-08T13:58:51-0700", + "state": "Running", + "haenable": false, + "groupid": 28, + "group": "web servers", + "zoneid": 1, + "zonename": "San Jose", + "hostid": 7, + "hostname": "192.168.21.214", + "templateid": 230, + "templatename": "Fedora 15", + "templatedisplaytext": "Fedora 15", + "passwordenabled": false, + "isoid": 230, + "isoname": "Fedora 15", + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 99, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1035, + "networkid": 238, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.116", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 1030, + "name": "i-19-1030-VM", + "displayname": "i-19-1030-VM", + "account": "SCALR", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-12T15:09:32-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 266, + "templatename": "CentOS 5.3 (64 bit) Xenserver", + "templatedisplaytext": "CentOS 5.3 (64 bit) Xenserver", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0.03%", + "networkkbsread": 10938, + "networkkbswrite": 2993, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "PreSetup", + "nic": [ + { + "id": 1095, + "networkid": 249, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.54", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "XenServer" + }, + { + "id": 1118, + "name": "i-7-1118-VM", + "displayname": "TMDemoVM1", + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "created": "2011-07-14T07:48:35-0700", + "state": "Stopped", + "haenable": false, + "groupid": 30, + "group": "TMDemo", + "zoneid": 1, + "zonename": "San Jose", + "templateid": 259, + "templatename": "CentOS 5.3 (64 bit) vSphere", + "templatedisplaytext": "CentOS 5.3 (64 bit) vSphere Password enabled", + "passwordenabled": true, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1185, + "networkid": 206, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.183", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 1274, + "name": "i-27-1274-VM", + "displayname": "i-27-1274-VM", + "account": "Yali", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-26T19:41:11-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 7, + "hostname": "192.168.21.214", + "templateid": 259, + "templatename": "CentOS 5.3 (64 bit) vSphere", + "templatedisplaytext": "CentOS 5.3 (64 bit) vSphere Password enabled", + "passwordenabled": true, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1347, + "networkid": 237, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.30", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 1276, + "name": "i-2-1276-VM", + "displayname": "sumita-direct-test", + "account": "admin", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-27T09:04:25-0700", + "state": "Running", + "haenable": false, + "zoneid": 2, + "zonename": "Chicago", + "hostid": 8, + "hostname": "x31.fre.vmops.com", + "templateid": 267, + "templatename": "CentOS 5.3 (64 bit) KVM", + "templatedisplaytext": "CentOS 5.3 (64 bit) KVM", + "passwordenabled": false, + "isoid": 307, + "isoname": "Gentoo AMD64 20110714", + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.01%", + "networkkbsread": 192035, + "networkkbswrite": 4105, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "securitygroup": [ + { + "id": 1, + "name": "default", + "description": "Default Security Group" + } + ], + "nic": [ + { + "id": 1349, + "networkid": 211, + "netmask": "255.255.255.0", + "gateway": "65.19.181.1", + "ipaddress": "65.19.181.76", + "isolationuri": "vlan://65", + "broadcasturi": "vlan://65", + "traffictype": "Guest", + "type": "Direct", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 1284, + "name": "i-23-1284-VM", + "displayname": "Base ServerTemplate for Linux (Chef) - Beta", + "account": "RS3", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-27T10:40:42-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 291, + "templatename": "RightImage_CentOS_5.4_x64_v5.6.34", + "templatedisplaytext": "RightImage_CentOS_5.4_x64_v5.6.34", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "2.01%", + "networkkbsread": 61486, + "networkkbswrite": 68649, + "guestosid": 14, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1357, + "networkid": 233, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.92", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 1323, + "name": "i-10-1323-VM", + "displayname": "osamu_vmware", + "account": "osamu", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-31T08:42:34-0700", + "state": "Stopped", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "templateid": 259, + "templatename": "CentOS 5.3 (64 bit) vSphere", + "templatedisplaytext": "CentOS 5.3 (64 bit) vSphere Password enabled", + "passwordenabled": true, + "serviceofferingid": 2, + "serviceofferingname": "Medium Instance", + "cpunumber": 1, + "cpuspeed": 1000, + "memory": 1024, + "cpuused": "0%", + "networkkbsread": 0, + "networkkbswrite": 0, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1396, + "networkid": 234, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.179", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "VMware" + }, + { + "id": 1324, + "name": "i-10-1324-VM", + "displayname": "osamu_kvm", + "account": "osamu", + "domainid": 1, + "domain": "ROOT", + "created": "2011-07-31T08:53:47-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 1, + "hostname": "905-17.sjc.vmops.com", + "templateid": 267, + "templatename": "CentOS 5.3 (64 bit) KVM", + "templatedisplaytext": "CentOS 5.3 (64 bit) KVM", + "passwordenabled": false, + "serviceofferingid": 2, + "serviceofferingname": "Medium Instance", + "cpunumber": 1, + "cpuspeed": 1000, + "memory": 1024, + "cpuused": "26.13%", + "networkkbsread": 4865, + "networkkbswrite": 307, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "NetworkFilesystem", + "nic": [ + { + "id": 1397, + "networkid": 234, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.139", + "isolationuri": "vlan://275", + "broadcasturi": "vlan://275", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "KVM" + }, + { + "id": 1355, + "name": "i-2-1355-VM", + "displayname": "i-2-1355-VM", + "account": "admin", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-02T07:43:07-0700", + "state": "Running", + "haenable": false, + "zoneid": 1, + "zonename": "San Jose", + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "templateid": 266, + "templatename": "CentOS 5.3 (64 bit) Xenserver", + "templatedisplaytext": "CentOS 5.3 (64 bit) Xenserver", + "passwordenabled": false, + "serviceofferingid": 2, + "serviceofferingname": "Medium Instance", + "cpunumber": 1, + "cpuspeed": 1000, + "memory": 1024, + "cpuused": "0.05%", + "networkkbsread": 4555210, + "networkkbswrite": 3920, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "PreSetup", + "nic": [ + { + "id": 1434, + "networkid": 212, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.32", + "isolationuri": "vlan://201", + "broadcasturi": "vlan://201", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "XenServer" + }, + { + "id": 1377, + "name": "i-44-1377-VM", + "displayname": "Eric-VM-1", + "account": "support-team", + "domainid": 12, + "domain": "cloud support", + "created": "2011-08-03T15:24:40-0700", + "state": "Running", + "haenable": false, + "groupid": 34, + "group": "Web", + "zoneid": 1, + "zonename": "San Jose", + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "templateid": 266, + "templatename": "CentOS 5.3 (64 bit) Xenserver", + "templatedisplaytext": "CentOS 5.3 (64 bit) Xenserver", + "passwordenabled": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "cpuused": "0.02%", + "networkkbsread": 1599417, + "networkkbswrite": 3267160, + "guestosid": 12, + "rootdeviceid": 0, + "rootdevicetype": "PreSetup", + "nic": [ + { + "id": 1456, + "networkid": 259, + "netmask": "255.255.255.0", + "gateway": "10.1.1.1", + "ipaddress": "10.1.1.95", + "traffictype": "Guest", + "type": "Virtual", + "isdefault": true + } + ], + "hypervisor": "XenServer" + } + ], + domains: [ + { + "id": 123, + "name": "ROOT" + } + ], + storage: [ + { + "id": 1863, + "name": "ROOT-1727", + "zoneid": 1, + "zonename": "San Jose", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1727, + "vmname": "i-57-1727-VM", + "vmdisplayname": "i-57-1727-VM", + "vmstate": "Stopped", + "size": 8589934592, + "created": "2011-08-19T16:22:29-0700", + "state": "Ready", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "XenServer", + "storage": "Xen Cluster01 NFS Primary", + "destroyed": false, + "serviceofferingid": 2, + "serviceofferingname": "Medium Instance", + "serviceofferingdisplaytext": "Medium Instance, $0.10 per hour", + "isextractable": false + }, + { + "id": 1864, + "name": "DATA-1727", + "zoneid": 1, + "zonename": "San Jose", + "type": "DATADISK", + "deviceid": 1, + "virtualmachineid": 1727, + "vmname": "i-57-1727-VM", + "vmdisplayname": "i-57-1727-VM", + "vmstate": "Stopped", + "size": 21474836480, + "created": "2011-08-19T16:22:29-0700", + "state": "Ready", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "XenServer", + "diskofferingid": 4, + "diskofferingname": "Medium", + "diskofferingdisplaytext": "Medium Disk, 20 GB", + "storage": "Xen Cluster01 NFS Primary", + "destroyed": false, + "isextractable": false + }, + { + "id": 1862, + "name": "ROOT-1726", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1726, + "vmname": "i-5-1726-VM", + "vmdisplayname": "6bit master", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T14:16:26-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1859, + "name": "ROOT-1723", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1723, + "vmname": "i-5-1723-VM", + "vmdisplayname": "i-5-1723-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T13:38:46-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1860, + "name": "ROOT-1725", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1725, + "vmname": "i-5-1725-VM", + "vmdisplayname": "i-5-1725-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T13:38:46-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1861, + "name": "ROOT-1724", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1724, + "vmname": "i-5-1724-VM", + "vmdisplayname": "i-5-1724-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T13:38:46-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1854, + "name": "ROOT-1719", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1719, + "vmname": "i-5-1719-VM", + "vmdisplayname": "i-5-1719-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T09:52:07-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1855, + "name": "ROOT-1720", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1720, + "vmname": "i-5-1720-VM", + "vmdisplayname": "i-5-1720-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T09:52:07-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1856, + "name": "ROOT-1721", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1721, + "vmname": "i-5-1721-VM", + "vmdisplayname": "i-5-1721-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T09:52:07-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1851, + "name": "ROOT-1716", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1716, + "vmname": "i-5-1716-VM", + "vmdisplayname": "i-5-1716-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T05:59:13-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1852, + "name": "ROOT-1717", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1717, + "vmname": "i-5-1717-VM", + "vmdisplayname": "i-5-1717-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T05:59:13-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1853, + "name": "ROOT-1718", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1718, + "vmname": "i-5-1718-VM", + "vmdisplayname": "i-5-1718-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T05:59:13-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1847, + "name": "ROOT-1712", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1712, + "vmname": "i-5-1712-VM", + "vmdisplayname": "i-5-1712-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T04:40:17-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1848, + "name": "ROOT-1713", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1713, + "vmname": "i-5-1713-VM", + "vmdisplayname": "i-5-1713-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T04:40:17-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1849, + "name": "ROOT-1715", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1715, + "vmname": "i-5-1715-VM", + "vmdisplayname": "i-5-1715-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T04:40:17-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1850, + "name": "ROOT-1714", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1714, + "vmname": "i-5-1714-VM", + "vmdisplayname": "i-5-1714-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-19T04:40:17-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1842, + "name": "ROOT-1707", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1707, + "vmname": "i-5-1707-VM", + "vmdisplayname": "i-5-1707-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-18T22:30:12-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1843, + "name": "ROOT-1708", + "zoneid": 2, + "zonename": "Chicago", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1708, + "vmname": "i-5-1708-VM", + "vmdisplayname": "i-5-1708-VM", + "vmstate": "Running", + "size": 10485760000, + "created": "2011-08-18T22:30:12-0700", + "state": "Ready", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "KVM", + "storage": "Chicago KVM Primary NFS", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1840, + "name": "ROOT-1705", + "zoneid": 1, + "zonename": "San Jose", + "type": "ROOT", + "deviceid": 0, + "virtualmachineid": 1705, + "vmname": "i-29-1705-VM", + "vmdisplayname": "test", + "vmstate": "Running", + "size": 8589934592, + "created": "2011-08-18T17:26:58-0700", + "state": "Ready", + "account": "JamieLong", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "XenServer", + "storage": "Xen Cluster 02 NFS Primary", + "destroyed": false, + "serviceofferingid": 1, + "serviceofferingname": "Small Instance", + "serviceofferingdisplaytext": "Small Instance, $0.05 per hour", + "isextractable": false + }, + { + "id": 1839, + "name": "DATA-1704", + "zoneid": 1, + "zonename": "San Jose", + "type": "DATADISK", + "size": 107374182400, + "created": "2011-08-18T16:19:18-0700", + "state": "Ready", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "storagetype": "shared", + "hypervisor": "XenServer", + "diskofferingid": 5, + "diskofferingname": "Large", + "diskofferingdisplaytext": "Large Disk, 100 GB", + "storage": "Xen Cluster01 NFS Primary", + "destroyed": false, + "isextractable": false + } + ], + snapshots: [ + { + "id": 120, + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1858, + "volumename": "ROOT-1722", + "volumetype": "ROOT", + "created": "2011-08-19T13:48:02-0700", + "name": "i-57-1722-VM_ROOT-1722_20110819204802", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 118, + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1836, + "volumename": "ROOT-1702", + "volumetype": "ROOT", + "created": "2011-08-18T15:16:04-0700", + "name": "i-57-1702-VM_ROOT-1702_20110818221604", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 116, + "account": "Tim demo", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1734, + "volumename": "ROOT-1604", + "volumetype": "ROOT", + "created": "2011-08-15T18:20:40-0700", + "name": "i-3-1604-VM_ROOT-1604_20110816012040", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 111, + "account": "SCALR", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1587, + "volumename": "ROOT-1446", + "volumetype": "ROOT", + "created": "2011-08-15T04:33:59-0700", + "name": "i-19-1446-VM_ROOT-1446_20110815113359", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 108, + "account": "iizuka", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1506, + "volumename": "ROOT-1381", + "volumetype": "ROOT", + "created": "2011-08-04T00:40:28-0700", + "name": "i-39-1381-VM_ROOT-1381_20110804074028", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 107, + "account": "RS5", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1492, + "volumename": "edwinOnInstance", + "volumetype": "DATADISK", + "created": "2011-08-03T11:42:27-0700", + "name": "i-16-1358-VM_edwinOnInstance_20110803184227", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 106, + "account": "RS5", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1468, + "volumename": "edwin-cloudstack-kvm", + "volumetype": "DATADISK", + "created": "2011-08-03T05:17:13-0700", + "name": "i-16-1358-VM_edwin-cloudstack-kvm_20110803121713", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 105, + "account": "RS5", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1468, + "volumename": "edwin-cloudstack-kvm", + "volumetype": "DATADISK", + "created": "2011-08-03T04:43:52-0700", + "name": "i-16-1358-VM_edwin-cloudstack-kvm_20110803114352", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 104, + "account": "RS5", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1468, + "volumename": "edwin-cloudstack-kvm", + "volumetype": "DATADISK", + "created": "2011-08-02T13:45:07-0700", + "name": "i-16-1358-VM_edwin-cloudstack-kvm_20110802204507", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 103, + "account": "osamu", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1428, + "volumename": "ROOT-1323", + "volumetype": "ROOT", + "created": "2011-08-01T18:46:30-0700", + "name": "i-10-1323-VM_ROOT-1323_20110802014630", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 102, + "account": "iizuka", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1395, + "volumename": "DATA-1297", + "volumetype": "DATADISK", + "created": "2011-07-27T22:03:15-0700", + "name": "i-39-1297-VM_DATA-1297_20110728050315", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 101, + "account": "iizuka", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1361, + "volumename": "ROOT-1265", + "volumetype": "ROOT", + "created": "2011-07-26T00:36:13-0700", + "name": "i-39-1265-VM_ROOT-1265_20110726073613", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 100, + "account": "iizuka", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 1223, + "volumename": "ROOT-1133", + "volumetype": "ROOT", + "created": "2011-07-15T03:36:56-0700", + "name": "i-39-1133-VM_ROOT-1133_20110715103656", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 92, + "account": "Fukuda_Hitachi", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 886, + "volumename": "ROOT-828", + "volumetype": "ROOT", + "created": "2011-07-07T06:17:47-0700", + "name": "i-11-828-VM_ROOT-828_20110707131747", + "intervaltype": "MANUAL", + "state": "BackedUp" + }, + { + "id": 90, + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "snapshottype": "DAILY", + "volumeid": 664, + "volumename": "ROOT-623", + "volumetype": "ROOT", + "created": "2011-07-05T09:01:42-0700", + "name": "i-7-623-VM_ROOT-623_20110705160142", + "intervaltype": "DAILY", + "state": "BackedUp" + }, + { + "id": 89, + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "snapshottype": "DAILY", + "volumeid": 664, + "volumename": "ROOT-623", + "volumetype": "ROOT", + "created": "2011-07-04T09:01:29-0700", + "name": "i-7-623-VM_ROOT-623_20110704160129", + "intervaltype": "DAILY", + "state": "BackedUp" + }, + { + "id": 88, + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "snapshottype": "DAILY", + "volumeid": 664, + "volumename": "ROOT-623", + "volumetype": "ROOT", + "created": "2011-07-03T09:01:15-0700", + "name": "i-7-623-VM_ROOT-623_20110703160115", + "intervaltype": "DAILY", + "state": "BackedUp" + }, + { + "id": 87, + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "snapshottype": "DAILY", + "volumeid": 664, + "volumename": "ROOT-623", + "volumetype": "ROOT", + "created": "2011-07-02T09:01:01-0700", + "name": "i-7-623-VM_ROOT-623_20110702160101", + "intervaltype": "DAILY", + "state": "BackedUp" + }, + { + "id": 86, + "account": "DEV", + "domainid": 3, + "domain": "DEV", + "snapshottype": "DAILY", + "volumeid": 664, + "volumename": "ROOT-623", + "volumetype": "ROOT", + "created": "2011-07-01T09:00:48-0700", + "name": "i-7-623-VM_ROOT-623_20110701160048", + "intervaltype": "DAILY", + "state": "BackedUp" + }, + { + "id": 85, + "account": "Fluid Hosting", + "domainid": 1, + "domain": "ROOT", + "snapshottype": "MANUAL", + "volumeid": 848, + "volumename": "ROOT-796", + "volumetype": "ROOT", + "created": "2011-06-30T11:29:24-0700", + "name": "i-36-796-VM_ROOT-796_20110630182924", + "intervaltype": "MANUAL", + "state": "BackedUp" + } + ], + network: [ + { + "id": 98, + "ipaddress": "72.52.67.77", + "allocated": "2011-08-05T07:05:26-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "turk-telecom", + "domainid": 14, + "domain": "Turkey", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": true, + "virtualmachineid": 1397, + "virtualmachinename": "i-46-1397-VM", + "virtualmachinedisplayname": "vm-3", + "associatednetworkid": 262, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 83, + "ipaddress": "72.52.67.62", + "allocated": "2011-08-12T11:51:27-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "Seagate", + "domainid": 24, + "domain": "Seagate", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 270, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 73, + "ipaddress": "72.52.67.52", + "allocated": "2011-08-16T02:51:44-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "Vlad", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 248, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 72, + "ipaddress": "72.52.67.51", + "allocated": "2011-08-02T06:14:54-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "system", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 200, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 67, + "ipaddress": "72.52.67.46", + "allocated": "2011-08-16T12:11:54-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "Cosmopolitan", + "domainid": 28, + "domain": "Cosmopolitan", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 272, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 66, + "ipaddress": "72.52.67.45", + "allocated": "2011-08-16T12:05:39-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "IGT", + "domainid": 25, + "domain": "IGT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 271, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 63, + "ipaddress": "72.52.67.42", + "allocated": "2011-08-09T10:41:22-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "Tim demo", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 204, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 58, + "ipaddress": "72.52.67.37", + "allocated": "2011-08-12T08:55:06-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "Tim demo", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 204, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 52, + "ipaddress": "72.52.67.31", + "allocated": "2011-08-18T13:38:15-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 273, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 44, + "ipaddress": "72.52.67.23", + "allocated": "2011-08-10T18:38:17-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "george", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 245, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 43, + "ipaddress": "72.52.67.22", + "allocated": "2011-08-10T18:37:44-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "george", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 245, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 41, + "ipaddress": "72.52.67.20", + "allocated": "2011-08-16T02:27:38-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "SCALR", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 2, + "vlanname": "67", + "isstaticnat": false, + "associatednetworkid": 249, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 40, + "ipaddress": "72.52.126.69", + "allocated": "2011-06-07T08:05:47-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "Tivit", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 226, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 39, + "ipaddress": "72.52.126.68", + "allocated": "2011-06-08T17:23:36-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "Tenzing", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 232, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 38, + "ipaddress": "72.52.126.67", + "allocated": "2011-06-07T09:44:23-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "cloud", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 227, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 37, + "ipaddress": "72.52.126.66", + "allocated": "2011-06-08T12:04:48-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "sheng", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 230, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 36, + "ipaddress": "72.52.126.65", + "allocated": "2011-06-23T14:41:18-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "sumi", + "domainid": 7, + "domain": "sumita", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 243, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 35, + "ipaddress": "72.52.126.64", + "allocated": "2011-08-05T06:27:59-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "turk-telecom", + "domainid": 14, + "domain": "Turkey", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": true, + "virtualmachineid": 1394, + "virtualmachinename": "i-46-1394-VM", + "virtualmachinedisplayname": "turk-tel-vm-1", + "associatednetworkid": 262, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 34, + "ipaddress": "72.52.126.63", + "allocated": "2011-06-10T10:44:56-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": true, + "account": "jlong", + "domainid": 1, + "domain": "ROOT", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": false, + "associatednetworkid": 236, + "networkid": 200, + "state": "Allocated" + }, + { + "id": 33, + "ipaddress": "72.52.126.62", + "allocated": "2011-08-03T15:42:08-0700", + "zoneid": 1, + "zonename": "San Jose", + "issourcenat": false, + "account": "support-team", + "domainid": 12, + "domain": "cloud support", + "forvirtualnetwork": true, + "vlanid": 1, + "vlanname": "72", + "isstaticnat": true, + "virtualmachineid": 1377, + "virtualmachinename": "i-44-1377-VM", + "virtualmachinedisplayname": "Eric-VM-1", + "associatednetworkid": 259, + "networkid": 200, + "state": "Allocated" + } + ], + securityGroups: [ + { + "id": 1, + "name": "Security Group A", + "description": "Test Security Group A", + "account": "admin", + "domainid": 1, + "domain": "ROOT", + "ingressrule": [ + { + "ruleid": 28, + "protocol": "icmp", + "icmptype": -1, + "icmpcode": -1, + "cidr": "0.0.0.0/0" + } + ] + }, + { + "id": 2, + "name": "Security Group B", + "description": "Test Security Group B", + "account": "admin", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 3, + "name": "Security Group C", + "description": "Test Security Group C", + "account": "admin", + "domainid": 1, + "domain": "ROOT" + } + ], + templates: [ + { + "id": 2516, + "name": "CumuLogic-Master-64bit-0622", + "displaytext": "CumuLogic 64bit Master", + desc: '64-bit master by CumuLogic. Based on CentOS 5.5', + "ispublic": false, + "created": "2011-06-22T18:24:01-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 112, + "ostypename": "CentOS 5.5 (64-bit)", + "account": "Patni", + "zoneid": 2, + "zonename": "Chicago", + "status": "Download Complete", + "size": 10485760000, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 4499, + "name": "RightImage_CentOS_5.4_x64_v5.6.34_Dev1", + desc: 'CentOS image by RightImage. Developer Preview', + "displaytext": "RightImage CentOS", + "ispublic": true, + "created": "2011-06-22T11:23:01-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": true, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS2", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 229239, + "name": "RightImage_Windows_2008R2_SP1_x64_v5.7.3", + desc: 'Windows Server 2008 image by RightImage', + "displaytext": "RightImage Windows 2008", + "ispublic": true, + "created": "2011-07-20T18:00:17-0700", + "isready": true, + "passwordenabled": true, + "format": "OVA", + "isfeatured": false, + "crossZones": false, + "ostypeid": 54, + "ostypename": "Windows Server 2008 R2 (64-bit)", + "account": "RS2", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 4590540800, + "templatetype": "USER", + "hypervisor": "VMware", + "domain": "ROOT", + "domainid": 1, + "isextractable": false, + "checksum": "15b2c450ef8b54467028faf6412ed8d0" + }, + { + "id": 27237, + "name": "CH_RightImage_CentOS_5.4_x64_v5.6.34.dev3", + desc: 'RightImage. Developer Preview', + "displaytext": "CH RightImage CentOS 5", + "ispublic": true, + "created": "2011-06-23T13:18:55-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS5", + "zoneid": 2, + "zonename": "Chicago", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 279898, + "name": "CH_RI_CLOCK", + desc: 'CentOS RightImage -- testing only', + "displaytext": "RI CentOS", + "ispublic": true, + "created": "2011-06-23T14:17:52-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS5", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 29930, + "name": "RightImage_CentOS_5.4_x64_v5.6.34.dev3", + desc: 'RightImage. Developer Preview', + "displaytext": "CentOS Dev", + "ispublic": true, + "created": "2011-06-23T12:56:31-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS5", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 49311, + "name": "RightImage_CentOS_5.4_x64_v5.6.32_XEN", + desc: 'XenServer-enabled CentOS by RightImage', + "displaytext": "RightImage CentOS Xen", + "ispublic": true, + "created": "2011-08-02T16:04:01-0700", + "isready": true, + "passwordenabled": false, + "format": "VHD", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS3", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "XenServer", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 44449326, + "name": "RightImage_CentOS_5.4_x64_v5.6.32_XEN", + desc: 'XenServer-enabled CentOS by RightImage -- 32-bit only', + "displaytext": "RightImage CentOS Xen 32", + "ispublic": true, + "created": "2011-08-02T16:03:39-0700", + "isready": false, + "passwordenabled": false, + "format": "VHD", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS3", + "zoneid": 1, + "zonename": "San Jose", + "status": "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target", + "templatetype": "USER", + "hypervisor": "XenServer", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 5257, + "name": "RightImage_CentOS_5.4_x64_v5.6.28.1_VMWARE", + desc: 'VMWare-based CentOS image by RightImage', + "displaytext": "RightImage CentOS 5.4 VMWare", + "ispublic": true, + "created": "2011-08-02T16:59:49-0700", + "isready": true, + "passwordenabled": false, + "format": "OVA", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS3", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 868321280, + "templatetype": "USER", + "hypervisor": "VMware", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 4266, + "name": "RightImage_CentOS_5.4_x64_v5.6.34_Dev6_25c035c3878a93", + desc: 'Developer testing CentOS by RightImage', + "displaytext": "RightImage CentOS 5.4 Dev6", + "ispublic": false, + "created": "2011-06-23T18:03:46-0700", + "isready": true, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS4", + "zoneid": 2, + "zonename": "Chicago", + "status": "Download Complete", + "size": 10737418240, + "templatetype": "USER", + "hypervisor": "KVM", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 0259, + "name": "RightImage_CentOS_5.4_x64_v5.6.32.1_CDC_XEN", + desc: 'XenServer image by RightImage', + "displaytext": "RightImage CentOS 5.4 x64 v5.6 CDC XEN", + "ispublic": true, + "created": "2011-08-11T10:32:28-0700", + "isready": true, + "passwordenabled": false, + "format": "VHD", + "isfeatured": true, + "crossZones": false, + "ostypeid": 14, + "ostypename": "CentOS 5.4 (64-bit)", + "account": "RS2", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 4294967296, + "templatetype": "USER", + "hypervisor": "XenServer", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 9296, + "name": "CentOS Test", + desc: 'For testing only!', + "displaytext": "CentOS Test", + "ispublic": false, + "created": "2011-07-05T10:42:49-0700", + "isready": true, + "passwordenabled": false, + "format": "VHD", + "isfeatured": false, + "crossZones": false, + "ostypeid": 12, + "ostypename": "CentOS 5.3 (64-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Download Complete", + "size": 7623147520, + "templatetype": "USER", + "hypervisor": "XenServer", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + }, + { + "id": 4298, + "name": "MySQL5.032bit-CloudStack", + desc: 'CentOS 5.1 with MySQL preinstalled -- 32-bit only', + "displaytext": "MySQL 5 32-bit CloudStack", + "ispublic": false, + "created": "2011-07-20T04:38:59-0700", + "isready": false, + "passwordenabled": false, + "format": "QCOW2", + "isfeatured": false, + "crossZones": false, + "ostypeid": 7, + "ostypename": "CentOS 5.1 (32-bit)", + "account": "Patni", + "zoneid": 2, + "zonename": "Chicago", + "status": "Connection timed out", + "templatetype": "USER", + "hypervisor": "None", + "domain": "ROOT", + "domainid": 1, + "isextractable": false + } + ], + isos: [ + { + "id": 130232, + "name": "Gentoo AMD64 20110714", + "displaytext": "Gentoo AMD64 20110714", + desc: 'Gentoo Linux 64-bit. Contains basic installation', + "ispublic": false, + "created": "2011-07-26T11:40:02-0700", + "isready": true, + "bootable": true, + "isfeatured": false, + "crossZones": false, + "ostypeid": 103, + "ostypename": "Other (64-bit)", + "account": "admin", + "zoneid": 2, + "zonename": "Chicago", + "status": "Successfully Installed", + "size": 143814656, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 1307, + "name": "Gentoo AMD64 20110714", + desc: 'Gentoo 64-bit with full installation', + "displaytext": "Gentoo AMD64 20110714", + "ispublic": false, + "created": "2011-07-26T11:40:02-0700", + "isready": true, + "bootable": true, + "isfeatured": false, + "crossZones": false, + "ostypeid": 103, + "ostypename": "Other (64-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Successfully Installed", + "size": 143814656, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 1244, + "name": "Windows 8 (64 bit)", + desc: 'Windows 8 Developer Preview; from MSDN image', + "displaytext": "Windows 8 Developer Preview (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:20:24-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 54, + "ostypename": "Windows 8 (64-bit)", + "account": "admin", + "zoneid": 2, + "zonename": "Chicago", + "status": "Successfully Installed", + "size": 2996799488, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 124633, + "name": "Ubuntu 10-04 (64 bit)", + desc: 'Ubuntu 10 64-bit; custom install', + "displaytext": "Ubuntu 10-04 (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:23:18-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 126, + "ostypename": "Ubuntu 10.04 (64-bit)", + "account": "admin", + "zoneid": 2, + "zonename": "Chicago", + "status": "Successfully Installed", + "size": 731453440, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 124512, + "name": "Windows 7 Pro (32 bit)", + desc: 'Windows 7 32-bit; not for server use', + "displaytext": "Windows 7 Pro (32 bit)", + "ispublic": true, + "created": "2011-06-08T20:22:09-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 48, + "ostypename": "Windows 7 (32-bit)", + "account": "admin", + "zoneid": 2, + "zonename": "Chicago", + "status": "Successfully Installed", + "size": 2400239616, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 12463, + "name": "Ubuntu 10-04 (64 bit)", + desc: 'Ubuntu 10 64-bit; contains Apache Web Server', + "displaytext": "Ubuntu 10-04 (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:23:18-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 126, + "ostypename": "Ubuntu 10.04 (64-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Successfully Installed", + "size": 731453440, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 12423984, + "name": "Windows 2008 R2 (64 bit)", + desc: 'Windows Server', + "displaytext": "Windows 2008 R2 (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:20:24-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 54, + "ostypename": "Windows Server 2008 R2 (64-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Successfully Installed", + "size": 2996799488, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 12488285, + "name": "Windows 7 Pro (32 bit)", + desc: 'Windows 7 (Workstation only)', + "displaytext": "Windows 7 Pro (32 bit)", + "ispublic": true, + "created": "2011-06-08T20:22:09-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 48, + "ostypename": "Windows 7 (32-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Successfully Installed", + "size": 2400239616, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 12433881111, + "name": "RHEL 6.1 (64 bit)", + desc: 'Red Hat Enterprise Linux 6 -- contains full server software', + "displaytext": "RHEL 6.1 (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:18:45-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 137, + "ostypename": "Red Hat Enterprise Linux 6.0 (64-bit)", + "account": "admin", + "zoneid": 2, + "zonename": "Chicago", + "status": "Successfully Installed", + "size": 3600812032, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + }, + { + "id": 122878343, + "name": "RHEL 6.1 (64 bit)", + desc: 'Red Hat Enterprise -- minimal installation', + "displaytext": "RHEL 6.1 (64 bit)", + "ispublic": true, + "created": "2011-06-08T20:18:45-0700", + "isready": true, + "bootable": true, + "isfeatured": true, + "crossZones": false, + "ostypeid": 137, + "ostypename": "Red Hat Enterprise Linux 6.0 (64-bit)", + "account": "admin", + "zoneid": 1, + "zonename": "San Jose", + "status": "Successfully Installed", + "size": 3600812032, + "domain": "ROOT", + "domainid": 1, + "isextractable": true + } + ], + events: [ + { + "id": 1786821, + "username": "itsolutionsnow", + "type": "NET.IPRELEASE", + "level": "INFO", + "description": "Successfully completed disassociating Ip. Ip Id: 54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:25:29-0700", + "state": "Completed", + "parentid": 17859 + }, + { + "id": 17860, + "username": "itsolutionsnow", + "type": "NET.IPRELEASE", + "level": "INFO", + "description": "Starting job for disassociating Ip. Ip Id: 54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:25:24-0700", + "state": "Started", + "parentid": 17859 + }, + { + "id": 1785339, + "username": "itsolutionsnow", + "type": "NET.IPRELEASE", + "level": "INFO", + "description": "Scheduled async job for Disassociating ip address with id=54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:25:24-0700", + "state": "Scheduled", + "parentid": 0 + }, + { + "id": 17858, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Successfully completed associating Ip. Ip Id: 54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:24:58-0700", + "state": "Completed", + "parentid": 17855 + }, + { + "id": 17857, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Starting job for associating Ip. Ip Id: 54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:24:51-0700", + "state": "Started", + "parentid": 17855 + }, + { + "id": 17856, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Scheduled async job for associating ip to network id: 273 in zone 1", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:24:51-0700", + "state": "Scheduled", + "parentid": 17855 + }, + { + "id": 17855, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Successfully created entity for allocating Ip. Ip Id: 54", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:24:51-0700", + "state": "Created", + "parentid": 0 + }, + { + "id": 17854, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Successfully completed associating Ip. Ip Id: 53", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:23:55-0700", + "state": "Completed", + "parentid": 17851 + }, + { + "id": 17853, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Starting job for associating Ip. Ip Id: 53", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:23:50-0700", + "state": "Started", + "parentid": 17851 + }, + { + "id": 17852, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Scheduled async job for associating ip to network id: 273 in zone 1", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:23:50-0700", + "state": "Scheduled", + "parentid": 17851 + }, + { + "id": 17851, + "username": "itsolutionsnow", + "type": "NET.IPASSIGN", + "level": "INFO", + "description": "Successfully created entity for allocating Ip. Ip Id: 53", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:23:50-0700", + "state": "Created", + "parentid": 0 + }, + { + "id": 17850, + "username": "itsolutionsnow", + "type": "VM.CREATE", + "level": "INFO", + "description": "Successfully completed starting Vm. Vm Id: 1727", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:23:11-0700", + "state": "Completed", + "parentid": 17847 + }, + { + "id": 17849, + "username": "itsolutionsnow", + "type": "VM.CREATE", + "level": "INFO", + "description": "Starting job for starting Vm. Vm Id: 1727", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:22:29-0700", + "state": "Started", + "parentid": 17847 + }, + { + "id": 17848, + "username": "itsolutionsnow", + "type": "VM.CREATE", + "level": "INFO", + "description": "Scheduled async job for starting Vm. Vm Id: 1727", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:22:29-0700", + "state": "Scheduled", + "parentid": 17847 + }, + { + "id": 17847, + "username": "itsolutionsnow", + "type": "VM.CREATE", + "level": "INFO", + "description": "Successfully created entity for deploying Vm. Vm Id: 1727", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:22:29-0700", + "state": "Created", + "parentid": 0 + }, + { + "id": 17846, + "username": "itsolutionsnow", + "type": "USER.LOGIN", + "level": "INFO", + "description": "user has logged in", + "account": "IT SOLUTIONS NOW", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T16:21:44-0700", + "state": "Completed", + "parentid": 0 + }, + { + "id": 17845, + "username": "admin", + "type": "USER.LOGIN", + "level": "INFO", + "description": "user has logged in", + "account": "admin", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T15:54:45-0700", + "state": "Completed", + "parentid": 0 + }, + { + "id": 17844, + "username": "raj", + "type": "VM.CREATE", + "level": "INFO", + "description": "Successfully completed starting Vm. Vm Id: 1726", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T14:25:41-0700", + "state": "Completed", + "parentid": 17832 + }, + { + "id": 17843, + "username": "raj", + "type": "VM.DESTROY", + "level": "INFO", + "description": "Successfully completed destroying Vm. Vm Id: 1706", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T14:25:24-0700", + "state": "Completed", + "parentid": 17830 + }, + { + "id": 17842, + "username": "raj", + "type": "VM.DESTROY", + "level": "INFO", + "description": "Successfully completed destroying Vm. Vm Id: 1694", + "account": "Patni", + "domainid": 1, + "domain": "ROOT", + "created": "2011-08-19T14:23:21-0700", + "state": "Completed", + "parentid": 17828 + } + ], + alerts: [ + { + "id": 2951, + "type": 7, + "description": "VM (name: i-5-1683-VM, id: 1683) stopped unexpectedly on host id:8, availability zone id:2, pod id:2", + "sent": "2011-08-18T04:27:20-0700" + }, + { + "id": 2946, + "type": 8, + "description": "Unable to restart r-1395-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:16-0700" + }, + { + "id": 2947, + "type": 8, + "description": "Unable to restart r-1410-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:16-0700" + }, + { + "id": 2948, + "type": 7, + "description": "Unable to restart i-31-1424-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:16-0700" + }, + { + "id": 2949, + "type": 7, + "description": "Unable to restart i-53-1546-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:16-0700" + }, + { + "id": 2950, + "type": 8, + "description": "Unable to restart r-1547-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:16-0700" + }, + { + "id": 2931, + "type": 6, + "description": "Host is down, name: Demo4 XenCluster 01 (id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2932, + "type": 8, + "description": "Unable to restart r-6-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2933, + "type": 8, + "description": "Unable to restart r-26-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2934, + "type": 8, + "description": "Unable to restart r-331-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2935, + "type": 7, + "description": "Unable to restart i-8-440-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2936, + "type": 8, + "description": "Unable to restart r-496-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2937, + "type": 8, + "description": "Unable to restart r-914-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2938, + "type": 7, + "description": "Unable to restart i-44-1377-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2939, + "type": 8, + "description": "Unable to restart r-1378-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2940, + "type": 7, + "description": "Unable to restart i-44-1379-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2941, + "type": 7, + "description": "Unable to restart i-39-1380-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2942, + "type": 7, + "description": "Unable to restart i-39-1381-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2943, + "type": 7, + "description": "Unable to restart i-45-1391-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + }, + { + "id": 2944, + "type": 8, + "description": "Unable to restart r-1392-VM which was running on host name: Demo4 XenCluster 01(id:4), availability zone: San Jose, pod: Pod1", + "sent": "2011-08-15T10:13:15-0700" + } + ], + accounts: [ + { + "id": 2, + "name": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 103330977048, + "sentbytes": 341826430073, + "vmlimit": "Unlimited", + "vmtotal": 9, + "vmavailable": "Unlimited", + "iplimit": "Unlimited", + "iptotal": 1, + "ipavailable": "Unlimited", + "volumelimit": "Unlimited", + "volumetotal": 16, + "volumeavailable": "Unlimited", + "snapshotlimit": "Unlimited", + "snapshottotal": 2, + "snapshotavailable": "Unlimited", + "templatelimit": "Unlimited", + "templatetotal": 11, + "templateavailable": "Unlimited", + "vmstopped": 1, + "vmrunning": 8, + "state": "enabled", + "user": [ + { + "id": 2, + "username": "admin", + "firstname": "admin", + "lastname": "cloud", + "created": "2011-05-26T15:16:39-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "apikey": "EbZq4Tnn3flF9kKXzGKr2uMGLE0jLpKAAb1FZdIBKMlYdF_BbPyXpjQOHtSaUNmSs1UT6zyV-t4jw6eG77hCrQ", + "secretkey": "RIbGt6VapuiqGq-FxSaMKNf8s2OAXWrWEdw0m6SEsj8efIZ9QYCo37X7vKWRR4YKFRV5NDiRAKkLUbIv-xggVQ" + } + ] + }, + { + "id": 3, + "name": "Tim demo", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 45318989, + "sentbytes": 10773079, + "vmlimit": "20", + "vmtotal": 1, + "vmavailable": "19", + "iplimit": "3", + "iptotal": 3, + "ipavailable": "0", + "volumelimit": "100", + "volumetotal": 4, + "volumeavailable": "96", + "snapshotlimit": "20", + "snapshottotal": 1, + "snapshotavailable": "19", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 1, + "state": "enabled", + "user": [ + { + "id": 3, + "username": "tim", + "firstname": "Tim", + "lastname": "Nicklas", + "email": "tim@cloud.com", + "created": "2011-05-27T10:35:06-0700", + "state": "enabled", + "account": "Tim demo", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Halifax" + } + ] + }, + { + "id": 4, + "name": "TeleSUR test account", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 0, + "sentbytes": 0, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 0, + "ipavailable": "3", + "volumelimit": "20", + "volumetotal": 0, + "volumeavailable": "20", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 4, + "username": "telesur", + "firstname": "Robby", + "lastname": "Kalloe", + "email": "robby.kalloe@telesur.sr", + "created": "2011-05-27T10:50:38-0700", + "state": "enabled", + "account": "TeleSUR test account", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Bogota" + } + ] + }, + { + "id": 5, + "name": "Patni", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 1404, + "sentbytes": 4035977095, + "vmlimit": "20", + "vmtotal": -36, + "vmavailable": "56", + "iplimit": "11", + "iptotal": 1, + "ipavailable": "10", + "volumelimit": "20", + "volumetotal": 19, + "volumeavailable": "1", + "snapshotlimit": "20", + "snapshottotal": 3, + "snapshotavailable": "17", + "templatelimit": "20", + "templatetotal": 16, + "templateavailable": "4", + "vmstopped": 1, + "vmrunning": 16, + "state": "enabled", + "user": [ + { + "id": 5, + "username": "raj", + "firstname": "Sandeep", + "lastname": "Patni", + "email": "spatni2000@yahoo.com", + "created": "2011-05-27T12:59:27-0700", + "state": "enabled", + "account": "Patni", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "apikey": "bgW-T5RxmaSH0TrJmmbOut8Yf4zJRG3Hj2VuiLlnUdQcyYN5M1_Lb4rWL__2uTTNLeTZdFkGg2fbnkm5kzIxmA", + "secretkey": "fE0b_ipmFPJ2CGWacfOMui6ZwUkUskN78xwq4bqY281jtdQpxBg6bJlMRleaWpsKD3cn2_u-ARKBXP4puLI4GA" + } + ] + }, + { + "id": 6, + "name": "ACME", + "accounttype": 2, + "domainid": 2, + "domain": "ACME CORP", + "receivedbytes": 0, + "sentbytes": 0, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 0, + "ipavailable": "3", + "volumelimit": "20", + "volumetotal": 0, + "volumeavailable": "20", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 6, + "username": "acmeadmin", + "firstname": "CanBe", + "lastname": "Deleted", + "email": "acmeadmin@cloud.com", + "created": "2011-05-27T13:18:36-0700", + "state": "enabled", + "account": "ACME", + "accounttype": 2, + "domainid": 2, + "domain": "ACME CORP", + "timezone": "America/Los_Angeles" + } + ] + }, + { + "id": 7, + "name": "DEV", + "accounttype": 0, + "domainid": 3, + "domain": "DEV", + "receivedbytes": 4542050297, + "sentbytes": 2005679642958, + "vmlimit": "20", + "vmtotal": 5, + "vmavailable": "15", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 9, + "volumeavailable": "11", + "snapshotlimit": "20", + "snapshottotal": 20, + "snapshotavailable": "0", + "templatelimit": "20", + "templatetotal": 1, + "templateavailable": "19", + "vmstopped": 1, + "vmrunning": 4, + "state": "enabled", + "user": [ + { + "id": 7, + "username": "devuser", + "firstname": "Dev", + "lastname": "CanBeDeleted", + "email": "acmeadmin@cloud.com", + "created": "2011-05-27T13:19:23-0700", + "state": "enabled", + "account": "DEV", + "accounttype": 0, + "domainid": 3, + "domain": "DEV", + "timezone": "America/Los_Angeles", + "apikey": "DKqMcZjxI42X44FyVcdChTeDJ6IE34Mz1IgkbImFKzdtSI_1tO9CoT33sdWHw0Y61w0XopQencLspHwEZFm3Bg", + "secretkey": "rDGd-SrkgwbyX_LMzmsciOfV90W5y8gHfUz2BxBtHFKraZcnFtwr_qrmuv64JP-B_tAONIXy9EzFT_uXrUkWUw" + }, + { + "id": 43, + "username": "devuser2", + "firstname": "Dev", + "lastname": "User2", + "email": "devuser2@cloud.com", + "created": "2011-07-07T11:22:10-0700", + "state": "enabled", + "account": "DEV", + "accounttype": 0, + "domainid": 3, + "domain": "DEV", + "timezone": "America/Los_Angeles" + } + ] + }, + { + "id": 8, + "name": "TEST", + "accounttype": 0, + "domainid": 4, + "domain": "TEST", + "receivedbytes": 101523337, + "sentbytes": 134387217, + "vmlimit": "20", + "vmtotal": 1, + "vmavailable": "19", + "iplimit": "3", + "iptotal": 4, + "ipavailable": "-1", + "volumelimit": "20", + "volumetotal": 3, + "volumeavailable": "17", + "snapshotlimit": "20", + "snapshottotal": 2, + "snapshotavailable": "18", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 1, + "state": "enabled", + "user": [ + { + "id": 8, + "username": "testuser", + "firstname": "Test", + "lastname": "CanBeDeleted", + "email": "acmeadmin@cloud.com", + "created": "2011-05-27T13:20:05-0700", + "state": "enabled", + "account": "TEST", + "accounttype": 0, + "domainid": 4, + "domain": "TEST", + "timezone": "America/Los_Angeles" + } + ] + }, + { + "id": 9, + "name": "Shannon", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 769131667, + "sentbytes": 30134472254, + "vmlimit": "20", + "vmtotal": 1, + "vmavailable": "19", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 6, + "volumeavailable": "14", + "snapshotlimit": "20", + "snapshottotal": 1, + "snapshotavailable": "19", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 1, + "state": "enabled", + "user": [ + { + "id": 10, + "username": "Shannon", + "firstname": "Shannon", + "lastname": "Williams", + "email": "shannon@cloud.com", + "created": "2011-06-01T07:57:53-0700", + "state": "enabled", + "account": "Shannon", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles" + } + ] + }, + { + "id": 10, + "name": "osamu", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 25715747, + "sentbytes": 2894751, + "vmlimit": "Unlimited", + "vmtotal": 2, + "vmavailable": "Unlimited", + "iplimit": "Unlimited", + "iptotal": 1, + "ipavailable": "Unlimited", + "volumelimit": "Unlimited", + "volumetotal": 2, + "volumeavailable": "Unlimited", + "snapshotlimit": "Unlimited", + "snapshottotal": 2, + "snapshotavailable": "Unlimited", + "templatelimit": "Unlimited", + "templatetotal": 0, + "templateavailable": "Unlimited", + "vmstopped": 1, + "vmrunning": 1, + "state": "enabled", + "user": [ + { + "id": 11, + "username": "osamu", + "firstname": "osamu", + "lastname": "mouri", + "email": "osamu@cloud.com", + "created": "2011-06-01T10:55:05-0700", + "state": "enabled", + "account": "osamu", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "Asia/Tokyo" + } + ] + }, + { + "id": 11, + "name": "Fukuda_Hitachi", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 54308801, + "sentbytes": 16975663, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 1, + "volumeavailable": "19", + "snapshotlimit": "20", + "snapshottotal": 1, + "snapshotavailable": "19", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 12, + "username": "Fukuda_Hitachi", + "firstname": "Yasuhiro", + "lastname": "Fukuda", + "email": "yasuhiro.fukuda.gc@hitachi.com", + "created": "2011-06-01T11:00:06-0700", + "state": "enabled", + "account": "Fukuda_Hitachi", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "Asia/Tokyo" + } + ] + }, + { + "id": 14, + "name": "Applied Computer Solutions ", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 0, + "sentbytes": 0, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 0, + "ipavailable": "3", + "volumelimit": "20", + "volumetotal": 0, + "volumeavailable": "20", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 15, + "username": "acs", + "firstname": "Nick", + "lastname": "Ross", + "email": "nick.ross@acsacs.com", + "created": "2011-06-03T13:21:18-0700", + "state": "enabled", + "account": "Applied Computer Solutions ", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT" + } + ] + }, + { + "id": 15, + "name": "RS4", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 292912869, + "sentbytes": 17443305, + "vmlimit": "20", + "vmtotal": -3, + "vmavailable": "23", + "iplimit": "11", + "iptotal": 1, + "ipavailable": "10", + "volumelimit": "20", + "volumetotal": 7, + "volumeavailable": "13", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 3, + "templateavailable": "17", + "vmstopped": 2, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 16, + "username": "rs4", + "firstname": "Cary", + "lastname": "Penniman ", + "email": "cary@rightscale.com", + "created": "2011-06-03T14:53:22-0700", + "state": "enabled", + "account": "RS4", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles", + "apikey": "zFO2JsXpF8w1U1EDWS9hhkj8mdzo30X6cDIEhU78q_XIAbHcEdbHYu2hkWEA8Vf9JYXazTSzx1vXSMwMn5TfPQ", + "secretkey": "-n9pd7v2n2KcEKxdgw_vmone1YPERhKUcZ8dK-n6q_qJUXwvG0uxn4rFo13DdHL0Qa_qKPFWTyF-Giv7GZ-Iww" + } + ] + }, + { + "id": 16, + "name": "RS5", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 73118370, + "sentbytes": 301749334, + "vmlimit": "20", + "vmtotal": 1, + "vmavailable": "19", + "iplimit": "11", + "iptotal": 1, + "ipavailable": "10", + "volumelimit": "20", + "volumetotal": 10, + "volumeavailable": "10", + "snapshotlimit": "20", + "snapshottotal": 4, + "snapshotavailable": "16", + "templatelimit": "20", + "templatetotal": 4, + "templateavailable": "16", + "vmstopped": 1, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 17, + "username": "rs5", + "firstname": "Cary", + "lastname": "Penniman ", + "email": "cary@rightscale.com", + "created": "2011-06-03T14:57:25-0700", + "state": "enabled", + "account": "RS5", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles", + "apikey": "lRKu9Fwhgi1Rh_o0T2CxIK2i82Ixy9WpQHcqqc9kJzWaCabzADR1b9dFAM4YcDb-pbf75MKr2YZGxB30I_fOhA", + "secretkey": "GHXt39hbA5KzLbLpLpnEcmr-Qmo37dYf_sFRVwpFBUG57565mANVCNOV2UQy7fYd5DNPmiSV7gCK3RzSnJENJw" + } + ] + }, + { + "id": 18, + "name": "Tivit", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 89996753686, + "sentbytes": 885391261619, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 1, + "volumeavailable": "19", + "snapshotlimit": "20", + "snapshottotal": 1, + "snapshotavailable": "19", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 19, + "username": "tivit", + "firstname": "Fernando", + "lastname": "Zangrande", + "email": "fernando.zangrande@tivit.com.br", + "created": "2011-06-06T12:25:39-0700", + "state": "enabled", + "account": "Tivit", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT" + } + ] + }, + { + "id": 19, + "name": "SCALR", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 19064238, + "sentbytes": 3495984, + "vmlimit": "20", + "vmtotal": 4, + "vmavailable": "16", + "iplimit": "3", + "iptotal": 3, + "ipavailable": "0", + "volumelimit": "20", + "volumetotal": 5, + "volumeavailable": "15", + "snapshotlimit": "20", + "snapshottotal": 1, + "snapshotavailable": "19", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 2, + "vmrunning": 2, + "state": "enabled", + "user": [ + { + "id": 20, + "username": "scalr", + "firstname": "Sebastian", + "lastname": "Stadil ", + "email": "sebastian@scalr.com", + "created": "2011-06-06T20:26:26-0700", + "state": "enabled", + "account": "SCALR", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "apikey": "xjdpxcJB_J-su-aRYcRCA6fNJuhfqYKFEDzhDAsOuF-_wMe80V5we-rBpvIW11VIHZv9bSFCxdAfiEdZ3If_0A", + "secretkey": "LJm2XC9FYDjkjmIR2YlOtwoPISYJjW-F393Z-rv195mqr21T6eI_-rqIGoWYWqSVmDBEjRFmuISD8i6i69czfg" + } + ] + }, + { + "id": 20, + "name": "cloud", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 119392343, + "sentbytes": 29370775, + "vmlimit": "20", + "vmtotal": 2, + "vmavailable": "18", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 5, + "volumeavailable": "15", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 2, + "state": "enabled", + "user": [ + { + "id": 21, + "username": "peder", + "firstname": "peder", + "lastname": "ulander", + "email": "peder@cloud.com", + "created": "2011-06-07T09:41:30-0700", + "state": "enabled", + "account": "cloud", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles" + } + ] + }, + { + "id": 21, + "name": "Tenzing", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 5917535, + "sentbytes": 526136, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 1, + "volumeavailable": "19", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 22, + "username": "Tenzing", + "firstname": "Raj", + "lastname": "Atwal", + "email": "raj.atwal@tenzing.com", + "created": "2011-06-08T11:49:59-0700", + "state": "enabled", + "account": "Tenzing", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/New_York" + } + ] + }, + { + "id": 22, + "name": "sheng", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 63987635, + "sentbytes": 15312103, + "vmlimit": "20", + "vmtotal": 0, + "vmavailable": "20", + "iplimit": "3", + "iptotal": 1, + "ipavailable": "2", + "volumelimit": "20", + "volumetotal": 2, + "volumeavailable": "18", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 0, + "templateavailable": "20", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 23, + "username": "sheng", + "firstname": "Sheng", + "lastname": "Liang", + "email": "sheng@cloud.com", + "created": "2011-06-08T12:03:16-0700", + "state": "enabled", + "account": "sheng", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT" + } + ] + }, + { + "id": 23, + "name": "RS3", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 9828, + "sentbytes": 28370265214, + "vmlimit": "20", + "vmtotal": 1, + "vmavailable": "19", + "iplimit": "11", + "iptotal": 1, + "ipavailable": "10", + "volumelimit": "20", + "volumetotal": 17, + "volumeavailable": "3", + "snapshotlimit": "20", + "snapshottotal": 0, + "snapshotavailable": "20", + "templatelimit": "20", + "templatetotal": 3, + "templateavailable": "17", + "vmstopped": 4, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 24, + "username": "rs3", + "firstname": "Cary", + "lastname": "Penniman", + "email": "cary@rightscale.com", + "created": "2011-06-08T20:30:52-0700", + "state": "enabled", + "account": "RS3", + "accounttype": 0, + "domainid": 1, + "domain": "ROOT", + "timezone": "Etc/UTC", + "apikey": "eVRxkp2hrYlTc60ggVmqXE1KmhBRYlg8mwzLk7r-3brofqrp9waIWeqXqPCUEPXFKuQK9--5q_vt5ilbKjRwyQ", + "secretkey": "TFiEKFJdoynEdTAJRstAiMgT88ruyHrYVGvgkSoIxyGXZ4sexRMMa0I8b9UMRcz2DzR3i1AJTKd_ZiOVygghxQ" + } + ] + }, + { + "id": 24, + "name": "RS2", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "receivedbytes": 192, + "sentbytes": 0, + "vmlimit": "Unlimited", + "vmtotal": -1, + "vmavailable": "Unlimited", + "iplimit": "Unlimited", + "iptotal": 1, + "ipavailable": "Unlimited", + "volumelimit": "Unlimited", + "volumetotal": 0, + "volumeavailable": "Unlimited", + "snapshotlimit": "Unlimited", + "snapshottotal": 0, + "snapshotavailable": "Unlimited", + "templatelimit": "Unlimited", + "templatetotal": 6, + "templateavailable": "Unlimited", + "vmstopped": 0, + "vmrunning": 0, + "state": "enabled", + "user": [ + { + "id": 25, + "username": "rs2", + "firstname": "Cary", + "lastname": "Penniman", + "email": "cary@rightscale.com", + "created": "2011-06-08T20:32:51-0700", + "state": "enabled", + "account": "RS2", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles", + "apikey": "b_HUwVBXfrli-_P1xugwYiwBp1NeGqy8UJxCTQ6rp3VgezVTXUBRLz69EiopopJp4ZP5eswXdv-y7jcUDSnF9A", + "secretkey": "jqV7pbOT7HekXTzmZ0zst_OvQqX9nKJ_gRnk-Dl_9x_u04K0K0No8lgpoZBg5CnUPkyb-c4rJ_LZeKkkd_lr4Q" + } + ] + } + ], + serviceOfferings: [ + { + "id": 1, + "name": "Small Instance", + "displaytext": "1.7 GB memory, 160 GB storage, 32-bit platform, $0.05/hr", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "created": "2011-05-26T22:16:39-0700", + "storagetype": "shared", + "offerha": false + }, + { + "id": 2, + "name": "Medium Instance", + "displaytext": "2 GB memory, 160 GB storage, 32-bit or 64-bit platform, $0.10/hr", + "cpunumber": 1, + "cpuspeed": 1000, + "memory": 1024, + "created": "2011-05-26T22:16:40-0700", + "storagetype": "shared", + "offerha": false + }, + { + "id": 12, + "name": "Large Instance", + "displaytext": "8 gb memory, 850 gb storage, 32-bit or 64-bit platform, $0.10/hr", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 512, + "created": "2011-08-05T06:44:13-0700", + "storagetype": "shared", + "offerha": false, + "domainid": 14, + "domain": "Turkey" + } + ], + systemServiceOfferings: [ + { + "id": 12, + "name": "System Offering For Secondary Storage VM", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 256, + "created": "2011-10-27T14:17:54-0700", + "storagetype": "shared", + "offerha": false, + "limitcpuuse": false, + "issystem": true, + "defaultuse": true, + "systemvmtype": "secondarystoragevm" + }, + { + "id": 15, + "name": "System Offering For Elastic LB VM", + "cpunumber": 1, + "cpuspeed": 128, + "memory": 128, + "created": "2011-10-27T14:17:54-0700", + "storagetype": "shared", + "offerha": true, + "limitcpuuse": false, + "issystem": true, + "defaultuse": true, + "systemvmtype": "elasticloadbalancervm", + "networkrate": 0 + }, + { + "id": 13, + "name": "System Offering For Software Router", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 128, + "created": "2011-10-27T14:17:54-0700", + "storagetype": "shared", + "offerha": true, + "limitcpuuse": false, + "issystem": true, + "defaultuse": true, + "systemvmtype": "domainrouter" + }, + { + "id": 14, + "name": "System Offering For Console Proxy", + "cpunumber": 1, + "cpuspeed": 500, + "memory": 1024, + "created": "2011-10-27T14:17:54-0700", + "storagetype": "shared", + "offerha": false, + "limitcpuuse": false, + "issystem": true, + "defaultuse": true, + "systemvmtype": "consoleproxy", + "networkrate": 0 + } + ], + diskOfferings: [ + { + "id": 3, + "name": "Small", + "displaytext": "Small Disk, 5 GB", + "disksize": 5, + "created": "2011-05-26T22:16:40-0700", + "iscustomized": false + }, + { + "id": 4, + "name": "Medium", + "displaytext": "Medium Disk, 20 GB", + "disksize": 20, + "created": "2011-05-26T22:16:40-0700", + "iscustomized": false + }, + { + "id": 5, + "name": "Large", + "displaytext": "Large Disk, 100 GB", + "disksize": 100, + "created": "2011-05-26T22:16:40-0700", + "iscustomized": false + }, + { + "id": 6, + "name": "Custom A", + "displaytext": "Custom Disk A", + "iscustomized": true + }, + { + "id": 7, + "name": "Custom B", + "displaytext": "Custom Disk B", + "iscustomized": true + } + + ], + networkOfferings: [ + { + "id": 6, + "name": "DefaultVirtualizedNetworkOffering", + "displaytext": "Virtual Vlan", + "traffictype": "Guest", + "isdefault": true, + "specifyvlan": false, + "availability": "Optional", + "guestiptype": "Virtual", + "networkrate": 200 + } + ], + globalSettings: [ + { + "category": "Advanced", + "name": "account.cleanup.interval", + "value": "300", + "description": "The interval (in seconds) between cleanup for removed accounts" + }, + { + "category": "Alert", + "name": "alert.email.addresses", + "description": "Comma separated list of email addresses used for sending alerts." + }, + { + "category": "Alert", + "name": "alert.email.sender", + "description": "Sender of alert email (will be in the From header of the email)." + }, + { + "category": "Alert", + "name": "alert.smtp.host", + "description": "SMTP hostname used for sending out email alerts." + }, + { + "category": "Alert", + "name": "alert.smtp.password", + "description": "Password for SMTP authentication (applies only if alert.smtp.useAuth is true)." + }, + { + "category": "Alert", + "name": "alert.smtp.port", + "value": "465", + "description": "Port the SMTP server is listening on." + }, + { + "category": "Alert", + "name": "alert.smtp.useAuth", + "description": "If true, use SMTP authentication when sending emails." + }, + { + "category": "Alert", + "name": "alert.smtp.username", + "description": "Username for SMTP authentication (applies only if alert.smtp.useAuth is true)." + }, + { + "category": "Alert", + "name": "alert.wait", + "description": "Seconds to wait before alerting on a disconnected agent" + }, + { + "category": "Advanced", + "name": "allow.public.user.templates", + "value": "true", + "description": "If false, users will not be able to create public templates." + }, + { + "category": "Usage", + "name": "capacity.check.period", + "value": "300000", + "description": "The interval in milliseconds between capacity checks" + }, + { + "category": "Advanced", + "name": "capacity.skipcounting.hours", + "value": "3600", + "description": "Time (in seconds) to wait before release VM's cpu and memory when VM in stopped state" + }, + { + "category": "Advanced", + "name": "check.pod.cidrs", + "value": "true", + "description": "If true, different pods must belong to different CIDR subnets." + }, + { + "category": "Advanced", + "name": "cmd.wait", + "value": "7200", + "description": "Time (in seconds) to wait for some heavy time-consuming commands" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.capacity.standby", + "value": "10", + "description": "The minimal number of console proxy viewer sessions that system is able to serve immediately(standby capacity)" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.capacityscan.interval", + "value": "30000", + "description": "The time interval(in millisecond) to scan whether or not system needs more console proxy to ensure minimal standby capacity" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.cmd.port", + "value": "8001", + "description": "Console proxy command port that is used to communicate with management server" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.cpu.mhz", + "value": "500", + "description": "CPU speed (in MHz) used to create new console proxy VMs" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.disable.rpfilter", + "value": "true", + "description": "disable rp_filter on console proxy VM public interface" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.launch.max", + "value": "10", + "description": "maximum number of console proxy instances per zone can be launched" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.loadscan.interval", + "value": "10000", + "description": "The time interval(in milliseconds) to scan console proxy working-load info" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.ram.size", + "value": "2048", + "description": "RAM size (in MB) used to create new console proxy VMs" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.restart", + "value": "true", + "description": "Console proxy restart flag, defaulted to true" + }, + { + "category": "Console Proxy", + "name": "consoleproxy.session.max", + "value": "100", + "description": "The max number of viewer sessions console proxy is configured to serve for" + } + ], + zones: [ + { + "id": 1, + "name": "San Jose", + "dns1": "8.8.8.8", + "internaldns1": "192.168.20.254", + "vlan": "200-299", + "guestcidraddress": "10.1.1.0/24", + "networktype": "Advanced", + "securitygroupsenabled": false, + "allocationstate": "Enabled" + }, + { + "id": 2, + "name": "Chicago", + "dns1": "8.8.8.8", + "internaldns1": "72.52.126.11", + "networktype": "Advanced", + "securitygroupsenabled": true, + "allocationstate": "Enabled" + } + ], + virtualAppliances: [ + { + "id": 4, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs3cloud.internal", + "gateway": "72.52.126.1", + "name": "r-4-VM", + "podid": 1, + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "linklocalip": "169.254.0.53", + "linklocalmacaddress": "255.255.0.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.44", + "publicmacaddress": "06:af:f6:00:00:23", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:02:c3:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 204, + "templateid": 1, + "created": "2011-05-27T10:36:54-0700", + "state": "Running", + "account": "Tim demo", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 6, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs8cloud.internal", + "gateway": "72.52.126.1", + "name": "r-6-VM", + "podid": 1, + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "linklocalip": "169.254.1.201", + "linklocalmacaddress": "255.255.0.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.57", + "publicmacaddress": "06:a0:84:00:00:30", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:61:5e:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 205, + "templateid": 1, + "created": "2011-05-27T13:23:28-0700", + "state": "Running", + "account": "TEST", + "domainid": 4, + "domain": "TEST" + }, + { + "id": 9, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs7cloud.internal", + "gateway": "72.52.126.1", + "name": "r-9-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "linklocalip": "192.168.21.39", + "linklocalmacaddress": "255.255.255.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.38", + "publicmacaddress": "06:66:1c:00:00:1d", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:7e:b8:00:03", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 206, + "templateid": 8, + "created": "2011-05-27T13:36:37-0700", + "state": "Running", + "account": "DEV", + "domainid": 3, + "domain": "DEV" + }, + { + "id": 11, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs5cloud.internal", + "gateway": "72.52.126.1", + "name": "r-11-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.41", + "publicmacaddress": "06:b2:7e:00:00:20", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:04:3d:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 207, + "templateid": 3, + "created": "2011-05-27T17:10:31-0700", + "state": "Stopped", + "account": "Patni", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 17, + "zoneid": 2, + "zonename": "Chicago", + "dns1": "8.8.8.8", + "networkdomain": "testdomain.com", + "name": "r-17-VM", + "podid": 2, + "hostid": 8, + "hostname": "x31.fre.vmops.com", + "linklocalip": "169.254.0.145", + "linklocalmacaddress": "255.255.0.0", + "linklocalnetworkid": 209, + "guestipaddress": "65.19.181.83", + "guestmacaddress": "06:98:0e:00:00:2c", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 211, + "templateid": 3, + "created": "2011-05-28T07:22:19-0700", + "state": "Running", + "account": "system", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 19, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs2cloud.internal", + "gateway": "72.52.126.1", + "name": "r-19-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "linklocalip": "192.168.21.37", + "linklocalmacaddress": "255.255.255.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.32", + "publicmacaddress": "06:c2:fe:00:00:17", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:7b:6c:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 212, + "templateid": 8, + "created": "2011-05-28T08:38:02-0700", + "state": "Running", + "account": "admin", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 26, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs9cloud.internal", + "gateway": "72.52.126.1", + "name": "r-26-VM", + "podid": 1, + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "linklocalip": "169.254.3.128", + "linklocalmacaddress": "255.255.0.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.43", + "publicmacaddress": "06:7b:de:00:00:22", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:38:f3:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 213, + "templateid": 1, + "created": "2011-06-01T07:58:49-0700", + "state": "Running", + "account": "Shannon", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 30, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "csbcloud.internal", + "gateway": "72.52.126.1", + "name": "r-30-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.61", + "publicmacaddress": "06:aa:68:00:00:34", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:79:9a:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 214, + "templateid": 1, + "created": "2011-06-01T11:01:48-0700", + "state": "Stopped", + "account": "Fukuda_Hitachi", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 183, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs10cloud.internal", + "gateway": "72.52.126.1", + "name": "r-183-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.47", + "publicmacaddress": "06:aa:b2:00:00:26", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:03:e5:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 225, + "templateid": 1, + "created": "2011-06-06T14:10:06-0700", + "state": "Stopped", + "account": "RS5", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 212, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs12cloud.internal", + "gateway": "72.52.126.1", + "name": "r-212-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.69", + "publicmacaddress": "06:31:66:00:00:3c", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:0d:6d:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 226, + "templateid": 1, + "created": "2011-06-07T08:05:47-0700", + "state": "Stopped", + "account": "Tivit", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 226, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs14cloud.internal", + "gateway": "72.52.126.1", + "name": "r-226-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "linklocalip": "192.168.21.38", + "linklocalmacaddress": "255.255.255.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.67", + "publicmacaddress": "06:e8:48:00:00:3a", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:00:03:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 227, + "templateid": 8, + "created": "2011-06-07T09:44:23-0700", + "state": "Running", + "account": "cloud", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 260, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs16cloud.internal", + "gateway": "72.52.126.1", + "name": "r-260-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.66", + "publicmacaddress": "06:f2:fa:00:00:39", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:2d:67:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 230, + "templateid": 1, + "created": "2011-06-08T12:04:48-0700", + "state": "Stopped", + "account": "sheng", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 263, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "csfcloud.internal", + "gateway": "72.52.126.1", + "name": "r-263-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.35", + "publicmacaddress": "06:f0:e2:00:00:1a", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:14:e4:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 231, + "templateid": 1, + "created": "2011-06-08T15:15:19-0700", + "state": "Stopped", + "account": "RS4", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 266, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs15cloud.internal", + "gateway": "72.52.126.1", + "name": "r-266-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.68", + "publicmacaddress": "06:98:c0:00:00:3b", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:5f:a4:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 232, + "templateid": 1, + "created": "2011-06-08T17:23:36-0700", + "state": "Stopped", + "account": "Tenzing", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 298, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs17cloud.internal", + "gateway": "72.52.126.1", + "name": "r-298-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.36", + "publicmacaddress": "06:cb:92:00:00:1b", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:55:eb:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 233, + "templateid": 3, + "created": "2011-06-09T13:24:14-0700", + "state": "Stopped", + "account": "RS3", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 331, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "csacloud.internal", + "gateway": "72.52.126.1", + "name": "r-331-VM", + "podid": 1, + "hostid": 4, + "hostname": "Demo4 XenCluster 01", + "linklocalip": "169.254.2.15", + "linklocalmacaddress": "255.255.0.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.53", + "publicmacaddress": "06:78:2a:00:00:2c", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:47:a0:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 234, + "templateid": 1, + "created": "2011-06-10T02:58:33-0700", + "state": "Running", + "account": "osamu", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 354, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs1acloud.internal", + "gateway": "72.52.126.1", + "name": "r-354-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.54", + "publicmacaddress": "06:30:90:00:00:2d", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:7f:38:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 235, + "templateid": 1, + "created": "2011-06-10T10:30:01-0700", + "state": "Stopped", + "account": "rikard", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 356, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs19cloud.internal", + "gateway": "72.52.126.1", + "name": "r-356-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.63", + "publicmacaddress": "06:1c:34:00:00:36", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:73:e8:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 236, + "templateid": 1, + "created": "2011-06-10T10:44:56-0700", + "state": "Stopped", + "account": "jlong", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 429, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs1bcloud.internal", + "gateway": "72.52.126.1", + "name": "r-429-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "linklocalip": "192.168.21.42", + "linklocalmacaddress": "255.255.255.0", + "linklocalnetworkid": 202, + "publicip": "72.52.126.33", + "publicmacaddress": "06:91:88:00:00:18", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:40:1a:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 237, + "templateid": 8, + "created": "2011-06-13T20:51:23-0700", + "state": "Running", + "account": "Yali", + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 494, + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "networkdomain": "cs20cloud.internal", + "gateway": "72.52.126.1", + "name": "r-494-VM", + "podid": 1, + "linklocalnetworkid": 202, + "publicip": "72.52.126.51", + "publicmacaddress": "06:7b:f0:00:00:2a", + "publicnetmask": "255.255.255.128", + "publicnetworkid": 200, + "guestipaddress": "10.1.1.1", + "guestmacaddress": "02:00:21:11:00:02", + "guestnetmask": "255.255.255.0", + "guestnetworkid": 238, + "templateid": 1, + "created": "2011-06-16T17:57:45-0700", + "state": "Stopped", + "account": "sumita-user", + "domainid": 7, + "domain": "sumita" + } + ], + systemVMs: [ + { + "id": 14, + "systemvmtype": "consoleproxy", + "zoneid": 2, + "zonename": "Chicago", + "dns1": "8.8.8.8", + "name": "v-14-VM", + "podid": 2, + "hostid": 8, + "hostname": "x31.fre.vmops.com", + "privateip": "192.168.204.71", + "privatemacaddress": "06:72:00:00:00:02", + "privatenetmask": "255.255.255.0", + "linklocalip": "169.254.0.166", + "linklocalmacaddress": "0e:00:a9:fe:00:a6", + "linklocalnetmask": "255.255.0.0", + "publicip": "65.19.181.108", + "publicmacaddress": "06:2e:50:00:00:45", + "publicnetmask": "255.255.255.0", + "templateid": 3, + "created": "2011-05-27T20:56:22-0700", + "state": "Running", + "activeviewersessions": 0 + }, + { + "id": 1353, + "systemvmtype": "consoleproxy", + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "name": "v-1353-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "privateip": "192.168.21.30", + "privatemacaddress": "06:97:8a:00:00:01", + "privatenetmask": "255.255.255.0", + "linklocalmacaddress": "02:00:2b:f8:00:40", + "publicip": "72.52.126.48", + "publicmacaddress": "06:9b:2c:00:00:27", + "publicnetmask": "255.255.255.128", + "templateid": 8, + "created": "2011-08-02T06:44:24-0700", + "state": "Running", + "activeviewersessions": 0 + }, + { + "id": 15, + "systemvmtype": "secondarystoragevm", + "zoneid": 2, + "zonename": "Chicago", + "dns1": "8.8.8.8", + "name": "s-15-VM", + "podid": 2, + "hostid": 8, + "hostname": "x31.fre.vmops.com", + "privateip": "192.168.204.74", + "privatemacaddress": "06:c3:34:00:00:05", + "privatenetmask": "255.255.255.0", + "linklocalip": "169.254.3.66", + "linklocalmacaddress": "0e:00:a9:fe:03:42", + "linklocalnetmask": "255.255.0.0", + "publicip": "65.19.181.109", + "publicmacaddress": "06:12:3e:00:00:46", + "publicnetmask": "255.255.255.0", + "templateid": 3, + "created": "2011-05-27T20:56:22-0700", + "state": "Running" + }, + { + "id": 1351, + "systemvmtype": "secondarystoragevm", + "zoneid": 1, + "zonename": "San Jose", + "dns1": "8.8.8.8", + "name": "s-1351-VM", + "podid": 1, + "hostid": 7, + "hostname": "192.168.21.214", + "privateip": "192.168.21.46", + "privatemacaddress": "06:43:d4:00:00:11", + "privatenetmask": "255.255.255.0", + "linklocalmacaddress": "02:00:40:fb:00:3f", + "publicip": "72.52.67.51", + "publicmacaddress": "06:a3:a2:00:00:5c", + "publicnetmask": "255.255.255.0", + "templateid": 8, + "created": "2011-08-02T06:14:54-0700", + "state": "Running" + } + ], + + networks: [ + { + "id": 269, + "name": "sumi-network-vlan-100", + "displaytext": "sumi-network-vlan-100", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "182.172.161.1", + "netmask": "255.255.255.0", + "startip": "182.172.161.10", + "endip": "182.172.161.100", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 269, + "broadcasturi": "vlan://100", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "100", + "isdefault": false, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + { + "id": 263, + "name": "Dedicated Customer Network", + "displaytext": "Dedicated Customer Network", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "192.168.129.1", + "netmask": "255.255.255.0", + "startip": "192.168.129.10", + "endip": "192.168.129.50", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 263, + "broadcasturi": "vlan://129", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "129", + "isdefault": true, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + { + "id": 263, + "name": "Dedicated Customer Network", + "displaytext": "Dedicated Customer Network", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "192.168.129.1", + "netmask": "255.255.255.0", + "startip": "192.168.129.10", + "endip": "192.168.129.50", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 263, + "broadcasturi": "vlan://129", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "129", + "isdefault": true, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + { + "id": 269, + "name": "sumi-network-vlan-100", + "displaytext": "sumi-network-vlan-100", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "182.172.161.1", + "netmask": "255.255.255.0", + "startip": "182.172.161.10", + "endip": "182.172.161.100", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 269, + "broadcasturi": "vlan://100", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "100", + "isdefault": false, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + { + "id": 263, + "name": "Dedicated Customer Network", + "displaytext": "Dedicated Customer Network", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "192.168.129.1", + "netmask": "255.255.255.0", + "startip": "192.168.129.10", + "endip": "192.168.129.50", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 263, + "broadcasturi": "vlan://129", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "129", + "isdefault": true, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + { + "id": 263, + "name": "Dedicated Customer Network", + "displaytext": "Dedicated Customer Network", + "broadcastdomaintype": "Vlan", + "traffictype": "Guest", + "gateway": "192.168.129.1", + "netmask": "255.255.255.0", + "startip": "192.168.129.10", + "endip": "192.168.129.50", + "zoneid": 1, + "networkofferingid": 7, + "networkofferingname": "DefaultDirectNetworkOffering", + "networkofferingdisplaytext": "Direct", + "networkofferingavailability": "Optional", + "isshared": true, + "issystem": false, + "state": "Setup", + "related": 263, + "broadcasturi": "vlan://129", + "dns1": "8.8.8.8", + "type": "Direct", + "vlan": "129", + "isdefault": true, + "service": [ + { + "name": "Dns" + }, + { + "name": "UserData" + }, + { + "name": "Dhcp" + } + ], + "securitygroupenabled": false + }, + ], + + hypervisors: [ + { + id: 'xen', + description: 'XenServer' + }, + { + id: 'kvm', + description: 'KVM' + }, + { + id: 'VMware', + description: 'VMware' + } + ], + + pods: [ + { + "id": 1, + "name": "Pod1", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.1", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + }, + { + "id": 2, + "name": "Pod2", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.2", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + }, + { + "id": 3, + "name": "Pod3", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.1", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + }, + { + "id": 4, + "name": "Pod4", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.2", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + }, + { + "id": 5, + "name": "Pod5", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.1", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + }, + { + "id": 6, + "name": "Pod6", + "zoneid": 1, + "zonename": "San Jose", + "gateway": "192.168.21.2", + "netmask": "255.255.255.0", + "startip": "192.168.21.30", + "endip": "192.168.21.49", + "allocationstate": "Enabled" + } + ], + + clusters: [ + { + "id": 1, + "name": "KVM Cluster 01", + "podid": 1, + "podname": "Pod1", + "zoneid": 1, + "zonename": "San Jose", + "hypervisortype": "KVM", + "clustertype": "CloudManaged", + "allocationstate": "Enabled" + }, + { + "id": 2, + "name": "Xen Cluster 01", + "podid": 1, + "podname": "Pod1", + "zoneid": 1, + "zonename": "San Jose", + "hypervisortype": "XenServer", + "clustertype": "CloudManaged", + "allocationstate": "Enabled" + }, + { + "id": 3, + "name": "Xen Cluster 02", + "podid": 1, + "podname": "Pod1", + "zoneid": 1, + "zonename": "San Jose", + "hypervisortype": "XenServer", + "clustertype": "CloudManaged", + "allocationstate": "Enabled" + }, + { + "id": 8, + "name": "192.168.20.218/SJ/esxDemo4", + "podid": 1, + "podname": "Pod1", + "zoneid": 1, + "zonename": "San Jose", + "hypervisortype": "VMware", + "clustertype": "ExternalManaged", + "allocationstate": "Enabled" + } + ], + + hosts: [ + { + "id": 1, + "name": "905-17.sjc.vmops.com", + "state": "Up", + "disconnected": "2011-09-07T17:22:09-0700", + "type": "Routing", + "ipaddress": "192.168.21.217", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "KVM", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "55.31%", + "cpuused": "29.6%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 28142824, + "networkkbswrite": 51473482, + "memorytotal": 16715161600, + "memoryallocated": 5368709120, + "memoryused": 5368709120, + "capabilities": "hvm", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 1, + "clustername": "KVM Cluster 01", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:00:03-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 5, + "name": "905-21", + "state": "Up", + "disconnected": "2011-09-12T13:11:17-0700", + "type": "Routing", + "ipaddress": "192.168.21.218", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "XenServer", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "22.12%", + "cpuused": "0.02%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 1475, + "networkkbswrite": 3877, + "memorytotal": 16190149248, + "memoryallocated": 2147483648, + "memoryused": 2147483648, + "capabilities": "xen-3.0-x86_64 , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p , hvm-3.0-x86_64", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 3, + "clustername": "Xen Cluster 02", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:14:48-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 1, + "name": "905-17.sjc.vmops.com", + "state": "Up", + "disconnected": "2011-09-07T17:22:09-0700", + "type": "Routing", + "ipaddress": "192.168.21.217", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "KVM", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "55.31%", + "cpuused": "29.6%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 28142824, + "networkkbswrite": 51473482, + "memorytotal": 16715161600, + "memoryallocated": 5368709120, + "memoryused": 5368709120, + "capabilities": "hvm", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 1, + "clustername": "KVM Cluster 01", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:00:03-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 5, + "name": "905-21", + "state": "Up", + "disconnected": "2011-09-12T13:11:17-0700", + "type": "Routing", + "ipaddress": "192.168.21.218", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "XenServer", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "22.12%", + "cpuused": "0.02%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 1475, + "networkkbswrite": 3877, + "memorytotal": 16190149248, + "memoryallocated": 2147483648, + "memoryused": 2147483648, + "capabilities": "xen-3.0-x86_64 , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p , hvm-3.0-x86_64", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 3, + "clustername": "Xen Cluster 02", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:14:48-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 1, + "name": "905-17.sjc.vmops.com", + "state": "Up", + "disconnected": "2011-09-07T17:22:09-0700", + "type": "Routing", + "ipaddress": "192.168.21.217", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "KVM", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "55.31%", + "cpuused": "29.6%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 28142824, + "networkkbswrite": 51473482, + "memorytotal": 16715161600, + "memoryallocated": 5368709120, + "memoryused": 5368709120, + "capabilities": "hvm", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 1, + "clustername": "KVM Cluster 01", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:00:03-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 5, + "name": "905-21", + "state": "Up", + "disconnected": "2011-09-12T13:11:17-0700", + "type": "Routing", + "ipaddress": "192.168.21.218", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "XenServer", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "22.12%", + "cpuused": "0.02%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 1475, + "networkkbswrite": 3877, + "memorytotal": 16190149248, + "memoryallocated": 2147483648, + "memoryused": 2147483648, + "capabilities": "xen-3.0-x86_64 , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p , hvm-3.0-x86_64", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 3, + "clustername": "Xen Cluster 02", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:14:48-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 1, + "name": "905-17.sjc.vmops.com", + "state": "Up", + "disconnected": "2011-09-07T17:22:09-0700", + "type": "Routing", + "ipaddress": "192.168.21.217", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "KVM", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "55.31%", + "cpuused": "29.6%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 28142824, + "networkkbswrite": 51473482, + "memorytotal": 16715161600, + "memoryallocated": 5368709120, + "memoryused": 5368709120, + "capabilities": "hvm", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 1, + "clustername": "KVM Cluster 01", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:00:03-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + }, + { + "id": 5, + "name": "905-21", + "state": "Up", + "disconnected": "2011-09-12T13:11:17-0700", + "type": "Routing", + "ipaddress": "192.168.21.218", + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "version": "2.2.5.20110524203546", + "hypervisor": "XenServer", + "cpunumber": 4, + "cpuspeed": 2260, + "cpuallocated": "22.12%", + "cpuused": "0.02%", + "cpuwithoverprovisioning": "18080.0", + "networkkbsread": 1475, + "networkkbswrite": 3877, + "memorytotal": 16190149248, + "memoryallocated": 2147483648, + "memoryused": 2147483648, + "capabilities": "xen-3.0-x86_64 , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p , hvm-3.0-x86_64", + "lastpinged": "1970-01-15T12:59:49-0800", + "managementserverid": 52238454490, + "clusterid": 3, + "clustername": "Xen Cluster 02", + "clustertype": "CloudManaged", + "islocalstorageactive": false, + "created": "2011-05-27T07:14:48-0700", + "events": "HostDown; AgentConnected; PingTimeout; Ping; MaintenanceRequested; ManagementServerDown; ShutdownRequested; AgentDisconnected", + "hosttags": "", + "hasEnoughCapacity": false, + "allocationstate": "Enabled" + } + ], + + 'primary-storage': [ + { + "id": 203, + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "name": "Xen Cluster 02 NFS Primary", + "ipaddress": "192.168.21.220", + "path": "/a6bcdca3-cb58-3d64-97a0-400823a0bce3", + "created": "2011-05-27T07:15:46-0700", + "type": "PreSetup", + "clusterid": 3, + "clustername": "Xen Cluster 02", + "disksizetotal": 962498199552, + "disksizeallocated": 260649058304, + "tags": "", + "state": "Up" + }, + { + "id": 203, + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "name": "Xen Cluster 02 NFS Primary", + "ipaddress": "192.168.21.220", + "path": "/a6bcdca3-cb58-3d64-97a0-400823a0bce3", + "created": "2011-05-27T07:15:46-0700", + "type": "PreSetup", + "clusterid": 3, + "clustername": "Xen Cluster 02", + "disksizetotal": 962498199552, + "disksizeallocated": 260649058304, + "tags": "", + "state": "Up" + }, + { + "id": 203, + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "name": "Xen Cluster 02 NFS Primary", + "ipaddress": "192.168.21.220", + "path": "/a6bcdca3-cb58-3d64-97a0-400823a0bce3", + "created": "2011-05-27T07:15:46-0700", + "type": "PreSetup", + "clusterid": 3, + "clustername": "Xen Cluster 02", + "disksizetotal": 962498199552, + "disksizeallocated": 260649058304, + "tags": "", + "state": "Up" + }, + { + "id": 203, + "zoneid": 1, + "zonename": "San Jose", + "podid": 1, + "podname": "Pod1", + "name": "Xen Cluster 02 NFS Primary", + "ipaddress": "192.168.21.220", + "path": "/a6bcdca3-cb58-3d64-97a0-400823a0bce3", + "created": "2011-05-27T07:15:46-0700", + "type": "PreSetup", + "clusterid": 3, + "clustername": "Xen Cluster 02", + "disksizetotal": 962498199552, + "disksizeallocated": 260649058304, + "tags": "", + "state": "Up" + } + ], + + users: [ + { + "id": 2, + "username": "admin", + "firstname": "admin", + "lastname": "cloud", + "created": "2011-05-26T15:16:39-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "apikey": "EbZq4Tnn3flF9kKXzGKr2uMGLE0jLpKAAb1FZdIBKMlYdF_BbPyXpjQOHtSaUNmSs1UT6zyV-t4jw6eG77hCrQ", + "secretkey": "RIbGt6VapuiqGq-FxSaMKNf8s2OAXWrWEdw0m6SEsj8efIZ9QYCo37X7vKWRR4YKFRV5NDiRAKkLUbIv-xggVQ" + }, + { + "id": 74, + "username": "kimihiko", + "firstname": "Kimihiko", + "lastname": "Kitase ", + "email": "Kimihiko.Kitase@citrix.co.jp", + "created": "2011-08-29T10:14:04-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "Asia/Tokyo", + "apikey": "WdCpxA2zT3gU0DrANRHDnqvQe_O8L3FcwZx7jSP_weUTpo2qpp_ZMwWYkQOIjVCXf4MOKys8e6QBGaKfFDiLWA", + "secretkey": "Xep6DsGSKlcsqgtTZ3U6C1RAvNdSDFIHMXnaiU71kuLdo9LhUYKW_JWlZ49EGxp96MSWKnP4CdGtPVWiz0p7gQ" + }, + { + "id": 79, + "username": "kimi", + "firstname": "Kimihiko", + "lastname": "Kitase2", + "email": "kimihiko.kitase@citrix.co.jp", + "created": "2011-08-31T19:30:40-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT" + }, + { + "id": 82, + "username": "tmackey", + "firstname": "Tim", + "lastname": "Mackey", + "email": "tim.mackey@citrix.com", + "created": "2011-09-06T07:58:01-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/New_York" + }, + { + "id": 89, + "username": "chris", + "firstname": "chris", + "lastname": "woolsey", + "email": "chris@cloud.com", + "created": "2011-09-13T16:39:55-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "America/Los_Angeles" + }, + { + "id": 95, + "username": "mikael", + "firstname": "Mikael", + "lastname": "Lindholm", + "email": "mikael.lindholm@kasetty.com", + "created": "2011-09-15T08:46:53-0700", + "state": "enabled", + "account": "admin", + "accounttype": 1, + "domainid": 1, + "domain": "ROOT", + "timezone": "CET" + } + ] + } + }; +})(window); + diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js new file mode 100644 index 00000000000..0668fcc4366 --- /dev/null +++ b/ui/scripts/accounts.js @@ -0,0 +1,240 @@ +(function(cloudStack, testData) { + + var rootDomainId = 1; + + cloudStack.sections.accounts = { + title: 'Accounts', + id: 'accounts', + listView: { + fields: { + name: { label: 'Name' }, + accounttype: { + label: 'Role', + converter: function(args){ + return cloudStack.converters.toRole(args); + } + }, + domain: { label: 'Domain' }, + state: { label: 'State' } + }, + + actions: { + add: { + label: 'Create account', + + messages: { + confirm: function(args) { + return 'Are you sure you want to create an account?'; + }, + success: function(args) { + return 'Your new account is being created.'; + }, + notification: function(args) { + return 'Creating new account'; + }, + complete: function(args) { + return 'Account has been created successfully!'; + } + }, + + createForm: { + title: 'Create account', + desc: 'Please fill in the following data to create a new account.', + preFilter: cloudStack.preFilter.createTemplate, + fields: { + username: { + label: 'Username', + validation: { required: true } + }, + password: { + label: 'Password', + validation: { required: true }, + isPassword: true + }, + email: { + label: 'Email', + validation: { required: true } + }, + firstname: { + label: 'First name', + validation: { required: true } + }, + lastname: { + label: 'Last name', + validation: { required: true } + }, + domainid: { + label: 'Domain', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var items = []; + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + account: { + label: 'Account' + }, + accounttype: { + label: 'Account type', + validation: { required: true }, + select: function(args) { + var items = []; + items.push({id:0, description: "User"}); //regular-user + items.push({id:1, description: "Admin"}); //root-admin + args.response.success({data: items}); + } + } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&username=" + todb(args.data.username)); + + var password = args.data.password; + if (md5Hashed) + password = $.md5(password); + array1.push("&password=" + password); + + array1.push("&email=" + todb(args.data.email)); + array1.push("&firstname=" + todb(args.data.firstname)); + array1.push("&lastname=" + todb(args.data.lastname)); + + array1.push("&domainid=" + args.data.domainid); + + var account = args.data.account; + if(account == null || account.length == 0) + account = args.data.username; + array1.push("&account=" + todb(account)); + + var accountType = args.data.accounttype; + if (args.data.accounttype == "1" && parseInt(args.data.domainid) != rootDomainId) //if account type is admin, but domain is not Root domain + accountType = "2"; // Change accounttype from root-domain("1") to domain-admin("2") + array1.push("&accounttype=" + accountType); + + /* + var timezone = $thisDialog.find("#add_user_timezone").val(); + if(timezone != null && timezone.length > 0) + array1.push("&timezone=" + todb(timezone)); + */ + + $.ajax({ + url: createURL("createAccount" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createaccountresponse.account; + args.response.success({data:item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + dataProvider: function(args) { + $.ajax({ + url: createURL("listAccounts&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listaccountsresponse.account; + args.response.success({ + actionFilter: accountActionfilter, + data:items + }); + } + }); + }, + + detailView: { + name: 'Account details', + + actions: { + + }, + + tabs: { + details: { + title: 'details', + + fields: [ + { + name: { + label: 'Name', + isEditable: true + } + }, + { + id: { label: 'ID' }, + accounttype: { + label: 'Role', + converter: function(args){ + return cloudStack.converters.toRole(args); + } + }, + domain: { label: 'Domain' }, + state: { label: 'State' }, + vmtotal: { label: 'Total of VM' }, + iptotal: { label: 'Total of IP Address' }, + receivedbytes: { + label: 'Bytes received', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + sentbytes: { + label: 'Bytes sent', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + } + } + ], + + dataProvider: function(args) { + args.response.success( + { + actionFilter: accountActionfilter, + data:args.context.accounts[0] + } + ); + } + } + } + } + } + }; + + var accountActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + return allowedActions; + } + +})(cloudStack, testData); diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js index 42ebaf75209..a83007e4001 100644 --- a/ui/scripts/cloud.core.callbacks.js +++ b/ui/scripts/cloud.core.callbacks.js @@ -17,59 +17,59 @@ */ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;} -/* -This file is meant to help with implementing single signon integration. If you are using the -cloud.com default UI, there is no need to touch this file. -*/ - -/* -This callback function is called when either the session has timed out for the user, -the session ID has been changed (i.e. another user logging into the UI via a different tab), -or it's the first time the user has come to this page. -*/ -function onLogoutCallback() { - // Returning true means the LOGIN page will be show. If you wish to redirect the user +/* +This file is meant to help with implementing single signon integration. If you are using the +cloud.com default UI, there is no need to touch this file. +*/ + +/* +This callback function is called when either the session has timed out for the user, +the session ID has been changed (i.e. another user logging into the UI via a different tab), +or it's the first time the user has come to this page. +*/ +function onLogoutCallback() { + // Returning true means the LOGIN page will be show. If you wish to redirect the user // to different login page, this is where you would do that. - g_loginResponse = null; - return true; + g_loginResponse = null; + return true; } -var g_loginResponse = null; - -/* +var g_loginResponse = null; + +/* For single signon purposes, you just need to make sure that after a successful login, you set the global variable "g_loginResponse" You can also pass in a special param called loginUrl that is pregenerated and sent to the CloudStack, it will -automatically log you in. - -Below is a sample login attempt +automatically log you in. + +Below is a sample login attempt */ var clientApiUrl = "/client/api"; var clientConsoleUrl = "/client/console"; - + $(document).ready(function() { - + var url = $.urlParam("loginUrl"); if (url != undefined && url != null && url.length > 0) { url = unescape(clientApiUrl+"?"+url); - $.ajax({ - url: url, - dataType: "json", - async: false, + $.ajax({ + url: url, + dataType: "json", + async: false, success: function(json) { g_loginResponse = json.loginresponse; - }, + }, error: function() { - onLogoutCallback(); - // This means the login failed. You should redirect to your login page. - }, - beforeSend: function(XMLHttpRequest) { - return true; - } + onLogoutCallback(); + // This means the login failed. You should redirect to your login page. + }, + beforeSend: function(XMLHttpRequest) { + return true; + } }); } -}); - - +}); + + diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js new file mode 100644 index 00000000000..0101722f63e --- /dev/null +++ b/ui/scripts/cloudStack.js @@ -0,0 +1,157 @@ +(function(cloudStack, $, testData) { + $.extend(window.cloudStack, testData, { + home: 'dashboard', + + sectionPreFilter: function(args) { + if(isAdmin()) { + return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration"]; + } + else if(isDomainAdmin()) { + return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events"]; + } + else { //normal user + return ["dashboard", "instances", "storage", "network", "templates", "events"]; + } + }, + sections: { + /** + * Dashboard + */ + dashboard: {}, + //'dashboard-user': {}, + instances: {}, + storage: {}, + network: {}, + templates: {}, + accounts: {}, + domains: {}, + events: {}, + system: {}, + 'global-settings': {}, + configuration: {} + } + }); + + $(function() { + var $container = $('#cloudStack3-container'); + + cloudStack.uiCustom.login({ + $container: $container, + + // Use this for checking the session, to bypass login screen + bypassLoginCheck: function(args) { + return false; + return { + user: { + login: 'wchan', + name: 'Will Chan' + } + }; + }, + + // Actual login process, via form + loginAction: function(args) { + var array1 = []; + array1.push("&username=" + encodeURIComponent(args.data.username)); + + var password; + if (md5Hashed) + password = $.md5(args.data.password); + else + password = args.data.password; + array1.push("&password=" + password); + + var domain; + if(args.data.domain != null && args.data.domain.length > 0) { + if (args.data.domain.charAt(0) != "/") + domain = "/" + args.data.domain; + else + domain = args.data.domain; + array1.push("&domain=" + encodeURIComponent(domain)); + } + else { + array1.push("&domain=" + encodeURIComponent("/")); + } + + $.ajax({ + //type: "POST", + url: createURL("login") + array1.join(""), + dataType: "json", + async: false, + success: function(json) { + var loginresponse = json.loginresponse; + + g_mySession = $.cookie('JSESSIONID'); + g_sessionKey = encodeURIComponent(loginresponse.sessionkey); + g_role = loginresponse.type; + g_username = loginresponse.username; + g_account = loginresponse.account; + g_domainid = loginresponse.domainid; + g_timezone = loginresponse.timezone; + g_timezoneoffset = loginresponse.timezoneoffset; + + $.cookie('sessionKey', g_sessionKey, { expires: 1}); + $.cookie('username', g_username, { expires: 1}); + $.cookie('account', g_account, { expires: 1}); + $.cookie('domainid', g_domainid, { expires: 1}); + $.cookie('role', g_role, { expires: 1}); + $.cookie('timezoneoffset', g_timezoneoffset, { expires: 1}); + $.cookie('timezone', g_timezone, { expires: 1}); + + $.ajax({ + url: createURL("listCapabilities"), + //url: "command=/client/api?listCapabilities&sessionkey="+g_sessionKey, + dataType: "json", + async: false, + success: function(json) { + /* g_supportELB: "guest" — ips are allocated on guest network (so use 'forvirtualnetwork' = false) + * g_supportELB: "public" - ips are allocated on public network (so use 'forvirtualnetwork' = true) + * g_supportELB: "false" – no ELB support + */ + g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean + $.cookie('supportELB', g_supportELB, { expires: 1}); + + g_firewallRuleUiEnabled = json.listcapabilitiesresponse.capability.firewallRuleUiEnabled.toString(); //convert boolean to string if it's boolean + $.cookie('firewallRuleUiEnabled', g_firewallRuleUiEnabled, { expires: 1}); + + if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) { + g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean + $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, { expires: 1}); + } + + if (json.listcapabilitiesresponse.capability.securitygroupsenabled != null) { + g_directAttachSecurityGroupsEnabled = json.listcapabilitiesresponse.capability.securitygroupsenabled.toString(); //convert boolean to string if it's boolean + $.cookie('directattachsecuritygroupsenabled', g_directAttachSecurityGroupsEnabled, { expires: 1}); + } + + args.response.success({ + data: { + user: $.extend(true, {}, loginresponse, { + name: loginresponse.firstname + ' ' + loginresponse.lastname, + role: loginresponse.type == 1 ? 'admin' : 'user' + }) + } + }); + }, + error: function(xmlHTTP) { + args.response.error(); + } + }); + }, + error: function() { + args.response.error(); + } + }); + }, + + // Show cloudStack main UI widget + complete: function(args) { + $container.cloudStack($.extend(cloudStack, { + context: { + users: [args.user] + } + })); + } + }); + }); +})(cloudStack, jQuery, testData); diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js new file mode 100644 index 00000000000..60878e6fa42 --- /dev/null +++ b/ui/scripts/configuration.js @@ -0,0 +1,625 @@ +(function(cloudStack, testData) { + cloudStack.sections.configuration = { + title: 'Configuration', + id: 'configuration', + sectionSelect: { + label: 'Select Offering' + }, + sections: { + serviceOfferings: { + type: 'select', + title: 'Service', + listView: { + label: 'Service Offerings', + fields: { + name: { label: 'Name', editable: true }, + storagetype: { label: 'Storage Type' }, + cpuspeed: { label: 'CPU' }, + memory: { label: 'Memory' }, + domain: { label: 'Domain'} + }, + + actions: { + add: { + label: 'Add service offering', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a service offering?'; + }, + success: function(args) { + return 'Your new service offering is being created.'; + }, + notification: function(args) { + return 'Creating new service offering'; + }, + complete: function(args) { + return 'Service offering has been created successfully!'; + } + }, + + createForm: { + title: 'Add service offering', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + storageType: { + label: 'Storage type', + select: function(args) { + var items = []; + items.push({id: 'shared', description: 'shared'}); + items.push({id: 'local', description: 'local'}); + args.response.success({data: items}); + } + }, + cpuNumber: { + label: '# of CPU cores', + validation: { + required: true, + number: true + } + }, + cpuSpeed: { + label: 'CPU (in MHz)', + validation: { + required: true, + number: true + } + }, + memory: { + label: 'Memory (in MB)', + validation: { + required: true, + number: true + } + }, + networkRate: { + label: 'Network rate', + validation: { + required: false, //optional + number: true + } + }, + offerHA: { + label: 'Offer HA', + isBoolean: true, + isChecked: false + }, + storageTags: { + label: 'Storage tags' + }, + hostTags: { + label: 'Host tags' + }, + cpuCap: { + label: 'CPU cap', + isBoolean: true, + isChecked: false + }, + isPublic: { + label: 'Public', + isBoolean: true, + isReverse: true, + isChecked: true + }, + domainId: { + label: 'Domain', + dependsOn: 'isPublic', + select: function(args) { + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var items = []; + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function(){ + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + }, + isHidden: true + } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + args.data.name); + array1.push("&displaytext=" + todb(args.data.description)); + array1.push("&storageType=" + todb(args.data.storageType)); + array1.push("&cpuNumber=" + args.data.cpuNumber); + array1.push("&cpuSpeed="+ args.data.cpuSpeed); + array1.push("&memory=" + args.data.memory); + + if(args.data.networkRate != null && args.data.networkRate.length > 0) + array1.push("&networkrate=" + args.data.networkRate); + + array1.push("&offerha=" + (args.data.offerHA == "on")); + + if(args.data.storageTags != null && args.data.storageTags.length > 0) + array1.push("&tags=" + todb(args.data.storageTags)); + + if(args.data.hostTags != null && args.data.hostTags.length > 0) + array1.push("&hosttags=" + todb(args.data.hostTags)); + + array1.push("&limitcpuuse=" + (args.data.cpuCap == "on")); + + if(args.$form.find('.form-item[rel=domainId]').css("display") != "none") + array1.push("&domainid=" + args.data.domainId); + + $.ajax({ + url: createURL("createServiceOffering&issystem=false"+array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var item = json.createserviceofferingresponse.serviceoffering; + args.response.success({data: item}); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + dataProvider: function(args) { + $.ajax({ + url: createURL("listServiceOfferings&issystem=false&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listserviceofferingsresponse.serviceoffering; + args.response.success({data:items}); + } + }); + } + } + }, + + systemServiceOfferings: { + type: 'select', + title: 'System Service', + listView: { + label: 'System Service Offerings', + fields: { + name: { label: 'Name', editable: true }, + storagetype: { label: 'Storage Type' }, + cpuspeed: { label: 'CPU' }, + memory: { label: 'Memory' }, + domain: { label: 'Domain'} + }, + + actions: { + add: { + label: 'Add system service offering', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a system service offering?'; + }, + success: function(args) { + return 'Your new system service offering is being created.'; + }, + notification: function(args) { + return 'Creating new system service offering'; + }, + complete: function(args) { + return 'System service offering has been created successfully!'; + } + }, + + createForm: { + title: 'Add system service offering', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + storageType: { + label: 'Storage type', + select: function(args) { + var items = []; + items.push({id: 'shared', description: 'shared'}); + items.push({id: 'local', description: 'local'}); + args.response.success({data: items}); + } + }, + cpuNumber: { + label: '# of CPU cores', + validation: { + required: true, + number: true + } + }, + cpuSpeed: { + label: 'CPU (in MHz)', + validation: { + required: true, + number: true + } + }, + memory: { + label: 'Memory (in MB)', + validation: { + required: true, + number: true + } + }, + networkRate: { + label: 'Network rate', + validation: { + required: false, //optional + number: true + } + }, + offerHA: { + label: 'Offer HA', + isBoolean: true, + isChecked: false + }, + storageTags: { + label: 'Storage tags' + }, + hostTags: { + label: 'Host tags' + }, + cpuCap: { + label: 'CPU cap', + isBoolean: true, + isChecked: false + }, + isPublic: { + label: 'Public', + isBoolean: true, + isReverse: true, + isChecked: true + }, + domainId: { + label: 'Domain', + dependsOn: 'isPublic', + select: function(args) { + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var items = []; + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function(){ + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + }, + isHidden: true + } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + args.data.name); + array1.push("&displaytext=" + todb(args.data.description)); + array1.push("&storageType=" + todb(args.data.storageType)); + array1.push("&cpuNumber=" + args.data.cpuNumber); + array1.push("&cpuSpeed="+ args.data.cpuSpeed); + array1.push("&memory=" + args.data.memory); + + if(args.data.networkRate != null && args.data.networkRate.length > 0) + array1.push("&networkrate=" + args.data.networkRate); + + array1.push("&offerha=" + (args.data.offerHA == "on")); + + if(args.data.storageTags != null && args.data.storageTags.length > 0) + array1.push("&tags=" + todb(args.data.storageTags)); + + if(args.data.hostTags != null && args.data.hostTags.length > 0) + array1.push("&hosttags=" + todb(args.data.hostTags)); + + array1.push("&limitcpuuse=" + (args.data.cpuCap == "on")); + + if(args.$form.find('.form-item[rel=domainId]').css("display") != "none") + array1.push("&domainid=" + args.data.domainId); + + $.ajax({ + url: createURL("createServiceOffering&issystem=true"+array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var item = json.createserviceofferingresponse.serviceoffering; + args.response.success({data: item}); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + dataProvider: function(args) { + $.ajax({ + url: createURL("listServiceOfferings&issystem=true&page="+args.page+"&pagesize="+pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listserviceofferingsresponse.serviceoffering; + args.response.success({data:items}); + } + }); + } + } + }, + + diskOfferings: { + type: 'select', + title: 'Disk', + listView: { + label: 'Disk Offerings', + fields: { + displaytext: { label: 'Name' }, + disksize: { label: 'Disk Size' }, + domain: { label: 'Domain'} + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listDiskOfferings&page="+args.page+"&pagesize="+pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listdiskofferingsresponse.diskoffering; + args.response.success({data:items}); + } + }); + }, + + actions: { + add: { + label: 'Add disk offering', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a disk offering?'; + }, + success: function(args) { + return 'Your new disk offering is being created.'; + }, + notification: function(args) { + return 'Creating new disk offering'; + }, + complete: function(args) { + return 'Disk offering has been created successfully!'; + } + }, + + createForm: { + title: 'Add disk offering', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + isCustomized: { + label: 'Custom disk size', + isBoolean: true, + isReverse: true, + isChecked: false + }, + disksize: { + label: 'Disk size (in GB)', + dependsOn: 'isCustomized', + validation: { required: true, number: true } + }, + tags: { + label: 'Storage tags' + }, + isPublic: { + label: 'Public', + isBoolean: true, + isReverse: true, + isChecked: true + }, + domainId: { + label: 'Domain', + dependsOn: 'isPublic', + select: function(args) { + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var items = []; + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function(){ + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + }, + isHidden: true + } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + args.data.name); + array1.push("&displaytext=" + todb(args.data.description)); + + array1.push("&customized=" + (args.data.isCustomized=="on")); + if(args.$form.find('.form-item[rel=disksize]').css("display") != "none") + array1.push("&disksize=" + args.data.disksize); + + if(args.data.tags != null && args.data.tags.length > 0) + array1.push("&tags=" + todb(args.data.tags)); + + if(args.$form.find('.form-item[rel=domainId]').css("display") != "none") + array1.push("&domainid=" + args.data.domainId); + + $.ajax({ + url: createURL("createDiskOffering&isMirrored=false" + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var item = json.creatediskofferingresponse.diskoffering; + args.response.success({data: item}); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + } + } + }, + networkOfferings: { + type: 'select', + title: 'Network', + listView: { + label: 'Network Offerings', + fields: { + name: { label: 'Name' }, + traffictype: { label: 'Traffic Type'} + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listNetworkOfferings&guestiptype=Virtual&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listnetworkofferingsresponse.networkoffering; + args.response.success({ + actionFilter: networkOfferingsActionfilter, + data:items + }); + } + }); + }, + detailView: { + name: 'Network offering details', + actions: { + edit: { + label: 'Edit', + action: function(args) { + var array1 = []; + array1.push("&displayText=" + todb(args.data.displaytext)); + array1.push("&availability=" + todb(args.data.availability)); + $.ajax({ + url: createURL("updateNetworkOffering&id=" + args.context.networkOfferings[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.updatenetworkofferingresponse.networkoffering; + args.response.success({ data:item }); + } + }); + } + } + }, + tabs: { + details: { + title: 'Details', + + fields: [ + { + name: { + label: 'Name' + } + }, + { + id: { label: 'ID' }, + displaytext: { + label: 'Description', + isEditable: true + }, + availability: { + label: 'Availability', + isEditable: true, + select: function(args) { + var items = []; + items.push({id: 'Required', description: 'Required'}); + items.push({id: 'Optional', description: 'Optional'}); + items.push({id: 'Unavailable', description: 'Unavailable'}); + args.response.success({data: items}); + } + }, + isdefault: { + label: 'Default', + converter:cloudStack.converters.toBooleanText + }, + specifyvlan: { + label: 'Specify VLAN', + converter:cloudStack.converters.toBooleanText + }, + networkrate: { + label: 'Network rate', + converter: function(args) { + var networkRate = args; + if (args == null || args == -1) { + return "Unlimited"; + } + else { + return fromdb(args) + " Mb/s"; + + } + } + }, + traffictype: { + label: 'Traffic type' + } + } + ], + + dataProvider: function(args) { + args.response.success( + { + actionFilter: networkOfferingsActionfilter, + data:args.context.networkOfferings[0] + } + ); + } + } + } + } + } + } + } + }; + + var networkOfferingsActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + allowedActions.push("edit"); + return allowedActions; + } + +})(cloudStack, testData); diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js new file mode 100644 index 00000000000..77231fb070c --- /dev/null +++ b/ui/scripts/dashboard.js @@ -0,0 +1,20 @@ +(function(cloudStack, testData) { + // Admin dashboard + cloudStack.sections.dashboard = { + title: 'Dashboard', + show: function() { + return $('#template').find('div.dashboard.admin').clone(); + } + }; + + // User dashboard + /* + cloudStack.sections['dashboard-user'] = { + title: 'Dashboard (user)', + show: function() { + return $('#template').find('div.dashboard.user').clone(); + } + }; + */ + +})(cloudStack, testData); diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js new file mode 100644 index 00000000000..6b6e1040e5f --- /dev/null +++ b/ui/scripts/domains.js @@ -0,0 +1,233 @@ +(function(cloudStack, testData) { + cloudStack.sections.domains = { + title: 'Domains', + id: 'domains', + + // Domain tree + treeView: { + // Details + detailView: { + name: 'Domain details', + viewAll: { + label: 'Accounts', + path: 'accounts' + }, + + // Detail actions + actions: { + 'delete': { + label: 'Delete domain', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete this domain?' + }, + notification: function(args) { + return 'Domain is deleted'; + } + }, + + preFilter: function(args) { + if(isAdmin()) { + args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block'); + } + }, + + createForm: { + title: 'Delete domain', + fields: { + isForced: { + label: 'Force delete', + isBoolean: true, + isHidden: true + } + } + }, + + action: function(args) { + var array1 = []; + //if(args.$form.find('.form-item[rel=isForced]').css("display") != "none") //uncomment after Brian fix it to include $form in args + array1.push("&cleanup=" + (args.data.isForced == "on")); + + $.ajax({ + url: createURL("deleteDomain&id=" + args.context.domains[0].id + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var jid = json.deletedomainresponse.jobid; + args.response.success( + {_custom: + {jobId: jid} + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + // Edit domain + edit: { + label: 'Edit domain details', + messages: { + notification: function(args) { + return 'Edited domain: ' + args.name; + } + }, + action: function(args) { + setTimeout(function() { + args.response.success(); + }, 200); + } + }, + + // Add domain + create: { + label: 'Add domain', + + action: function(args) { + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&parentdomainid=" + args.context.domains[0].id); + $.ajax({ + url: createURL("createDomain" + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var item = json.createdomainresponse.domain; + args.response.success({data: item}); + } + }); + }, + + messages: { + notification: function(args) { + return 'Created domain' + } + }, + + createForm: { + title: 'Add subdomain', + desc: 'Please specify the subdomain you want to create under this domain', + fields: { + name: { + label: 'Name', + validation: { required: true } + } + } + }, + + notification: { + poll: testData.notifications.testPoll + } + } + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name', isEditable: true } + }, + { + id: { label: 'ID' }, + accounts: { label: 'Accounts' }, + instances: { label: 'Instances' }, + volumes: { label: 'Volumes' } + } + ], + dataProvider: function(args) { + args.response.success({ + data: args.context.domains[0] + }); + } + }, + adminAccounts: { + title: 'Admin Accounts', + multiple: true, + fields: [ + { + name: { label: 'Name' }, + vmtotal: { label: 'VMs' }, + iptotal: { label: 'IPs' }, + receivedbytes: { label: 'Bytes received' }, + sentbytes: { label: 'Bytes sent' }, + state: { label: 'State' } + } + ], + dataProvider: function(args) { + args.response.success({ + data: $.grep(testData.data.accounts, function(item, index) { + return item.domain === 'ROOT' && index <= 5; + }) + }); + } + }, + resourceLimits: { + title: 'Resource Limits', + fields: { + vmlimit: { label: 'Instance Limit' }, + iplimit: { label: 'Public IP Limit' }, + volumelimit: { label: 'Volume Limit' }, + snapshotlimit: { label: 'Snapshot Limit' }, + templatelimit: { label: 'Template Limit' } + }, + dataProvider: function(args) { + args.response.success({ + data: testData.data.accounts[4] + }); + } + } + } + }, + labelField: 'name', + dataProvider: function(args) { + var parentDomain = args.context.parentDomain; + if(parentDomain == null) { //draw root node + $.ajax({ + url: createURL("listDomains&id=" + g_domainid), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainsresponse.domain; + args.response.success({ + actionFilter: domainActionfilter, + data: domainObjs + }); + } + }); + } + else { + $.ajax({ + url: createURL("listDomainChildren&id=" + parentDomain.id), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainchildrenresponse.domain; + args.response.success({ + actionFilter: domainActionfilter, + data: domainObjs + }); + } + }); + } + } + } + }; + + var domainActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + if(isAdmin()) { + allowedActions.push("add"); + if(jsonObj.id != 1) { //"ROOT" domain is not allowed to edit or delete + allowedActions.push("edit"); + allowedActions.push("delete"); + } + } + allowedActions.push("updateResourceCount"); + return allowedActions; + } + +})(cloudStack, testData); diff --git a/ui/scripts/events.js b/ui/scripts/events.js new file mode 100644 index 00000000000..3db5e59a1b5 --- /dev/null +++ b/ui/scripts/events.js @@ -0,0 +1,82 @@ +(function(cloudStack, testData) { + cloudStack.sections.events = { + title: 'Events', + id: 'events', + sectionSelect: { + preFilter: function(args) { + if(isAdmin()) + return ["events", "alerts"]; + else + return ["events"]; + }, + label: 'Select view' + }, + sections: { + events: { + type: 'select', + title: 'Events', + listView: { + id: 'events', + label: 'Events', + fields: { + type: { label: 'Type' }, + description: { label: 'Description' }, + username: { label: 'Initiated By' }, + created: { label: 'Date' } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listEvents&page="+args.page+"&pagesize="+pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listeventsresponse.event; + args.response.success({data:items}); + } + }); + } + } + }, + alerts: { + type: 'select', + title: 'Alerts', + listView: { + id: 'alerts', + label: 'Alerts', + fields: { + type: { label: 'Type' }, + description: { label: 'Description' }, + sent: { label: 'Date' } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listAlerts&page="+args.page+"&pagesize="+pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listalertsresponse.alert; + args.response.success({data:items}); + } + }); + }, + detailView: { + name: 'Alert details', + tabs: { + details: { + title: 'Details', + fields: [ + { + type: { label: 'Type' }, + description: { label: 'Description' }, + created: { label: 'Sent' } + } + ], + dataProvider: testData.dataProvider.detailView('alerts') + }, + } + } + } + } + } + }; +})(cloudStack, testData); diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js new file mode 100644 index 00000000000..dd1c045991a --- /dev/null +++ b/ui/scripts/globalSettings.js @@ -0,0 +1,52 @@ +(function(cloudStack) { + cloudStack.sections['global-settings'] = { + title: 'Global Settings', + id: 'global-settings', + listView: { + label: 'Global Settings', + actions: { + edit: { + label: 'Change value', + action: function(args) { + debugger; + var name = args.data.jsonObj.name; + var value = args.data.value; + + $.ajax({ + url: createURL( + 'updateConfiguration&name=' + name + '&value=' + value + ), + dataType: 'json', + async: true, + success: function(json) { + var item = json.updateconfigurationresponse.configuration; + args.response.success({data: item}); + }, + error: function(json) { + args.response.error({ + message: $.parseJSON(json.responseText).updateconfigurationresponse.errortext + }); + } + }); + } + } + }, + fields: { + name: { label: 'Name', id: true }, + description: { label: 'Description' }, + value: { label: 'Value', editable: true } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listConfigurations&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listconfigurationsresponse.configuration; + args.response.success({ data: items }); + } + }); + } + } + }; +})(cloudStack); diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js new file mode 100644 index 00000000000..d1fb8a1d437 --- /dev/null +++ b/ui/scripts/instances.js @@ -0,0 +1,1619 @@ +(function($, cloudStack, testData) { + + var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, isoObjs, serviceOfferingObjs, diskOfferingObjs; + var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj; + var step5ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network', 'select-security-group' + + cloudStack.sections.instances = { + title: 'Instances', + id: 'instances', + listView: { + section: 'instances', + filters: { + mine: { label: 'Mine' }, + running: { label: 'Running' }, + stopped: { label: 'Stopped' }, + destroyed: { label: 'Destroyed' } + }, + fields: { + name: { label: 'Name', editable: true }, + displayname: { label: 'Display Name' }, + zonename: { label: 'Zone' }, + state: { + label: 'Status', + indicator: { + 'Running': 'on', + 'Stopped': 'off', + 'Error': 'off' + } + } + }, + + // List view actions + actions: { + // Add instance wizard + add: { + label: 'Add instance', + + action: { + custom: cloudStack.instanceWizard({ + steps: [ + // Step 1: Setup + function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + zoneObjs = json.listzonesresponse.zone; + args.response.success({ data: {zones: zoneObjs}}); + } + }); + }, + + // Step 2: Select template + function(args) { + $(zoneObjs).each(function(){ + if(this.id == args.currentData.zoneid) { + selectedZoneObj = this; + return false; //break the $.each() loop + } + }); + if(selectedZoneObj == null) { + alert("error: can't find matched zone object"); + return; + } + + $.ajax({ + url: createURL("listHypervisors&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + hypervisorObjs = json.listhypervisorsresponse.hypervisor; + } + }); + + $.ajax({ + url: createURL("listTemplates&templatefilter=featured&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + featuredTemplateObjs = json.listtemplatesresponse.template; + } + }); + + $.ajax({ + url: createURL("listTemplates&templatefilter=community&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + communityTemplateObjs = json.listtemplatesresponse.template; + } + }); + + $.ajax({ + url: createURL("listTemplates&templatefilter=selfexecutable&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + myTemplateObjs = json.listtemplatesresponse.template; + } + }); + + $.ajax({ + url: createURL("listIsos&isReady=true&bootable=true&isofilter=executable&zoneid="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + isoObjs = json.listisosresponse.iso; + } + }); + + args.response.success({ + hypervisor: { + idField: 'name', + nameField: 'name' + }, + data: { + templates: { + featuredtemplates: featuredTemplateObjs, + communitytemplates: communityTemplateObjs, + mytemplates: myTemplateObjs, + isos: isoObjs + }, + hypervisors: hypervisorObjs + } + }); + }, + + // Step 3: Service offering + function(args) { + if(args.currentData["select-template"] == "select-template") { + for(var i=0; i < featuredTemplateObjs.length; i++) { + if(featuredTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = featuredTemplateObjs[i]; + break; + } + } + if(selectedTemplateObj == null) { + for(var i=0; i < communityTemplateObjs.length; i++) { + if(communityTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = communityTemplateObjs[i]; + break; + } + } + } + if(selectedTemplateObj == null) { + for(var i=0; i < myTemplateObjs.length; i++) { + if(myTemplateObjs[i].id == args.currentData.templateid) { + selectedTemplateObj = myTemplateObjs[i]; + break; + } + } + } + if(selectedTemplateObj == null) + alert("unable to find matched template object"); + else + selectedHypervisor = selectedTemplateObj.hypervisor; + } + else { //(args.currentData["select-template"] == "select-iso" + selectedHypervisor = args.currentData.hypervisorid; + } + + $.ajax({ + url: createURL("listServiceOfferings&issystem=false"), + dataType: "json", + async: true, + success: function(json) { + serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering; + args.response.success({ + data: {serviceOfferings: serviceOfferingObjs} + }); + } + }); + }, + + // Step 4: Data disk offering + function(args) { + var isRequred = (args.currentData["select-template"] == "select-iso"? true: false); + $.ajax({ + url: createURL("listDiskOfferings"), + dataType: "json", + async: true, + success: function(json) { + diskOfferingObjs = json.listdiskofferingsresponse.diskoffering; + args.response.success({ + required: isRequred, + customFlag: 'iscustomized', // Field determines if custom slider is shown + data: {diskOfferings: diskOfferingObjs} + }); + } + }); + }, + + // Step 5: Network + function(args) { + if(diskOfferingObjs != null && diskOfferingObjs.length > 0) { + for(var i=0; i < diskOfferingObjs.length; i++) { + if(diskOfferingObjs[i].id == args.currentData.diskofferingid) { + selectedDiskOfferingObj = diskOfferingObjs[i]; + break; + } + } + } + + if (selectedZoneObj.securitygroupsenabled == false) { //show network container + //vmWizardShowNetworkContainer($thisPopup); + step5ContainerType = 'select-network'; + } + else if (selectedZoneObj.securitygroupsenabled == true) { // if security group is enabled + var hasDedicatedDirectTaggedDefaultNetwork = false; + $.ajax({ + url: createURL("listNetworks&type=Direct&domainid="+g_domainid+"&account="+g_account+"&zoneId="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + var items = json.listnetworksresponse.network; + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + if(items[i].isshared == false && items[i].isdefault == true) { //dedicated, is default one. + var broadcasturi = items[i].broadcasturi; //e.g. "vlan://53" + if(broadcasturi != null && broadcasturi.length > 0) { + var vlanIdString = broadcasturi.substring(7); //e.g. "53" + if(isNaN(vlanIdString) == false) + hasDedicatedDirectTaggedDefaultNetwork = true; + } + } + } + } + } + }); + + //hasDedicatedDirectTaggedDefaultNetwork = true; //for testing only, comment it out before checking in!!!!!!!!!!!! + if(hasDedicatedDirectTaggedDefaultNetwork == true) { + if(confirm("Do you wish to launch your instance on your own private dedicated network?")) { + step5ContainerType = 'select-network'; + } + else { + if(selectedHypervisor == "VMware" || g_directAttachSecurityGroupsEnabled != "true") + step5ContainerType = 'nothing-to-select'; + else + step5ContainerType = 'select-security-group'; + } + } + else { + if(selectedHypervisor == "VMware" || g_directAttachSecurityGroupsEnabled != "true") + step5ContainerType = 'nothing-to-select'; + else + step5ContainerType = 'select-security-group'; + } + } + + //step5ContainerType = 'nothing-to-select'; //for testing only, comment it out before checking in!!!!!!!!!!!! + if(step5ContainerType == 'select-network') { + var defaultNetworkArray = [], optionalNetworkArray = []; + $.ajax({ + url: createURL("listNetworks&domainid="+g_domainid+"&account="+g_account+"&zoneId="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + var networks = json.listnetworksresponse.network; + + //***** Setup Virtual Network (begin) ***** + //virtualNetwork is first radio button in required network section. Show virtualNetwork when its networkofferingavailability is 'Required' or'Optional' + var virtualNetwork = null; + if(selectedZoneObj.securitygroupsenabled == false) { + if (networks != null && networks.length > 0) { + for (var i = 0; i < networks.length; i++) { + if (networks[i].type == 'Virtual') { + virtualNetwork = networks[i]; + break; + } + } + } + if (virtualNetwork == null) { //if there is no virtualNetwork + $.ajax({ + url: createURL("listNetworkOfferings&guestiptype=Virtual"), //check DefaultVirtualizedNetworkOffering + dataType: "json", + async: false, + success: function(json) { + var networkOfferings = json.listnetworkofferingsresponse.networkoffering; + if (networkOfferings != null && networkOfferings.length > 0) { + for (var i = 0; i < networkOfferings.length; i++) { + if (networkOfferings[i].isdefault == true + && (networkOfferings[i].availability == "Required" || networkOfferings[i].availability == "Optional") + ) { + // Create a virtual network + var networkName = "Virtual Network"; + var networkDesc = "A dedicated virtualized network for your account. The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router."; + $.ajax({ + url: createURL("createNetwork&networkOfferingId="+networkOfferings[i].id+"&name="+todb(networkName)+"&displayText="+todb(networkDesc)+"&zoneId="+args.currentData.zoneid), + dataType: "json", + async: false, + success: function(json) { + virtualNetwork = json.createnetworkresponse.network; + defaultNetworkArray.push(virtualNetwork); + } + }); + } + } + } + } + }); + } + else { //virtualNetwork != null (there is already a virtualNetwork) + if (virtualNetwork.networkofferingavailability == 'Required' || virtualNetwork.networkofferingavailability == 'Optional') { + defaultNetworkArray.push(virtualNetwork); + } + else { //virtualNetwork.networkofferingavailability == 'Unavailable' + //do not show virtualNetwork + } + } + } + //***** Setup Virtual Network (end) ***** + + + //***** Setup Direct Networks (begin) ***** + //direct networks whose isdefault==true is 2nd~Nth radio buttons in required network section + //direct networks whose isdefault==false is a bunch of checkboxes in optional network section + if (networks != null && networks.length > 0) { + for (var i = 0; i < networks.length; i++) { + //if selectedZoneObj.securitygroupsenabled is true and users still choose to select network instead of security group (from dialog), then UI won't show networks whose securitygroupenabled is true. + if(selectedZoneObj.securitygroupsenabled == true && networks[i].securitygroupenabled == true) { + continue; + } + + if (networks[i].type != 'Direct') { + continue; + } + + if (networks[i].isdefault) { + if (virtualNetwork.networkofferingavailability == 'Required') { + continue; //don't display 2nd~Nth radio buttons in required network section when networkofferingavailability == 'Required' + } + defaultNetworkArray.push(networks[i]); + } + else { + optionalNetworkArray.push(networks[i]); + } + } + } + //***** Setup Direct Networks (end) ***** + } + }); + args.response.success({ + type: 'select-network', + data: { + defaultNetworks: defaultNetworkArray, + optionalNetworks: optionalNetworkArray, + securityGroups: [] + } + }); + } + + else if(step5ContainerType == 'select-security-group') { + var securityGroupArray = []; + $.ajax({ + url: createURL("listSecurityGroups"+"&domainid="+g_domainid+"&account="+g_account), + dataType: "json", + async: false, + success: function(json) { + var items = json.listsecuritygroupsresponse.securitygroup; + if (items != null && items.length > 0) { + for (var i = 0; i < items.length; i++) { + if(items[i].name != "default") //exclude default security group because it is always applied + securityGroupArray.push(items[i]); + } + } + } + }); + args.response.success({ + type: 'select-security-group', + data: { + defaultNetworks: [], + optionalNetworks: [], + securityGroups: securityGroupArray + } + }); + } + + else if(step5ContainerType == 'nothing-to-select') { + args.response.success({ + type: 'nothing-to-select', + data: { + defaultNetworks: [], + optionalNetworks: [], + securityGroups: [] + } + }); + } + + }, + + // Step 6: Review + function(args) { + return false; + } + ], + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisPopup.find("#wizard_vm_name"), $thisPopup.find("#wizard_vm_name_errormsg"), true); //optional + isValid &= validateString("Group", $thisPopup.find("#wizard_vm_group"), $thisPopup.find("#wizard_vm_group_errormsg"), true); //optional + if (!isValid) + return; + */ + + // Create a new VM!!!! + var array1 = []; + + //step 1 : select zone + array1.push("&zoneId=" + args.data.zoneid); + + //step 2: select template + array1.push("&templateId=" + args.data.templateid); + array1.push("&hypervisor=" + selectedHypervisor); + + //step 3: select service offering + array1.push("&serviceOfferingId=" + args.data.serviceofferingid); + + //step 4: select disk offering + if(args.data.diskofferingid != null && args.data.diskofferingid != "0") { + array1.push("&diskOfferingId=" + args.data.diskofferingid); + if(selectedDiskOfferingObj.iscustomized == true) + array1.push("&size=" + args.data.size); + } + + //step 5: select network + if (step5ContainerType == 'select-network') { + var array2 = []; + var defaultNetwork = args.data["default-network"]; + if(defaultNetwork != null && defaultNetwork.length > 0) + array2.push(defaultNetwork); + + var optionalNetworks = args.data["optional-networks"]; + //optionalNetworks might be: (1) an array of string, e.g. ["203", "202"], + if(typeof(optionalNetworks) == "object" && optionalNetworks.length != null) { + if(optionalNetworks != null && optionalNetworks.length > 0) { + for(var i=0; i < optionalNetworks.length; i++) { + array2.push(optionalNetworks[i]); + } + } + } + //optionalNetworks might be: (2) just an string, e.g. "202" + else if(typeof(optionalNetworks) == "string" && optionalNetworks.length > 0) { + array2.push(optionalNetworks); + } + array1.push("&networkIds=" + array2.join(",")); + } + else if (step5ContainerType == 'select-security-group') { + var securityGroupList; + var groups = args.data["security-groups"]; + if(groups != null && groups.length > 0) { + for(var i=0; i < groups.length; i++) { + if(i == 0) + securityGroupList = groups[i]; + else + securityGroupList += ("," + groups[i]); + } + } + if(securityGroupList != null) + array1.push("&securitygroupids=" + securityGroupList); + } + + var displayname = args.data.displayname; + if(displayname != null && displayname.length > 0) + array1.push("&displayname="+todb(displayname)); + + var group = args.data.groupname; + if (group != null && group.length > 0) + array1.push("&group="+todb(group)); + + $.ajax({ + url: createURL("deployVirtualMachine"+array1.join("")), + dataType: "json", + success: function(json) { + var jid = json.deployvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + }, + error: function(XMLHttpResponse) { + //args.response.error(); //wait for Brian to implement + alert("Failed to deploy VM."); + } + }); + } + }) + }, + + messages: { + confirm: function(args) { //never being called + return 'Are you sure you want to deploy an instance?'; + }, + success: function(args) { //never being called + return args.name + ' is being created.'; + }, + notification: function(args) { + //return 'Creating new VM: ' + args.name; //args.name is not available + return 'Creating new VM'; + }, + complete: function(args) { //never being called + return args.name + ' has been created successfully!'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + start: { + label: 'Start instance' , + action: function(args) { + $.ajax({ + url: createURL("startVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.startvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to start ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being started.'; + }, + notification: function(args) { + return 'Starting VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been started.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + stop: { + label: 'Stop instance', + action: function(args) { + $.ajax({ + url: createURL("stopVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.stopvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to stop ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being stopped.'; + }, + notification: function(args) { + return 'Stopping VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been stopped.'; + } + }, + notification: { + //poll: testData.notifications.testPoll + poll: pollAsyncJobResult + } + }, + restart: { + label: 'Reboot instance', + action: function(args) { + $.ajax({ + url: createURL("rebootVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.rebootvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to reboot ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being rebooted.'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been rebooted successfully.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + destroy: { + label: 'Destroy instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being destroyed.'; + }, + notification: function(args) { + return 'Destroying VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been destroyed.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("destroyVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.destroyvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + restore: { + label: 'Restore instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to restore ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being restored.'; + }, + notification: function(args) { + return 'Restoring VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been restored.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("recoverVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var item = json.recovervirtualmachineresponse.virtualmachine; + args.response.success({data:item}); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + dataProvider: function(args) { + var array1 = []; + if(args.filterBy != null) { + if(args.filterBy.kind != null) { + switch(args.filterBy.kind) { + case "mine": + array1.push("&domainid=" + g_domainid + "&account=" + g_account); + break; + case "running": + array1.push("&state=Running"); + break; + case "stopped": + array1.push("&state=Stopped"); + break; + case "destroyed": + array1.push("&state=Destroyed"); + break; + } + } + if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) { + switch(args.filterBy.search.by) { + case "name": + array1.push("&keyword=" + args.filterBy.search.value); + break; + } + } + } + + $.ajax({ + url: createURL("listVirtualMachines&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var items = json.listvirtualmachinesresponse.virtualmachine; + + args.response.success({ + actionFilter: vmActionfilter, + data: items + }); + } + }); + }, + + detailView: { + name: 'Instance details', + viewAll: { path: 'storage.volumes', label: 'Volumes' }, + + // Detail view actions + actions: { + start: { + label: 'Start instance' , + action: function(args) { + $.ajax({ + url: createURL("startVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.startvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to start ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being started.'; + }, + notification: function(args) { + return 'Starting VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been started.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + stop: { + label: 'Stop instance', + action: function(args) { + $.ajax({ + url: createURL("stopVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.stopvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to stop ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being stopped.'; + }, + notification: function(args) { + return 'Stopping VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been stopped.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + restart: { + label: 'Reboot instance', + action: function(args) { + $.ajax({ + url: createURL("rebootVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.rebootvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to reboot ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being rebooted.'; + }, + notification: function(args) { + return 'Rebooting VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been rebooted successfully.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + destroy: { + label: 'Destroy instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being destroyed.'; + }, + notification: function(args) { + return 'Destroying VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been destroyed.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("destroyVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.destroyvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + restore: { + label: 'Restore instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to restore ' + args.name + '?'; + }, + success: function(args) { + return args.name + ' is being restored.'; + }, + notification: function(args) { + return 'Restoring VM: ' + args.name; + }, + complete: function(args) { + return args.name + ' has been restored.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("recoverVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var item = json.recovervirtualmachineresponse.virtualmachine; + args.response.success({data:item}); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + edit: { + label: 'Edit', + action: function(args) { + var array1 = []; + array1.push("&displayName=" + args.response.data.displayname); + array1.push("&group=" + args.response.data.group); + array1.push("&ostypeid=" + args.response.data.guestosid); + //array1.push("&haenable=" + haenable); + + $.ajax({ + url: createURL("updateVirtualMachine&id=" + args.context.instances[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.updatevirtualmachineresponse.virtualmachine; + args.response.success({data:item}); + } + }); + } + }, + + attachISO: { + label: 'Attach ISO', + createForm: { + title: 'Attach ISO', + desc: 'Attach ISO to instance', + fields: { + iso: { + label: 'ISO', + select: function(args) { + $.ajax({ + url: createURL("listIsos&isReady=true&isofilter=executable"), + dataType: "json", + async: true, + success: function(json) { + var isos = json.listisosresponse.iso; + var items = []; + $(isos).each(function() { + items.push({id: this.id, description: this.displaytext}); + }); + args.response.success({data: items}); + } + }); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("attachIso&virtualmachineid=" + args.context.instances[0].id + "&id=" + args.data.iso), + dataType: "json", + async: true, + success: function(json) { + var jid = json.attachisoresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to attach ISO to instance ' + args.name + '?'; + }, + success: function(args) { + return 'ISO is being attached to instance ' + args.name; + }, + notification: function(args) { + return 'Attaching ISO to instance ' + args.name; + }, + complete: function(args) { + return 'ISO has been attached to instance ' + args.name; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + detachISO: { + label: 'Detach instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to detach ISO ?'; + }, + success: function(args) { + return 'ISO is being detached.'; + }, + notification: function(args) { + return 'Detaching ISO'; + }, + complete: function(args) { + return 'ISO has been detached.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("detachIso&virtualmachineid=" + args.context.instances[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.detachisoresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + resetPassword: { + label: 'Reset password', + messages: { + confirm: function(args) { + /* + if (jsonObj.passwordenabled == false) { + $("#dialog_info") + .text(dictionary["message.action.reset.password.off"]) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); + return; + } else if (jsonObj.state != 'Stopped') { + $("#dialog_info") + .text(dictionary["message.action.reset.password.warning"]) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); + return; + } + */ + return 'Are you sure you want to reset password?'; + }, + success: function(args) { + return 'Password is being reset.'; + }, + notification: function(args) { + return 'Resetting password'; + }, + complete: function(args) { + return 'Password has been reset to ' + args.password; + } + }, + action: function(args) { + $.ajax({ + url: createURL("resetPasswordForVirtualMachine&id=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.resetpasswordforvirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + changeService: { + label: 'Change service offering', + messages: { + confirm: function(args) { + return 'Are you sure you want to change service offering?'; + }, + success: function(args) { + return 'Service offering is being changed.'; + }, + notification: function(args) { + return 'Changing service offering'; + }, + complete: function(args) { + return 'Service offering has been changed.'; + } + }, + createForm: { + title: 'Change Service Offering', + desc: '', + fields: { + serviceOffering: { + label: 'Service offering', + select: function(args) { + $.ajax({ + url: createURL("listServiceOfferings&VirtualMachineId=" + args.context.instances[0].id), + dataType: "json", + async: true, + success: function(json) { + var serviceofferings = json.listserviceofferingsresponse.serviceoffering; + var items = []; + $(serviceofferings).each(function() { + items.push({id: this.id, description: this.displaytext}); + }); + args.response.success({data: items}); + } + }); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("changeServiceForVirtualMachine&id=" + args.context.instances[0].id + "&serviceOfferingId=" + args.data.serviceOffering), + dataType: "json", + async: true, + success: function(json) { + var jsonObj = json.changeserviceforvirtualmachineresponse.virtualmachine; + args.response.success({data: jsonObj}); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + createTemplate: { + label: 'Create template', + messages: { + confirm: function(args) { + /* + if (getUserPublicTemplateEnabled() == "true" || isAdmin()) { + $dialogCreateTemplate.find("#create_template_public_container").show(); + } + */ + return 'Are you sure you want to create template?'; + }, + success: function(args) { + return 'Template is being created.'; + }, + notification: function(args) { + return 'Creating template'; + }, + complete: function(args) { + return 'Template has been created.'; + } + }, + createForm: { + title: 'Create Template', + desc: '', + preFilter: cloudStack.preFilter.createTemplate, + fields: { + name: { label: 'Name', validation: { required: true }}, + displayText: { label: 'Description', validation: { required: true }}, + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + isPublic: { label: 'Public', isBoolean: true }, + url: { label: 'Image directory', validation: { required: true } } + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_template_name"), $thisDialog.find("#create_template_name_errormsg")); + isValid &= validateString("Display Text", $thisDialog.find("#create_template_desc"), $thisDialog.find("#create_template_desc_errormsg")); + isValid &= validateString("Image Directory", $thisDialog.find("#image_directory"), $thisDialog.find("#image_directory_errormsg"), false); //image directory is required when creating template from VM whose hypervisor is BareMetal + if (!isValid) + return; + $thisDialog.dialog("close"); + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displayText)); + array1.push("&osTypeId=" + args.data.osTypeId); + + //array1.push("&isPublic=" + args.data.isPublic); + array1.push("&isPublic=" + (args.data.isPublic=="on")); //temporary, before Brian fixes it. + + array1.push("&url=" + todb(args.data.url)); + + $.ajax({ + url: createURL("createTemplate&virtualmachineid=" + args.context.instances[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createtemplateresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //no properties in this VM needs to be updated + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + viewConsole: { + label: 'View VM console', + action: { + externalLink: { + url: function(args) { + return clientConsoleUrl + '?cmd=access&vm=' + args.context.instances[0].id; + }, + title: function(args) { + return getVmName(args.context.instances[0].name, args.context.instances[0].displayname) + ' console'; + }, + width: 820, + height: 640 + } + } + }, + + migrate: { + label: 'Migrate instance', + messages: { + confirm: function(args) { + return 'Are you sure you want to migrate instance?'; + }, + success: function(args) { + return 'Instance is being migrated.'; + }, + notification: function(args) { + return 'Migrating instance'; + }, + complete: function(args) { + return 'Instance has been migrated.'; + } + }, + createForm: { + title: 'Migrate instance', + desc: '', + fields: { + hostId: { + label: 'Host', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listHosts&VirtualMachineId=" + args.context.instances[0].id), + //url: createURL("listHosts"), //for testing only, comment it out before checking in. + dataType: "json", + async: true, + success: function(json) { + var hosts = json.listhostsresponse.host; + var items = []; + $(hosts).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("migrateVirtualMachine&hostid=" + args.data.hostId + "&virtualmachineid=" + args.context.instances[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.migratevirtualmachineresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.virtualmachine; + /* + var vmObj; + $.ajax({ + url: createURL("listVirtualMachines&id=" + args.context.instances[0].id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listvirtualmachinesresponse.virtualmachine; + if(items != null && items.length > 0) { + vmObj = items[0]; + } + } + }); + return vmObj; + */ + }, + getActionFilter: function() { + return vmActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + // Details tab + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name', isEditable: false } + }, + { + id: { label: 'ID', isEditable: false }, + displayname: { label: 'Display Name', isEditable: true }, + state: { label: 'State', isEditable: false }, + zonename: { label: 'Zone', isEditable: false }, + hypervisor: { label: 'Hypervisor', isEditable: false }, + templatename: { label: 'Template', isEditable: false }, + templateid: { + label: 'Template type', + isEditable: false + /* + , + select: function(args) { + var items = []; + + $(testData.data.templates).each(function() { + items.push({ id: this.id, description: this.name }); + }); + + args.response.success({ data: items }); + } + */ + }, + guestosid: { + label: 'OS Type', + isEditable: true, + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + + serviceofferingname: { label: 'Service offering', isEditable: false }, + group: { label: 'Group', isEditable: true }, + hostname: { label: 'Host', isEditable: false}, + haenable: { label: 'HA Enable', isEditable: false, converter:cloudStack.converters.toBooleanText }, + isoid: { + label: 'Attached ISO', + isEditable: false, + converter: function(isoid) { + return cloudStack.converters.toBooleanText(isoid != null); + } + }, + domain: { label: 'Domain', isEditable: false }, + account: { label: 'Account', isEditable: false }, + created: { label: 'Created', isEditable: false } + } + ], + + dataProvider: function(args) { + args.response.success( + { + actionFilter: vmActionfilter, + data: args.context.instances[0] + } + ); + } + }, + + /** + * NICs tab + */ + nics: { + title: 'NICs', + multiple: true, + fields: [ + { + id: { label: 'ID' }, + ipaddress: { label: 'IP Address' }, + type: { label: 'Type' }, + gateway: { label: 'Default gateway' }, + netmask: { label: 'Netmask' } + } + ], + dataProvider: function(args) { + args.response.success({data: args.context.instances[0].nic}); + } + }, + + /** + * Security Groups tab + */ + securityGroups: { + title: 'Security groups', + multiple: true, + fields: [ + { + id: { label: 'ID' }, + name: { label: 'Name' }, + description: { label: 'Description' } + } + ], + dataProvider: function(args) { + args.response.success({data: args.context.instances[0].securitygroup}); + } + }, + + /** + * Statistics tab + */ + stats: { + title: 'Statistics', + fields: { + cpuspeed: { label: 'Total CPU' }, + cpuused: { label: 'CPU Utilized' }, + networkkbsread: { label: 'Network Read' }, + networkkbswrite: { label: 'Network Write' } + }, + dataProvider: testData.dataProvider.detailView('instances') + } + } + } + } + }; + + var vmActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if (jsonObj.state == 'Destroyed') { + if(isAdmin() || isDomainAdmin()) { + allowedActions.push("restore"); + } + } + else if (jsonObj.state == 'Running') { + allowedActions.push("edit"); + allowedActions.push("stop"); + allowedActions.push("restart"); + allowedActions.push("destroy"); + if (isAdmin() + && (jsonObj.rootdevicetype == 'NetworkFilesystem' || jsonObj.rootdevicetype == 'IscsiLUN' || jsonObj.rootdevicetype == 'PreSetup' || jsonObj.rootdevicetype == 'OCFS2') + //&& (jsonObj.hypervisor == 'XenServer' || jsonObj.hypervisor == 'VMware') + ) + { + allowedActions.push("migrate"); + } + + if (jsonObj.isoid == null) { + allowedActions.push("attachISO"); + } + else { + allowedActions.push("detachISO"); + } + + allowedActions.push("resetPassword"); + allowedActions.push("changeService"); + + if(jsonObj.hypervisor == "BareMetal") { + allowedActions.push("createTemplate"); + } + + allowedActions.push("viewConsole"); + } + else if (jsonObj.state == 'Stopped') { + allowedActions.push("edit"); + allowedActions.push("start"); + allowedActions.push("destroy"); + if (jsonObj.isoid == null) { + allowedActions.push("attachISO"); + } + else { + allowedActions.push("detachISO"); + } + allowedActions.push("resetPassword"); + allowedActions.push("changeService"); + if(jsonObj.hypervisor == "BareMetal") { + allowedActions.push("createTemplate"); + } + } + else if (jsonObj.state == 'Starting') { + allowedActions.push("stop"); + } + else if (jsonObj.state == 'Error') { + allowedActions.push("destroy"); + } + return allowedActions; + } + +})(jQuery, cloudStack, testData); diff --git a/ui/scripts/network.js b/ui/scripts/network.js new file mode 100644 index 00000000000..71c2bb5a779 --- /dev/null +++ b/ui/scripts/network.js @@ -0,0 +1,1551 @@ +(function(cloudStack, $, testData) { + var actionFilters = { + ipAddress: function(args) { + var allowedActions = args.context.actions; + var disallowedActions = []; + var item = args.context.item; + var status = item.state; + + if (status == 'Destroyed' || + status == 'Releasing' || + status == 'Released' || + status == 'Creating' || + status == 'Allocating' || + item.account == 'system') { + disallowedActions = allowedActions; + } + + if (item.isstaticnat) { + disallowedActions.push('enableStaticNAT'); + } else { + disallowedActions.push('disableStaticNAT'); + } + + if (item.vpnenabled) { + disallowedActions.push('enableVPN'); + } else { + disallowedActions.push('disableVPN'); + } + + if (item.issourcenat){ + disallowedActions.push('enableStaticNAT'); + disallowedActions.push('disableStaticNAT'); + disallowedActions.push('destroy'); + } else { + disallowedActions.push('enableVPN'); + disallowedActions.push('disableVPN'); + } + + allowedActions = $.grep(allowedActions, function(item) { + return $.inArray(item, disallowedActions) == -1; + }); + + return allowedActions; + } + }; + + cloudStack.sections.network = { + title: 'Network', + id: 'network', + sectionSelect: { + preFilter: function(args) { + if (g_directAttachSecurityGroupsEnabled == "true") { + return args.context.sections; + } + else { + return ['ipAddresses']; + } + }, + label: 'Select view' + }, + sections: { + ipAddresses: { + type: 'select', + title: 'IP Addresses', + listView: { + id: 'ipAddresses', + label: 'IPs', + filters: { + allocated: { label: 'Allocated ' }, + mine: { label: 'My network' } + }, + fields: { + ipaddress: { + label: 'IP', + converter: function(text, item) { + if (item.issourcenat) { + return text + ' [Source NAT]'; + } + + return text; + } + }, + zonename: { label: 'Zone' }, + vlanname: { label: 'VLAN' }, + account: { label: 'Account' }, + state: { label: 'State', indicator: { 'Allocated': 'on' } } + }, + actions: { + add: { + label: 'Acquire new IP', + + action: function(args) { + $.ajax({ + url: createURL('associateIpAddress'), + data: { + zoneid: args.data.availabilityZone + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.associateipaddressresponse.jobid, + getUpdatedItem: function(data) { + return data.queryasyncjobresultresponse.jobresult.ipaddress; + }, + getActionFilter: function(args) { + return ['enableStaticNAT', 'destroy']; + } + } + }); + } + }); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add this new IP?'; + }, + notification: function(args) { + return 'Allocated IP'; + } + }, + + createForm: { + title: 'Acquire new IP', + desc: 'Please select a zone from which you want to acquire your new IP from.', + fields: { + availabilityZone: { + label: 'Zone', + select: function(args) { + $.ajax({ + url: createURL('listZones'), + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: $.map(data.listzonesresponse.zone, function(zone) { + return { + id: zone.id, + description: zone.name + }; + }) + }); + } + }); + } + } + } + }, + + notification: { + poll: pollAsyncJobResult + } + }, + enableVPN: { + label: 'Enable VPN', + action: function(args) { + $.ajax({ + url: createURL('createRemoteAccessVpn'), + data: { + publicipid: args.context.ipAddresses[0].id, + domainid: args.context.ipAddresses[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { jobId: data.createremoteaccessvpnresponse.jobid } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want VPN enabled for this IP address.'; + }, + notification: function(args) { + return 'Enabled VPN'; + }, + complete: function(args) { + return 'VPN is now enabled for IP ' + args.publicip + '.' + + '
    Your IPsec pre-shared key is:
    ' + args.presharedkey; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + disableVPN: { + label: 'Disable VPN', + action: function(args) { + $.ajax({ + url: createURL('deleteRemoteAccessVpn'), + data: { + publicipid: args.context.ipAddresses[0].id, + domainid: args.context.ipAddresses[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + getUpdatedItem: function(data) { + + }, + jobId: data.deleteremoteaccessvpnresponse.jobid + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable VPN?'; + }, + notification: function(args) { + return 'Disabled VPN'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + enableStaticNAT: { + label: 'Enable static NAT', + action: { + noAdd: true, + custom: cloudStack.uiCustom.enableStaticNAT({ + listView: cloudStack.sections.instances, + action: function(args) { + $.ajax({ + url: createURL('enableStaticNat'), + data: { + ipaddressid: args.context.ipAddresses[0].id, + virtualmachineid: args.context.instances[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success(); + } + }); + } + }) + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to enable static NAT?'; + }, + notification: function(args) { + return 'Enabled Static NAT'; + } + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + disableStaticNAT: { + label: 'Disable static NAT', + action: function(args) { + $.ajax({ + url: createURL('disableStaticNat'), + data: { + ipaddressid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.disablestaticnatresponse.jobid, + getActionFilter: function() { + return function(args) { + return ['enableStaticNAT']; + }; + } + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable static NAT?'; + }, + notification: function(args) { + return 'Disable Static NAT'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + destroy: { + label: 'Release IP', + action: function(args) { + $.ajax({ + url: createURL('disassociateIpAddress'), + data: { + id: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.disassociateipaddressresponse.jobid, + getActionFilter: function() { + return function(args) { + var allowedActions = ['enableStaticNAT']; + + return allowedActions; + }; + }, + getUpdatedItem: function(args) { + return { + state: 'Released' + }; + } + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to release this IP?'; + }, + notification: function(args) { + return 'Release IP'; + } + }, + notification: { poll: pollAsyncJobResult } + } + }, + + //dataProvider: testData.dataProvider.listView('network'), + dataProvider: function(args) { + var data = { + page: args.page, + pageSize: pageSize + }; + + if (g_supportELB == "guest") // IPs are allocated on guest network + $.extend(data, { + forvirtualnetwork: false, + forloadbalancing: true + }); + else if(g_supportELB == "public") // IPs are allocated on public network + $.extend(data, { + forvirtualnetwork: true, + forloadbalancing: true + }); + + $.ajax({ + url: createURL('listPublicIpAddresses'), + data: data, + dataType: "json", + async: true, + success: function(json) { + var items = json.listpublicipaddressesresponse.publicipaddress; + var processedItems = 0; + + if (!items) { + args.response.success({ + data: [] + }); + return; + } + + // Get network data + $(items).each(function() { + var item = this; + $.ajax({ + url: createURL('listNetworks'), + data: { + networkid: this.networkid + }, + dataType: 'json', + async: true, + success: function(data) { + // Get VPN data + $.ajax({ + url: createURL('listRemoteAccessVpns'), + data: { + publicipid: item.id + }, + dataType: 'json', + async: true, + success: function(vpnResponse) { + var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count; + if (isVPNEnabled) { + item.vpnenabled = true; + item.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0]; + }; + + // Check if data retrieval complete + item.network = data.listnetworksresponse.network[0]; + processedItems++; + + if (processedItems == items.length) { + args.response.success({ + actionFilter: actionFilters.ipAddress, + data: items + }); + } + } + }); + } + }); + }); + } + }); + }, + + // Detail view + detailView: { + name: 'IP address detail', + tabFilter: function(args) { + var disabledTabs = []; + var ipAddress = args.context.ipAddresses[0]; + + if (!ipAddress.issourcenat || + (ipAddress.issourcenat && !ipAddress.vpnenabled)) { + disabledTabs.push('vpn'); + } + + return disabledTabs; + }, + actions: { + enableVPN: { + label: 'Enable VPN', + action: function(args) { + $.ajax({ + url: createURL('createRemoteAccessVpn'), + data: { + publicipid: args.context.ipAddresses[0].id, + domainid: args.context.ipAddresses[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { jobId: data.createremoteaccessvpnresponse.jobid } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want VPN enabled for this IP address.'; + }, + notification: function(args) { + return 'Enabled VPN'; + }, + complete: function(args) { + return 'VPN is now enabled for IP ' + args.publicip + '.' + + '
    Your IPsec pre-shared key is:
    ' + args.presharedkey; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + disableVPN: { + label: 'Disable VPN', + action: function(args) { + $.ajax({ + url: createURL('deleteRemoteAccessVpn'), + data: { + publicipid: args.context.ipAddresses[0].id, + domainid: args.context.ipAddresses[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + getUpdatedItem: function(data) { + + }, + jobId: data.deleteremoteaccessvpnresponse.jobid + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable VPN?'; + }, + notification: function(args) { + return 'Disabled VPN'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + enableStaticNAT: { + label: 'Enable static NAT', + action: { + noAdd: true, + custom: cloudStack.uiCustom.enableStaticNAT({ + listView: cloudStack.sections.instances, + action: function(args) { + $.ajax({ + url: createURL('enableStaticNat'), + data: { + ipaddressid: args.context.ipAddresses[0].id, + virtualmachineid: args.context.instances[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success(); + } + }); + } + }) + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to enable static NAT?'; + }, + notification: function(args) { + return 'Enabled Static NAT'; + } + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + disableStaticNAT: { + label: 'Disable static NAT', + action: function(args) { + $.ajax({ + url: createURL('disableStaticNat'), + data: { + ipaddressid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.disablestaticnatresponse.jobid, + getActionFilter: function() { + return function(args) { + return ['enableStaticNAT']; + }; + } + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to disable static NAT?'; + }, + notification: function(args) { + return 'Disable Static NAT'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + destroy: { + label: 'Release IP', + action: function(args) { + $.ajax({ + url: createURL('disassociateIpAddress'), + data: { + id: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.disassociateipaddressresponse.jobid, + getActionFilter: function() { + return function(args) { + var allowedActions = ['enableStaticNAT']; + + return allowedActions; + }; + }, + getUpdatedItem: function(args) { + return { + state: 'Released' + }; + } + } + }); + } + }); + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to release this IP?'; + }, + notification: function(args) { + return 'Release IP'; + } + }, + notification: { poll: pollAsyncJobResult } + } + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + ipaddress: { label: 'IP' } + }, + { + state: { label: 'State' }, + zonename: { label: 'Zone' }, + vlanname: { label: 'VLAN' }, + issourcenat: { label: 'Source NAT' } + } + ], + + //dataProvider: testData.dataProvider.detailView('network') + dataProvider: function(args) { + $.ajax({ + url: createURL("listPublicIpAddresses&id="+args.id), + dataType: "json", + async: true, + success: function(json) { + var items = json.listpublicipaddressesresponse.publicipaddress; + if(items != null && items.length > 0) { + args.response.success({ + actionFilter: actionFilters.ipAddress, + data: items[0] + }); + } + } + }); + } + }, + ipRules: { + title: 'Configuration', + custom: cloudStack.ipRules({ + preFilter: function(args) { + if (args.context.ipAddresses[0].isstaticnat) { + return args.items; // All items filtered means static NAT + } + + return []; + }, + + // Firewall rules + firewall: { + noSelect: true, + fields: { + 'cidrlist': { edit: true, label: 'Source CIDR' }, + 'protocol': { + label: 'Protocol', + select: function(args) { + args.$select.change(function() { + var $inputs = args.$form.find('input'); + var $icmpFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return $.inArray(name, [ + 'icmptype', + 'icmpcode' + ]) > -1; + }); + var $otherFields = $inputs.filter(function() { + var name = $(this).attr('name'); + + return name != 'icmptype' && name != 'icmpcode' && name != 'cidrlist'; + }); + + if ($(this).val() == 'icmp') { + $icmpFields.attr('disabled', false); + $otherFields.attr('disabled', 'disabled'); + } else { + $otherFields.attr('disabled', false); + $icmpFields.attr('disabled', 'disabled'); + } + }); + + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' }, + { name: 'icmp', description: 'ICMP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'icmptype': { edit: true, label: 'ICMP Type', isDisabled: true }, + 'icmpcode': { edit: true, label: 'ICMP Code', isDisabled: true }, + 'add-rule': { + label: 'Add Rule', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + $.ajax({ + url: createURL('createFirewallRule'), + data: $.extend(args.data, { + ipaddressid: args.context.ipAddresses[0].id + }), + dataType: 'json', + success: function(data) { + args.response.success({ + _custom: { + jobId: data.createfirewallruleresponse.jobid + }, + notification: { + label: 'Add firewall rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + $.ajax({ + url: createURL('deleteFirewallRule'), + data: { + id: args.context.multiRule[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.deletefirewallruleresponse.jobid; + + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Remove firewall rule ' + args.context.multiRule[0].id, + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL('listFirewallRules'), + data: { + ipaddressid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: data.listfirewallrulesresponse.firewallrule + }); + } + }); + } + }, + + staticNAT: { + noSelect: true, + fields: { + 'protocol': { + label: 'Protocol', + select: function(args) { + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'add-rule': { + label: 'Add Rule', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + $.ajax({ + url: createURL('createIpForwardingRule'), + data: $.extend(args.data, { + ipaddressid: args.context.ipAddresses[0].id + }), + dataType: 'json', + success: function(data) { + args.response.success({ + _custom: { + jobId: data.createipforwardingruleresponse.jobid + }, + notification: { + label: 'Added static NAT rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + $.ajax({ + url: createURL('deleteIpForwardingRule'), + data: { + id: args.context.multiRule[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.deleteipforwardingruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Removed static NAT rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + dataProvider: function(args) { + setTimeout(function() { + $.ajax({ + url: createURL('listIpForwardingRules'), + data: { + ipaddressid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: data.listipforwardingrulesresponse.ipforwardingrule + }); + } + }); + }, 100); + } + }, + + // Load balancing rules + loadBalancing: { + listView: cloudStack.sections.instances, + multipleAdd: true, + fields: { + 'name': { edit: true, label: 'Name' }, + 'publicport': { edit: true, label: 'Public Port' }, + 'privateport': { edit: true, label: 'Private Port' }, + 'algorithm': { + label: 'Algorithm', + select: function(args) { + args.response.success({ + data: [ + { name: 'roundrobin', description: 'Round-robin' }, + { name: 'leastconn', description: 'Least connections' }, + { name: 'source', description: 'Source' } + ] + }); + } + }, + 'add-vm': { + label: 'Add VMs', + addButton: true + } + }, + add: { + label: 'Add VMs', + action: function(args) { + $.ajax({ + url: createURL(), + data: $.extend(args.data, { + command: 'createLoadBalancerRule', + publicipid: args.context.ipAddresses[0].id + }), + dataType: 'json', + async: true, + success: function(data) { + var itemData = args.itemData; + + $.ajax({ + url: createURL(), + data: { + command: 'assignToLoadBalancerRule', + id: data.createloadbalancerruleresponse.id, + virtualmachineids: $.map(itemData, function(elem) { + return elem.id; + }).join(',') + }, + dataType: 'json', + async: true, + success: function(data) { + + } + }); + + args.response.success({ + _custom: { + jobId: data.createloadbalancerruleresponse.jobid + }, + notification: { + label: 'Add load balancer rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove load balancer rule', + action: function(args) { + $.ajax({ + url: createURL(), + data: { + command: 'deleteLoadBalancerRule', + id: args.context.multiRule[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.deleteloadbalancerruleresponse.jobid; + + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Remove load balancer rule ' + args.context.multiRule[0].id, + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL(), + data: { + command: 'listLoadBalancerRules', + publicipid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var loadBalancerData = data.listloadbalancerrulesresponse.loadbalancerrule; + var loadVMTotal = loadBalancerData.length; + var loadVMCurrent = 0; + + $(loadBalancerData).each(function() { + var item = this; + + // Get instances + $.ajax({ + url: createURL(), + dataType: 'json', + async: true, + data: { + command: 'listLoadBalancerRuleInstances', + id: item.id + }, + success: function(data) { + loadVMCurrent++; + $.extend(item, { + _itemData: data + .listloadbalancerruleinstancesresponse.loadbalancerruleinstance + }); + + if (loadVMCurrent == loadVMTotal) { + args.response.success({ + data: loadBalancerData + }); + } + } + }); + }); + } + }); + } + }, + + // Port forwarding rules + portForwarding: { + listView: cloudStack.sections.instances, + fields: { + 'private-ports': { + edit: true, + label: 'Private Ports', + range: ['privateport', 'privateendport'] + }, + 'public-ports': { + edit: true, + label: 'Public Ports', + range: ['publicport', 'publicendport'] + }, + 'protocol': { + label: 'Protocol', + select: function(args) { + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' } + ] + }); + } + }, + 'add-vm': { + label: 'Add VM', + addButton: true + } + }, + add: { + label: 'Add VM', + action: function(args) { + $.ajax({ + url: createURL(), + data: $.extend(args.data, { + command: 'createPortForwardingRule', + ipaddressid: args.context.ipAddresses[0].id, + virtualmachineid: args.itemData[0].id + }), + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + _custom: { + jobId: data.createportforwardingruleresponse.jobid + }, + notification: { + label: 'Add port forwarding rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove port forwarding rule', + action: function(args) { + $.ajax({ + url: createURL(), + data: { + command: 'deletePortForwardingRule', + id: args.context.multiRule[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.deleteportforwardingruleresponse.jobid; + + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Remove port forwarding rule ' + args.context.multiRule[0].id, + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL(), + data: { + command: 'listPortForwardingRules', + ipaddressid: args.context.ipAddresses[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + // Get instance + var portForwardingData = data + .listportforwardingrulesresponse.portforwardingrule; + var loadTotal = portForwardingData.length; + var loadCurrent = 0; + + $(portForwardingData).each(function() { + var item = this; + + $.ajax({ + url: createURL(), + dataType: 'json', + async: true, + data: { + command: 'listVirtualMachines', + id: item.virtualmachineid + }, + success: function(data) { + loadCurrent++; + $.extend(item, { + _itemData: data.listvirtualmachinesresponse.virtualmachine, + _context: { + instances: data.listvirtualmachinesresponse.virtualmachine + } + }); + + if (loadCurrent == loadTotal) { + args.response.success({ + data: portForwardingData + }); + } + } + }); + }); + } + }); + } + } + }) + }, + vpn: { + title: 'VPN', + custom: function(args) { + var ipAddress = args.context.ipAddresses[0].ipaddress; + var psk = args.context.ipAddresses[0].remoteaccessvpn.presharedkey; + + return $('
    ') + .append( + $('
      ').addClass('info') + .append( + // VPN IP + $('
    • ').addClass('ip').html('Your VPN access is currently enabled and can be accessed via the IP: ') + .append($('').html(ipAddress)) + ) + .append( + // PSK + $('
    • ').addClass('psk').html('Your IPSec pre-shared key is: ') + .append($('').html(psk)) + ) + ).multiEdit({ + context: args.context, + noSelect: true, + fields: { + 'username': { edit: true, label: 'Username' }, + 'password': { edit: true, isPassword: true, label: 'Password' }, + 'add-user': { addButton: true, label: 'Add user' } + }, + add: { + label: 'Add user', + action: function(args) { + $.ajax({ + url: createURL('addVpnUser'), + data: args.data, + dataType: 'json', + success: function(data) { + args.response.success({ + _custom: { + jobId: data.addvpnuserresponse.jobid + }, + notification: { + label: 'Added VPN user', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove user', + action: function(args) { + $.ajax({ + url: createURL('removeVpnUser'), + data: { + username: args.context.multiRule[0].username, + id: args.context.multiRule[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.removevpnuserresponse.jobid; + + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Removed VPN user', + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL('listVpnUsers'), + data: { + domainid: args.context.ipAddresses[0].domainid + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: data.listvpnusersresponse.vpnuser + }); + } + }); + } + }); + } + } + } + } + } + }, + securityGroups: { + type: 'select', + title: 'Security Groups', + listView: { + id: 'securityGroups', + label: 'Security Groups', + fields: { + name: { label: 'Name', editable: true }, + description: { label: 'Description' }, + domain: { label: 'Domain' }, + account: { label: 'Account' } + }, + actions: { + add: { + label: 'Add security group', + + action: function(args) { + $.ajax({ + url: createURL('createSecurityGroup'), + data: { + name: args.data.name, + description: args.data.description + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: data.createsecuritygroupresponse.securitygroup + }); + } + }); + }, + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + notification: function(args) { + return 'Created security group'; + } + }, + + createForm: { + title: 'New security group', + desc: 'Please name your security group.', + fields: { + name: { label: 'Name' }, + description: { label: 'Description' } + } + } + }, + destroy: { + label: 'Delete security group', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete ' + args.name + '?'; + }, + notification: function(args) { + return 'Deleted security group: ' + args.name; + } + }, + action: function(args) { + $.ajax({ + url: createURL('deleteSecurityGroup'), + data: { + id: args.context.securityGroups[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + actionFilter: function() { return []; } + }); + } + }); + } + } + }, + + //dataProvider: testData.dataProvider.listView('securityGroups'), + dataProvider: function(args) { + $.ajax({ + url: createURL("listSecurityGroups&page="+args.page+"&pagesize="+pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listsecuritygroupsresponse.securitygroup; + args.response.success({data:items}); + } + }); + }, + + detailView: { + name: 'Security group details', + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + domain: { label: 'Domain' }, + account: { label: 'Account' } + } + ], + + //dataProvider: testData.dataProvider.detailView('securityGroups') + dataProvider: function(args) { + $.ajax({ + url: createURL("listSecurityGroups&id="+args.id), + dataType: "json", + async: true, + success: function(json) { + var items = json.listsecuritygroupsresponse.securitygroup; + if(items != null && items.length > 0) { + args.response.success({data:items[0]}); + } + } + }); + } + }, + ingressRules: { + title: 'Ingress Rules', + custom: cloudStack.uiCustom.securityRules({ + noSelect: true, + noHeaderActionsColumn: true, + fields: { + 'protocol': { + label: 'Protocol', + select: function(args) { + args.$select.change(function() { + var $inputs = args.$form.find('th, td'); + var $icmpFields = $inputs.filter(function() { + var name = $(this).attr('rel'); + + return $.inArray(name, [ + 'icmptype', + 'icmpcode' + ]) > -1; + }); + var $otherFields = $inputs.filter(function() { + var name = $(this).attr('rel'); + + return name != 'icmptype' && + name != 'icmpcode' && + name != 'protocol' && + name != 'add-rule' && + name != 'cidr' && + name != 'accountname' && + name != 'securitygroup'; + }); + + if ($(this).val() == 'icmp') { + $icmpFields.show(); + $otherFields.hide(); + } else { + $icmpFields.hide(); + $otherFields.show(); + } + }); + + args.response.success({ + data: [ + { name: 'tcp', description: 'TCP' }, + { name: 'udp', description: 'UDP' }, + { name: 'icmp', description: 'ICMP' } + ] + }); + } + }, + 'startport': { edit: true, label: 'Start Port' }, + 'endport': { edit: true, label: 'End Port' }, + 'icmptype': { edit: true, label: 'ICMP Type', isHidden: true }, + 'icmpcode': { edit: true, label: 'ICMP Code', isHidden: true }, + 'cidr': { edit: true, label: 'CIDR', isHidden: true }, + 'accountname': { + edit: true, + label: 'Account, Security Group', + isHidden: true, + range: ['accountname', 'securitygroup'] + }, + 'add-rule': { + label: 'Add', + addButton: true + } + }, + add: { + label: 'Add', + action: function(args) { + var data = { + securitygroupid: args.context.securityGroups[0].id, + protocol: args.data.protocol, + domainid: args.context.securityGroups[0].domainid, + account: args.context.securityGroups[0].account + }; + + // TCP / ICMP + if (args.data.icmptype && args.data.icmpcode) { // ICMP + $.extend(data, { + icmptype: args.data.icmptype, + icmpcode: args.data.icmpcode + }); + } else { // TCP + $.extend(data, { + startport: args.data.startport, + endport: args.data.endport + }); + } + + // CIDR / account + if (args.data.cidr) { + data.cidrlist = args.data.cidr; + } else { + data['usersecuritygrouplist[0].account'] = args.data.accountname; + data['usersecuritygrouplist[0].group'] = args.data.securitygroup; + } + + $.ajax({ + url: createURL('authorizeSecurityGroupIngress'), + data: data, + dataType: 'json', + async: true, + success: function(data) { + var jobId = data.authorizesecuritygroupingressresponse.jobid; + + args.response.success({ + _custom: { + jobId: jobId + }, + notification: { + label: 'Add new ingress rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + }, + actions: { + destroy: { + label: 'Remove Rule', + action: function(args) { + $.ajax({ + url: createURL('revokeSecurityGroupIngress'), + data: { + domainid: args.context.securityGroups[0].domainid, + account: args.context.securityGroups[0].account, + id: args.context.multiRule[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + var jobID = data.revokesecuritygroupingress.jobid; + + args.response.success({ + _custom: { + jobId: jobID + }, + notification: { + label: 'Revoke ingress rule', + poll: pollAsyncJobResult + } + }); + } + }); + } + } + }, + ignoreEmptyFields: true, + dataProvider: function(args) { + $.ajax({ + url: createURL('listSecurityGroups'), + data: { + id: args.context.securityGroups[0].id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success({ + data: $.map( + data.listsecuritygroupsresponse.securitygroup[0].ingressrule, + function(elem) { + return { + id: elem.ruleid, + protocol: elem.protocol, + startport: elem.startport ? elem.startport : elem.icmptype, + endport: elem.endport ? elem.endport : elem.icmpcode, + cidr: elem.cidr ? elem.cidr : ''.concat(elem.account, ' - ', elem.securitygroupname) + }; + } + ) + }); + } + }); + } + }) + } + } + } + } + } + } + }; +})(cloudStack, jQuery, testData); diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js new file mode 100644 index 00000000000..d5d07dfefaa --- /dev/null +++ b/ui/scripts/sharedFunctions.js @@ -0,0 +1,349 @@ +var g_mySession = null; +var g_sessionKey = null; +var g_role = null; // roles - root, domain-admin, ro-admin, user +var g_username = null; +var g_account = null; +var g_domainid = null; +var g_enableLogging = false; +var g_timezoneoffset = null; +var g_timezone = null; +var g_supportELB = null; +var g_firewallRuleUiEnabled = null; //true or false +var g_directAttachSecurityGroupsEnabled = "false"; +var g_userPublicTemplateEnabled = "true"; + +//keyboard keycode +var keycode_Enter = 13; + +//XMLHttpResponse.status +var ERROR_ACCESS_DENIED_DUE_TO_UNAUTHORIZED = 401; +var ERROR_INTERNET_NAME_NOT_RESOLVED = 12007; +var ERROR_INTERNET_CANNOT_CONNECT = 12029; +var ERROR_VMOPS_ACCOUNT_ERROR = 531; + +// Default password is MD5 hashed. Set the following variable to false to disable this. +var md5Hashed = true; + +//page size for API call (e.g."listXXXXXXX&pagesize=N" ) +var pageSize = 50; + +//async action +var pollAsyncJobResult = function(args) { + $.ajax({ + url: createURL("queryAsyncJobResult&jobId=" + args._custom.jobId), + dataType: "json", + async: false, + success: function(json) { + var result = json.queryasyncjobresultresponse; + if (result.jobstatus == 0) { + return; //Job has not completed + } else { + if (result.jobstatus == 1) { // Succeeded + //debugger; + if(args._custom.getUpdatedItem != null && args._custom.getActionFilter != null) { + args.complete({ + data: args._custom.getUpdatedItem(json), + actionFilter: args._custom.getActionFilter() + }); + } + else { + args.complete(); + } + } + else if (result.jobstatus == 2) { // Failed + args.error({message:result.jobresult.errortext}); + } + } + }, + error: function(XMLHttpResponse) { + args.error(); + } + }); +} + +//API calls +function createURL(apiName) { + return clientApiUrl + "?" + "command=" + apiName +"&response=json&sessionkey=" + g_sessionKey; +} + +function fromdb(val) { + return sanitizeXSS(noNull(val)); +} + +function todb(val) { + return encodeURIComponent(val); +} + +function noNull(val) { + if(val == null) + return ""; + else + return val; +} + +function sanitizeXSS(val) { // Prevent cross-site-script(XSS) attack + if(val == null || typeof(val) != "string") + return val; + val = val.replace(//g, ">"); //replace > whose unicode is \u003e + return unescape(val); +} + +// Role Functions +function isAdmin() { + return (g_role == 1); +} + +function isDomainAdmin() { + return (g_role == 2); +} + +function isUser() { + return (g_role == 0); +} + +// FUNCTION: Handles AJAX error callbacks. You can pass in an optional function to +// handle errors that are not already handled by this method. +function handleError(XMLHttpResponse, handleErrorCallback) { + // User Not authenticated + if (XMLHttpResponse.status == ERROR_ACCESS_DENIED_DUE_TO_UNAUTHORIZED) { + $("#dialog_session_expired").dialog("open"); + } + else if (XMLHttpResponse.status == ERROR_INTERNET_NAME_NOT_RESOLVED) { + $("#dialog_error_internet_not_resolved").dialog("open"); + } + else if (XMLHttpResponse.status == ERROR_INTERNET_CANNOT_CONNECT) { + $("#dialog_error_management_server_not_accessible").dialog("open"); + } + else if (XMLHttpResponse.status == ERROR_VMOPS_ACCOUNT_ERROR && handleErrorCallback != undefined) { + handleErrorCallback(); + } + else if (handleErrorCallback != undefined) { + handleErrorCallback(); + } + else { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + $("#dialog_error").text(fromdb(errorMsg)).dialog("open"); + } +} + +function parseXMLHttpResponse(XMLHttpResponse) { + if(isValidJsonString(XMLHttpResponse.responseText) == false) { + return ""; + } + + //var json = jQuery.parseJSON(XMLHttpResponse.responseText); + var json = JSON.parse(XMLHttpResponse.responseText); + if (json != null) { + var property; + for(property in json) {} + var errorObj = json[property]; + return fromdb(errorObj.errortext); + } else { + return ""; + } +} + +function isValidJsonString(str) { + try { + JSON.parse(str); + } + catch (e) { + return false; + } + return true; +} + +cloudStack.preFilter = { + createTemplate: function(args) { + if(isAdmin()) { + args.$form.find('.form-item[rel=isPublic]').css('display', 'inline-block'); + args.$form.find('.form-item[rel=isFeatured]').css('display', 'inline-block'); + } + else { + if (g_userPublicTemplateEnabled == "true") { + args.$form.find('.form-item[rel=isPublic]').css('display', 'inline-block'); + } + else { + args.$form.find('.form-item[rel=isPublic]').hide(); + } + args.$form.find('.form-item[rel=isFeatured]').hide(); + } + } +} + +cloudStack.converters = { + convertBytes: function(bytes) { + if (bytes < 1024 * 1024) { + return (bytes / 1024).toFixed(2) + " KB"; + } else if (bytes < 1024 * 1024 * 1024) { + return (bytes / 1024 / 1024).toFixed(2) + " MB"; + } else if (bytes < 1024 * 1024 * 1024 * 1024) { + return (bytes / 1024 / 1024 / 1024).toFixed(2) + " GB"; + } else { + return (bytes / 1024 / 1024 / 1024 / 1024).toFixed(2) + " TB"; + } + }, + toBooleanText: function(booleanValue) { + if(booleanValue == true) + return "Yes"; + else if(booleanValue == false) + return "No"; + }, + convertHz: function(hz) { + if (hz == null) + return ""; + + if (hz < 1000) { + return hz + " MHZ"; + } else { + return (hz / 1000).toFixed(2) + " GHZ"; + } + }, + toDayOfWeekDesp: function(dayOfWeek) { + if (dayOfWeek == "1") + return "Sunday"; + else if (dayOfWeek == "2") + return "Monday"; + else if (dayOfWeek == "3") + return "Tuesday"; + else if (dayOfWeek == "4") + return "Wednesday"; + else if (dayOfWeek == "5") + return "Thursday" + else if (dayOfWeek == "6") + return "Friday"; + else if (dayOfWeek == "7") + return "Saturday"; + }, + toDayOfWeekDesp: function(dayOfWeek) { + if (dayOfWeek == "1") + return "Sunday"; + else if (dayOfWeek == "2") + return "Monday"; + else if (dayOfWeek == "3") + return "Tuesday"; + else if (dayOfWeek == "4") + return "Wednesday"; + else if (dayOfWeek == "5") + return "Thursday" + else if (dayOfWeek == "6") + return "Friday"; + else if (dayOfWeek == "7") + return "Saturday"; + }, + toNetworkType: function(usevirtualnetwork) { + if(usevirtualnetwork == true || usevirtualnetwork == "true") + return "Public"; + else + return "Direct"; + }, + toRole: function(type) { + if (type == "0") { + return "User"; + } else if (type == "1") { + return "Admin"; + } else if (type == "2") { + return "Domain-Admin"; + } + }, + toAlertType: function(alertCode) { + switch (alertCode) { + case 0 : return "Capacity Threshold - Memory"; + case 1 : return "Capacity Threshold - CPU"; + case 2 : return "Capacity Threshold - Storage Used"; + case 3 : return "Capacity Threshold - Storage Allocated"; + case 4 : return "Capacity Threshold - Public IP"; + case 5 : return "Capacity Threshold - Private IP"; + case 6 : return "Monitoring - Host"; + case 7 : return "Monitoring - VM"; + case 8 : return "Monitoring - Domain Router"; + case 9 : return "Monitoring - Console Proxy"; + case 10 : return "Monitoring - Routing Host"; + case 11 : return "Monitoring - Storage"; + case 12 : return "Monitoring - Usage Server"; + case 13 : return "Monitoring - Management Server"; + case 14 : return "Migration - Domain Router"; + case 15 : return "Migration - Console Proxy"; + case 16 : return "Migration - User VM"; + case 17 : return "VLAN"; + case 18 : return "Monitoring - Secondary Storage VM"; + } + } +} + +//VM Instance +function getVmName(p_vmName, p_vmDisplayname) { + if(p_vmDisplayname == null) + return fromdb(p_vmName); + + var vmName = null; + if (p_vmDisplayname != p_vmName) { + vmName = fromdb(p_vmName) + " (" + fromdb(p_vmDisplayname) + ")"; + } else { + vmName = fromdb(p_vmName); + } + return vmName; +} + +// Timezones +var timezones = new Object(); +timezones['Etc/GMT+12']='[UTC-12:00] GMT-12:00'; +timezones['Etc/GMT+11']='[UTC-11:00] GMT-11:00'; +timezones['Pacific/Samoa']='[UTC-11:00] Samoa Standard Time'; +timezones['Pacific/Honolulu']='[UTC-10:00] Hawaii Standard Time'; +timezones['US/Alaska']='[UTC-09:00] Alaska Standard Time'; +timezones['America/Los_Angeles']='[UTC-08:00] Pacific Standard Time'; +timezones['Mexico/BajaNorte']='[UTC-08:00] Baja California'; +timezones['US/Arizona']='[UTC-07:00] Arizona'; +timezones['US/Mountain']='[UTC-07:00] Mountain Standard Time'; +timezones['America/Chihuahua']='[UTC-07:00] Chihuahua, La Paz'; +timezones['America/Chicago']='[UTC-06:00] Central Standard Time'; +timezones['America/Costa_Rica']='[UTC-06:00] Central America'; +timezones['America/Mexico_City']='[UTC-06:00] Mexico City, Monterrey'; +timezones['Canada/Saskatchewan']='[UTC-06:00] Saskatchewan'; +timezones['America/Bogota']='[UTC-05:00] Bogota, Lima'; +timezones['America/New_York']='[UTC-05:00] Eastern Standard Time'; +timezones['America/Caracas']='[UTC-04:00] Venezuela Time'; +timezones['America/Asuncion']='[UTC-04:00] Paraguay Time'; +timezones['America/Cuiaba']='[UTC-04:00] Amazon Time'; +timezones['America/Halifax']='[UTC-04:00] Atlantic Standard Time'; +timezones['America/La_Paz']='[UTC-04:00] Bolivia Time'; +timezones['America/Santiago']='[UTC-04:00] Chile Time'; +timezones['America/St_Johns']='[UTC-03:30] Newfoundland Standard Time'; +timezones['America/Araguaina']='[UTC-03:00] Brasilia Time'; +timezones['America/Argentina/Buenos_Aires']='[UTC-03:00] Argentine Time'; +timezones['America/Cayenne']='[UTC-03:00] French Guiana Time'; +timezones['America/Godthab']='[UTC-03:00] Greenland Time'; +timezones['America/Montevideo']='[UTC-03:00] Uruguay Time]'; +timezones['Etc/GMT+2']='[UTC-02:00] GMT-02:00'; +timezones['Atlantic/Azores']='[UTC-01:00] Azores Time'; +timezones['Atlantic/Cape_Verde']='[UTC-01:00] Cape Verde Time'; +timezones['Africa/Casablanca']='[UTC] Casablanca'; +timezones['Etc/UTC']='[UTC] Coordinated Universal Time'; +timezones['Atlantic/Reykjavik']='[UTC] Reykjavik'; +timezones['Europe/London']='[UTC] Western European Time'; +timezones['CET']='[UTC+01:00] Central European Time'; +timezones['Europe/Bucharest']='[UTC+02:00] Eastern European Time'; +timezones['Africa/Johannesburg']='[UTC+02:00] South Africa Standard Time'; +timezones['Asia/Beirut']='[UTC+02:00] Beirut'; +timezones['Africa/Cairo']='[UTC+02:00] Cairo'; +timezones['Asia/Jerusalem']='[UTC+02:00] Israel Standard Time'; +timezones['Europe/Minsk']='[UTC+02:00] Minsk'; +timezones['Europe/Moscow']='[UTC+03:00] Moscow Standard Time'; +timezones['Africa/Nairobi']='[UTC+03:00] Eastern African Time'; +timezones['Asia/Karachi']='[UTC+05:00] Pakistan Time'; +timezones['Asia/Kolkata']='[UTC+05:30] India Standard Time'; +timezones['Asia/Bangkok']='[UTC+05:30] Indochina Time'; +timezones['Asia/Shanghai']='[UTC+08:00] China Standard Time'; +timezones['Asia/Kuala_Lumpur']='[UTC+08:00] Malaysia Time'; +timezones['Australia/Perth']='[UTC+08:00] Western Standard Time (Australia)'; +timezones['Asia/Taipei']='[UTC+08:00] Taiwan'; +timezones['Asia/Tokyo']='[UTC+09:00] Japan Standard Time'; +timezones['Asia/Seoul']='[UTC+09:00] Korea Standard Time'; +timezones['Australia/Adelaide']='[UTC+09:30] Central Standard Time (South Australia)'; +timezones['Australia/Darwin']='[UTC+09:30] Central Standard Time (Northern Territory)'; +timezones['Australia/Brisbane']='[UTC+10:00] Eastern Standard Time (Queensland)'; +timezones['Australia/Canberra']='[UTC+10:00] Eastern Standard Time (New South Wales)'; +timezones['Pacific/Guam']='[UTC+10:00] Chamorro Standard Time'; +timezones['Pacific/Auckland']='[UTC+12:00] New Zealand Standard Time'; diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js new file mode 100644 index 00000000000..3739599eb16 --- /dev/null +++ b/ui/scripts/storage.js @@ -0,0 +1,1674 @@ +(function(cloudStack, testData) { + + var diskofferingObjs, selectedDiskOfferingObj; + + cloudStack.sections.storage = { + title: 'Storage', + id: 'storage', + sectionSelect: { + label: 'Select view' + }, + sections: { + /** + * Volumes + */ + volumes: { + type: 'select', + title: 'Volumes', + listView: { + id: 'volumes', + label: 'Volumes', + fields: { + name: { label: 'Name', editable: true }, + type: { label: 'Type' }, + zonename: { label: 'Zone' }, + deviceid: { label: 'Device ID' }, + size: { label: 'Size' } + }, + + // List view actions + actions: { + // Add volume + add: { + label: 'Add volume', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add ' + args.name + '?'; + }, + success: function(args) { + return 'Your new volume is being created.'; + }, + notification: function(args) { + return 'Creating new volume'; + }, + complete: function(args) { + return 'Volume has been created successfully!'; + } + }, + + createForm: { + title: 'Add volume', + desc: 'Please fill in the following data to add a new volume.', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + availabilityZone: { + label: 'Availability Zone', + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var items = json.listzonesresponse.zone; + args.response.success({descriptionField: 'name', data: items}); + } + }); + } + }, + diskOffering: { + label: 'Disk Offering', + select: function(args) { + $.ajax({ + url: createURL("listDiskOfferings"), + dataType: "json", + async: false, + success: function(json) { + diskofferingObjs = json.listdiskofferingsresponse.diskoffering; + var items = []; + $(diskofferingObjs).each(function(){ + items.push({id: this.id, description: this.displaytext}); + }); + args.response.success({data: items}); + } + }); + + args.$select.change(function() { + var diskOfferingId = $(this).val(); + $(diskofferingObjs).each(function(){ + if(this.id == diskOfferingId) { + selectedDiskOfferingObj = this; + return false; //break the $.each() loop + } + }); + if(selectedDiskOfferingObj == null) + return; + + var $form = $(this).closest('form'); + var $diskSize = $form.find('.form-item[rel=diskSize]'); + if (selectedDiskOfferingObj.iscustomized == true) { + $diskSize.css('display', 'inline-block'); + } + else { + $diskSize.hide(); + } + }); + } + } + + , + diskSize: { + label: 'Disk size (in GB)', + validation: { required: true, number: true }, + isHidden: true + } + + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + args.data.name); + array1.push("&zoneId=" + args.data.availabilityZone); + array1.push("&diskOfferingId=" + args.data.diskOffering); + + // if(thisDialog.find("#size_container").css("display") != "none") { //wait for Brian to include $form in args + if (selectedDiskOfferingObj.iscustomized == true) { + array1.push("&size=" + args.data.diskSize); + } + + $.ajax({ + url: createURL("createVolume" + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + + notification: { + poll: pollAsyncJobResult + } + }, + + takeSnapshot: { + label: 'Take snapshot', + messages: { + confirm: function(args) { + return 'Please confirm that you want to take a snapshot of ' + args.name; + }, + success: function(args) { + return 'Your new snapshot ' + args.name + ' is being created.'; + }, + notification: function(args) { + return 'Made snapshot of volume: ' + args.name; + }, + complete: function(args) { + return 'Snapshot ' + args.name + ' is ready.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("createSnapshot&volumeid=" + args.context.volumes[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createsnapshotresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //no properties in this volume needs to be updated + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + recurringSnapshot: { + label: 'Setup recurring snapshots', + action: { + custom: cloudStack.uiCustom.recurringSnapshots({ + desc: 'You can setup recurring snapshot schedules by selecting from the available options below and applying your policy preference.', + dataProvider: function(args) { + $.ajax({ + url: createURL('listSnapshotPolicies'), + data: { + volumeid: args.context.volumes[0].id + }, + async: true, + dataType: 'json', + success: function(data) { + args.response.success({ + data: $.map( + data.listsnapshotpoliciesresponse.snapshotpolicy, + function(snapshot, index) { + return { + id: snapshot.id, + type: snapshot.intervaltype, + time: snapshot.intervaltype > 0 ? + snapshot.schedule.split(':')[1] + ':' + snapshot.schedule.split(':')[0] : + snapshot.schedule, + timezone: snapshot.timezone, + keep: snapshot.maxsnaps, + 'day-of-week': snapshot.intervaltype == 2 ? + snapshot.schedule.split(':')[2] : null, + 'day-of-month': snapshot.intervaltype == 3 ? + snapshot.schedule.split(':')[2] : null + }; + } + ) + }); + } + }); + }, + actions: { + add: function(args) { + var snap = args.snapshot; + + var data = { + keep: snap.maxsnaps, + timezone: snap.timezone + }; + + var convertTime = function(minute, hour, meridiem, extra) { + var convertedHour = meridiem == 'PM' ? + (hour != 12 ? parseInt(hour) + 12 : 12) : (hour != 12 ? hour : '00'); + var time = minute + ':' + convertedHour; + if (extra) time += ':' + extra; + + return time; + }; + + switch (snap['snapshot-type']) { + case 'hourly': // Hourly + $.extend(data, { + schedule: snap.schedule + }); break; + + case 'daily': // Daily + $.extend(data, { + schedule: convertTime( + snap['time-minute'], + snap['time-hour'], + snap['time-meridiem'] + ) + }); break; + + case 'weekly': // Weekly + $.extend(data, { + schedule: convertTime( + snap['time-minute'], + snap['time-hour'], + snap['time-meridiem'], + snap['day-of-week'] + ) + }); break; + + case 'monthly': // Monthly + $.extend(data, { + schedule: convertTime( + snap['time-minute'], + snap['time-hour'], + snap['time-meridiem'], + snap['day-of-month'] + ) + }); break; + } + + $.ajax({ + url: createURL('createSnapshotPolicy'), + data: { + volumeid: args.context.volumes[0].id, + intervaltype: snap['snapshot-type'], + maxsnaps: snap.maxsnaps, + schedule: data.schedule, + timezone: snap.timezone + }, + dataType: 'json', + async: true, + success: function(successData) { + var snapshot = successData.createsnapshotpolicyresponse.snapshotpolicy; + + args.response.success({ + data: { + id: snapshot.id, + type: snapshot.intervaltype, + time: snapshot.intervaltype > 0 ? + snapshot.schedule.split(':')[1] + ':' + snapshot.schedule.split(':')[0] : + snapshot.schedule, + timezone: snapshot.timezone, + keep: snapshot.maxsnaps, + 'day-of-week': snapshot.intervaltype == 2 ? + snapshot.schedule.split(':')[2] : null, + 'day-of-month': snapshot.intervaltype == 3 ? + snapshot.schedule.split(':')[2] : null + } + }); + } + }); + }, + remove: function(args) { + $.ajax({ + url: createURL('deleteSnapshotPolicies'), + data: { + id: args.snapshot.id + }, + dataType: 'json', + async: true, + success: function(data) { + args.response.success(); + } + }); + } + }, + + // Select data + selects: { + schedule: function(args) { + var time = []; + + for (var i = 1; i <= 59; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + timezone: function(args) { + args.response.success({ + data: $.map(timezones, function(value, key) { + return { + id: key, + name: value + }; + }) + }); + }, + 'day-of-week': function(args) { + args.response.success({ + data: [ + { id: 1, name: 'Sunday' }, + { id: 2, name: 'Monday' }, + { id: 3, name: 'Tuesday' }, + { id: 4, name: 'Wednesday' }, + { id: 5, name: 'Thursday' }, + { id: 6, name: 'Friday' }, + { id: 7, name: 'Saturday' } + ] + }); + }, + + 'day-of-month': function(args) { + var time = []; + + for (var i = 1; i <= 31; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-hour': function(args) { + var time = []; + + for (var i = 1; i <= 12; i++) { + time.push({ + id: i, + name: i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-minute': function(args) { + var time = []; + + for (var i = 0; i <= 59; i++) { + time.push({ + id: i < 10 ? '0' + i : i, + name: i < 10 ? '0' + i : i + }); + } + + args.response.success({ + data: time + }); + }, + + 'time-meridiem': function(args) { + args.response.success({ + data: [ + { id: 'AM', name: 'AM' }, + { id: 'PM', name: 'PM' } + ] + }); + } + } + }) + }, + messages: { + notification: function(args) { + return 'Setup recurring snapshot'; + } + }, + notification: { + poll: testData.notifications.testPoll + } + }, + + attachDisk: { + label: 'Attach Disk', + messages: { + confirm: function(args) { + return 'Are you sure you want to attach disk?'; + }, + success: function(args) { + return 'Disk is being attached to instance'; + }, + notification: function(args) { + return 'Attaching disk to instance'; + }, + complete: function(args) { + return 'Disk has been attached to instance'; + } + }, + createForm: { + title: 'Attach Disk', + desc: 'Attach Disk to Instance', + fields: { + virtualMachineId: { + label: 'Instance', + select: function(args) { + var items = []; + $.ajax({ + url: createURL("listVirtualMachines&state=Running&zoneid=" + args.context.volumes[0].zoneid + "&domainid=" + args.context.volumes[0].domainid + "&account=" + args.context.volumes[0].account), + dataType: "json", + async: false, + success: function(json) { + var instanceObjs= json.listvirtualmachinesresponse.virtualmachine; + $(instanceObjs).each(function() { + items.push({id: this.id, description: this.displayname}); + }); + } + }); + $.ajax({ + url: createURL("listVirtualMachines&state=Stopped&zoneid=" + args.context.volumes[0].zoneid + "&domainid=" + args.context.volumes[0].domainid + "&account=" + args.context.volumes[0].account), + dataType: "json", + async: false, + success: function(json) { + var instanceObjs= json.listvirtualmachinesresponse.virtualmachine; + $(instanceObjs).each(function() { + items.push({id: this.id, description: this.displayname}); + }); + } + }); + args.response.success({data: items}); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("attachVolume&id=" + args.context.volumes[0].id + '&virtualMachineId=' + args.data.virtualMachineId), + dataType: "json", + async: true, + success: function(json) { + var jid = json.attachvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + + , + detachDisk: { + label: 'Detach disk', + messages: { + confirm: function(args) { + return 'Are you sure you want to detach disk ?'; + }, + success: function(args) { + return 'Disk is being detached.'; + }, + notification: function(args) { + return 'Detaching disk'; + }, + complete: function(args) { + return 'Disk has been detached.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("detachVolume&id=" + args.context.volumes[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.detachvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + downloadVolume: { + label: 'Download volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to download volume ?'; + }, + success: function(args) { + return 'Volume is being downloaded.'; + }, + notification: function(args) { + return 'Downloading volume'; + }, + complete: function(args) { + var url = decodeURIComponent(args.url); + var htmlMsg = 'Please click 00000 to download volume'; + var htmlMsg2 = htmlMsg.replace(/#/, url).replace(/00000/, url); + //$infoContainer.find("#info").html(htmlMsg2); + return htmlMsg2; + } + }, + action: function(args) { + $.ajax({ + url: createURL("extractVolume&id=" + args.context.volumes[0].id + "&zoneid=" + args.context.volumes[0].zoneid + "&mode=HTTP_DOWNLOAD"), + dataType: "json", + async: true, + success: function(json) { + var jid = json.extractvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } , + + createTemplate: { + label: 'Create template', + messages: { + confirm: function(args) { + /* + if (getUserPublicTemplateEnabled() == "true" || isAdmin()) { + $dialogCreateTemplate.find("#create_template_public_container").show(); + } + */ + return 'Are you sure you want to create template?'; + }, + success: function(args) { + return 'Template is being created.'; + }, + notification: function(args) { + return 'Creating template'; + }, + complete: function(args) { + return 'Template has been created.'; + } + }, + createForm: { + title: 'Create Template', + desc: '', + preFilter: cloudStack.preFilter.createTemplate, + fields: { + name: { label: 'Name', validation: { required: true }}, + displayText: { label: 'Description', validation: { required: true }}, + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + isPublic: { label: 'Public', isBoolean: true }, + isPasswordEnabled: { label: 'Password enabled', isBoolean: true } + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_template_name"), $thisDialog.find("#create_template_name_errormsg")); + isValid &= validateString("Display Text", $thisDialog.find("#create_template_desc"), $thisDialog.find("#create_template_desc_errormsg")); + if (!isValid) + return; + $thisDialog.dialog("close"); + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displayText)); + array1.push("&osTypeId=" + args.data.osTypeId); + array1.push("&isPublic=" + (args.data.isPublic=="on")); + array1.push("&passwordEnabled=" + (args.data.isPasswordEnabled=="on")); + + $.ajax({ + url: createURL("createTemplate&volumeId=" + args.context.volumes[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createtemplateresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //no properties in this volume needs to be updated + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete volume ?'; + }, + success: function(args) { + return 'Volume is being deleted.'; + }, + notification: function(args) { + return 'Deleting volume'; + }, + complete: function(args) { + return 'Volume has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteVolume&id=" + args.context.volumes[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletevolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid + } + } + ); + } + }); + }, + notification: { + poll: function(args) {args.complete();} + } + } + + }, + + dataProvider: function(args) { + var apiCmd = "listVolumes&page=" + args.page + "&pagesize=" + pageSize; + if(args.context != null) { + if("instances" in args.context) { + apiCmd += "&virtualMachineId=" + args.context.instances[0].id; + } + } + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + async: true, + success: function(json) { + var items = json.listvolumesresponse.volume; + args.response.success({ + actionFilter: volumeActionfilter, + data: items + }); + } + }); + }, + + detailView: { + name: 'Volume details', + viewAll: { path: 'storage.snapshots', label: 'Snapshots' }, + actions: { + takeSnapshot: { + label: 'Take snapshot', + messages: { + confirm: function(args) { + return 'Please confirm that you want to take a snapshot of ' + args.name; + }, + success: function(args) { + return 'Your new snapshot ' + args.name + ' is being created.'; + }, + notification: function(args) { + return 'Made snapshot of volume: ' + args.name; + }, + complete: function(args) { + return 'Snapshot ' + args.name + ' is ready.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("createSnapshot&volumeid=" + args.data.id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createsnapshotresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.snapshot; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + attachDisk: { + label: 'Attach Disk', + messages: { + confirm: function(args) { + return 'Are you sure you want to attach disk?'; + }, + success: function(args) { + return 'Disk is being attached to instance'; + }, + notification: function(args) { + return 'Attaching disk to instance'; + }, + complete: function(args) { + return 'Disk has been attached to instance'; + } + }, + createForm: { + title: 'Attach Disk', + desc: 'Attach Disk to Instance', + fields: { + virtualMachineId: { + label: 'Instance', + select: function(args) { + var items = []; + $.ajax({ + url: createURL("listVirtualMachines&state=Running&zoneid=" + args.context.volumes[0].zoneid + "&domainid=" + args.context.volumes[0].domainid + "&account=" + args.context.volumes[0].account), + dataType: "json", + async: false, + success: function(json) { + var instanceObjs= json.listvirtualmachinesresponse.virtualmachine; + $(instanceObjs).each(function() { + items.push({id: this.id, description: this.displayname}); + }); + } + }); + $.ajax({ + url: createURL("listVirtualMachines&state=Stopped&zoneid=" + args.context.volumes[0].zoneid + "&domainid=" + args.context.volumes[0].domainid + "&account=" + args.context.volumes[0].account), + dataType: "json", + async: false, + success: function(json) { + var instanceObjs= json.listvirtualmachinesresponse.virtualmachine; + $(instanceObjs).each(function() { + items.push({id: this.id, description: this.displayname}); + }); + } + }); + args.response.success({data: items}); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("attachVolume&id=" + args.context.volumes[0].id + '&virtualMachineId=' + args.data.virtualMachineId), + dataType: "json", + async: true, + success: function(json) { + var jid = json.attachvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + + , + detachDisk: { + label: 'Detach disk', + messages: { + confirm: function(args) { + return 'Are you sure you want to detach disk ?'; + }, + success: function(args) { + return 'Disk is being detached.'; + }, + notification: function(args) { + return 'Detaching disk'; + }, + complete: function(args) { + return 'Disk has been detached.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("detachVolume&id=" + args.context.volumes[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.detachvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + downloadVolume: { + label: 'Download volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to download volume ?'; + }, + success: function(args) { + return 'Volume is being downloaded.'; + }, + notification: function(args) { + return 'Downloading volume'; + }, + complete: function(args) { + var url = decodeURIComponent(args.url); + var htmlMsg = 'Please click 00000 to download volume'; + var htmlMsg2 = htmlMsg.replace(/#/, url).replace(/00000/, url); + //$infoContainer.find("#info").html(htmlMsg2); + return htmlMsg2; + } + }, + action: function(args) { + $.ajax({ + url: createURL("extractVolume&id=" + args.context.volumes[0].id + "&zoneid=" + args.context.volumes[0].zoneid + "&mode=HTTP_DOWNLOAD"), + dataType: "json", + async: true, + success: function(json) { + var jid = json.extractvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.volume; + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } , + + createTemplate: { + label: 'Create template', + messages: { + confirm: function(args) { + return 'Are you sure you want to create template?'; + }, + success: function(args) { + return 'Template is being created.'; + }, + notification: function(args) { + return 'Creating template'; + }, + complete: function(args) { + return 'Template has been created.'; + } + }, + createForm: { + title: 'Create Template', + desc: '', + fields: { + name: { label: 'Name', validation: { required: true }}, + displayText: { label: 'Description', validation: { required: true }}, + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + isPublic: { label: 'Public', isBoolean: true }, + isPasswordEnabled: { label: 'Password enabled', isBoolean: true } + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_template_name"), $thisDialog.find("#create_template_name_errormsg")); + isValid &= validateString("Display Text", $thisDialog.find("#create_template_desc"), $thisDialog.find("#create_template_desc_errormsg")); + if (!isValid) + return; + $thisDialog.dialog("close"); + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displayText)); + array1.push("&osTypeId=" + args.data.osTypeId); + array1.push("&isPublic=" + (args.data.isPublic=="on")); + array1.push("&passwordEnabled=" + (args.data.isPasswordEnabled=="on")); + + $.ajax({ + url: createURL("createTemplate&volumeId=" + args.context.volumes[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createtemplateresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //no properties in this volume needs to be updated + }, + getActionFilter: function() { + return volumeActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete volume ?'; + }, + success: function(args) { + return 'Volume is being deleted.'; + }, + notification: function(args) { + return 'Deleting volume'; + }, + complete: function(args) { + return 'Volume has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteVolume&id=" + args.context.volumes[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletevolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid + } + } + ); + } + }); + }, + notification: { + poll: function(args) {args.complete();} + } + } + + }, + tabs: { + details: { + title: 'Details', + + preFilter: function(args) { + var hiddenFields; + if(isAdmin()) { + hiddenFields = []; + } + else { + hiddenFields = ["storage"]; + } + return hiddenFields; + }, + + fields: [ + { + name: { label: 'Name', isEditable: true } + }, + { + id: { label: 'ID' }, + zonename: { label: 'Zone' }, + deviceid: { label: 'Device ID' }, + state: { label: 'State' }, + type: { label: 'Type' }, + storagetype: { label: 'Storage Type' }, + storage: { label: 'Storage' }, + size : { + label: 'Size ', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + virtualmachineid: { + label: 'VM ID', + converter: function(args) { + if (args == null) + return "detached"; + else + return args; + } + }, + vmname: { label: 'VM Name' }, + vmdisplayname: { label: 'VM Display Name' }, + created: { label: 'Created' }, + domain: { label: 'Domain' }, + account: { label: 'Account' } + } + ], + + dataProvider: function(args) { + args.response.success( + { + actionFilter: volumeActionfilter, + data: args.context.volumes[0] + } + ); + } + + } + } + } + } + }, + + /** + * Snapshots + */ + snapshots: { + type: 'select', + title: 'Snapshots', + listView: { + id: 'snapshots', + label: 'Snapshots', + fields: { + volumename: { label: 'Volume' }, + state: { label: 'State' }, + intervaltype: { label: 'Interval Type' }, + created: { label: 'Date' } + }, + + actions: { + createTemplate: { + label: 'Create template', + messages: { + confirm: function(args) { + return 'Are you sure you want to create template?'; + }, + success: function(args) { + return 'Template is being created.'; + }, + notification: function(args) { + return 'Creating template'; + }, + complete: function(args) { + return 'Template has been created.'; + } + }, + createForm: { + title: 'Create Template', + desc: '', + fields: { + name: { label: 'Name', validation: { required: true }}, + displayText: { label: 'Description', validation: { required: true }}, + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + isPublic: { label: 'Public', isBoolean: true }, + isPasswordEnabled: { label: 'Password enabled', isBoolean: true } + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_template_name"), $thisDialog.find("#create_template_name_errormsg")); + isValid &= validateString("Display Text", $thisDialog.find("#create_template_desc"), $thisDialog.find("#create_template_desc_errormsg")); + if (!isValid) + return; + $thisDialog.dialog("close"); + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displayText)); + array1.push("&osTypeId=" + args.data.osTypeId); + array1.push("&isPublic=" + (args.data.isPublic=="on")); + array1.push("&passwordEnabled=" + (args.data.isPasswordEnabled=="on")); + + $.ajax({ + url: createURL("createTemplate&snapshotid=" + args.context.snapshots[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createtemplateresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this snapshot needs to be updated + }, + getActionFilter: function() { + return snapshotActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + createVolume: { + label: 'Create volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to create volume?'; + }, + success: function(args) { + return 'Volume is being created.'; + }, + notification: function(args) { + return 'Creating volume'; + }, + complete: function(args) { + return 'Volume has been created.'; + } + }, + createForm: { + title: 'Create volume', + desc: '', + fields: { + name: { label: 'Name', validation: { required: true }} + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_volume_name"), $thisDialog.find("#create_volume_name_errormsg")); + if (!isValid) + return; + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + + $.ajax({ + url: createURL("createVolume&snapshotid=" + args.context.snapshots[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this snapshot needs to be updated + }, + getActionFilter: function() { + return snapshotActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete snapshot', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete snapshot ?'; + }, + success: function(args) { + return 'Snapshot is being deleted.'; + }, + notification: function(args) { + return 'Deleting snapshot'; + }, + complete: function(args) { + return 'Snapshot has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteSnapshot&id=" + args.context.snapshots[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletesnapshotresponse.jobid; + args.response.success( + {_custom: + {jobId: jid + } + } + ); + } + }); + }, + notification: { + poll: function(args) {args.complete();} + } + } + }, + + dataProvider: function(args) { + var apiCmd = "listSnapshots&page=" + args.page + "&pagesize=" + pageSize; + if(args.context != null) { + if("volumes" in args.context) { + apiCmd += "&volumeid=" + args.context.volumes[0].id; + } + } + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + async: true, + success: function(json) { + var items = json.listsnapshotsresponse.snapshot; + args.response.success({ + actionFilter: snapshotActionfilter, + data: items + }); + } + }); + }, + + detailView: { + name: 'Snapshot detail', + actions: { + createTemplate: { + label: 'Create template', + messages: { + confirm: function(args) { + return 'Are you sure you want to create template?'; + }, + success: function(args) { + return 'Template is being created.'; + }, + notification: function(args) { + return 'Creating template'; + }, + complete: function(args) { + return 'Template has been created.'; + } + }, + createForm: { + title: 'Create Template', + desc: '', + fields: { + name: { label: 'Name', validation: { required: true }}, + displayText: { label: 'Description', validation: { required: true }}, + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({id: this.id, description: this.description}); + }); + args.response.success({data: items}); + } + }); + } + }, + isPublic: { label: 'Public', isBoolean: true }, + isPasswordEnabled: { label: 'Password enabled', isBoolean: true } + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_template_name"), $thisDialog.find("#create_template_name_errormsg")); + isValid &= validateString("Display Text", $thisDialog.find("#create_template_desc"), $thisDialog.find("#create_template_desc_errormsg")); + if (!isValid) + return; + $thisDialog.dialog("close"); + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displayText)); + array1.push("&osTypeId=" + args.data.osTypeId); + array1.push("&isPublic=" + (args.data.isPublic=="on")); + array1.push("&passwordEnabled=" + (args.data.isPasswordEnabled=="on")); + + $.ajax({ + url: createURL("createTemplate&snapshotid=" + args.context.snapshots[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createtemplateresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this snapshot needs to be updated + }, + getActionFilter: function() { + return snapshotActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + createVolume: { + label: 'Create volume', + messages: { + confirm: function(args) { + return 'Are you sure you want to create volume?'; + }, + success: function(args) { + return 'Volume is being created.'; + }, + notification: function(args) { + return 'Creating volume'; + }, + complete: function(args) { + return 'Volume has been created.'; + } + }, + createForm: { + title: 'Create volume', + desc: '', + fields: { + name: { label: 'Name', validation: { required: true }} + } + }, + action: function(args) { + /* + var isValid = true; + isValid &= validateString("Name", $thisDialog.find("#create_volume_name"), $thisDialog.find("#create_volume_name_errormsg")); + if (!isValid) + return; + */ + + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + + $.ajax({ + url: createURL("createVolume&snapshotid=" + args.context.snapshots[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.createvolumeresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this snapshot needs to be updated + }, + getActionFilter: function() { + return snapshotActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete snapshot', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete snapshot ?'; + }, + success: function(args) { + return 'Snapshot is being deleted.'; + }, + notification: function(args) { + return 'Deleting snapshot'; + }, + complete: function(args) { + return 'Snapshot has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteSnapshot&id=" + args.context.snapshots[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletesnapshotresponse.jobid; + args.response.success( + {_custom: + {jobId: jid + } + } + ); + } + }); + }, + notification: { + poll: function(args) {args.complete();} + } + } + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' } + }, + { + id: { label: 'ID' }, + name: { label: 'Name' }, + volumename: { label: 'Volume Name' }, + state: { label: 'State' }, + intervaltype: { label: 'Interval Type' }, + domain: { label: 'Domain' }, + account: { label: 'Account' }, + created: { label: 'Created' } + } + ], + + dataProvider: function(args) { + args.response.success( + { + actionFilter: snapshotActionfilter, + data: args.context.snapshots[0] + } + ); + } + } + } + } + } + } + } + }; + + + var volumeActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + if(jsonObj.hypervisor != "Ovm") { + allowedActions.push("takeSnapshot"); + allowedActions.push("recurringSnapshot"); + } + if(jsonObj.state != "Allocated") { + if(jsonObj.hypervisor != "Ovm") { + allowedActions.push("downloadVolume"); + } + } + if(jsonObj.state != "Creating" && jsonObj.state != "Corrupted" && jsonObj.name != "attaching") { + if(jsonObj.type == "ROOT") { + if (jsonObj.vmstate == "Stopped") { + allowedActions.push("createTemplate"); + } + } + else { + if (jsonObj.virtualmachineid != null) { + if (jsonObj.storagetype == "shared" && (jsonObj.vmstate == "Running" || jsonObj.vmstate == "Stopped" || jsonObj.vmstate == "Destroyed")) { + allowedActions.push("detachDisk"); + } + } + else { // Disk not attached + if (jsonObj.storagetype == "shared") { + allowedActions.push("attachDisk"); + if(jsonObj.vmname == null || jsonObj.vmname == "none") { + allowedActions.push("delete"); + } + } + } + } + } + return allowedActions; + } + + var snapshotActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + if(jsonObj.state == "BackedUp") { + allowedActions.push("createTemplate"); + allowedActions.push("createVolume"); + } + allowedActions.push("delete"); + return allowedActions; + } + +})(cloudStack, testData); \ No newline at end of file diff --git a/ui/scripts/system.js b/ui/scripts/system.js new file mode 100644 index 00000000000..cf4400be1ca --- /dev/null +++ b/ui/scripts/system.js @@ -0,0 +1,5059 @@ +(function($, cloudStack, testData) { + + var zoneObjs, podObjs, clusterObjs, domainObjs; + var selectedClusterObj; + + cloudStack.sections.system = { + title: 'System', + id: 'system', + show: cloudStack.uiCustom.physicalResources({ + sectionSelect: { + label: 'Select view' + }, + sections: { + physicalResources: { + type: 'select', + title: 'Physical Resources', + listView: { + id: 'zones', + label: 'Physical Resources', + fields: { + name: { label: 'Zone' }, + networktype: { label: 'Network Type' }, + allocationstate: { label: 'Allocation State' } + }, + actions: { + add: { + label: 'Add zone', + action: { + custom: cloudStack.zoneWizard({ + steps: [ + // Step 1: Setup + null, + + // Step 2: Setup Zone + function(args) { + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + domainObjs = json.listdomainsresponse.domain; + } + }); + args.response.success({domains: domainObjs}); + }, + + // Step 3: Setup Pod + null, + + // Step 4: Setup IP Range + function(args) { + args.response.success({domains: domainObjs}); + } + ], + + action: function(args) { + var array1 = []; + + //var networktype = $thisWizard.find("#step1").find("input:radio[name=basic_advanced]:checked").val(); //"Basic", "Advanced" + var networktype = args.data["network-model"]; + array1.push("&networktype=" + todb(networktype)); + + array1.push("&name=" + todb(args.data.name)); + + array1.push("&dns1=" + todb(args.data.dns1)); + + var dns2 = args.data.dns2; + if (dns2 != null && dns2.length > 0) + array1.push("&dns2=" + todb(dns2)); + + array1.push("&internaldns1="+todb(args.data.internaldns1)); + + var internaldns2 = args.data.internaldns2; + if (internaldns2 != null && internaldns2.length > 0) + array1.push("&internaldns2=" + todb(internaldns2)); + + if(networktype == "Advanced") { + if(args.data["isolation-mode"] == "security-groups") { + array1.push("&securitygroupenabled=true"); + } + else { //args.data["isolation-mode"] == "vlan" + array1.push("&securitygroupenabled=false"); + + var vlanStart = args.data["vlan-range-start"]; + if(vlanStart != null && vlanStart.length > 0) { + var vlanEnd = args.data["vlan-range-end"]; + if (vlanEnd != null && vlanEnd.length > 0) + array1.push("&vlan=" + todb(vlanStart + "-" + vlanEnd)); + else + array1.push("&vlan=" + todb(vlanStart)); + } + + var guestcidraddress = args.data["guest-cidr"]; + if(guestcidraddress != null && guestcidraddress.length > 0) { + array1.push("&guestcidraddress="+todb(guestcidraddress)); + } + } + } + + if(args.data["public"] == null) //public checkbox is unchecked + array1.push("&domainid=" + args.data["zone-domain"]); + + var zoneId, podId; + $.ajax({ + url: createURL("createZone" + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var item = json.createzoneresponse.zone; + args.response.success({data:item}); + + zoneId = item.id; + //$("#leftmenu_security_group_container").show(); + + $.ajax({ + url: createURL("listCapabilities"), + dataType: "json", + async: false, + success: function(json) { + /* g_supportELB: "guest" — ips are allocated on guest network (so use 'forvirtualnetwork' = false) + * g_supportELB: "public" - ips are allocated on public network (so use 'forvirtualnetwork' = true) + * g_supportELB: "false" – no ELB support + */ + g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean + $.cookie('supportELB', g_supportELB, { expires: 1}); + + g_firewallRuleUiEnabled = json.listcapabilitiesresponse.capability.firewallRuleUiEnabled.toString(); //convert boolean to string if it's boolean + $.cookie('firewallRuleUiEnabled', g_firewallRuleUiEnabled, { expires: 1}); + + if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) { + g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean + $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, { expires: 1}); + } + + if (json.listcapabilitiesresponse.capability.securitygroupsenabled != null) { + g_directAttachSecurityGroupsEnabled = json.listcapabilitiesresponse.capability.securitygroupsenabled.toString(); //convert boolean to string if it's boolean + $.cookie('directattachsecuritygroupsenabled', g_directAttachSecurityGroupsEnabled, { expires: 1}); + } + } + }); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + + if(zoneId != null) { + // create pod (begin) + var array1 = []; + array1.push("&zoneId=" + zoneId); + array1.push("&name=" + todb(args.data["pod-name"])); + array1.push("&netmask=" + todb(args.data["pod-netmask"])); + array1.push("&startIp=" + todb(args.data["pod-ip-range-start"])); + + var endip = args.data["pod-ip-range-end"]; //optional + if (endip != null && endip.length > 0) + array1.push("&endIp=" + todb(endip)); + + array1.push("&gateway=" + todb(args.data["pod-gateway"])); + + $.ajax({ + url: createURL("createPod"+array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var item = json.createpodresponse.pod; + //args.response.success({data:item}); //do nothing until Brian extends zoneWizard to support 3 API call + podId = item.id; + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + //args.response.error(errorMsg); //do nothing until Brian extends zoneWizard to support 3 API call + } + }); + // create pod (end) + + + // create direct VLAN (basic zone, advanced zone + security group) + //var $createDirectVlan = $thisWizard.find("#step4").find("#create_direct_vlan"); + //if ($createDirectVlan.css("display") != "none") { + if(networktype == "Basic" || (networktype == "Advanced" && args.data["isolation-mode"] == "security-groups")) { + var array1 = []; + + array1.push("&gateway=" + todb(args.data["guest-gateway"])); + array1.push("&netmask=" + todb(args.data["guest-netmask"])); + array1.push("&startip=" + todb(args.data["guest-ip-range-start"])); + + var endip = args.data["guest-ip-range-end"]; + if(endip != null && endip.length > 0) + array1.push("&endip=" + todb(endip)); + + array1.push("&forVirtualNetwork=false"); //direct VLAN + array1.push("&zoneid=" + zoneId); + + var isValid = true; + if(networktype == "Basic") { //Basic zone (default VLAN is at pod-level) + array1.push("&vlan=untagged"); + array1.push("&podId=" + podId); + if(podId == null) + isValid = false; + } + else { //Advanced zone + security group (default VLAN is at zone-level) + array1.push("&vlan=" + args.data["vlan-id"]); + } + + if(isValid) { + $.ajax({ + url: createURL("createVlanIpRange" + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var item = json.createvlaniprangeresponse.vlan; + //args.response.success({data:item}); //do nothing until Brian extends zoneWizard to support 3 API call + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + //args.response.error(errorMsg); //do nothing until Brian extends zoneWizard to support 3 API call + } + }); + } + } + + + // create virtual VLAN (advanced zone + virtual) + //var $createVirtualVlan = $thisWizard.find("#step4").find("#create_virtual_vlan"); + //if ($createVirtualVlan.css("display") != "none") { + else if (networktype == "Advanced" && args.data["isolation-mode"] == "vlan") { + var array1 = []; + //if ($createVirtualVlan.find("#add_publicip_vlan_tagged").val() == "tagged") + if(args.data["vlan-type"] == "tagged") { + array1.push("&vlan=" + args.data["vlan-id"]); + if(args.data["ip-scope-tagged"] == "account-specific") { + array1.push("&domainId=" + args.data["ip-domain"]); + array1.push("&account=" + args.data.account); + } + } + else { //args.data["vlan-type"] == "untagged" + array1.push("&vlan=untagged"); + } + + array1.push("&gateway=" + todb(args.data["guest-gateway"])); + array1.push("&netmask=" + todb(args.data["guest-netmask"])); + array1.push("&startip=" + todb(args.data["guest-ip-range-start"])); + + var endip = args.data["guest-ip-range-end"]; //optional field (might be empty) + if(endip != null && endip.length > 0) + array1.push("&endip=" + todb(endip)); + + $.ajax({ + url: createURL("createVlanIpRange&forVirtualNetwork=true&zoneId=" + zoneId + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createvlaniprangeresponse.vlan; + //args.response.success({data:item}); //do nothing until Brian extends zoneWizard to support 3 API call + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + //args.response.error(errorMsg); //do nothing until Brian extends zoneWizard to support 3 API call + } + }); + } + } + } + }) + }, + messages: { + confirm: function(args) { + return 'Are you sure you want to add a zone?'; + }, + notification: function(args) { + return 'Created new zone'; + } + }, + notification: { + poll: testData.notifications.testPoll + } + }, + + enable: { + label: 'Enable zone', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this zone?'; + }, + success: function(args) { + return 'This zone is being enabled.'; + }, + notification: function(args) { + return 'Enabling zone'; + }, + complete: function(args) { + return 'Zone has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateZone&id=" + args.context.physicalResources[0].id + "&allocationstate=Enabled"), //embedded objects in listView is called physicalResources while embedded objects in detailView is called zones + dataType: "json", + async: true, + success: function(json) { + var item = json.updatezoneresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable zone', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this zone?'; + }, + success: function(args) { + return 'This zone is being disabled.'; + }, + notification: function(args) { + return 'Disabling zone'; + }, + complete: function(args) { + return 'Zone has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateZone&id=" + args.context.physicalResources[0].id + "&allocationstate=Disabled"), //embedded objects in listView is called physicalResources while embedded objects in detailView is called zones + dataType: "json", + async: true, + success: function(json) { + var item = json.updatezoneresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this zone.'; + }, + success: function(args) { + return 'Zone is being deleted.'; + }, + notification: function(args) { + return 'Deleting zone'; + }, + complete: function(args) { + return 'Zone has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteZone&id=" + args.context.physicalResources[0].id), //embedded objects in listView is called physicalResources while embedded objects in detailView is called zones + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + + dataProvider: function(args) { + $.ajax({ + url: createURL("listZones&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + zoneObjs = json.listzonesresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:zoneObjs + }); + } + }); + }, + detailView: { + isMaximized: true, + pageGenerator: cloudStack.zoneChart({ + dataProvider: function(args) { + args.response.success({data:args.jsonObj}); + }, + detailView: { + name: 'Zone details', + viewAll: { path: '_zone.pods', label: 'Pods' }, + actions: { + edit: { + label: 'Edit', + action: function(args) { + var array1 = []; + array1.push("&name=" +todb(args.data.name)); + array1.push("&dns1=" + todb(args.data.dns1)); + array1.push("&dns2=" + todb(args.data.dns2)); //dns2 can be empty ("") when passed to API + array1.push("&internaldns1=" + todb(args.data.internaldns1)); + array1.push("&internaldns2=" + todb(args.data.internaldns2)); //internaldns2 can be empty ("") when passed to API + + if(args.context.zones[0].networktype == "Advanced") { //remove this after Brian fixes it to include $form in args + var vlan; + //if(args.$form.find('.form-item[rel=startVlan]').css("display") != "none") { //comment out until Brian fixes it to include $form in args + var vlanStart = args.data.startVlan; + if(vlanStart != null && vlanStart.length > 0) { + var vlanEnd = args.data.endVlan; + if (vlanEnd != null && vlanEnd.length > 0) + vlan = vlanStart + "-" + vlanEnd; + else + vlan = vlanStart; + array1.push("&vlan=" + todb(vlan)); + } + //} + + //if(args.$form.find('.form-item[rel=guestcidraddress]').css("display") != "none") { //comment out until Brian fixes it to include $form in args + array1.push("&guestcidraddress=" + todb(args.data.guestcidraddress)); + //} + } //remove this after Brian fixes it to include $form in args + + $.ajax({ + url: createURL("updateZone&id=" + args.context.zones[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.updatezoneresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:item + }); + } + }); + } + }, + + enable: { + label: 'Enable zone', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this zone?'; + }, + success: function(args) { + return 'This zone is being enabled.'; + }, + notification: function(args) { + return 'Enabling zone'; + }, + complete: function(args) { + return 'Zone has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateZone&id=" + args.context.zones[0].id + "&allocationstate=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatezoneresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable zone', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this zone?'; + }, + success: function(args) { + return 'This zone is being disabled.'; + }, + notification: function(args) { + return 'Disabling zone'; + }, + complete: function(args) { + return 'Zone has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateZone&id=" + args.context.zones[0].id + "&allocationstate=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatezoneresponse.zone; + args.response.success({ + actionFilter: zoneActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this zone.'; + }, + success: function(args) { + return 'Zone is being deleted.'; + }, + notification: function(args) { + return 'Deleting zone'; + }, + complete: function(args) { + return 'Zone has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteZone&id=" + args.context.zones[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + }, + tabs: { + details: { + title: 'Details', + + preFilter: function(args) { + /* + var hiddenFields; + if(args.context.zones[0].networktype == "Basic") + hiddenFields = ["guestcidraddress", "startVlan", "endVlan"]; + else if(args.context.zones[0].networktype == "Advanced") + hiddenFields = []; + return hiddenFields; + */ + //comment out the above section until Brian fix it to include context in args + return []; + }, + + fields: [ + { + name: { label: 'Zone', isEditable: true } + }, + { + id: { label: 'ID' }, + allocationstate: { label: 'Allocation State' }, + dns1: { label: 'DNS 1', isEditable: true }, + dns2: { label: 'DNS 2', isEditable: true }, + internaldns1: { label: 'Internal DNS 1', isEditable: true }, + internaldns2: { label: 'Internal DNS 2', isEditable: true }, + networktype: { label: 'Network Type' }, + securitygroupsenabled: { + label: 'Security Groups Enabled', + converter:cloudStack.converters.toBooleanText + }, + domain: { label: 'Domain' }, + + //only advanced zones have VLAN and CIDR Address + guestcidraddress: { label: 'Guest CIDR Address', isEditable: true }, + vlan: { label: 'Vlan' }, + startVlan: { label: 'Start Vlan', isEditable: true }, + endVlan: { label: 'End Vlan', isEditable: true } + } + ], + + dataProvider: function(args) { + args.response.success({ + actionFilter: zoneActionfilter, + data: args.context.zones[0] + }); + } + } + } + } + }) + } + } + }, + routers: { + type: 'select', + title: 'Virtual Appliances', + id: 'routers', + listView: { + label: 'Virtual Appliances', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + state: { + label: 'Status', + indicator: { + 'Running': 'on', + 'Stopped': 'off', + 'Error': 'off' + } + } + }, + actions: { + start: { + label: 'Start router', + messages: { + confirm: function(args) { + return 'Are you sure you want to start router?'; + }, + notification: function(args) { + return 'Starting router'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('startRouter&id=' + args.context.routers[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.startrouterresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.domainrouter; + }, + getActionFilter: function() { + return routerActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + stop: { + label: 'Stop router', + messages: { + confirm: function(args) { + return 'Are you sure you want to stop router?'; + }, + notification: function(args) { + return 'Stopping router'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('stopRouter&id=' + args.context.routers[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.stoprouterresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.domainrouter; + }, + getActionFilter: function() { + return routerActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + restart: { + label: 'reboot router', + messages: { + confirm: function(args) { + return 'Are you sure you want to reboot router?'; + }, + notification: function(args) { + return 'rebooting router'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('rebootRouter&id=' + args.context.routers[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.rebootrouterresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.domainrouter; + }, + getActionFilter: function() { + return routerActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + changeService: { + label: 'Change service offering', + messages: { + confirm: function(args) { + return 'Are you sure you want to change service offering?'; + }, + success: function(args) { + return 'Service offering is being changed.'; + }, + notification: function(args) { + return 'Changing service offering'; + }, + complete: function(args) { + return 'Service offering has been changed.'; + } + }, + createForm: { + title: 'Change Service Offering', + desc: '', + fields: { + serviceOfferingId: { + label: 'Service offering', + select: function(args) { + $.ajax({ + url: createURL("listServiceOfferings&issystem=true&systemvmtype=domainrouter"), + dataType: "json", + async: true, + success: function(json) { + var serviceofferings = json.listserviceofferingsresponse.serviceoffering; + var items = []; + $(serviceofferings).each(function() { + if(this.id != args.context.routers[0].serviceofferingid) { + items.push({id: this.id, description: this.displaytext}); + } + }); + args.response.success({data: items}); + } + }); + } + } + } + }, + action: function(args) { + $.ajax({ + url: createURL("changeServiceForRouter&id=" + args.context.routers[0].id + "&serviceofferingid=" + args.data.serviceOfferingId), + dataType: "json", + async: true, + success: function(json) { + var jsonObj = json.changeserviceforrouterresponse.domainrouter; + args.response.success({data: jsonObj}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + migrate: { + label: 'Migrate router', + messages: { + confirm: function(args) { + return 'Are you sure you want to migrate router?'; + }, + success: function(args) { + return 'Router is being migrated.'; + }, + notification: function(args) { + return 'Migrating router'; + }, + complete: function(args) { + return 'Router has been migrated.'; + } + }, + createForm: { + title: 'Migrate router', + desc: '', + fields: { + hostId: { + label: 'Host', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), + //url: createURL("listHosts"), //for testing only, comment it out before checking in. + dataType: "json", + async: true, + success: function(json) { + var hostObjs = json.listhostsresponse.host; + var items = []; + $(hostObjs).each(function() { + items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + }); + args.response.success({data: items}); + } + }); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + } + } + }, + action: function(args) { + if(args.data.hostId == null) { + args.response.error("Host field is required"); + return; + } + $.ajax({ + url: createURL("migrateSystemVm&hostid=" + args.data.hostId + "&virtualmachineid=" + args.context.routers[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.migratesystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + //return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance + $.ajax({ + url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listroutersresponse.router; + if(items != null && items.length > 0) { + return items[0]; + } + } + }); + }, + getActionFilter: function() { + return routerActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL('listRouters&page=' + args.page + '&pagesize=' + pageSize), + dataType: 'json', + async: true, + success: function(json) { + var items = json.listroutersresponse.router; + args.response.success({ + actionFilter: routerActionfilter, + data: items + }); + } + }); + } + } + }, + systemvms: { + type: 'select', + title: 'System VMs', + listView: { + label: 'System VMs', + fields: { + name: { label: 'Name' }, + systemvmtype: { label: 'Type' }, + zonename: { label: 'Zone' }, + state: { + label: 'Status', + indicator: { + 'Running': 'on', + 'Stopped': 'off', + 'Error': 'off' + } + } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listSystemVms&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listsystemvmsresponse.systemvm; + args.response.success({ + actionFilter: systemvmActionfilter, + data: items + }); + } + }); + }, + + actions: { + start: { + label: 'Start system VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to start system VM?'; + }, + notification: function(args) { + return 'Starting system VM'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('startSystemVm&id=' + args.context.systemvms[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.startsystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.systemvm; + }, + getActionFilter: function() { + return systemvmActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + stop: { + label: 'Stop system VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to stop system VM?'; + }, + notification: function(args) { + return 'Stopping system VM'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('stopSystemVm&id=' + args.context.systemvms[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.stopsystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.systemvm; + }, + getActionFilter: function() { + return systemvmActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + restart: { + label: 'reboot system VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to reboot system VM?'; + }, + notification: function(args) { + return 'rebooting system VM'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('rebootSystemVm&id=' + args.context.systemvms[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.rebootsystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.systemvm; + }, + getActionFilter: function() { + return systemvmActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Destroy system VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to destroy this system VM?'; + }, + notification: function(args) { + return 'Destroyping system VM'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('destroySystemVm&id=' + args.context.systemvms[0].id), + dataType: 'json', + async: true, + success: function(json) { + var jid = json.destroysystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + //return {}; //nothing in this systemVM needs to be updated, in fact, this whole systemVM has being destroyed + }, + getActionFilter: function() { + return systemvmActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + migrate: { + label: 'Migrate system VM', + messages: { + confirm: function(args) { + return 'Are you sure you want to migrate system VM?'; + }, + success: function(args) { + return 'System VM is being migrated.'; + }, + notification: function(args) { + return 'Migrating system VM'; + }, + complete: function(args) { + return 'System VM has been migrated.'; + } + }, + createForm: { + title: 'Migrate system VM', + desc: '', + fields: { + hostId: { + label: 'Host', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listHosts&VirtualMachineId=" + args.context.systemvms[0].id), + //url: createURL("listHosts"), //for testing only, comment it out before checking in. + dataType: "json", + async: true, + success: function(json) { + var hostObjs = json.listhostsresponse.host; + var items = []; + $(hostObjs).each(function() { + items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + }); + args.response.success({data: items}); + } + }); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + } + } + }, + action: function(args) { + if(args.data.hostId == null) { + args.response.error("Host field is required"); + return; + } + $.ajax({ + url: createURL("migrateSystemVm&hostid=" + args.data.hostId + "&virtualmachineid=" + args.context.systemvms[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.migratesystemvmresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + //return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance + $.ajax({ + url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listsystemvmsresponse.systemvm; + if(items != null && items.length > 0) { + return items[0]; + } + } + }); + }, + getActionFilter: function() { + return systemvmActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + } + } + } + } + }), + subsections: { + networks: { + sectionSelect: { label: 'Network type' }, + sections: { + publicNetworks: { + type: 'select', + title: 'Public network', + listView: { + section: 'networks', + id: 'networks', + fields: { + //id: { label: "ID" }, + traffictype: { label: "Traffic type" }, + broadcastdomaintype: { label: "Broadcast domain type" } + }, + + dataProvider: function(args) { //public network + var showPublicNetwork = true; + var zoneObj = args.context.zones[0]; + if(zoneObj.networktype == "Basic") { + //$("#add_network_button").hide(); + $.ajax({ + url: createURL("listExternalFirewalls&zoneid=" + zoneObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listexternalfirewallsresponse.externalfirewall; + if(items != null && items.length > 0) { + showPublicNetwork = true; + //$("#add_iprange_button,#tab_ipallocation").show(); + } + else { + showPublicNetwork = false; + //$("#add_iprange_button,#tab_ipallocation").hide(); + } + } + }); + } + else { // Advanced zone + showPublicNetwork = true; + //$("#add_network_button,#add_iprange_button,#tab_ipallocation").show(); + //listMidMenuItems2(("listNetworks&type=Direct&zoneId="+zoneObj.id), networkGetSearchParams, "listnetworksresponse", "network", directNetworkToMidmenu, directNetworkToRightPanel, directNetworkGetMidmenuId, false, 1); + } + + if(showPublicNetwork == true && zoneObj.securitygroupsenabled == false) { //public network + $.ajax({ + url: createURL("listNetworks&trafficType=Public&isSystem=true&zoneId="+zoneObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listnetworksresponse.network; + args.response.success({data: items}); + } + }); + } + else if (showPublicNetwork == true && zoneObj.securitygroupsenabled == true){ + $.ajax({ + url: createURL("listNetworks&type=Direct&trafficType=Guest&isSystem=true&zoneId="+zoneObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listnetworksresponse.network; + args.response.success({data: items}); + } + }); + } + else { + args.response.success({data: null}); + } + } , + + detailView: { + //viewAll: { label: 'Hosts', path: 'instances' }, + + actions: { + addIpRange: { + label: 'Add IP range', + messages: { + confirm: function(args) { + return 'Are you sure you want to add IP range?'; + }, + success: function(args) { + return 'IP range is being added.'; + }, + notification: function(args) { + return 'Adding IP range'; + }, + complete: function(args) { + return 'IP range has been added.'; + } + }, + createForm: { + title: 'Add IP range', + fields: { + vlanTagged: { + label: 'VLAN', + dependsOn: 'isBootable', + select: function(args) { + var items = []; + items.push({id: "untagged", description: "untagged"}); + items.push({id: "tagged", description: "tagged"}); + args.response.success({data: items}); + args.$select.change(function() { + var $form = $(this).closest('form'); + if($(this).val() == "tagged") + $form.find('.form-item[rel=vlanId]').css('display', 'inline-block'); + else //"untagged" + $form.find('.form-item[rel=vlanId]').hide(); + }); + } + }, + vlanId: { label: "VLAN ID" }, + + scope: { + label: 'Scope', + select: function(args) { + var zoneObj = args.context.zones[0]; + var array1 = []; + if(zoneObj.securitygroupsenabled) { + array1.push({id: 'account-specific', description: 'account-specific'}); + } + else { + array1.push({id: 'zone-wide', description: 'zone-wide'}); + array1.push({id: 'domain-specific', description: 'domain-specific'}); + array1.push({id: 'account-specific', description: 'account-specific'}); + } + args.response.success({data: array1}); + + args.$select.change(function() { + var $form = $(this).closest('form'); + if($(this).val() == "zone-wide") { + $form.find('.form-item[rel=domainId]').hide(); + $form.find('.form-item[rel=account]').hide(); + } + else if ($(this).val() == "domain-specific") { + $form.find('.form-item[rel=domainId]').css('display', 'inline-block'); + $form.find('.form-item[rel=account]').hide(); + } + else if($(this).val() == "account-specific") { + $form.find('.form-item[rel=domainId]').css('display', 'inline-block'); + $form.find('.form-item[rel=account]').css('display', 'inline-block'); + } + }); + } + }, + domainId: { + label: 'Domain', + validation: { required: true }, + select: function(args) { + var items = []; + var zoneObj = args.context.zones[0]; + if(zoneObj.domainid != null) { //list only domains under zoneObj.domainid + $.ajax({ + url: createURL("listDomainChildren&id=" + zoneObj.domainid + "&isrecursive=true"), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainchildrenresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + $.ajax({ + url: createURL("listDomains&id=" + zoneObj.domainid), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + } + else { //list all domains + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + } + args.response.success({data: items}); + } + }, + account: { label: 'Account' }, + + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' } + } + }, + action: function(args) { + var $form = args.$form; + var array1 = []; + array1.push("&zoneId=" + args.context.zones[0].id); + + if (args.data.vlanTagged == "tagged") + array1.push("&vlan=" + todb(args.data.vlanId)); + else + array1.push("&vlan=untagged"); + + if($form.find('.form-item[rel=domainId]').css("display") != "none") { + if($form.find('.form-item[rel=account]').css("display") != "none") { //account-specific + array1.push("&domainId=" + args.data.domainId); + array1.push("&account=" + args.data.account); + } + else { //domain-specific + array1.push("&domainId=" + args.data.domainId); + array1.push("&isshared=true"); + } + } + else { //zone-wide + array1.push("&isshared=true"); + } + + array1.push("&gateway=" + args.data.gateway); + array1.push("&netmask=" + args.data.netmask); + array1.push("&startip=" + args.data.startip); + if(args.data.endip != null && args.data.endip.length > 0) + array1.push("&endip=" + args.data.endip); + + if(args.context.zones[0].securitygroupsenabled == false) + array1.push("&forVirtualNetwork=true"); + else + array1.push("&forVirtualNetwork=false"); + + $.ajax({ + url: createURL("createVlanIpRange" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createvlaniprangeresponse.vlan; + args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + tabs: { + details: { + title: 'Details', + fields: [ + { + networkofferingdisplaytext: { label: "Network offering description" } + }, + { + id: { label: "ID" }, + broadcastdomaintype: { label: 'Broadcast domain type' }, + traffictype: { label: 'Traffic type' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + zoneid: { label: 'Zone ID' }, + networkofferingid: { label: 'Network offering ID' }, + networkofferingname: { label: 'Network offering name' }, + networkofferingavailability: { label: 'network offering availability' }, + isshared: { + label: 'Shared', + converter: cloudStack.converters.toBooleanText + }, + issystem: { + label: 'System', + converter: cloudStack.converters.toBooleanText + }, + isdefault: { + label: 'Default', + converter: cloudStack.converters.toBooleanText + }, + securitygroupenabled: { + label: 'Security group enabled', + converter: cloudStack.converters.toBooleanText + }, + state: { label: 'State' }, + related: { label: 'Related' }, + dns1: { label: 'DNS 1' }, + dns2: { label: 'DNS 2' }, + vlan: { label: 'VLAN' }, + domainid: { label: 'Domain ID' }, + account: { label: 'Account' } + } + ], + dataProvider: function(args) { + args.response.success({data: args.context.publicNetworks[0]}); + } + }, + ipAllocations: { + title: 'IP Allocations', + multiple: true, + fields: [ + { + id: { label: 'ID' }, + vlan: { label: 'VLAN' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + domain: { label: 'Domain' }, + account: { label: 'Account' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL("listVlanIpRanges&zoneid=" + args.context.zones[0].id + "&networkId=" + args.context.publicNetworks[0].id), + dataType: "json", + success: function(json) { + var items = json.listvlaniprangesresponse.vlaniprange; + args.response.success({ + actionFilter: publicNetworkActionfilter, + data: items}); + } + }); + } + } + } + } + } + }, + directNetworks: { + title: 'Direct network', + type: 'select', + listView: { + section: 'networks', + id: 'networks', + fields: { + //id: { label: "ID" }, + vlan: { label: "VLAN ID" }, + traffictype: { label: "Traffic type" } + }, + actions: { + add: { + label: 'Create network', + + messages: { + confirm: function(args) { + return 'Are you sure you want to create a network?'; + }, + success: function(args) { + return 'Your new network is being created.'; + }, + notification: function(args) { + return 'Creating new network'; + }, + complete: function(args) { + return 'Network has been created successfully!'; + } + }, + + createForm: { + title: 'Create network', + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + isDefault: { + label: "Default", + isBoolean: true + }, + vlanTagged: { + label: 'VLAN', + select: function(args) { + args.response.success({data: {id: "tagged", description: "tagged"}}); + } + }, + vlanId: { label: "VLAN ID" }, + scope: { + label: 'Scope', + select: function(args) { + var zoneObj = args.context.zones[0]; + var array1 = []; + if(zoneObj.securitygroupsenabled) { + array1.push({id: 'account-specific', description: 'account-specific'}); + } + else { + array1.push({id: 'zone-wide', description: 'zone-wide'}); + array1.push({id: 'domain-specific', description: 'domain-specific'}); + array1.push({id: 'account-specific', description: 'account-specific'}); + } + args.response.success({data: array1}); + + args.$select.change(function() { + var $form = $(this).closest('form'); + if($(this).val() == "zone-wide") { + $form.find('.form-item[rel=domainId]').hide(); + $form.find('.form-item[rel=account]').hide(); + } + else if ($(this).val() == "domain-specific") { + $form.find('.form-item[rel=domainId]').css('display', 'inline-block'); + $form.find('.form-item[rel=account]').hide(); + } + else if($(this).val() == "account-specific") { + $form.find('.form-item[rel=domainId]').css('display', 'inline-block'); + $form.find('.form-item[rel=account]').css('display', 'inline-block'); + } + }); + } + }, + domainId: { + label: 'Domain', + validation: { required: true }, + select: function(args) { + var items = []; + var zoneObj = args.context.zones[0]; + if(zoneObj.domainid != null) { //list only domains under zoneObj.domainid + $.ajax({ + url: createURL("listDomainChildren&id=" + zoneObj.domainid + "&isrecursive=true"), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainchildrenresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + $.ajax({ + url: createURL("listDomains&id=" + zoneObj.domainid), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + } + else { //list all domains + $.ajax({ + url: createURL("listDomains"), + dataType: "json", + async: false, + success: function(json) { + var domainObjs = json.listdomainsresponse.domain; + $(domainObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + } + }); + } + args.response.success({data: items}); + } + }, + account: { label: 'Account' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + networkdomain: { label: 'Network domain' }, + tags: { label: 'Tags' } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&zoneId=" + args.context.zones[0].id); + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.description)); + + if (args.data.vlanTagged == "tagged") + array1.push("&vlan=" + todb(args.data.vlanId)); + else + array1.push("&vlan=untagged"); + + var $form = args.$form; + + if($form.find('.form-item[rel=domainId]').css("display") != "none") { + if($form.find('.form-item[rel=account]').css("display") != "none") { //account-specific + array1.push("&domainId=" + args.data.domainId); + array1.push("&account=" + args.data.account); + } + else { //domain-specific + array1.push("&domainId=" + args.data.domainId); + array1.push("&isshared=true"); + } + } + else { //zone-wide + array1.push("&isshared=true"); + } + + array1.push("&isDefault=" + (args.data.isDefault=="on")); + array1.push("&gateway=" + args.data.gateway); + array1.push("&netmask=" + args.data.netmask); + array1.push("&startip=" + args.data.startip); + array1.push("&endip=" + args.data.endip); + + if(args.data.networkdomain != null && args.data.networkdomain.length > 0) + array1.push("&networkdomain=" + todb(args.data.networkdomain)); + + if(args.data.tags != null && args.data.tags.length > 0) + array1.push("&tags=" + todb(args.data.tags)); + + //get network offering of direct network + $.ajax({ + url: createURL("listNetworkOfferings&guestiptype=Direct"), + dataType: "json", + async: false, + success: function(json) { + var networkOfferings = json.listnetworkofferingsresponse.networkoffering; + if (networkOfferings != null && networkOfferings.length > 0) { + for (var i = 0; i < networkOfferings.length; i++) { + if (networkOfferings[i].isdefault) { + array1.push("&networkOfferingId=" + networkOfferings[i].id); + + // Create a network from this. + $.ajax({ + url: createURL("createNetwork" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createnetworkresponse.network; + args.response.success({data:item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + } + } + } + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + dataProvider: function(args) { //direct netwoerk + var zoneObj = args.context.zones[0]; + if(zoneObj.networktype == "Basic") { + args.response.success({data: null}); + } + else { // Advanced zone + //$("#add_network_button,#add_iprange_button,#tab_ipallocation").show(); + $.ajax({ + url: createURL("listNetworks&type=Direct&zoneId="+zoneObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listnetworksresponse.network; + args.response.success({ + actionFilter: directNetworkActionfilter, + data: items}); + } + }); + } + } , + + detailView: { + //viewAll: { label: 'Hosts', path: 'instances' }, + actions: { + addIpRange: { + label: 'Add IP range', + messages: { + confirm: function(args) { + return 'Are you sure you want to add IP range?'; + }, + success: function(args) { + return 'IP range is being added.'; + }, + notification: function(args) { + return 'Adding IP range'; + }, + complete: function(args) { + return 'IP range has been added.'; + } + }, + createForm: { + title: 'Add IP range', + preFilter: function(args) { + if(args.context.zones[0].securitygroupsenabled) { + args.$form.find('.form-item[rel=vlanId]').css('display', 'inline-block'); + args.$form.find('.form-item[rel=gateway]').css('display', 'inline-block'); + args.$form.find('.form-item[rel=netmask]').css('display', 'inline-block'); + } + else { + args.$form.find('.form-item[rel=vlanId]').hide(); + args.$form.find('.form-item[rel=gateway]').hide(); + args.$form.find('.form-item[rel=netmask]').hide(); + } + }, + fields: { + vlanId: { label: 'VLAN ID' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' } + } + }, + action: function(args) { + var $form = args.$form; + var array1 = []; + if($form.find('.form-item[rel=vlanId]').css("display") != "none") { + array1.push("&vlan="+todb(args.data.vlanId)); + } + //else { //Bug 8950 (don't specify "vlan=untagged" if vlanId is not available when Adding Ip Range to Direct Network) + // array1.push("&vlan=untagged"); + //} + + if($form.find('.form-item[rel=gateway]').css("display") != "none") { + array1.push("&gateway=" + todb(args.data.gateway)); + } + + if($form.find('.form-item[rel=netmask]').css("display") != "none") { + array1.push("&netmask=" + todb(args.data.netmask)); + } + + array1.push("&startip=" + todb(args.data.startip)); + + if(args.data.endip != null && args.data.endip.length > 0) + array1.push("&endip=" + todb(args.data.endip)); + + + $.ajax({ + url: createURL("createVlanIpRange&forVirtualNetwork=false&networkid=" + args.context.directNetworks[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createvlaniprangeresponse.vlan; + args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + edit: { + label: 'Edit', + + messages: { + confirm: function(args) { + return 'Are you sure you want to edit network?'; + }, + success: function(args) { + return 'Network is being edited.'; + }, + notification: function(args) { + return 'Editing network'; + }, + complete: function(args) { + return 'Network has been edited.'; + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.displaytext)); + array1.push("&networkdomain=" + todb(args.data.networkdomain)); + array1.push("&tags=" + todb(args.data.tags)); + + $.ajax({ + url: createURL("updateNetwork&id=" + args.context.directNetworks[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var jid = json.updatenetworkresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + var item = json.queryasyncjobresultresponse.jobresult.network; + return {data: item}; + }, + getActionFilter: function() { + return directNetworkActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete network', + messages: { + confirm: function(args) { + return 'Are you sure you want to delete network ?'; + }, + success: function(args) { + return 'Network is being deleted.'; + }, + notification: function(args) { + return 'Deleting network'; + }, + complete: function(args) { + return 'Network has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteNetwork&id=" + args.context.directNetworks[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletenetworkresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this template needs to be updated, in fact, this whole template has being deleted + }, + getActionFilter: function() { + return directNetworkActionfilter; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + + tabs: { + details: { + title: 'Details', //direct network details + fields: [ + { + name: { + label: 'Name', + isEditable: true + } + }, + { + id: { label: "ID" }, + displaytext: { + label: 'Description', + isEditable: true + }, + isdefault: { + label: 'Default', + converter: cloudStack.converters.toBooleanText + }, + vlan: { label: 'VLAN ID' }, + domain: { label: 'Domain' }, + account: { label: 'Account' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' }, + networkdomain: { + label: 'Network domain', + isEditable: true + }, + tags: { + label: 'Tags', + isEditable: true + } + } + ], + dataProvider: function(args) { + args.response.success({data: args.context.directNetworks[0]}); + } + }, + ipAllocations: { + title: 'IP Allocations', + multiple: true, + fields: [ + { + id: { label: 'ID' }, + vlan: { label: 'VLAN' }, + startip: { label: 'Start IP' }, + endip: { label: 'End IP' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL("listVlanIpRanges&zoneid="+ args.context.zones[0].id + "&networkid="+ args.context.directNetworks[0].id), + dataType: "json", + success: function(json) { + var items = json.listvlaniprangesresponse.vlaniprange; + args.response.success({data: items}); + } + }); + } + } + } + } + } + } + } + }, + + pods: { + title: 'Pods', + listView: { + id: 'pods', + section: 'pods', + fields: { + name: { label: 'Name' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + allocationstate: { label: 'Allocation Status' } + }, + + dataProvider: function(args) { + $.ajax({ + url: createURL("listPods&zoneid=" + args.ref.zoneID + "&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listpodsresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:items + }); + } + }); + }, + + actions: { + add: { + label: 'Add pod', + + createForm: { + title: 'Add new pod', + desc: 'Please fill in the following information to add a new pod', + + preFilter: function(args) { + var $guestFields = args.$form.find('.form-item[rel=guestGateway], .form-item[rel=guestNetmask], .form-item[rel=startGuestIp], .form-item[rel=endGuestIp]'); + if (args.context.zones[0].networktype == "Basic") { + $guestFields.css('display', 'inline-block'); + } + else if(args.context.zones[0].networktype == "Advanced") { //advanced-mode network (zone-wide VLAN) + $guestFields.hide(); + } + }, + + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + gateway: { + label: 'Gateway', + validation: { required: true } + }, + netmask: { + label: 'Netmask', + validation: { required: true } + }, + startip: { + label: 'Start IP', + validation: { required: true } + }, + endip: { + label: 'End IP', + validation: { required: false } + }, + + //only basic zones show guest fields (begin) + guestGateway: { + label: 'Guest Gateway', + validation: { required: true }, + isHidden: true + }, + guestNetmask: { + label: 'Guest Netmask', + validation: { required: true }, + isHidden: true + }, + startGuestIp: { + label: 'Start Guest IP', + validation: { required: true }, + isHidden: true + }, + endGuestIp: { + label: 'End Guest IP', + validation: { required: false }, + isHidden: true + } + //only basic zones show guest fields (end) + } + }, + + action: function(args) { + var array1 = []; + array1.push("&zoneId=" + args.context.zones[0].id); + array1.push("&name=" + todb(args.data.name)); + array1.push("&netmask=" + todb(args.data.netmask)); + array1.push("&startIp=" + todb(args.data.startip)); + + var endip = args.data.endip; //optional + if (endip != null && endip.length > 0) + array1.push("&endIp=" + todb(endip)); + + array1.push("&gateway=" + todb(args.data.gateway)); + + $.ajax({ + url: createURL("createPod" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createpodresponse.pod; + args.response.success({data:item}); + var podId = item.id; + + //Create IP Range + //if($thisDialog.find("#guestip_container").css("display") != "none") { + if(args.context.zones[0].networktype == "Basic") { + var array1 = []; + array1.push("&vlan=untagged"); + array1.push("&zoneid=" + args.context.zones[0].id); + array1.push("&podId=" + podId); + array1.push("&forVirtualNetwork=false"); //direct VLAN + array1.push("&gateway=" + todb(args.data.guestGateway)); + array1.push("&netmask=" + todb(args.data.guestNetmask)); + array1.push("&startip=" + todb(args.data.startGuestIp)); + + var endip = args.data.endGuestIp; + if(endip != null && endip.length > 0) + array1.push("&endip=" + todb(endip)); + + $.ajax({ + url: createURL("createVlanIpRange" + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + //var item = json.createvlaniprangeresponse.vlan; + }, + error: function(XMLHttpResponse) { + //var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + //args.response.error(errorMsg); + } + }); + } + + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new pod'; + } + } + }, + + enable: { + label: 'Enable pod', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this pod?'; + }, + success: function(args) { + return 'This pod is being enabled.'; + }, + notification: function(args) { + return 'Enabling pod'; + }, + complete: function(args) { + return 'Pod has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updatePod&id=" + args.context.pods[0].id + "&allocationstate=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatepodresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable pod', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this pod?'; + }, + success: function(args) { + return 'This pod is being disabled.'; + }, + notification: function(args) { + return 'Disabling pod'; + }, + complete: function(args) { + return 'Pod has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updatePod&id=" + args.context.pods[0].id + "&allocationstate=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatepodresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this pod.'; + }, + success: function(args) { + return 'pod is being deleted.'; + }, + notification: function(args) { + return 'Deleting pod'; + }, + complete: function(args) { + return 'Pod has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deletePod&id=" + args.context.pods[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + }, + + detailView: { + viewAll: { path: '_zone.clusters', label: 'Clusters' }, + tabFilter: function(args) { + var hiddenTabs = []; + var selectedZoneObj = args.context.zones[0]; + if(selectedZoneObj.networktype == "Basic") { //basic-mode network (pod-wide VLAN) + //$("#tab_ipallocation, #add_iprange_button, #tab_network_device, #add_network_device_button").show(); + } + else if(selectedZoneObj.networktype == "Advanced") { //advanced-mode network (zone-wide VLAN) + //$("#tab_ipallocation, #add_iprange_button, #tab_network_device, #add_network_device_button").hide(); + hiddenTabs.push("ipAllocations"); + //hiddenTabs.push("networkDevices"); //network devices tab is moved out of pod page at 3.0 UI. It will go to new network page. + } + return hiddenTabs; + }, + actions: { + edit: { + label: 'Edit', + action: function(args) { + var array1 = []; + array1.push("&name=" +todb(args.data.name)); + array1.push("&netmask=" + todb(args.data.netmask)); + array1.push("&startIp=" + todb(args.data.startip)); + if(args.data.endip != null && args.data.endip.length > 0) + array1.push("&endIp=" + todb(args.data.endip)); + if(args.data.gateway != null && args.data.gateway.length > 0) + array1.push("&gateway=" + todb(args.data.gateway)); + + $.ajax({ + url: createURL("updatePod&id=" + args.context.pods[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.updatepodresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:item + }); + } + }); + } + }, + + enable: { + label: 'Enable pod', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this pod?'; + }, + success: function(args) { + return 'This pod is being enabled.'; + }, + notification: function(args) { + return 'Enabling pod'; + }, + complete: function(args) { + return 'Pod has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updatePod&id=" + args.context.pods[0].id + "&allocationstate=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatepodresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable pod', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this pod?'; + }, + success: function(args) { + return 'This pod is being disabled.'; + }, + notification: function(args) { + return 'Disabling pod'; + }, + complete: function(args) { + return 'Pod has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updatePod&id=" + args.context.pods[0].id + "&allocationstate=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatepodresponse.pod; + args.response.success({ + actionFilter: podActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this pod.'; + }, + success: function(args) { + return 'pod is being deleted.'; + }, + notification: function(args) { + return 'Deleting pod'; + }, + complete: function(args) { + return 'Pod has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deletePod&id=" + args.context.pods[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + }, + + addIpRange: { + label: 'Add IP range' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to add IP range to this pod'; + }, + success: function(args) { + return 'IP range is being added.'; + }, + notification: function(args) { + return 'Adding IP range'; + }, + complete: function(args) { + return 'IP range has been added.'; + } + }, + + createForm: { + title: 'Add IP range', + fields: { + gateway: { label: 'Guest gateway' }, + netmask: { label: 'Guest netmask' }, + startip: { label: 'Guest start IP' }, + endip: { label: 'Guest end IP' } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&vlan=untagged"); + array1.push("&zoneid=" + args.context.zones[0].id); + array1.push("&podId=" + args.context.pods[0].id); + array1.push("&forVirtualNetwork=false"); //direct VLAN + array1.push("&gateway=" + todb(args.data.gateway)); + array1.push("&netmask=" + todb(args.data.netmask)); + array1.push("&startip=" + todb(args.data.startip)); + if(args.data.endip != null && args.data.endip.length > 0) + array1.push("&endip=" + todb(args.data.endip)); + + $.ajax({ + url: createURL("createVlanIpRange" + array1.join("")), + dataType: "json", + async: false, + success: function(json) { + var item = json.createvlaniprangeresponse.vlan; + args.response.success({data: item}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name', isEditable: true }, + }, + { + id: { label: 'ID' }, + netmask: { label: 'Netmask', isEditable: true }, + startip: { label: 'Start IP Range', isEditable: true }, + endip: { label: 'End IP Range', isEditable: true }, + gateway: { label: 'Gateway', isEditable: true }, + allocationstate: { label: 'Allocation Status' } + } + ], + + dataProvider: function(args) { + args.response.success({ + actionFilter: podActionfilter, + data: args.context.pods[0] + }); + } + }, + + ipAllocations: { + title: 'IP Allocations', + multiple: true, + fields: [ + { + id: { label: 'ID' }, + description: { label: 'Description' }, + gateway: { label: 'Gateway' }, + netmask: { label: 'Netmask' }, + startip: { label: 'Start IP range' }, + endip: { label: 'End IP range' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL("listVlanIpRanges&zoneid=" + args.context.zones[0].id + "&podid=" + args.context.pods[0].id), + dataType: "json", + success: function(json) { + var items = json.listvlaniprangesresponse.vlaniprange; + args.response.success({data: items}); + } + }); + } + }, + + //network devices tab is moved out of pod page at 3.0 UI. It will go to new network page. + /* + networkDevices: { + title: 'Network devices', + multiple: true, + + //preFilter won't work until Brian fix Bug #155 + preFilter: function(args) { + var networkDeviceObj = args.context.networkDevices[0]; + + var hiddenFields; + if(networkDeviceObj.pingstorageserverip == null || networkDeviceObj.pingstorageserverip.length == 0) + hiddenFields.push("pingstorageserverip"); + if(networkDeviceObj.pingdir == null || networkDeviceObj.pingdir.length == 0) + hiddenFields.push("pingdir"); + if(networkDeviceObj.tftpdir == null || networkDeviceObj.tftpdir.length == 0) + hiddenFields.push("tftpdir"); + + return hiddenFields; + }, + + + fields: [ + { + id: { label: 'ID' }, + url: { label: 'URL' }, + type: { label: 'Type' }, + pingstorageserverip: { label: 'PING storage IP' }, + pingdir: { label: 'PING directory' }, + tftpdir: { label: 'TFTP directory' } + } + ], + dataProvider: function(args) { + var array1 = []; + array1.push("&networkdeviceparameterlist[0].zoneid=" + args.context.pods[0].zoneid); + array1.push("&networkdeviceparameterlist[0].podid=" + args.context.pods[0].id); + $.ajax({ + url: createURL("listNetworkDevice" + array1.join("")), + dataType: "json", + success: function(json) { + var items = json.listnetworkdevice.networkdevice; + args.response.success({ + actionFilter: networkDeviceActionfilter, + data: items + }); + } + }); + } + } + */ + } + } + } + }, + clusters: { + title: 'Clusters', + listView: { + id: 'clusters', + section: 'clusters', + fields: { + name: { label: 'Name' }, + podname: { label: 'Pod' }, + hypervisortype: { label: 'Hypervisor' }, + allocationstate: { label: 'Allocation State' }, + managedstate: { label: 'Managed State' } + }, + + //dataProvider: testData.dataProvider.listView('clusters'), + dataProvider: function(args) { + $.ajax({ + url: createURL("listClusters&zoneid=" + args.ref.zoneID + "&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listclustersresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:items + }); + } + }); + }, + + actions: { + add: { + label: 'Add cluster', + + messages: { + confirm: function(args) { + return 'Are you sure you want to add a cluster?'; + }, + success: function(args) { + return 'Your new cluster is being created.'; + }, + notification: function(args) { + return 'Creating new cluster'; + }, + complete: function(args) { + return 'Cluster has been created successfully!'; + } + }, + + createForm: { + title: 'Add cluster', + desc: 'Please fill in the following data to add a new cluster.', + fields: { + hypervisor: { + label: 'Hypervisor', + select: function(args) { + $.ajax({ + url: createURL("listHypervisors"), + dataType: "json", + async: false, + success: function(json) { + var hypervisors = json.listhypervisorsresponse.hypervisor; + var items = []; + $(hypervisors).each(function() { + items.push({id: this.name, description: this.name}) + }); + args.response.success({data: items}); + } + }); + + args.$select.bind("change", function(event) { + var $form = $(this).closest('form'); + if($(this).val() == "VMware") { + //$('li[input_sub_group="external"]', $dialogAddCluster).show(); + $form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterDatacenter]').css('display', 'inline-block'); + + //$("#cluster_name_label", $dialogAddCluster).text("vCenter Cluster:"); + } + else { + //$('li[input_group="vmware"]', $dialogAddCluster).hide(); + $form.find('.form-item[rel=vCenterHost]').css('display', 'none'); + $form.find('.form-item[rel=vCenterUsername]').css('display', 'none'); + $form.find('.form-item[rel=vCenterPassword]').css('display', 'none'); + $form.find('.form-item[rel=vCenterDatacenter]').css('display', 'none'); + + //$("#cluster_name_label", $dialogAddCluster).text("Cluster:"); + } + }); + } + }, + podId: { + label: 'Pod', + select: function(args) { + $.ajax({ + url: createURL("listPods&zoneid=" + args.context.zones[0].id), + dataType: "json", + async: true, + success: function(json) { + var pods = json.listpodsresponse.pod; + var items = []; + $(pods).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + name: { + label: 'Cluster Name', + validation: { required: true } + }, + + //hypervisor==VMWare begins here + vCenterHost: { + label: 'vCenter Host', + validation: { required: true } + }, + vCenterUsername: { + label: 'vCenter Username', + validation: { required: true } + }, + vCenterPassword: { + label: 'vCenter Password', + validation: { required: true }, + isPassword: true + }, + vCenterDatacenter: { + label: 'vCenter Datacenter', + validation: { required: true } + } + //hypervisor==VMWare ends here + } + }, + + action: function(args) { + var array1 = []; + array1.push("&zoneId=" + args.context.zones[0].id); + array1.push("&hypervisor=" + args.data.hypervisor); + array1.push("&clustertype=CloudManaged"); + array1.push("&podId=" + args.data.podId); + + var clusterName = args.data.name; + if(args.data.hypervisor == "VMware") { + array1.push("&username=" + todb(args.data.vCenterUsername)); + array1.push("&password=" + todb(args.data.vCenterPassword)); + + var hostname = args.data.vCenterHost; + var dcName = args.data.vCenterDatacenter; + + var url; + if(hostname.indexOf("http://") == -1) + url = "http://" + hostname; + else + url = hostname; + url += "/" + dcName + "/" + clusterName; + array1.push("&url=" + todb(url)); + + clusterName = hostname + "/" + dcName + "/" + clusterName; //override clusterName + } + array1.push("&clustername=" + todb(clusterName)); + + $.ajax({ + url: createURL("addCluster" + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var item = json.addclusterresponse.cluster[0]; + args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + enable: { + label: 'Enable cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this cluster?'; + }, + success: function(args) { + return 'This cluster is being enabled.'; + }, + notification: function(args) { + return 'Enabling cluster'; + }, + complete: function(args) { + return 'Cluster has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&allocationstate=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this cluster?'; + }, + success: function(args) { + return 'This cluster is being disabled.'; + }, + notification: function(args) { + return 'Disabling cluster'; + }, + complete: function(args) { + return 'Cluster has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&allocationstate=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + manage: { + label: 'Manage cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to manage this cluster?'; + }, + success: function(args) { + return 'This cluster is being managed.'; + }, + notification: function(args) { + return 'Managing cluster'; + }, + complete: function(args) { + return 'Cluster has been managed.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&managedstate=Managed"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + unmanage: { + label: 'Unmanage cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to unmanage this cluster?'; + }, + success: function(args) { + return 'This cluster is being unmanaged.'; + }, + notification: function(args) { + return 'Unmanaging cluster'; + }, + complete: function(args) { + return 'Cluster has been unmanaged.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&managedstate=Unmanaged"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this cluster.'; + }, + success: function(args) { + return 'Cluster is being deleted.'; + }, + notification: function(args) { + return 'Deleting cluster'; + }, + complete: function(args) { + return 'Cluster has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteCluster&id=" + args.context.clusters[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + detailView: { + viewAll: { path: '_zone.hosts', label: 'Hosts' }, + + actions: { + enable: { + label: 'Enable cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to enable this cluster?'; + }, + success: function(args) { + return 'This cluster is being enabled.'; + }, + notification: function(args) { + return 'Enabling cluster'; + }, + complete: function(args) { + return 'Cluster has been enabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&allocationstate=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + disable: { + label: 'Disable cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to disable this cluster?'; + }, + success: function(args) { + return 'This cluster is being disabled.'; + }, + notification: function(args) { + return 'Disabling cluster'; + }, + complete: function(args) { + return 'Cluster has been disabled.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&allocationstate=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + manage: { + label: 'Manage cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to manage this cluster?'; + }, + success: function(args) { + return 'This cluster is being managed.'; + }, + notification: function(args) { + return 'Managing cluster'; + }, + complete: function(args) { + return 'Cluster has been managed.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&managedstate=Managed"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + unmanage: { + label: 'Unmanage cluster', + messages: { + confirm: function(args) { + return 'Are you sure you want to unmanage this cluster?'; + }, + success: function(args) { + return 'This cluster is being unmanaged.'; + }, + notification: function(args) { + return 'Unmanaging cluster'; + }, + complete: function(args) { + return 'Cluster has been unmanaged.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateCluster&id=" + args.context.clusters[0].id + "&managedstate=Unmanaged"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updateclusterresponse.cluster; + args.response.success({ + actionFilter: clusterActionfilter, + data:item + }); + } + }); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this cluster.'; + }, + success: function(args) { + return 'Cluster is being deleted.'; + }, + notification: function(args) { + return 'Deleting cluster'; + }, + complete: function(args) { + return 'Cluster has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteCluster&id=" + args.context.clusters[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + }, + + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' }, + }, + { + id: { label: 'ID' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' }, + hypervisortype: { label: 'Hypervisor' }, + clustertype: { label: 'Clulster type' }, + allocationstate: { label: 'Allocation State' }, + managedstate: { label: 'Managed State' } + } + ], + + //dataProvider: testData.dataProvider.detailView('clusters') + dataProvider: function(args) { + args.response.success({ + actionFilter: clusterActionfilter, + data: args.context.clusters[0] + }); + } + } + } + } + } + }, + hosts: { + title: 'Hosts', + id: 'hosts', + listView: { + section: 'hosts', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' }, + clustername: { label: 'Cluster' } + }, + + //dataProvider: testData.dataProvider.listView('hosts'), + dataProvider: function(args) { + $.ajax({ + url: createURL("listHosts&type=Routing&zoneid=" + args.ref.zoneID + "&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listhostsresponse.host; + args.response.success({ + actionFilter: hostActionfilter, + data: items + }); + } + }); + }, + + actions: { + add: { + label: 'Add host', + + createForm: { + title: 'Add new host', + desc: 'Please fill in the following information to add a new host fro the specified zone configuration.', + fields: { + //always appear (begin) + podId: { + label: 'Pod', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listPods&zoneid=" + args.context.zones[0].id), + dataType: "json", + async: true, + success: function(json) { + var pods = json.listpodsresponse.pod; + var items = []; + $(pods).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + + clusterId: { + label: 'Cluster', + validation: { required: true }, + dependsOn: 'podId', + select: function(args) { + + + $.ajax({ + url: createURL("listClusters&podid=" + args.podId), + dataType: "json", + async: false, + success: function(json) { + clusterObjs = json.listclustersresponse.cluster; + var items = []; + $(clusterObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + + args.$select.change(function() { + var $form = $(this).closest('form'); + + var clusterId = $(this).val(); + if(clusterId == null) + return; + + var items = []; + $(clusterObjs).each(function(){ + if(this.id == clusterId){ + selectedClusterObj = this; + return false; //break the $.each() loop + } + }); + if(selectedClusterObj == null) + return; + + if(selectedClusterObj.hypervisortype == "VMware") { + //$('li[input_group="general"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=hostname]').hide(); + $form.find('.form-item[rel=username]').hide(); + $form.find('.form-item[rel=password]').hide(); + + //$('li[input_group="vmware"]', $dialogAddHost).show(); + $form.find('.form-item[rel=vcenterHost]').css('display', 'inline-block'); + + //$('li[input_group="baremetal"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=baremetalCpuCores]').hide(); + $form.find('.form-item[rel=baremetalCpu]').hide(); + $form.find('.form-item[rel=baremetalMemory]').hide(); + $form.find('.form-item[rel=baremetalMAC]').hide(); + + //$('li[input_group="Ovm"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=agentUsername]').hide(); + $form.find('.form-item[rel=agentPassword]').hide(); + } + else if (selectedClusterObj.hypervisortype == "BareMetal") { + //$('li[input_group="general"]', $dialogAddHost).show(); + $form.find('.form-item[rel=hostname]').css('display', 'inline-block'); + $form.find('.form-item[rel=username]').css('display', 'inline-block'); + $form.find('.form-item[rel=password]').css('display', 'inline-block'); + + //$('li[input_group="baremetal"]', $dialogAddHost).show(); + $form.find('.form-item[rel=baremetalCpuCores]').css('display', 'inline-block'); + $form.find('.form-item[rel=baremetalCpu]').css('display', 'inline-block'); + $form.find('.form-item[rel=baremetalMemory]').css('display', 'inline-block'); + $form.find('.form-item[rel=baremetalMAC]').css('display', 'inline-block'); + + //$('li[input_group="vmware"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=vcenterHost]').hide(); + + //$('li[input_group="Ovm"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=agentUsername]').hide(); + $form.find('.form-item[rel=agentPassword]').hide(); + } + else if (selectedClusterObj.hypervisortype == "Ovm") { + //$('li[input_group="general"]', $dialogAddHost).show(); + $form.find('.form-item[rel=hostname]').css('display', 'inline-block'); + $form.find('.form-item[rel=username]').css('display', 'inline-block'); + $form.find('.form-item[rel=password]').css('display', 'inline-block'); + + //$('li[input_group="vmware"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=vcenterHost]').hide(); + + //$('li[input_group="baremetal"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=baremetalCpuCores]').hide(); + $form.find('.form-item[rel=baremetalCpu]').hide(); + $form.find('.form-item[rel=baremetalMemory]').hide(); + $form.find('.form-item[rel=baremetalMAC]').hide(); + + //$('li[input_group="Ovm"]', $dialogAddHost).show(); + $form.find('.form-item[rel=agentUsername]').css('display', 'inline-block'); + $form.find('.form-item[rel=agentUsername]').find('input').val("oracle"); + $form.find('.form-item[rel=agentPassword]').css('display', 'inline-block'); + } + else { + //$('li[input_group="general"]', $dialogAddHost).show(); + $form.find('.form-item[rel=hostname]').css('display', 'inline-block'); + $form.find('.form-item[rel=username]').css('display', 'inline-block'); + $form.find('.form-item[rel=password]').css('display', 'inline-block'); + + //$('li[input_group="vmware"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=vcenterHost]').hide(); + + //$('li[input_group="baremetal"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=baremetalCpuCores]').hide(); + $form.find('.form-item[rel=baremetalCpu]').hide(); + $form.find('.form-item[rel=baremetalMemory]').hide(); + $form.find('.form-item[rel=baremetalMAC]').hide(); + + //$('li[input_group="Ovm"]', $dialogAddHost).hide(); + $form.find('.form-item[rel=agentUsername]').hide(); + $form.find('.form-item[rel=agentPassword]').hide(); + } + }); + + args.$select.trigger("change"); + } + }, + //always appear (end) + + //input_group="general" starts here + hostname: { + label: 'Host name', + validation: { required: true }, + isHidden: true + }, + + username: { + label: 'User name', + validation: { required: true }, + isHidden: true + }, + + password: { + label: 'Password', + validation: { required: true }, + isHidden: true, + isPassword: true + }, + //input_group="general" ends here + + //input_group="VMWare" starts here + vcenterHost: { + label: 'ESX/ESXi Host', + validation: { required: true }, + isHidden: true + }, + //input_group="VMWare" ends here + + //input_group="BareMetal" starts here + baremetalCpuCores: { + label: '# of CPU Cores', + validation: { required: true }, + isHidden: true + }, + baremetalCpu: { + label: 'CPU (in MHz)', + validation: { required: true }, + isHidden: true + }, + baremetalMemory: { + label: 'Memory (in MB)', + validation: { required: true }, + isHidden: true + }, + baremetalMAC: { + label: 'Host MAC', + validation: { required: true }, + isHidden: true + }, + //input_group="BareMetal" ends here + + //input_group="OVM" starts here + agentUsername: { + label: 'Agent Username', + validation: { required: false }, + isHidden: true + }, + agentPassword: { + label: 'Agent Password', + validation: { required: true }, + isHidden: true, + isPassword: true + }, + //input_group="OVM" ends here + + //always appear (begin) + hosttags: { + label: 'Host tags', + validation: { required: false } + } + //always appear (end) + } + }, + + action: function(args) { + var array1 = []; + array1.push("&zoneid=" + args.context.zones[0].id); + array1.push("&podid=" + args.data.podId); + array1.push("&clusterid=" + args.data.clusterId); + array1.push("&hypervisor=" + todb(selectedClusterObj.hypervisortype)); + var clustertype = selectedClusterObj.clustertype; + array1.push("&clustertype=" + todb(clustertype)); + array1.push("&hosttags=" + todb(args.data.hosttags)); + + if(selectedClusterObj.hypervisortype == "VMware") { + array1.push("&username="); + array1.push("&password="); + var hostname = args.data.vcenterHost; + var url; + if(hostname.indexOf("http://")==-1) + url = "http://" + hostname; + else + url = hostname; + array1.push("&url=" + todb(url)); + } + else { + array1.push("&username=" + todb(args.data.username)); + array1.push("&password=" + todb(args.data.password)); + + var hostname = args.data.hostname; + + var url; + if(hostname.indexOf("http://")==-1) + url = "http://" + hostname; + else + url = hostname; + array1.push("&url="+todb(url)); + + if (selectedClusterObj.hypervisortype == "BareMetal") { + array1.push("&cpunumber=" + todb(args.data.baremetalCpuCores)); + array1.push("&cpuspeed=" + todb(args.data.baremetalCpu)); + array1.push("&memory=" + todb(args.data.baremetalMemory)); + array1.push("&hostmac=" + todb(args.data.baremetalMAC)); + } + else if(selectedClusterObj.hypervisortype == "Ovm") { + array1.push("&agentusername=" + todb(args.data.agentUsername)); + array1.push("&agentpassword=" + todb(args.data.agentPassword)); + } + } + + $.ajax({ + url: createURL("addHost" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.addhostresponse.host[0]; + args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args){ + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new host'; + } + } + }, + + enableMaintenaceMode: { + label: 'Enable Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("prepareHostForMaintenance&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.preparehostformaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.'; + }, + success: function(args) { + return 'Maintenance is being enabled.'; + }, + notification: function(args) { + return 'Enabling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been enabled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + cancelMaintenaceMode: { + label: 'Cancel Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("cancelHostMaintenance&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.cancelhostmaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to cancel this maintenance.'; + }, + success: function(args) { + return 'Maintenance is being cancelled.'; + }, + notification: function(args) { + return 'Cancelling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been cancelled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + forceReconnect: { + label: 'Force Reconnect' , + action: function(args) { + $.ajax({ + url: createURL("reconnectHost&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.reconnecthostresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to force reconnect this host.'; + }, + success: function(args) { + return 'Host is being force reconnected.'; + }, + notification: function(args) { + return 'Force reconnecting host'; + }, + complete: function(args) { + return 'Host has been force reconnected.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Remove host' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to remove this host.'; + }, + success: function(args) { + return 'Host is being removed.'; + }, + notification: function(args) { + return 'Removing host'; + }, + complete: function(args) { + return 'Host has been removed.'; + } + }, + preFilter: function(args) { + if(isAdmin()) { + args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block'); + } + }, + createForm: { + title: 'Remove host', + fields: { + isForced: { + label: 'Force Remove', + isBoolean: true, + isHidden: true + } + } + }, + action: function(args) { + var array1 = []; + //if(args.$form.find('.form-item[rel=isForced]').css("display") != "none") //uncomment after Brian fix it to include $form in args + array1.push("&forced=" + (args.data.isForced == "on")); + + $.ajax({ + url: createURL("deleteHost&id=" + args.context.hosts[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + //{ "deletehostresponse" : { "success" : "true"} } + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + detailView: { + name: "Host details", + actions: { + edit: { + label: 'Edit', + action: function(args) { + var array1 = []; + array1.push("&hosttags=" + todb(args.data.hosttags)); + + if (args.data.oscategoryid != null) + array1.push("&osCategoryId=" + args.data.oscategoryid); + else //OS is none + array1.push("&osCategoryId=0"); + + $.ajax({ + url: createURL("updateHost&id=" + args.context.hosts[0].id + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.updatehostresponse.host; + args.response.success({ + actionFilter: hostActionfilter, + data:item}); + } + }); + } + }, + + enableMaintenaceMode: { + label: 'Enable Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("prepareHostForMaintenance&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.preparehostformaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.'; + }, + success: function(args) { + return 'Maintenance is being enabled.'; + }, + notification: function(args) { + return 'Enabling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been enabled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + cancelMaintenaceMode: { + label: 'Cancel Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("cancelHostMaintenance&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.cancelhostmaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to cancel this maintenance.'; + }, + success: function(args) { + return 'Maintenance is being cancelled.'; + }, + notification: function(args) { + return 'Cancelling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been cancelled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + forceReconnect: { + label: 'Force Reconnect' , + action: function(args) { + $.ajax({ + url: createURL("reconnectHost&id=" + args.context.hosts[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.reconnecthostresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.host; + }, + getActionFilter: function() { + return hostActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to force reconnect this host.'; + }, + success: function(args) { + return 'Host is being force reconnected.'; + }, + notification: function(args) { + return 'Force reconnecting host'; + }, + complete: function(args) { + return 'Host has been force reconnected.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Remove host' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to remove this host.'; + }, + success: function(args) { + return 'Host is being removed.'; + }, + notification: function(args) { + return 'Removing host'; + }, + complete: function(args) { + return 'Host has been removed.'; + } + }, + preFilter: function(args) { + if(isAdmin()) { + args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block'); + } + }, + createForm: { + title: 'Remove host', + fields: { + isForced: { + label: 'Force Remove', + isBoolean: true, + isHidden: true + } + } + }, + action: function(args) { + var array1 = []; + //if(args.$form.find('.form-item[rel=isForced]').css("display") != "none") //uncomment after Brian fix it to include $form in args + array1.push("&forced=" + (args.data.isForced == "on")); + + $.ajax({ + url: createURL("deleteHost&id=" + args.context.hosts[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + //{ "deletehostresponse" : { "success" : "true"} } + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' }, + }, + { + id: { label: 'ID' }, + state: { label: 'State' }, + type: { label: 'Type' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' }, + clustername: { label: 'Cluster' }, + ipaddress: { label: 'IP Address' }, + version: { label: 'Version' }, + hosttags: { + label: 'Host tags', + isEditable: true + }, + oscategoryid: { + label: 'OS Preference', + isEditable: true, + select: function(args) { + $.ajax({ + url: createURL("listOsCategories"), + dataType: "json", + async: true, + success: function(json) { + var oscategoryObjs = json.listoscategoriesresponse.oscategory; + var items = []; + $(oscategoryObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + disconnected: { label: 'Last disconnected' } + } + ], + + dataProvider: function(args) { + args.response.success({ + actionFilter: hostActionfilter, + data: args.context.hosts[0] + }); + } + + }, + } + } + } + }, + 'primary-storage': { + title: 'Primary Storage', + id: 'primarystorages', + listView: { + section: 'primary-storage', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' } + }, + + //dataProvider: testData.dataProvider.listView('primaryStorage'), + dataProvider: function(args) { + $.ajax({ + url: createURL("listStoragePools&zoneid=" + args.ref.zoneID + "&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.liststoragepoolsresponse.storagepool; + args.response.success({ + actionFilter: primarystorageActionfilter, + data:items + }); + } + }); + }, + + actions: { + add: { + label: 'Add primary storage', + + createForm: { + title: 'Add new primary storage', + desc: 'Please fill in the following information to add a new primary storage', + fields: { + //always appear (begin) + podId: { + label: 'Pod', + validation: { required: true }, + select: function(args) { + $.ajax({ + url: createURL("listPods&zoneid=" + args.context.zones[0].id), + dataType: "json", + async: true, + success: function(json) { + var pods = json.listpodsresponse.pod; + var items = []; + $(pods).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + + clusterId: { + label: 'Cluster', + validation: { required: true }, + dependsOn: 'podId', + select: function(args) { + $.ajax({ + url: createURL("listClusters&podid=" + args.podId), + dataType: "json", + async: false, + success: function(json) { + clusterObjs = json.listclustersresponse.cluster; + var items = []; + $(clusterObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({ + actionFilter: clusterActionfilter, + data: items + }); + } + }); + } + }, + + name: { + label: 'Name', + validation: { required: true } + }, + + protocol: { + label: 'Protocol', + validation: { required: true }, + dependsOn: 'clusterId', + select: function(args) { + var clusterId = args.clusterId; + if(clusterId == null) + return; + var items = []; + $(clusterObjs).each(function(){ + if(this.id == clusterId){ + selectedClusterObj = this; + return false; //break the $.each() loop + } + }); + if(selectedClusterObj == null) + return; + + if(selectedClusterObj.hypervisortype == "KVM") { + var items = []; + items.push({id: "nfs", description: "nfs"}); + items.push({id: "SharedMountPoint", description: "SharedMountPoint"}); + args.response.success({data: items}); + } + else if(selectedClusterObj.hypervisortype == "XenServer") { + var items = []; + items.push({id: "nfs", description: "nfs"}); + items.push({id: "PreSetup", description: "PreSetup"}); + items.push({id: "iscsi", description: "iscsi"}); + args.response.success({data: items}); + } + else if(selectedClusterObj.hypervisortype == "VMware") { + var items = []; + items.push({id: "nfs", description: "nfs"}); + items.push({id: "vmfs", description: "vmfs"}); + args.response.success({data: items}); + } + else if(selectedClusterObj.hypervisortype == "Ovm") { + var items = []; + items.push({id: "nfs", description: "nfs"}); + items.push({id: "ocfs2", description: "ocfs2"}); + args.response.success({data: items}); + } + else { + args.response.success({data:[]}); + } + + args.$select.change(function() { + var $form = $(this).closest('form'); + + var protocol = $(this).val(); + if(protocol == null) + return; + + if(protocol == "nfs") { + //$("#add_pool_server_container", $dialogAddPool).show(); + $form.find('.form-item[rel=server]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_nfs_server").val(""); + $form.find('.form-item[rel=server]').find(".value").find("input").val(""); + + //$('li[input_group="nfs"]', $dialogAddPool).show(); + $form.find('.form-item[rel=path]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.path"]+":"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + else if(protocol == "ocfs2") {//ocfs2 is the same as nfs, except no server field. + //$dialogAddPool.find("#add_pool_server_container").hide(); + $form.find('.form-item[rel=server]').hide(); + //$dialogAddPool.find("#add_pool_nfs_server").val(""); + $form.find('.form-item[rel=server]').find(".value").find("input").val(""); + + //$('li[input_group="nfs"]', $dialogAddPool).show(); + $form.find('.form-item[rel=path]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.path"]+":"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + else if(protocol == "PreSetup") { + //$dialogAddPool.find("#add_pool_server_container").hide(); + $form.find('.form-item[rel=server]').hide(); + //$dialogAddPool.find("#add_pool_nfs_server").val("localhost"); + $form.find('.form-item[rel=server]').find(".value").find("input").val("localhost"); + + //$('li[input_group="nfs"]', $dialogAddPool).show(); + $form.find('.form-item[rel=path]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_path_container").find("label").text(g_dictionary["label.SR.name"]+":"); + $form.find('.form-item[rel=path]').find(".name").find("label").text("SR Name-Label:"); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + else if(protocol == "iscsi") { + //$dialogAddPool.find("#add_pool_server_container").show(); + $form.find('.form-item[rel=server]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_nfs_server").val(""); + $form.find('.form-item[rel=server]').find(".value").find("input").val(""); + + //$('li[input_group="nfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=path]').hide(); + + //$('li[input_group="iscsi"]', $dialogAddPool).show(); + $form.find('.form-item[rel=iqn]').css('display', 'inline-block'); + $form.find('.form-item[rel=lun]').css('display', 'inline-block'); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + else if(protocol == "vmfs") { + //$dialogAddPool.find("#add_pool_server_container").show(); + $form.find('.form-item[rel=server]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_nfs_server").val(""); + $form.find('.form-item[rel=server]').find(".value").find("input").val(""); + + //$('li[input_group="nfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=path]').hide(); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).show(); + $form.find('.form-item[rel=vCenterDataCenter]').css('display', 'inline-block'); + $form.find('.form-item[rel=vCenterDataStore]').css('display', 'inline-block'); + } + else if(protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does. + //$dialogAddPool.find("#add_pool_server_container").hide(); + $form.find('.form-item[rel=server]').hide(); + //$dialogAddPool.find("#add_pool_nfs_server").val("localhost"); + $form.find('.form-item[rel=server]').find(".value").find("input").val("localhost"); + + //$('li[input_group="nfs"]', $dialogAddPool).show(); + $form.find('.form-item[rel=path]').css('display', 'inline-block'); + $form.find('.form-item[rel=path]').find(".name").find("label").text("Path:"); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + else { + //$dialogAddPool.find("#add_pool_server_container").show(); + $form.find('.form-item[rel=server]').css('display', 'inline-block'); + //$dialogAddPool.find("#add_pool_nfs_server").val(""); + $form.find('.form-item[rel=server]').find(".value").find("input").val(""); + + //$('li[input_group="iscsi"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=iqn]').hide(); + $form.find('.form-item[rel=lun]').hide(); + + //$('li[input_group="vmfs"]', $dialogAddPool).hide(); + $form.find('.form-item[rel=vCenterDataCenter]').hide(); + $form.find('.form-item[rel=vCenterDataStore]').hide(); + } + }); + + args.$select.trigger("change"); + } + }, + //always appear (end) + + server: { + label: 'Server', + validation: { required: true }, + isHidden: true + }, + + //nfs + path: { + label: 'Path', + validation: { required: true }, + isHidden: true + }, + + //iscsi + iqn: { + label: 'Target IQN', + validation: { required: true }, + isHidden: true + }, + lun: { + label: 'LUN #', + validation: { required: true }, + isHidden: true + }, + + //vmfs + vCenterDataCenter: { + label: 'vCenter Datacenter', + validation: { required: true }, + isHidden: true + }, + vCenterDataStore: { + label: 'vCenter Datastore', + validation: { required: true }, + isHidden: true + }, + + //always appear (begin) + storageTags: { + label: 'Storage Tags', + validation: { required: false } + } + //always appear (end) + } + }, + + action: function(args) { + var array1 = []; + array1.push("&zoneid=" + args.context.zones[0].id); + array1.push("&podId=" + args.data.podId); + array1.push("&clusterid=" + args.data.clusterId); + array1.push("&name=" + todb(args.data.name)); + + var server = args.data.server; + var url = null; + if (args.data.protocol == "nfs") { + //var path = trim($thisDialog.find("#add_pool_path").val()); + var path = args.data.path; + + if(path.substring(0,1) != "/") + path = "/" + path; + url = nfsURL(server, path); + } + else if (args.data.protocol == "PreSetup") { + //var path = trim($thisDialog.find("#add_pool_path").val()); + var path = args.data.path; + + if(path.substring(0,1) != "/") + path = "/" + path; + url = presetupURL(server, path); + } + else if (args.data.protocol == "ocfs2") { + //var path = trim($thisDialog.find("#add_pool_path").val()); + var path = args.data.path; + + if(path.substring(0,1) != "/") + path = "/" + path; + url = ocfs2URL(server, path); + } + else if (args.data.protocol == "SharedMountPoint") { + //var path = trim($thisDialog.find("#add_pool_path").val()); + var path = args.data.path; + + if(path.substring(0,1) != "/") + path = "/" + path; + url = SharedMountPointURL(server, path); + } + else if (args.data.protocol == "vmfs") { + //var path = trim($thisDialog.find("#add_pool_vmfs_dc").val()); + var path = args.data.vCenterDataCenter; + + if(path.substring(0,1) != "/") + path = "/" + path; + path += "/" + args.data.vCenterDataStore; + url = vmfsURL("dummy", path); + } + else { + //var iqn = trim($thisDialog.find("#add_pool_iqn").val()); + var iqn = args.data.iqn; + + if(iqn.substring(0,1) != "/") + iqn = "/" + iqn; + var lun = args.data.lun; + url = iscsiURL(server, iqn, lun); + } + array1.push("&url=" + todb(url)); + + if(args.data.storageTags != null && args.data.storageTags.length > 0) + array1.push("&tags=" + todb(args.data.storageTags)); + + $.ajax({ + url: createURL("createStoragePool" + array1.join("")), + dataType: "json", + success: function(json) { + var item = json.createstoragepoolresponse.storagepool[0]; + args.response.success({data: item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args){ + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new primary storage'; + } + } + }, + + enableMaintenaceMode: { + label: 'Enable Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("enableStorageMaintenance&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.prepareprimarystorageformaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.storagepool; + }, + getActionFilter: function() { + return primarystorageActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Warning: placing the primary storage into maintenance mode will cause all VMs using volumes from it to be stopped. Do you want to continue?'; + }, + success: function(args) { + return 'Maintenance is being enabled.'; + }, + notification: function(args) { + return 'Enabling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been enabled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + cancelMaintenaceMode: { + label: 'Cancel Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("cancelStorageMaintenance&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.cancelprimarystoragemaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.storagepool; + }, + getActionFilter: function() { + return primarystorageActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to cancel this maintenance.'; + }, + success: function(args) { + return 'Maintenance is being cancelled.'; + }, + notification: function(args) { + return 'Cancelling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been cancelled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this primary storage.'; + }, + success: function(args) { + return 'Primary storage is being deleted.'; + }, + notification: function(args) { + return 'Deleting primary storage'; + }, + complete: function(args) { + return 'Primary storage has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteStoragePool&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + + detailView: { + name: "Primary storage details", + actions: { + enableMaintenaceMode: { + label: 'Enable Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("enableStorageMaintenance&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.prepareprimarystorageformaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.storagepool; + }, + getActionFilter: function() { + return primarystorageActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Warning: placing the primary storage into maintenance mode will cause all VMs using volumes from it to be stopped. Do you want to continue?'; + }, + success: function(args) { + return 'Maintenance is being enabled.'; + }, + notification: function(args) { + return 'Enabling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been enabled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + cancelMaintenaceMode: { + label: 'Cancel Maintenace' , + action: function(args) { + $.ajax({ + url: createURL("cancelStorageMaintenance&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + var jid = json.cancelprimarystoragemaintenanceresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.storagepool; + }, + getActionFilter: function() { + return primarystorageActionfilter; + } + } + } + ); + } + }); + }, + messages: { + confirm: function(args) { + return 'Please confirm that you want to cancel this maintenance.'; + }, + success: function(args) { + return 'Maintenance is being cancelled.'; + }, + notification: function(args) { + return 'Cancelling maintenance'; + }, + complete: function(args) { + return 'Maintenance has been cancelled.'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this primary storage.'; + }, + success: function(args) { + return 'Primary storage is being deleted.'; + }, + notification: function(args) { + return 'Deleting primary storage'; + }, + complete: function(args) { + return 'Primary storage has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteStoragePool&id=" + args.context.primarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' }, + }, + { + id: { label: 'ID' }, + state: { label: 'State' }, + zonename: { label: 'Zone' }, + podname: { label: 'Pod' }, + clustername: { label: 'Cluster' }, + type: { label: 'Type' }, + ipaddress: { label: 'IP Address' }, + path: { label: 'Path' }, + disksizetotal: { + label: 'Disk total', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + disksizeallocated: { + label: 'Disk Allocated', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + tags: { label: 'Primary tags' } + } + ], + + //dataProvider: testData.dataProvider.detailView('primaryStorage') + dataProvider: function(args) { + args.response.success({ + actionFilter: primarystorageActionfilter, + data: args.context.primarystorages[0] + }); + } + + } + } + } + } + }, + + 'secondary-storage': { + title: 'Secondary Storage', + id: 'secondarystorages', + listView: { + section: 'seconary-storage', + fields: { + name: { label: 'Name' }, + zonename: { label: 'Zone' } + }, + + //dataProvider: testData.dataProvider.listView('clusters'), + dataProvider: function(args) { + $.ajax({ + url: createURL("listHosts&type=SecondaryStorage&zoneid=" + args.ref.zoneID + "&page=" + args.page + "&pagesize=" + pageSize), + dataType: "json", + async: true, + success: function(json) { + var items = json.listhostsresponse.host; + args.response.success({ + actionFilter: secondarystorageActionfilter, + data:items + }); + } + }); + }, + + actions: { + add: { + label: 'Add secondary storage', + + createForm: { + title: 'Add new secondary storage', + desc: 'Please fill in the following information to add a new secondary storage', + fields: { + nfsServer: { + label: 'NFS Server', + validation: { required: true } + }, + path: { + label: 'Path', + validation: { required: true } + } + } + }, + + action: function(args) { + var zoneId = args.context.zones[0].id; + var nfs_server = args.data.nfsServer; + var path = args.data.path; + var url = nfsURL(nfs_server, path); + + $.ajax({ + url: createURL("addSecondaryStorage&zoneId=" + zoneId + "&url=" + todb(url)), + dataType: "json", + success: function(json) { + var item = json.addsecondarystorageresponse.secondarystorage; + args.response.success({data:item}); + }, + error: function(XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + args.response.error(errorMsg); + } + }); + }, + + notification: { + poll: function(args) { + args.complete(); + } + }, + + messages: { + notification: function(args) { + return 'Added new secondary storage'; + } + } + }, + + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this secondary storage.'; + }, + success: function(args) { + return 'Secondary storage is being deleted.'; + }, + notification: function(args) { + return 'Deleting secondary storage'; + }, + complete: function(args) { + return 'Secondary storage has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteHost&id=" + args.context.secondarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + + detailView: { + name: 'Secondary storage details', + actions: { + 'delete': { + label: 'Delete' , + messages: { + confirm: function(args) { + return 'Please confirm that you want to delete this secondary storage.'; + }, + success: function(args) { + return 'Secondary storage is being deleted.'; + }, + notification: function(args) { + return 'Deleting secondary storage'; + }, + complete: function(args) { + return 'Secondary storage has been deleted.'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteHost&id=" + args.context.secondarystorages[0].id), + dataType: "json", + async: true, + success: function(json) { + args.response.success({data:{}}); + } + }); + }, + notification: { + poll: function(args) { args.complete(); } + } + } + + }, + tabs: { + details: { + title: 'Details', + fields: [ + { + name: { label: 'Name' }, + }, + { + id: { label: 'ID' }, + zonename: { label: 'Zone' }, + type: { label: 'Type' }, + ipaddress: { label: 'IP Address' } + } + ], + + //dataProvider: testData.dataProvider.detailView('secondaryStorage') + dataProvider: function(args) { + args.response.success({ + actionFilter: secondarystorageActionfilter, + data: args.context.secondarystorages[0] + }); + } + } + } + } + } + } + } + }; + + function nfsURL(server, path) { + var url; + if(server.indexOf("://")==-1) + url = "nfs://" + server + path; + else + url = server + path; + return url; + } + + function presetupURL(server, path) { + var url; + if(server.indexOf("://")==-1) + url = "presetup://" + server + path; + else + url = server + path; + return url; + } + + function ocfs2URL(server, path) { + var url; + if(server.indexOf("://")==-1) + url = "ocfs2://" + server + path; + else + url = server + path; + return url; + } + + function SharedMountPointURL(server, path) { + var url; + if(server.indexOf("://")==-1) + url = "SharedMountPoint://" + server + path; + else + url = server + path; + return url; + } + + function vmfsURL(server, path) { + var url; + if(server.indexOf("://")==-1) + url = "vmfs://" + server + path; + else + url = server + path; + return url; + } + + function iscsiURL(server, iqn, lun) { + var url; + if(server.indexOf("://")==-1) + url = "iscsi://" + server + iqn + "/" + lun; + else + url = server + iqn + "/" + lun; + return url; + } + + //action filters (begin) + var zoneActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + allowedActions.push("edit"); + if(jsonObj.allocationstate == "Disabled") + allowedActions.push("enable"); + else if(jsonObj.allocationstate == "Enabled") + allowedActions.push("disable"); + allowedActions.push("delete"); + return allowedActions; + } + + var podActionfilter = function(args) { + var podObj = args.context.item; + var allowedActions = []; + allowedActions.push("edit"); + if(podObj.allocationstate == "Disabled") + allowedActions.push("enable"); + else if(podObj.allocationstate == "Enabled") + allowedActions.push("disable"); + allowedActions.push("delete"); + + var selectedZoneObj; + $(zoneObjs).each(function(){ + if(this.id == podObj.zoneid) { + selectedZoneObj = this; + return false; //break the $.each() loop + } + }); + + if(selectedZoneObj.networktype == "Basic") { //basic-mode network (pod-wide VLAN) + //$("#tab_ipallocation, #add_iprange_button, #tab_network_device, #add_network_device_button").show(); + allowedActions.push("addIpRange"); + allowedActions.push("addNetworkDevice"); + } + else if(selectedZoneObj.networktype == "Advanced") { //advanced-mode network (zone-wide VLAN) + //$("#tab_ipallocation, #add_iprange_button, #tab_network_device, #add_network_device_button").hide(); + } + + return allowedActions; + } + + var networkDeviceActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + return allowedActions; + } + + var clusterActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if(jsonObj.allocationstate == "Disabled") + allowedActions.push("enable"); + else if(jsonObj.allocationstate == "Enabled") + allowedActions.push("disable"); + + if(jsonObj.managedstate == "Managed") + allowedActions.push("unmanage"); + else //PrepareUnmanaged , PrepareUnmanagedError, Unmanaged + allowedActions.push("manage"); + + allowedActions.push("delete"); + + return allowedActions; + } + + var hostActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if (jsonObj.state == 'Up' || jsonObj.state == "Connecting") { + allowedActions.push("edit"); + allowedActions.push("enableMaintenaceMode"); + allowedActions.push("forceReconnect"); + } + else if(jsonObj.state == 'Down') { + allowedActions.push("edit"); + allowedActions.push("enableMaintenaceMode"); + allowedActions.push("delete"); + } + else if(jsonObj.state == "Alert") { + allowedActions.push("edit"); + allowedActions.push("delete"); + } + else if (jsonObj.state == "ErrorInMaintenance") { + allowedActions.push("edit"); + allowedActions.push("enableMaintenaceMode"); + allowedActions.push("cancelMaintenaceMode"); + } + else if (jsonObj.state == "PrepareForMaintenance") { + allowedActions.push("edit"); + allowedActions.push("cancelMaintenaceMode"); + } + else if (jsonObj.state == "Maintenance") { + allowedActions.push("edit"); + allowedActions.push("cancelMaintenaceMode"); + allowedActions.push("delete"); + } + else if (jsonObj.state == "Disconnected"){ + allowedActions.push("edit"); + allowedActions.push("delete"); + } + return allowedActions; + } + + var primarystorageActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if (jsonObj.state == 'Up' || jsonObj.state == "Connecting") { + allowedActions.push("enableMaintenaceMode"); + } + else if(jsonObj.state == 'Down') { + allowedActions.push("enableMaintenaceMode"); + allowedActions.push("delete"); + } + else if(jsonObj.state == "Alert") { + allowedActions.push("delete"); + } + else if (jsonObj.state == "ErrorInMaintenance") { + allowedActions.push("enableMaintenaceMode"); + allowedActions.push("cancelMaintenaceMode"); + } + else if (jsonObj.state == "PrepareForMaintenance") { + allowedActions.push("cancelMaintenaceMode"); + } + else if (jsonObj.state == "Maintenance") { + allowedActions.push("cancelMaintenaceMode"); + allowedActions.push("delete"); + } + else if (jsonObj.state == "Disconnected"){ + allowedActions.push("delete"); + } + return allowedActions; + } + + var secondarystorageActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + allowedActions.push("delete"); + return allowedActions; + } + + var publicNetworkActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + allowedActions.push("addIpRange"); + return allowedActions; + } + + var directNetworkActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + allowedActions.push("addIpRange"); + allowedActions.push("edit"); + allowedActions.push("delete"); + return allowedActions; + } + + var routerActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if (jsonObj.state == 'Running') { + allowedActions.push("stop"); + allowedActions.push("restart"); + allowedActions.push("changeService"); + if (isAdmin()) + allowedActions.push("migrate"); + } + else if (jsonObj.state == 'Stopped') { + allowedActions.push("start"); + allowedActions.push("changeService"); + } + return allowedActions; + } + + var systemvmActionfilter = function(args) { + var jsonObj = args.context.item; + var allowedActions = []; + + if (jsonObj.state == 'Running') { + allowedActions.push("stop"); + allowedActions.push("restart"); + allowedActions.push("delete"); //destroy + if (isAdmin()) + allowedActions.push("migrate"); + } + else if (jsonObj.state == 'Stopped') { + allowedActions.push("start"); + allowedActions.push("delete"); //destroy + } + else if (jsonObj.state == 'Error') { + allowedActions.push("delete"); //destroy + } + return allowedActions; + } + //action filters (end) + +})($, cloudStack, testData); diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js new file mode 100644 index 00000000000..49e162371a7 --- /dev/null +++ b/ui/scripts/templates.js @@ -0,0 +1,1431 @@ +(function(cloudStack, testData) { + + cloudStack.sections.templates = { + title: 'Templates', + id: 'templates', + sectionSelect: { + label: 'Select view' + }, + sections: { + templates: { + type: 'select', + title: 'Templates', + listView: { + id: 'templates', + label: 'Templates', + fields: { + name: { label: 'Name' }, + id: { label: 'ID' }, + zonename: { label: 'Zone' }, + hypervisor: { label: 'Hypervisor' } + }, + actions: { + add: { + label: 'Create template', + + messages: { + confirm: function(args) { + return 'Are you sure you want to create a template?'; + }, + success: function(args) { + return 'Your new template is being created.'; + }, + notification: function(args) { + return 'Creating new template'; + }, + complete: function(args) { + return 'Template has been created successfully!'; + } + }, + + createForm: { + title: 'Create template', + desc: 'Please fill in the following data to create a new template.', + preFilter: cloudStack.preFilter.createTemplate, + fields: { + name: { + label: 'Name', + validation: { required: true } + }, + description: { + label: 'Description', + validation: { required: true } + }, + url: { + label: 'URL', + validation: { required: true } + }, + zone: { + label: 'Zone', + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = json.listzonesresponse.zone; + var items = []; + if (isAdmin()) + items.push({id: -1, description: "All Zones"}); + $(zoneObjs).each(function() { + items.push({id: this.id, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + hypervisor: { + label: 'Hypervisor', + dependsOn: 'zone', + select: function(args) { + if(args.zone == null) + return; + + var apiCmd; + if(args.zone == -1) + apiCmd = "listHypervisors&zoneid=-1"; + else + apiCmd = "listHypervisors&zoneid=" + args.zone; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + async: false, + success: function(json) { + var hypervisorObjs = json.listhypervisorsresponse.hypervisor; + var items = []; + $(hypervisorObjs).each(function(){ + items.push({id: this.name, description: this.name}); + }); + args.response.success({data: items}); + } + }); + } + }, + format: { + label: 'Format', + dependsOn: 'hypervisor', + select: function(args) { + var items = []; + if(args.hypervisor == "XenServer") { + //formatSelect.append(""); + items.push({id:'VHD', description: 'VHD'}); + } + else if(args.hypervisor == "VMware") { + //formatSelect.append(""); + items.push({id:'OVA', description: 'OVA'}); + } + else if(args.hypervisor == "KVM") { + //formatSelect.append(""); + items.push({id:'QCOW2', description: 'QCOW2'}); + } + else if(args.hypervisor == "BareMetal") { + //formatSelect.append(""); + items.push({id:'BareMetal', description: 'BareMetal'}); + } + else if(args.hypervisor == "Ovm") { + //formatSelect.append(""); + items.push({id:'RAW', description: 'RAW'}); + } + args.response.success({data: items}); + } + }, + + osTypeId: { + label: 'OS Type', + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var items = json.listostypesresponse.ostype; + args.response.success({data: items}); + } + }); + } + }, + + isExtractable: { + label: "Extractable", + isBoolean: true + }, + + isPasswordEnabled: { + label: "Password Enabled", + isBoolean: true + }, + + isPublic: { + label: "Public", + isBoolean: true, + isHidden: true + }, + + isFeatured: { + label: "Featured", + isBoolean: true, + isHidden: true + } + } + }, + + action: function(args) { + var array1 = []; + array1.push("&name=" + todb(args.data.name)); + array1.push("&displayText=" + todb(args.data.description)); + array1.push("&url=" + todb(args.data.url)); + array1.push("&zoneid=" + args.data.zone); + array1.push("&format=" + args.data.format); + array1.push("&isextractable=" + (args.data.isExtractable=="on")); + array1.push("&passwordEnabled=" + (args.data.isPasswordEnabled=="on")); + array1.push("&osTypeId=" + args.data.osTypeId); + array1.push("&hypervisor=" + args.data.hypervisor); + + if(args.$form.find('.form-item[rel=isPublic]').css("display") != "none") + array1.push("&ispublic=" + (args.data.isPublic == "on")); + if(args.$form.find('.form-item[rel=isFeatured]').css("display") != "none") + array1.push("&isfeatured=" + (args.data.isFeatured == "on")); + + $.ajax({ + url: createURL("registerTemplate" + array1.join("")), + dataType: "json", + success: function(json) { + var items = json.registertemplateresponse.template; //items might have more than one array element if it's create templates for all zones. + args.response.success({data:items[0]}); + /* + if(items.length > 1) { + for(var i=1; i 1) { + for(var i=1; i').listView(instances); + + // Change action label + $listView.find('th.actions').html('Select'); + + return $listView; + }; + + var $dataList = vmList({ + listView: listView + }).dialog({ + dialogClass: 'multi-edit-add-list panel', + width: 825, + title: 'Select VM for Static NAT', + buttons: [ + { + text: 'Done', + 'class': 'ok', + click: function() { + var complete = args.complete; + + $dataList.fadeOut(function() { + action({ + context: $.extend(true, {}, context, { + instances: [ + $dataList.find('tr.multi-edit-selected').data('json-obj') + ] + }), + response: { + success: function(args) { + complete({ + $item: $instanceRow + }); + } + } + }); + $dataList.remove(); + }); + + $('div.overlay').fadeOut(function() { + $('div.overlay').remove(); + }); + } + }, + { + text: 'Cancel', + 'class': 'cancel', + click: function() { + $dataList.fadeOut(function() { + $dataList.remove(); + }); + $('div.overlay').fadeOut(function() { + $('div.overlay').remove(); + }); + } + } + ] + }).parent('.ui-dialog').overlay(); + }; + }; +}(cloudStack, jQuery)); \ No newline at end of file diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js new file mode 100644 index 00000000000..16018624396 --- /dev/null +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -0,0 +1,584 @@ +(function($, cloudStack) { + /** + * Instance wizard + */ + cloudStack.instanceWizard = function(args) { + return function(listViewArgs) { + var instanceWizard = function(data) { + var $wizard = $('#template').find('div.instance-wizard').clone(); + var $progress = $wizard.find('div.progress ul li'); + var $steps = $wizard.find('div.steps').children().hide(); + var $diagramParts = $wizard.find('div.diagram').children().hide(); + var $form = $wizard.find('form'); + + $form.validate(); + + // Close instance wizard + var close = function() { + $wizard.dialog('destroy'); + $('div.overlay').fadeOut(function() { $('div.overlay').remove(); }); + }; + + // Save instance and close wizard + var completeAction = function() { + var data = cloudStack.serializeForm($form); + + args.action({ + // Populate data + data: data, + response: { + success: function(args) { + var $loading = $('.list-view').listView('prependItem', { + data: [ + { + name: data.displayname ? data.displayname : 'New VM', + zonename: $wizard.find('select[name=zoneid] option').filter(function() { + return $(this).val() == data.zoneid; + }).html(), + state: 'Creating' + } + ], + actionFilter: function(args) { return []; } + }); + + listViewArgs.complete({ + _custom: args._custom, + messageArgs: cloudStack.serializeForm($form), + $item: $loading + }); + + close(); + }, + error: function(args) { + $wizard.remove(); + $('div.overlay').remove(); + + if (args.message) { + cloudStack.dialog.notice({ message: args.message }); + } + } + } + }); + }; + + var makeSelects = function(name, data, fields, options) { + var $selects = $('
      '); + options = options ? options : {}; + + $(data).each(function() { + var $select = $('
      ').addClass('select') + .append( + $('') + .attr({ + type: (function(type) { + return type ? type : 'radio'; + })(options ? options.type : null), + name: name, + value: this[fields.id], + 'wizard-field': options['wizard-field'] + }) + ) + .append( + $('
      ').addClass('select-desc') + .append($('
      ').addClass('name').html(this[fields.name])) + .append($('
      ').addClass('desc').html(this[fields.desc])) + ); + + $selects.append($select); + }); + + cloudStack.evenOdd($selects, 'div.select', { + even: function($elem) { + $elem.addClass('even'); + }, + odd: function($elem) { + $elem.addClass('odd'); + } + }); + + return $selects.children(); + }; + + var dataProvider = function(step, providerArgs, callback) { + // Call appropriate data provider + args.steps[step - 1]($.extend(providerArgs, { + currentData: cloudStack.serializeForm($form) + })); + }; + + var dataGenerators = { + setup: function($step, formData) { + var originalValues = function(formData) { + $step.find('select').val( + formData.zoneid + ); + + $step.find('input[type=radio]').filter(function() { + return $(this).val() == formData['select-template']; + }).click(); + }; + + return { + response: { + success: function(args) { + // Zones + $(args.data.zones).each(function() { + $step.find('.select-zone select').append( + $('