diff --git a/api-sandbox/app/indent_json.svg b/api-sandbox/app/indent_json.svg new file mode 100644 index 0000000..07b73a1 --- /dev/null +++ b/api-sandbox/app/indent_json.svg @@ -0,0 +1,9 @@ + + + json + + Layer 1 + {+} + + + \ No newline at end of file diff --git a/api-sandbox/app/index.html b/api-sandbox/app/index.html index 06f8c85..ae93ee8 100644 --- a/api-sandbox/app/index.html +++ b/api-sandbox/app/index.html @@ -21,99 +21,137 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + - + + + + + + + + + + + +
-
SCΛLΞCUBΞ
+ +
+ +
+ SCΛLΞ + CUBΞ +
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
-
- - -
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
- +
+
+ +
+
+ +
+
-
- +
+
+ +
+
+
+
-
+
- -
-
-
-
+
+
+
+
+
1
+
ORGANIZATIONS
+
MEMBERS
+
TOTAL
+
-
-
- diff --git a/api-sandbox/components/Utils.js b/api-sandbox/components/Utils.js index fb40a9c..1a0280d 100644 --- a/api-sandbox/components/Utils.js +++ b/api-sandbox/components/Utils.js @@ -32,4 +32,4 @@ function getJSON(url, callback) { } }; xhr.send(); -}; \ No newline at end of file +}; diff --git a/api-sandbox/components/account/account.css b/api-sandbox/components/account/account.css new file mode 100644 index 0000000..74f7b8d --- /dev/null +++ b/api-sandbox/components/account/account.css @@ -0,0 +1,61 @@ + +.mini-photo-wrapper { + display: block; +} + +.mini-photo { + border-radius: 50%; +} +.account-user-menu-wrap { + position: relative; + overflow: visible; + background: #2C2C2C; +} + +.account-menu-container { + opacity: 0; + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + background-color: #2C2C2C; +} +.account-menu-container.active { + overflow: visible; + visibility: visible; + opacity: 1; + transition: all 0.3s ease-in-out; +} + +.account-user-menu { + position: absolute; + right: -22px; + color: #fff; + background-color: #2C2C2C; + width: 240px; + border-radius: 4px; + border: 1px solid rgba(0, 0, 0, 0.15); + padding-top: 5px; + padding-bottom: 5px; + margin-top: 10px; +} +.account-user-menu .account-user-menu-link { + display: block; + text-decoration: none; + background-color: #2C2C2C; + color: #fff; + font-size: 14px; + padding: 5px 10px; +} +.account-user-menu .account-user-menu-link:hover { + background-color: #4183c4; + color: #fff; +} + +.account-user-menu:after { + position: absolute; + top: -22px; + right: -3px; + display: inline-block; + content: ""; + border: 14px solid transparent; + border-bottom-color: #2C2C2C; +} diff --git a/api-sandbox/components/account/account.html b/api-sandbox/components/account/account.html new file mode 100644 index 0000000..4e8e59c --- /dev/null +++ b/api-sandbox/components/account/account.html @@ -0,0 +1,31 @@ + + + + + Title + + + + + + + + + \ No newline at end of file diff --git a/api-sandbox/components/account/account.js b/api-sandbox/components/account/account.js new file mode 100644 index 0000000..98d38ec --- /dev/null +++ b/api-sandbox/components/account/account.js @@ -0,0 +1,44 @@ + +var account; +function accountEventPublish(id){ + account.callbacks.forEach((call) => call(id)); +} + +class Account { + + constructor(containerId, profile, logout) { + this.profile = profile; + this.callbacks = new Array(); + appendHtmlElement(containerId, this.view(profile.picture, profile.name)); + + document.querySelector('.mini-photo-wrapper').addEventListener('click', function() { + document.querySelector('.account-menu-container').classList.toggle('active'); + }); + + this.logoutBtn = document.getElementById('qsLogoutBtn'); + this.logoutBtn.addEventListener('click', logout); + + account = this; + + } + + listen(callback) { + this.callbacks.push(callback); + } + + + view(img , name) { + return "" + } +} \ No newline at end of file diff --git a/api-sandbox/components/auth/assets/loading.svg b/api-sandbox/components/auth/assets/loading.svg new file mode 100644 index 0000000..74311d8 --- /dev/null +++ b/api-sandbox/components/auth/assets/loading.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/api-sandbox/components/auth/auth0-variables.js b/api-sandbox/components/auth/auth0-variables.js new file mode 100644 index 0000000..d130b71 --- /dev/null +++ b/api-sandbox/components/auth/auth0-variables.js @@ -0,0 +1,4 @@ +var AUTH0_CLIENT_ID='BkdC1Jkv8gTX_iJL9CCvtpshOXeDpFPG'; +var AUTH0_DOMAIN='scalecube-admin.eu.auth0.com'; +var AUTH0_CALLBACK_URL=location.href; + diff --git a/api-sandbox/components/auth/login.css b/api-sandbox/components/auth/login.css new file mode 100644 index 0000000..6d33d73 --- /dev/null +++ b/api-sandbox/components/auth/login.css @@ -0,0 +1,61 @@ +.myButton { + -moz-box-shadow: 0px 1px 0px 0px #f0f7fa; + -webkit-box-shadow: 0px 1px 0px 0px #f0f7fa; + box-shadow: 0px 1px 0px 0px #f0f7fa; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2)); + background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%); + background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%); + background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%); + background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%); + background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#33bdef', endColorstr='#019ad2',GradientType=0); + background-color:#33bdef; + -moz-border-radius:6px; + -webkit-border-radius:6px; + border-radius:6px; + border:1px solid #057fd0; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:Arial; + font-size:13px; + font-weight:bold; + padding:6px 24px; + text-decoration:none; + text-shadow:0px -1px 0px #5b6178; +} +.myButton:hover { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #019ad2), color-stop(1, #33bdef)); + background:-moz-linear-gradient(top, #019ad2 5%, #33bdef 100%); + background:-webkit-linear-gradient(top, #019ad2 5%, #33bdef 100%); + background:-o-linear-gradient(top, #019ad2 5%, #33bdef 100%); + background:-ms-linear-gradient(top, #019ad2 5%, #33bdef 100%); + background:linear-gradient(to bottom, #019ad2 5%, #33bdef 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#019ad2', endColorstr='#33bdef',GradientType=0); + background-color:#019ad2; +} +.myButton:active { + position:relative; + top:1px; +} + +.btn-margin { + margin-top: 7px +} + +#login-view { + display: none; +} + +#loading { + position: absolute; + display: flex; + justify-content: center; + height: 100vh; + width: 100vw; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #fff; +} \ No newline at end of file diff --git a/api-sandbox/components/auth/login.html b/api-sandbox/components/auth/login.html new file mode 100644 index 0000000..3cc2dae --- /dev/null +++ b/api-sandbox/components/auth/login.html @@ -0,0 +1,23 @@ + + + + + + + + + + + +
hello + Loading spinner +
+ + + + + + diff --git a/api-sandbox/components/auth/login.js b/api-sandbox/components/auth/login.js new file mode 100644 index 0000000..68f5861 --- /dev/null +++ b/api-sandbox/components/auth/login.js @@ -0,0 +1,157 @@ +function displayButtons() { + let loginBtn = document.getElementById('qsLoginBtn'); + let logoutBtn = document.getElementById('qsLogoutBtn'); + + if (isAuthenticated()) { + loginBtn.style.display = 'none'; + if(logoutBtn) { + logoutBtn.style.display = 'inline-block'; + } + } else { + loginBtn.style.display = 'inline-block'; + if(logoutBtn) { + logoutBtn.style.display = 'none'; + } + } +} + +function isAuthenticated() { + // Check whether the current time is past the + // access token's expiry time + let expiresAt = localStorage.getItem('expiresAt'); + return localStorage.getItem('isLoggedIn') === 'true' && new Date().getTime() < ( parseInt(expiresAt) || 0 ); +} +function token() { + return localStorage.getItem('idToken'); +} +function accessToken() { + return localStorage.getItem('accessToken'); +} + +class Login { + + constructor(elementId) { + this.listeners = new Array(); + let html = "
" + + "" + + "
" + + appendHtmlElement(elementId, html); + this.entries = document.getElementById(this.id); + + this.idToken; + this.accessToken; + + window.webAuth = new auth0.WebAuth({ + domain: AUTH0_DOMAIN, + clientID: AUTH0_CLIENT_ID, + redirectUri: AUTH0_CALLBACK_URL, + responseType: 'token id_token', + scope: 'openid profile', + leeway: 60 + }); + + // buttons and event listeners + this.loginBtn = document.getElementById('qsLoginBtn'); + this.logoutBtn = document.getElementById('qsLogoutBtn'); + + this.loginBtn.addEventListener('click', function(e) { + e.preventDefault(); + window.webAuth.authorize(); + }); + + if (localStorage.getItem('isLoggedIn') === 'true') { + this.renewTokens(); + } else { + this.handleAuthentication(); + } + } + getProfile() { + return new Promise((resolve ,reject) => { + window.webAuth.client.userInfo(accessToken(), (err, profile) => { + if (err) { + reject(err); + return; + } else { + resolve(profile); + } + }); + }); + } + localLogin(authResult) { + // Set isLoggedIn flag in localStorage + localStorage.setItem('isLoggedIn', 'true'); + // Set the time that the access token will expire at + let expiresAt = JSON.stringify( + authResult.expiresIn * 1000 + new Date().getTime() + ); + + this.accessToken = authResult.accessToken; + this.idToken = authResult.idToken; + + localStorage.setItem('expiresAt',expiresAt); + localStorage.setItem('idToken', authResult.idToken); + localStorage.setItem('accessToken', authResult.accessToken); + this._notify(this.idToken); + displayButtons(); + } + _notify(token) { + this.listeners.forEach(callback=>{ + callback(token); + }); + } + renewTokens() { + const self = this; + window.webAuth.checkSession({}, (err, authResult) => { + if (authResult && authResult.accessToken && authResult.idToken) { + self.localLogin(authResult); + } else if (err) { + alert( + 'Could not get a new token ' + err.error + ':' + err.error_description + '.' + ); + self.logout(); + } + displayButtons(); + }); + } + + logout() { + const self = this; + // Remove isLoggedIn flag from localStorage + localStorage.removeItem('isLoggedIn'); + // Remove tokens and expiry time + self.accessToken = ''; + self.idToken = ''; + + localStorage.setItem('expiresAt',0); + window.webAuth.logout({ + return_to: window.location.origin + }); + + displayButtons(); + } + + + + handleAuthentication() { + const self = this; + window.webAuth.parseHash(function(err, authResult) { + if (authResult && authResult.accessToken && authResult.idToken) { + window.location.hash = ''; + self.localLogin(authResult); + self.loginBtn.style.display = 'none'; + } else if (err) { + console.log(err); + alert( + 'Error: ' + err.error + '. Check the console for further details.' + ); + } + displayButtons(); + }); + } + + + onAuthenticated(callback) { + this.listeners.push(callback); + } +} \ No newline at end of file diff --git a/api-sandbox/components/console/console.css b/api-sandbox/components/console/console.css index 53e3761..ebafcd1 100644 --- a/api-sandbox/components/console/console.css +++ b/api-sandbox/components/console/console.css @@ -42,9 +42,9 @@ svg.icon { padding-top: 0px; - padding-right: 4px; + padding-right: 0px; stroke: #9d9d9d; - height: 18px; + height: 11px; vertical-align: middle; } @@ -75,15 +75,26 @@ svg.icon { color: #bfbfb5; } -.log-line:hover { - background-color: #323232; +.log-line-copy { + width: 14px; + height: 14px; + position:relative; /*or absolute*/ + left: -14px; + top: 14px; + display: none; } -a::before { - content: counter(line-numbering); - counter-increment: line-numbering; - padding-right: 1em; - color: white; +.log-line:hover .log-line-copy { + background-color: rgba(99, 99, 99, 0.81); + display: block; +} + +.btn { + position: relative; + size: inherit; + border: none; /* Remove borders */ + color: white; /* White text */ + cursor: pointer; /* Mouse pointer on hover */ } body { diff --git a/api-sandbox/components/console/console.html b/api-sandbox/components/console/console.html index 4f98fe2..118ea76 100644 --- a/api-sandbox/components/console/console.html +++ b/api-sandbox/components/console/console.html @@ -7,6 +7,7 @@
+ diff --git a/api-sandbox/components/console/console.js b/api-sandbox/components/console/console.js index 5f6feff..91daf10 100644 --- a/api-sandbox/components/console/console.js +++ b/api-sandbox/components/console/console.js @@ -1,8 +1,14 @@ +var _consoles = new Map(); + +function copyOnClick(msg, id) { + _consoles.get(id).callbacks.forEach(callback=>callback(msg)); +} class Console { constructor(elementId) { this.id = "log-entries" + window.performance.now(); + _consoles.set(this.id, this); let html = "
" + "
" + "
" + ""+ time + "" + ""+ msg +"" + "
"; - appendHtmlElement(this.id,html); + appendHtmlElement(this.id,html); } } function now(){ - var currentTime = new Date(); + const currentTime = new Date(); return " | " + currentTime.getHours() + ":" + currentTime.getMinutes() + ":" + currentTime.getSeconds() + "." + currentTime.getMilliseconds() + " | "; } function clearLog(elementId){ @@ -88,4 +105,4 @@ function clearLog(elementId){ while (entries.hasChildNodes()) { entries.removeChild(entries.lastChild); } -}; +} diff --git a/api-sandbox/components/console/import_btn.svg b/api-sandbox/components/console/import_btn.svg new file mode 100644 index 0000000..b036dc5 --- /dev/null +++ b/api-sandbox/components/console/import_btn.svg @@ -0,0 +1,30 @@ + + + + + diff --git a/api-sandbox/components/editor/CodeEditor.js b/api-sandbox/components/editor/CodeEditor.js index 9ebd882..387c234 100644 --- a/api-sandbox/components/editor/CodeEditor.js +++ b/api-sandbox/components/editor/CodeEditor.js @@ -36,4 +36,11 @@ class CodeEditor { setMode(mode){ this.editor.session.setMode("ace/mode/" + mode); } + + makeBeauty() { + const obj = JSON.parse( this.editor.getValue() ); + const json = JSON.stringify(obj, null, 2) + this.editor.setValue(json); + this.beautify.beautify(this.editor.session);; + } } \ No newline at end of file diff --git a/api-sandbox/components/organizations/organizations.css b/api-sandbox/components/organizations/organizations.css new file mode 100644 index 0000000..8f7a109 --- /dev/null +++ b/api-sandbox/components/organizations/organizations.css @@ -0,0 +1,84 @@ +.tbl { + display: flex; + flex-direction: column; +} +.row { + display: flex; + min-height: 20px; +} +.cell { + flex: 4; + border: 1px solid rgba(0, 0, 0, 0.1); + background-color: #3c3c3c; + color: white; +} +.cell:nth-child(1) { + flex: 1; +} +.cell:nth-child(2) { + flex: 2; +} +.cell.span4-5 { + flex: 8 14px; /* col 4,5 flex-grow/border/padding */ +} +.cell.span3-4 { + flex: 8 14px; /* col 3,4 flex-grow/border/padding */ +} +.cell.span3-5 { + flex: 12 36px; /* col 3,4,5 flex-grow/border/padding */ +} +.row:first-child .cell { + display: flex; + justify-content: center; /* center horiz. */ + align-items: center; /* center vert. */ +} +.row .cell { + padding: 5px; + box-sizing: border-box; +} + +/* Style the tab content (and add height:100% for full page content) */ +.tabcontent { + color: white; + padding: 20px 20px; +} + + +.dropbtn { + background-color: #3498DB; + color: white; + padding: 16px; + font-size: 16px; + border: none; + cursor: pointer; +} + +.dropbtn:hover, .dropbtn:focus { + background-color: #2980B9; +} + +.dropdown { + position: relative; + display: inline-block; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: #f1f1f1; + min-width: 160px; + overflow: auto; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; +} + +.dropdown-content a { + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; +} + +.dropdown a:hover {background-color: #ddd;} + +.show {display: block;} \ No newline at end of file diff --git a/api-sandbox/components/organizations/organizations.html b/api-sandbox/components/organizations/organizations.html new file mode 100644 index 0000000..fcf3e5a --- /dev/null +++ b/api-sandbox/components/organizations/organizations.html @@ -0,0 +1,36 @@ + + + + + + +
+
+
+
+
1
+
ORGANIZATION
+
MEMBERS
+
TOTAL
+
+
+
+ +
+
+
+
2
+
ORGANIZATION
+
MEMBERS
+
TOTAL
+
+
+
+
+ + + \ No newline at end of file diff --git a/api-sandbox/components/organizations/organizations.js b/api-sandbox/components/organizations/organizations.js new file mode 100644 index 0000000..6a4337b --- /dev/null +++ b/api-sandbox/components/organizations/organizations.js @@ -0,0 +1,45 @@ +function myFunction() { + document.getElementById("organizations_menu").classList.toggle("show"); +} + +class Organizations { + + constructor(containerId, token) { + + this.orgService = new OrganizationService(token); + + this.orgService.getMembership().then((res)=>{ + if(res.d.errorCode) { + console.error(res); + } else { + let organizationsList = new Array(); + res.d.organizations.forEach(org=> { + console.log(org.id); + console.log(org); + organizationsList.push(org); + this.orgService.getOrganizationMembers(org.id).then((m) => { + console.log(m); + }); + }); + this.organizationsList = organizationsList; + this.show(containerId, organizationsList); + } + }); + + } + + show(containerId, organizationsList ) { + let html = ""; + + appendHtmlElement(containerId, html); + } + + +} diff --git a/api-sandbox/components/settings/settings.css b/api-sandbox/components/settings/settings.css index 1fecf8a..d33f7aa 100644 --- a/api-sandbox/components/settings/settings.css +++ b/api-sandbox/components/settings/settings.css @@ -2632,7 +2632,7 @@ body.layout-left .editor-layout-buttons #left-layout svg, body.layout-top .edito } .embed-modal .CodeMirror-dialog-top button:hover, .embed-modal .CodeMirror-dialog-top button:focus { - background: #1e1e1e + background: #2C2C2C } .embed-modal .CodeMirror-scrollbar-filler, .embed-modal .CodeMirror-gutter-filler { @@ -5464,7 +5464,7 @@ body.layout-left .layout-change-links #left-layout svg, body.layout-top .layout- .collections-select { width: 120px; display: inline-block; - background: url(https://static.codepen.io/assets/buttons/arrow-tiny-down-white-cd748d5e97310942356ea8298bca9b344350441cffed1a653c89551258a76b3a.png) 93% 7px no-repeat, #1e1e1e !important; + background: url(https://static.codepen.io/assets/buttons/arrow-tiny-down-white-cd748d5e97310942356ea8298bca9b344350441cffed1a653c89551258a76b3a.png) 93% 7px no-repeat, #2C2C2C !important; color: white; -webkit-transform: none !important; transform: none !important; @@ -5485,13 +5485,13 @@ body.layout-left .layout-change-links #left-layout svg, body.layout-top .layout- } .editor-toggle-buttons > .button, .editor-toggle-buttons > .file-upload-button { - background: #1e1e1e + background: #2C2C2C } .editor-toggle-buttons > .button.active, .editor-toggle-buttons > .active.file-upload-button { color: white; font-weight: 900 !important; - background: #1e1e1e + background: #2C2C2C } .editor-toggle-buttons > .button:not(:first-child), .editor-toggle-buttons > .file-upload-button:not(:first-child) { diff --git a/api-sandbox/components/tabs/tabs.js b/api-sandbox/components/tabs/tabs.js new file mode 100644 index 0000000..19fc540 --- /dev/null +++ b/api-sandbox/components/tabs/tabs.js @@ -0,0 +1,31 @@ +class Tabs { + + constructor(containerId) { + this.tabs = new Map(); + let list = document.getElementById(containerId).children; + + for(var i = 0; i < list.length; i++) { + var elem = list[i]; + this.tabs.set(elem.id, elem); + } + } + + selected(){ + return this.selectedTab; + } + + show(id) { + if(this.tabs.has(id)){ + this.hideAll(); + this.tabs.get(id).style.display = null; + this.tabs.get(id).style.visibility = null; + this.selectedTab = id; + } + } + hideAll() { + this.tabs.forEach((tab)=>{ + tab.style.display = "none"; + tab.style.visibility = "hidden"; + }); + } +} \ No newline at end of file diff --git a/api-sandbox/config-admin/app.css b/api-sandbox/config-admin/app.css new file mode 100644 index 0000000..1f03eb4 --- /dev/null +++ b/api-sandbox/config-admin/app.css @@ -0,0 +1,199 @@ +@charset "utf-8"; +::-webkit-scrollbar { + width: 12px; + background-color: rgb(75, 76, 68); +} + +::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); + border-radius: 10px; +} + +::-webkit-scrollbar-thumb { + border-radius: 10px; + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); +} +#editor { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} +.brand-name { + padding-top: 8px; + padding-left: 10px; + text-transform: uppercase; +} +.text-white { + color: #fff; + font-family: "Raleway", Helvetica, Arial, sans-serif; +} +.text-blue { + color: #77a3e5; + font-family: "Raleway", Helvetica, Arial, sans-serif; +} +.text-bold, strong { + font-weight: 700; +} + +.ace_editor, .ace_editor * +{ + font-family: "Monaco", "Menlo", "Ubuntu Mono", "Droid Sans Mono", "Consolas", monospace; + font-size: 12px !important; + font-weight: 400 !important; + letter-spacing: 1px !important; +} +.send-button { + display: inline-block; + height: 28px; + width: calc(100% - 2px); + border: 1px solid #f1f1f1; + color: #f1f1f1; + border-radius: 2px; + line-height: 1.8; + font-size: 14px; + font-weight: 300; + background-color: #232323; + cursor: pointer; + overflow: hidden; +} +.send-button:hover { + background-color: #1ae96c; + border: 1px solid #1ae96c; + color: #1b1b1b; + font-weight: bold; +} +.top-bar-button { + display: inline-block; + height: 28px; + padding: 0 .8em; + border: 1px solid #f1f1f1; + color: #f1f1f1; + border-radius: 2px; + line-height: 1.8; + font-size: 14px; + font-weight: 300; + background-color: inherit; + cursor: pointer; + overflow: hidden; +} +.top-bar-button:hover { + background-color: #1ae96c; + border: 1px solid #1ae96c; + color: #1b1b1b; + font-weight: bold; +} +button:disabled { + cursor: not-allowed; + pointer-events: all !important; + color: #5a5a5a; +} +button:disabled:hover { + background-color: #404040; + border: 1px solid #418856; + font-weight: normal; +} +/* horizontal panel*/ + +.panel-container { + display: flex; + flex-direction: row; + border: 1px solid #5a5a5a; + overflow: hidden; + height: calc(100vh - 3px); + /* avoid browser level touch actions */ + xtouch-action: none; +} + +.panel-left { + flex: 0 0 auto; + /* only manually resize */ + padding: 3px; + width: 450px; + min-height: 200px; + min-width: 265px; + white-space: nowrap; + background: #272822; + color: white; +} + +.splitter { + flex: 0 0 auto; + width: 14px; + background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #313131; + min-height: 200px; + cursor: col-resize; +} + +.panel-right { + flex: 1 1 auto; + /* resizable */ + padding: 1px; + width: 100%; + min-height: 200px; + min-width: 200px; + background: #0f0f0f; +} +.treeview { + width: 100%; + height: calc(100% - 74px); + color: white; +} +.k-splitbar { + background: black; +} +html, +body { + height: 100%; + padding: 0; + margin: 0; + overflow: auto; +} +/* vertical panel */ + +.panel-container-vertical { + display: flex; + flex-direction: column; + height: calc(100% - 2px); + border: 1px solid #6b6868; + overflow: hidden; +} + +.panel-top { + flex: 0 0 auto; + /* only manually resize */ + height: calc(100% - 1px); + width: calc(100%); + white-space: nowrap; + background-color: #292828; + color: black; +} + +.splitter-horizontal { + flex: 0 0 auto; + height: 14px; + background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/hsizegrip.png) center center no-repeat #313131; + cursor: row-resize; +} +/* + css corrections: + */ +.panel-bottom { + flex: 1 1 auto; + /* resizable */ + padding: 1px; + min-height: 200px; + background: #000000; + overflow-y:auto; +} + +span.indent { + margin-left: 5px; + margin-right: 5px; +} + +.list-group-item { + padding: 2px; + border: 0.6px solid #54575a; +} diff --git a/api-sandbox/config-admin/import_btn.svg b/api-sandbox/config-admin/import_btn.svg new file mode 100644 index 0000000..b036dc5 --- /dev/null +++ b/api-sandbox/config-admin/import_btn.svg @@ -0,0 +1,30 @@ + + + + + diff --git a/api-sandbox/config-admin/index.html b/api-sandbox/config-admin/index.html new file mode 100644 index 0000000..088333c --- /dev/null +++ b/api-sandbox/config-admin/index.html @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
SCΛLΞCUBΞ
+
+ + + +
+ + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + + + + diff --git a/api-sandbox/config-admin/login.html b/api-sandbox/config-admin/login.html new file mode 100644 index 0000000..c3b6a36 --- /dev/null +++ b/api-sandbox/config-admin/login.html @@ -0,0 +1,26 @@ + + + + + + + +
+ + + \ No newline at end of file diff --git a/api-sandbox/services/ConfigurationService.js b/api-sandbox/services/ConfigurationService.js new file mode 100644 index 0000000..4ace3b4 --- /dev/null +++ b/api-sandbox/services/ConfigurationService.js @@ -0,0 +1,53 @@ +var url='wss://configuration-service-rs.genesis.om2.com:7070'; + +class ConfigurationService { + + constructor(url, token) { + this.token = token; + this.socket = new WebSocketTransport(url); + this.nonce = new Nonce(); + this.socket.listen().subscribe((next)=>{ + console.log(next); + }); + } + + createRepo(repoName) { + let req = { + "q": "/configuration/createRepository", + "sid" : this.nonce.generate().toString(), + "d": { + "token": this.token, + "repository": repoName + } + }; + return this.socket.requestResponse(req); + } + + save(repo, key, value) { + let req = { + "q": "/configuration/save", + "sid" : this.nonce.generate().toString(), + "d": { + "token": this.token, + "repository": repo, + "key": key, + "value": value + } + }; + return this.socket.requestResponse(req); + } + + + fetch(repo, key) { + let req = { + "q": "/configuration/fetch", + "sid" : this.nonce.generate().toString(), + "d": { + "token": this.token, + "repository": repo, + "key": key + } + }; + return this.socket.requestResponse(req); + } +} \ No newline at end of file diff --git a/api-sandbox/services/OrganizationService.js b/api-sandbox/services/OrganizationService.js new file mode 100644 index 0000000..39065fd --- /dev/null +++ b/api-sandbox/services/OrganizationService.js @@ -0,0 +1,91 @@ + +var url='wss://configuration-service-ws.genesis.om2.com/'; + +class OrganizationService { + + constructor(token) { + this.socket = new WebSocketTransport(url); + this.token = token; + this.nonce = new Nonce(); + } + + getMembership() { + let req = { + "q": "/organizations/getUserOrganizationsMembership", + "sid" : this.nonce.generate().toString(), + "d": { + "token": { + "token": this.token + } + } + }; + return this.socket.requestResponse(req); + } + + createOrganization(name, email) { + let req = { + "q": "/organizations/create", + "sid" : this.nonce.generate().toString(), + "d": { + "token": { + "token": this.token + }, + "name": name, + "email": email + } + }; + return this.socket.requestResponse(req); + } + + getOrganization(organizationId) { + let req = { + "q": "/organizations/create", + "sid" : this.nonce.generate().toString(), + "d": { + "token": { + "token": this.token + }, + "organizationId": organizationId + } + }; + return this.socket.requestResponse(req); + } + + /** + * + * @param name + * @param organizationId + * @param role "Owner/Admin/Member (PERMISSION LEVEL FOR API KEY TO CONFIGURATION SERVICE)" + */ + addApiKey(name, organizationId, role) { + let req = { + "q": "/organizations/addOrganizationApiKey", + "sid" : this.nonce.generate().toString(), + "d": { + "token": { + "token": this.token + }, + "organizationId": organizationId, + "apiKeyName": name, + "claims": { + "role": role + } + } + }; + return this.socket.requestResponse(req); + } + + getOrganizationMembers(id) { + let req = { + "q": "/organizations/getOrganizationMembers", + "sid" : this.nonce.generate().toString(), + "d": { + "token": { + "token": this.token + }, + "organizationId": id + } + }; + return this.socket.requestResponse(req); + } +} \ No newline at end of file diff --git a/api-sandbox/services/RSocketTransport.js b/api-sandbox/services/RSocketTransport.js index e34118f..838ce64 100644 --- a/api-sandbox/services/RSocketTransport.js +++ b/api-sandbox/services/RSocketTransport.js @@ -61,6 +61,11 @@ class RSocketTransport { metadata: input.metadata }; + send (request); + }; + + send (request) { + let onnext = resp => serialize(resp,this.subject); let onerror = error => serialize(error,this.subject); let oncomplete = () => console.debug("Completed!"); diff --git a/api-sandbox/services/WebSocketTransport.js b/api-sandbox/services/WebSocketTransport.js index d1000dc..84db630 100644 --- a/api-sandbox/services/WebSocketTransport.js +++ b/api-sandbox/services/WebSocketTransport.js @@ -31,5 +31,23 @@ class WebSocketTransport { return this.subject; }; + requestResponse(req) { + let p = this._response(req); + this.next(req); + return p; + } + _response(req) { + return new Promise((resolve, reject) => { + this.listen().subscribe((msg)=> { + if (msg.sid.toString() === req.sid.toString()) { + resolve(msg); + } + },(error) => { + console.log(error); + reject(error); + }); + + }); + } } diff --git a/images/json.png b/images/json.png new file mode 100644 index 0000000..683981b Binary files /dev/null and b/images/json.png differ