How to use getHost method in Appium Xcuitest Driver

Best JavaScript code snippet using appium-xcuitest-driver

admin.js

Source:admin.js Github

copy

Full Screen

1import axios from 'axios'2import request from '@/api/request'3export function getBuilding(params) {4 let url = getHost() + '/building?name='+params.name+'&customerId='+params.customerId+'&pageNum='+params.pageNum+'&counts='+params.counts5 return axios.get(6 url,7 {8 headers: {9 'token': localStorage.getItem("token")10 }11 }12 )13}14export function getSection(params) {15 let url = getHost() + '/section?name='+params.name+'&customerId='+params.customerId+'&buildingId='+params.buildingId+'&pageNum='+params.pageNum+'&counts='+params.counts16 return axios.get(17 url,18 {19 headers: {20 'token': localStorage.getItem("token")21 }22 }23 )24}25export function getDeviceStatus(params) {26 let url = getHost() + '/device/with_regular?name='+params.name+'&customerId='+params.customerId+'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&online='+params.online+'&pageNum='+params.pageNum+'&counts='+params.counts27 return axios.get(28 url,29 {30 headers: {31 'token': localStorage.getItem("token")32 }33 }34 )35}36export function getDeviceHistory(params) {37 let url = getHost() + '/regular?iotDeviceId='+params.iotDeviceId+'&startDate='+params.startDate+'&endDate='+params.endDate+'&pageNum='+params.pageNum + '&counts=' + params.counts38 return axios.get(39 url,40 {41 headers: {42 'token': localStorage.getItem("token")43 }44 }45 )46}47export function getImportedDevice(params) {48 let url = getHost() + '/device?name='+params.deviceName+'&code='+params.deviceCode+'&imei='+params.imei+'&sellStatus='+params.sellStatus+49 '&customerId='+params.customerId+'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&pageNum='+params.pageNum+'&counts='+params.counts50 return axios.get(51 url,52 {53 headers: {54 'token': localStorage.getItem("token")55 }56 }57 )58}59export function updateDevice(params) {60 let url = getHost() + '/device/' + params.id61 return axios.patch(62 url,63 params,64 {65 headers: {66 'token': localStorage.getItem("token")67 }68 }69 )70}71export function deleteDevice(params) {72 let url = getHost() + '/device/' + params.id73 return axios.delete(74 url,75 {76 headers: {77 'token': localStorage.getItem("token")78 }79 }80 )81}82export function getCustomer(params) {83 let url = getHost() + '/customer?name='+params.customerName+'&pageNum='+params.pageNum+'&counts='+params.counts84 return axios.get(85 url,86 {87 headers: {88 'token': localStorage.getItem("token")89 }90 }91 )92}93export function getCustomerForUser(params) {94 let url = getHost() + '/customer/list/'+params.id95 return axios.get(96 url,97 {98 headers: {99 'token': localStorage.getItem("token")100 }101 }102 )103}104export function patchImport(params) {105 let url = getHost() + '/device/list'106 return axios.post(107 url,108 params,109 {110 headers: {111 'token': localStorage.getItem("token")112 }113 }114 )115}116export function patchBind(params) {117 let url = getHost() + '/device/binding/batch'118 return axios.patch(119 url,120 params,121 {122 headers: {123 'token': localStorage.getItem("token")124 }125 }126 )127}128export function singleBind(params) {129 let url = getHost() + '/device/binding/single'130 return axios.patch(131 url,132 params,133 {134 headers: {135 'token': localStorage.getItem("token")136 }137 }138 )139}140export function getCurrentUsage(params) {141 let url = getHost() + '/device/with_regular?name='+params.deviceName+'&customerId='+params.customerId+'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&pageNum='+params.pageNum+'&counts='+params.counts142 return axios.get(143 url,144 {145 headers: {146 'token': localStorage.getItem("token")147 }148 }149 )150}151export function getPeriodUsage(params) {152 let url = getHost() + '/calculation/usage/periods?customerId='+params.customerId+'&startTime='+params.startTime+'&endTime=' + params.endTime +'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&name='+params.deviceName+'&pageNum='+params.pageNum+'&counts='+params.counts153 return axios.get(154 url,155 {156 headers: {157 'token': localStorage.getItem("token")158 }159 }160 )161}162export function getHourUsages(params) {163 let url = getHost() + '/calculation/usage/hour?customerId='+params.customerId+'&startTime='+params.startTime+'&endTime=' + params.endTime +'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&name='+params.deviceName164 return axios.get(165 url,166 {167 headers: {168 'token': localStorage.getItem("token")169 }170 }171 )172}173export function getDayUsages(params) {174 let url = getHost() + '/calculation/usage/day?customerId='+params.customerId+'&startTime='+params.startTime+'&endTime=' + params.endTime +'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&name='+params.deviceName175 return axios.get(176 url,177 {178 headers: {179 'token': localStorage.getItem("token")180 }181 }182 )183}184export function getMonthUsages(params) {185 let url = getHost() + '/calculation/usage/month?customerId='+params.customerId+'&startTime='+params.startTime+'&endTime=' + params.endTime +'&buildingId='+params.buildingId+'&sectionId='+params.sectionId+'&name='+params.deviceName186 return axios.get(187 url,188 {189 headers: {190 'token': localStorage.getItem("token")191 }192 }193 )194}195export function getAccountList(params) {196 let url = getHost() + '/account?customerId='+params.customerId+'&userName='+params.accountName+'&pageNum='+params.pageNum+'&counts='+params.counts197 return axios.get(198 url,199 {200 headers: {201 'token': localStorage.getItem("token")202 }203 }204 )205}206export function updateAccount(params) {207 let url = getHost() + '/account/'+params.id208 return axios.patch(209 url,210 params,211 {212 headers: {213 'token': localStorage.getItem("token")214 }215 }216 )217}218export function deleteAccount(params) {219 let url = getHost() + '/account/'+params.id220 return axios.delete(221 url,222 {223 headers: {224 'token': localStorage.getItem("token")225 }226 }227 )228}229export function resetPwd(params) {230 let url = getHost() + '/account/'+params.id+'/pwd/default'231 return axios.patch(232 url,233 params,234 {235 headers: {236 'token': localStorage.getItem("token")237 }238 }239 )240}241export function addAccount(params) {242 let url = getHost() + '/account'243 return axios.post(244 url,245 params,246 {247 headers: {248 'token': localStorage.getItem("token")249 }250 }251 )252}253export function addCustomer(params) {254 let url = getHost() + '/customer'255 return axios.post(256 url,257 params,258 {259 headers: {260 'token': localStorage.getItem("token")261 }262 }263 )264}265export function updateCustomer(params) {266 let url = getHost() + '/customer/'+params.id267 return axios.put(268 url,269 params,270 {271 headers: {272 'token': localStorage.getItem("token")273 }274 }275 )276}277export function deleteCustomer(params) {278 let url = getHost() + '/customer/'+params.id279 return axios.delete(280 url,281 {282 headers: {283 'token': localStorage.getItem("token")284 }285 }286 )287}288export function addBuilding(params) {289 let url = getHost() + '/building'290 return axios.post(291 url,292 params,293 {294 headers: {295 'token': localStorage.getItem("token")296 }297 }298 )299}300export function updateBuilding(params) {301 let url = getHost() + '/building/' + params.id302 return axios.put(303 url,304 params,305 {306 headers: {307 'token': localStorage.getItem("token")308 }309 }310 )311}312export function deleteBuilding(params) {313 let url = getHost() + '/building/' + params.id314 return axios.delete(315 url,316 {317 headers: {318 'token': localStorage.getItem("token")319 }320 }321 )322}323export function addSection(params) {324 let url = getHost() + '/section'325 return axios.post(326 url,327 params,328 {329 headers: {330 'token': localStorage.getItem("token")331 }332 }333 )334}335export function deleteSection(params) {336 let url = getHost() + '/section/' + params.id337 return axios.delete(338 url,339 {340 headers: {341 'token': localStorage.getItem("token")342 }343 }344 )345}346export function updateSection(params) {347 let url = getHost() + '/section/' + params.id348 return axios.put(349 url,350 params,351 {352 headers: {353 'token': localStorage.getItem("token")354 }355 }356 )357}358export function updatePwd(params) {359 let url = getHost() + '/account/' + params.id+'/pwd'360 return axios.patch(361 url,362 params,363 {364 headers: {365 'token': localStorage.getItem("token")366 }367 }368 )369}370export function getResource(params) {371 let url = getHost() + '/resource?resourceName='+params.resourceName+'&pageNum='+params.pageNum+'&counts='+params.counts372 return axios.get(373 url,374 {375 headers: {376 'token': localStorage.getItem("token")377 }378 }379 )380}381export function saveResource(params) {382 let url = getHost() + '/resource'383 return axios.post(384 url,385 params,386 {387 headers: {388 'token': localStorage.getItem("token")389 }390 }391 )392}393export function updateResource(params) {394 let url = getHost() + '/resource/'+params.id395 console.log(url)396 return axios.put(397 url,398 params,399 {400 headers: {401 'token': localStorage.getItem("token")402 }403 }404 )405}406export function deleteResource(params) {407 let url = getHost() + '/resource/'+params.id408 return axios.delete(409 url,410 {411 headers: {412 'token': localStorage.getItem("token")413 }414 }415 )416}417export function getRole(params) {418 let url = getHost() + '/role?roleName='+params.roleName+'&pageNum='+params.pageNum+'&counts='+params.counts419 return axios.get(420 url,421 {422 headers: {423 'token': localStorage.getItem("token")424 }425 }426 )427}428export function saveRole(params) {429 let url = getHost() + '/role'430 return axios.post(431 url,432 params,433 {434 headers: {435 'token': localStorage.getItem("token")436 }437 }438 )439}440export function updateRole(params) {441 let url = getHost() + '/role/'+params.id442 return axios.put(443 url,444 params,445 {446 headers: {447 'token': localStorage.getItem("token")448 }449 }450 )451}452export function deleteRole(params) {453 let url = getHost() + '/role/'+params.id454 return axios.delete(455 url,456 {457 headers: {458 'token': localStorage.getItem("token")459 }460 }461 )462}463export function getAccountRole(params) {464 let url = getHost() + '/user_role?userId='+params.accountId+'&pageNum='+params.pageNum+'&counts='+params.counts465 return axios.get(466 url,467 {468 headers: {469 'token': localStorage.getItem("token")470 }471 }472 )473}474export function saveAccountRole(params) {475 let url = getHost() + '/user_role'476 return axios.post(477 url,478 params,479 {480 headers: {481 'token': localStorage.getItem("token")482 }483 }484 )485}486export function deleteAccountRole(params) {487 let url = getHost() + '/user_role/'+params.id488 return axios.delete(489 url,490 {491 headers: {492 'token': localStorage.getItem("token")493 }494 }495 )496}497export function getRoleResource(params) {498 let url = getHost() + '/role_permission?roleId='+params.roleId+'&pageNum='+params.pageNum+'&counts='+params.counts499 return axios.get(500 url,501 {502 headers: {503 'token': localStorage.getItem("token")504 }505 }506 )507}508export function saveRoleResource(params) {509 let url = getHost() + '/role_permission'510 return axios.post(511 url,512 params,513 {514 headers: {515 'token': localStorage.getItem("token")516 }517 }518 )519}520export function deleteRoleResource(params) {521 let url = getHost() + '/role_permission/'+params.id522 return axios.delete(523 url,524 {525 headers: {526 'token': localStorage.getItem("token")527 }528 }529 )530}531export function login(params) {532 let url = getHost() + '/auth/login'533 return axios.post(url,params)534}535export function checkSession() {536 let url = getHost() + '/session'537 return axios.get(538 url,539 {540 headers: {541 'token': localStorage.getItem("token")542 }543 }544 )545}546export function logout() {547 let params = {548 action: 'logout'549 }550 let url = getHost() + '/signout'551 return axios.put(552 url,553 params,554 {555 headers: {556 'token': localStorage.getItem("token")557 }558 }559 )560}561export function checkAccountRole() {562 let url = getHost() + '/user_role/module'563 return axios.get(564 url,565 {566 headers: {567 'token': localStorage.getItem("token")568 }569 }570 )571}572export function checkRolePermission() {573 let url = getHost() + '/role_permission/module'574 return axios.get(575 url,576 {577 headers: {578 'token': localStorage.getItem("token")579 }580 }581 )582}583export function checkAccount() {584 let url = getHost() + '/account/module'585 return axios.get(586 url,587 {588 headers: {589 'token': localStorage.getItem("token")590 }591 }592 )593}594export function checkAccessible(module) {595 let url = getHost() + '/'+module+'/module'596 return axios.get(597 url,598 {599 headers: {600 'token': localStorage.getItem("token")601 }602 }603 )604}605export function switchOut(params) {606 let url = getHost() + '/device/'+params.id+'/switchout'607 return axios.patch(608 url,609 params,610 {611 headers: {612 'token': localStorage.getItem("token")613 }614 }615 )616}617export function switchOn(params) {618 let url = getHost() + '/device/'+params.id+'/switchon'619 return axios.patch(620 url,621 params,622 {623 headers: {624 'token': localStorage.getItem("token")625 }626 }627 )628}629export function getPrice(params) {630 let url = getHost() + '/price?customerId='+params.customerId+'&pageNum='+params.pageNum+'&counts='+params.counts631 return axios.get(632 url,633 {634 headers: {635 'token': localStorage.getItem("token")636 }637 }638 )639}640export function savePrice(params) {641 let url = getHost() + '/price'642 return axios.post(643 url,644 params,645 {646 headers: {647 'token': localStorage.getItem("token")648 }649 }650 )651}652export function updatePrice(params) {653 let url = getHost() + '/price/' + params.id654 return axios.put(655 url,656 params,657 {658 headers: {659 'token': localStorage.getItem("token")660 }661 }662 )663}664export function deletePrice(params) {665 let url = getHost() + '/price/' + params.id666 return axios.delete(667 url,668 {669 headers: {670 'token': localStorage.getItem("token")671 }672 }673 )674}675export function getCustomerDevice(params) {676 let url = getHost() + '/customer/' + params.customerId + '/device'677 return axios.get(678 url,679 {680 headers: {681 'token': localStorage.getItem("token")682 }683 }684 )685}686function getHost() {687 let localhostUrl = 'http://192.168.1.8:9290'688 let aliyunUrl = 'http://47.110.82.181:9290'689 return aliyunUrl...

Full Screen

Full Screen

template.js

Source:template.js Github

copy

Full Screen

1// JavaScript Document2// Author: Bill, 20123 /*<!--#include virtual="../../../config.shtml" -->*/45var Template_MainPanel=[6'<div id="${id}">',7 '<div style="margin-bottom:5px;font-size:12px;padding:5px;" class="ui-widget-content ui-corner-all">',8 Locale["gethost.template.tips"],9 '</div>',10 11 // Data Center12 '<div id="datacenterpanel" name="datacenterpanel" class="ui-widget-content ui-corner-all step-panel">',13 '<div class="orderTitle">', Locale["gethost.panel.title.datacenter"], '</div>',14 '<div zmlm:item="datacenterList" class="List"></div>',15 '</div>',16 17 // Software18 '<div id="softwarepanel" name="softwarepanel" class="ui-widget-content ui-corner-all step-panel step-panel-hidden">',19 '<div class="orderTitle">', Locale["gethost.panel.title.software"], '</div>',20 21 '<table class="List" style="margin-bottom:0;">',22 '<thead>',23 '<tr>',24 '<th><span class="softwareName RowHeader">', Locale["gethost.template.software.name"], '</span></th>',25 '<th><span class="softwareDesc RowHeader">', Locale["gethost.template.software.desc"], '</span></th>',26 '</tr>',27 '</thead>',28 '<tbody zmlm:item="softwareList"></tbody>',29 '</table>',30 '</div>',31 32 // Hardware33 '<div id="hardwarepanel" name="hardwarepanel" class="ui-widget-content ui-corner-all step-panel step-panel-hidden">',34 '<div class="orderTitle">', Locale["gethost.panel.title.hardware"], '</div>',35 36 '<table class="List" style="margin-bottom:0;">',37 '<thead>',38 '<tr>',39 '<th><span class="hardwareDesc RowHeader">', Locale["gethost.template.hardware.type"], '</span></th>',40 '<th><span class="hardwareCpu RowHeader">', Locale["gethost.template.hardware.dcpu"], '</span></th>',41 '<th><span class="hardwareMaxCpu RowHeader">', Locale["gethost.template.hardware.mcpu"], '</span></th>',42 '<th><span class="hardwareMem RowHeader">', Locale["gethost.template.hardware.dmem"], '</span></th>',43 '<th><span class="hardwareMaxMem RowHeader">', Locale["gethost.template.hardware.mmem"], '</span></th>',44 '</tr>',45 '</thead>',46 '<tbody zmlm:item="hardwareList"></tbody>',47 '</table>',48 '</div>',49 50 // Plan51 '<div id="planpanel" name="planpanel" class="ui-widget-content ui-corner-all step-panel step-panel-hidden">',52 '<div class="orderTitle">', Locale["gethost.panel.title.plan"], '</div>',53 54 '<table class="List" style="margin-bottom:0;">',55 '<thead>',56 '<tr>',57 '<th><span class="planName RowHeader">', Locale["gethost.template.plan.name"], '</span></th>',58 '<th><span class="planDesc RowHeader">', Locale["gethost.template.plan.desc"], '</span></th>',59 '<th><span class="planPrice RowHeader">', Locale["gethost.template.plan.price"], '</span></th>',60 '<th><span class="planCpu RowHeader">', Locale["gethost.template.plan.cpuprice"], '</span></th>',61 '<th><span class="planMem RowHeader">', Locale["gethost.template.plan.memprice"], '</span></th>',62 '<th><span class="planNet RowHeader">', Locale["gethost.template.plan.netprice"], '</span></th>',63 '</tr>',64 '</thead>',65 '<tbody zmlm:item="planList"></tbody>',66 '</table>',67 '</div>',68 69 // VM Name70 '<div id="vmnamepanel" name="vmnamepanel" class="ui-widget-content ui-corner-all step-panel step-panel-hidden">',71 '<div class="orderTitle">', Locale["gethost.panel.title.naming"], '</div>',72 73 '<div zmlm:item="vmname" class="List" style="padding:5px;">',74 '<span>', Locale["gethost.template.naming.name"], '</span>',75 '<input id="vmname" style="font-size:16px;text-align:center;" maxlength="<!--#echo var="MaxLength_Instance"-->" class="ui-widget-content ui-corner-all bgyellow" />',76 '<button id="checkvmname">', Locale["gethost.template.naming.btncheck"], '</button>',77 '<label style="color:#aaa;">', Locale["gethost.template.naming.tips"], '</label>',78 '</div>',79 '</div>',80 81 // Additional Settings82 '<div id="additionalpanel" name="additionalpanel" class="ui-widget-content ui-corner-all step-panel step-panel-hidden">',83 '<div class="orderTitle">', Locale["gethost.panel.title.additional"], '</div>',84 85 // Public Network IP86 '<div id="networkpanel" name="networkpanel" style="margin:10px;background:#fff;" class="ui-widget-content ui-corner-all">',87 '<div class="orderTitle">', Locale["gethost.template.additional.network.subtitle"], '</div>',88 89 '<div zmlm:item="network" class="List" style="padding:5px;">',90 '<span>', Locale["gethost.template.additional.network.needed"], '</span>',91 '<span style="display:inline-block; margin:0 10px;">',92 '<input id="network_no" value="false" name="network" type="radio" checked/>',93 '<label for="network_no">', Locale["gethost.template.additional.network.needed.no"], '</label>',94 '</span>',95 '<span style="display:inline-block; margin:0 10px;">',96 '<input id="network_yes" value="true" name="network" type="radio" />',97 '<label for="network_yes">', Locale["gethost.template.additional.network.needed.yes"], '</label>',98 '</span>',99 '<span style="display:inline-block; margin:0 10px;">',100 '<div style="color:red;" id="ippricespan"></div>',101 '</span>',102 '</div>',103 104 // Public Network Type105 '<div id="networkdetailpanel" name="networkdetailpanel" class="step-panel-hidden">',106 '<div zmlm:item="networktype" class="List" style="padding:5px;">',107 '<span>', Locale["gethost.template.additional.network.type"], '</span>',108 '<span style="display:inline-block; margin:0 10px;">',109 '<input id="network_public" value="web" name="networktype" type="radio" />',110 '<label for="network_public">', Locale["gethost.template.additional.network.type.public"], '</label>',111 '</span>',112 '<span style="display:inline-block; margin:0 10px;">',113 '<input id="network_private" value="personal" name="networktype" type="radio" />',114 '<label for="network_private">', Locale["gethost.template.additional.network.type.private"], '</label>',115 '</span>',116 '</div>',117 '</div>',118 '</div>',119 120 // Volume121 '<div id="volumepanel" name="volumepanel" style="margin:10px;background:#fff;" class="ui-widget-content ui-corner-all step-panel">',122 '<div class="orderTitle">', Locale["gethost.template.additional.volume.subtitle"], '</div>',123 124 '<div zmlm:item="volume" class="List" style="padding:5px;">',125 '<span>', Locale["gethost.template.additional.volume.needed"], '</span>',126 '<span style="display:inline-block; margin:0 10px;">',127 '<input id="volume_no" value="false" name="volume" type="radio" checked/>',128 '<label for="volume_no">', Locale["gethost.template.additional.volume.needed.no"], '</label>',129 '</span>',130 '<span style="display:inline-block; margin:0 10px;">',131 '<input id="volume_yes" value="true" name="volume" type="radio" />',132 '<label for="volume_yes">', Locale["gethost.template.additional.volume.needed.yes"], '</label>',133 '</span>',134 '<span style="display:inline-block; margin:0 10px;">',135 '<div style="color:red;" id="volumepricespan"></div>',136 '</span>',137 '</div>',138 139 // Volume Size & Name140 '<div id="volumedetailpanel" name="volumedetailpanel" class="step-panel-hidden">',141 '<div zmlm:item="volumename" class="List" style="padding:5px;">',142 '<span>', Locale["gethost.template.additional.volume.name"], '</span>',143 '<input id="volumename" style="font-size:16px;text-align:center;" maxlength="<!--#echo var="MaxLength_Volume"-->" class="ui-widget-content ui-corner-all bgyellow" />',144 '<label style="color:#aaa;">', Locale["gethost.template.additional.volume.name.tips"], '</label>',145 '</div>',146 147 '<div zmlm:item="volumesize" class="List" style="padding:5px;">',148 '<span>', Locale["gethost.template.additional.volume.size"], '</span>',149 '<span zmlm:item="volumesizeList" class="List"><select id="volumesize"></select></span>',150 '</div>',151 '</div>',152 '</div>',153 154 '<div style="margin:10px;text-align:center;">',155 '<button onclick="validateOrder()">', Locale["gethost.template.button.order.submit"], '</button>',156 '</div>',157 158 '</div>',159'</div>'160].join("");161162var Template_SoftwareRow=[163'<tr class="Row hidable">',164 '<input name="softwareId" type="hidden" value="${id}" />',165 '<input name="softwareName" type="hidden" value="${SoftwareName}" />',166 '<td><span class="RowCell softwareName">{{html formatOSIcon(SoftwareName)}} ${SoftwareName}</span></td>',167 '<td><span class="RowCell softwareDesc">${Description}</span></td>',168'</tr>'169].join("");170171var Template_HardwareRow=[172'<tr class="Row hidable">',173 '<input name="hardwareId" type="hidden" value="${resourceid}" />',174 '<input name="hardwareMaxCpu" type="hidden" value="${maxcpu}" />',175 '<input name="hardwareCpu" type="hidden" value="${cpu}" />',176 '<input name="hardwareMaxMem" type="hidden" value="${maxmemory}" />',177 '<input name="hardwareMem" type="hidden" value="${memory}" />',178 '<td><span class="RowCell hardwareDesc">${description}</span></td>',179 '<td><span class="RowCell hardwareCpu">${cpu}</span></td>',180 '<td><span class="RowCell hardwareMaxCpu">${maxcpu}</span></td>',181 '<td><span class="RowCell hardwareMem">{{html formatSize(memory*1024*1024, 2)}}</span></td>',182 '<td><span class="RowCell hardwareMaxMem">{{html formatSize(maxmemory*1024*1024, 2)}}</span></td>',183'</tr>'184].join("");185186var Template_PlanRow=[187'<tr class="Row hidable">',188 '<input name="softwareresourceid" type="hidden" value="${resourceid}" />',189 '<input name="planid" type="hidden" value="${vmplanid}" />',190 '<input name="onceprice" type="hidden" value="${price}" />',191 '<input name="plancpu" type="hidden" value="${cpufee}" />',192 '<input name="planmem" type="hidden" value="${memfee}" />',193 '<input name="plannet" type="hidden" value="${netfee}" />',194 '<td><span class="RowCell planName">${planname}</span></td>',195 '<td><span class="RowCell planDesc">${plandesc}</span></td>',196 '<td><span class="RowCell planPrice">{{html formatPrice(price)}}</span></td>',197 '<td><span class="RowCell planCpu">{{html formatPrice(cpufee)}}</span></td>',198 '<td><span class="RowCell planMem">{{html formatPrice(memfee)}}</span></td>',199 '<td><span class="RowCell planNet">{{html formatPrice(netfee)}}</span></td>',200'</tr>'201].join("");202203var Template_ConfirmDialog=[204'<div title="', Locale["gethost.template.dialog.confirm.title"], '" class="confirmDialog">',205 '<div style="margin-bottom:2px;font-size:12px;padding:5px;display:inline-block;width:90%;text-align:left;" class="ui-widget-content ui-corner-all ui-state-highlight">',206 '<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>',207 Locale["gethost.template.tips.confirm"],208 '</div>',209 210 '<table class="ui-widget-content ui-corner-all">',211 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.software"],'</td></tr>',212 213 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.software"], '</td><td class="value">${softwarename}</td></tr>',214 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.vmname"], '</td><td class="value">${vmname}</td></tr>',215 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.datacenter"], '</td><td class="value">${datacenterlabel}</td></tr>',216 217 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.hardware"],'</td></tr>',218 219 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.dcpu"], '</td><td class="value">${hardwareCpu}</td></tr>',220 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.mcpu"], '</td><td class="value">${hardwareMaxCpu}</td></tr>',221 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.dmem"], '</td><td class="value">${hardwareMem}</td></tr>',222 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.mmem"], '</td><td class="value">${hardwareMaxMem}</td></tr>',223 224 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.plan"],'</td></tr>',225 226 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.plan"], '</td><td class="value">${planName}</td></tr>',227 '{{if isPagOrder(planid)==false}}',228 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.price"], '</td><td class="value">${planPrice}</td></tr>',229 '{{else}}',230 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.cpuprice"], '</td><td class="value">${planCpu}</td></tr>',231 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.memprice"], '</td><td class="value">${planMem}</td></tr>',232 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.netprice"], '</td><td class="value">${planNet}</td></tr>',233 '{{/if}}',234 235 236 '{{if enterprise==false}}',237 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.network"],'</td></tr>',238 239 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.hasnetwork"], '</td><td class="value">{{html formatBoolean(hasNetwork)}}</td></tr>',240 '{{if hasNetwork=="true"}}',241 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.networktype"], '</td><td class="value">{{html formatNetworkType(networkType)}}</td></tr>',242 '{{/if}}',243 244 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.volume"],'</td></tr>',245 246 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.hasvolume"], '</td><td class="value">{{html formatBoolean(hasVolume)}}</td></tr>',247 '{{if hasVolume=="true"}}',248 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.volumename"], '</td><td class="value">${volumeName}</td></tr>',249 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.volumesize"], '</td><td class="value">{{html formatVolumeSize(volumeSize)}}</td></tr>',250 '{{/if}}',251 '{{/if}}',252 253 '<tr><td colspan="2" class="subtitle ui-corner-all ui-widget-content ">', Locale["gethost.template.dialog.confirm.subtitle.total"],'</td></tr>',254 255 256 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.fee.vm"], '</td><td class="value">{{html planPrice}}</td></tr>',257 '{{if enterprise==false}}',258 '{{if hasNetwork=="true"}}',259 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.fee.network"], '</td><td class="value">{{html calIpPrice(ipprice, provider)}}</td></tr>',260 '{{/if}}',261 '{{if hasVolume=="true"}}',262 '<tr><td class="label">', Locale["gethost.template.dialog.confirm.fee.volume"], '</td><td class="value">{{html (volumeprice*volumeSize)}}</td></tr>',263 '{{/if}}',264 '{{/if}}',265 '<tr>',266 '<td class="label">', Locale["gethost.template.dialog.confirm.fee.ordercount"], '</td><td class="value">',267 '<select name="orderAmount">', dumpOrderAmountList(), '</select>',268 '</td>',269 '</tr>',270 '<tr style="height:36px;">',271 '<td class="label emphasis">', Locale["gethost.template.dialog.confirm.fee.total"], '</td>',272 '<td class="value emphasis bgyellow" name="feeTotal" style="color:red;"></td>',273 '</tr>',274 275 '</table>',276 277'</div>'278].join("");279280var Template_SaveOrderDialog=[281'<div id="${id}" title="', Locale["gethost.template.dialog.saveorder.title"], '" class="saveOrderDialog">',282 '<table class="ui-widget-content ui-corner-all">',283 '<tr>',284 '<td class="label">', Locale["gethost.template.dialog.saveorder.template.name"], '</td>',285 '<td class="value"><input name="templatename" class="ui-widget-content ui-corner-all bgyellow" style="width:95%;" maxlength="<!--#echo var="MaxLength_OrderTemplateName"-->"></td>',286 '</tr>',287 288 '<tr>',289 '<td class="label">', Locale["gethost.template.dialog.saveorder.template.desc"], '</td>',290 '<td class="value"><input name="templatedesc" class="ui-widget-content ui-corner-all bgyellow" style="width:95%;" maxlength="<!--#echo var="MaxLength_OrderTemplateDesc"-->"></td>',291 '</tr>',292 '</table>',293'</div>'294].join("");295296var Template_MessageBox=[297'<div title="'+Locale["gethost.dialog.title.tips"]+'">',298 '<p class="message">{{html message}}</p>',299'</div>'300].join("");301302303304305306 ...

Full Screen

Full Screen

zh_CN.js

Source:zh_CN.js Github

copy

Full Screen

1/* JavaScript Document2Author: Bill, 2011~20123<!--#config timefmt="%A %B %d, %Y %H:%M:%S" -->4This file last modified <!--#echo var="LAST_MODIFIED" -->56HTTP_REFERER: <!--#echo var="HTTP_REFERER" -->7REQUEST_METHOD: <!--#echo var="REQUEST_METHOD" -->8CONTENT_TYPE: <!--#echo var="CONTENT_TYPE" -->9UNIQUE_ID: <!--#echo var="UNIQUE_ID" -->10*/1112/*13 * <!--#include virtual="../../../../config.shtml" -->14 */1516var Locale={17 /*-- Global --*/18 "global.processing": "处理中, 请稍候...",19 20 /* Reference: http://datatables.net/plug-ins/i18n */21 dataTable: {22 "sProcessing": "处理中...",23 "sLengthMenu": "显示 _MENU_ 项结果",24 "sZeroRecords": "没有匹配结果",25 "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",26 "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",27 "sInfoFiltered": "(由 _MAX_ 项结果过滤)",28 "sInfoPostFix": "",29 "sSearch": "搜索:",30 "sUrl": "",31 "oPaginate": {32 "sFirst": "首页",33 "sPrevious": "上页",34 "sNext": "下页",35 "sLast": "末页"36 }37 },38 39 /* ----Module Monitor Management---- */40 "gethost.banner" : "获取VM",41 42 "gethost.dialog.close" : "关闭",43 "gethost.dialog.create" : "创建",44 "gethost.dialog.modify" : "修改",45 46 "gethost.panel.title.datacenter": "1. 选择数据中心:",47 "gethost.panel.title.software": "2. 选择您所需要的镜像:",48 "gethost.panel.title.hardware": "3. 选择硬件配置:",49 "gethost.panel.title.plan": "4. 选择付费套餐:",50 "gethost.panel.title.naming": "5. 命名您的VM:",51 "gethost.panel.title.additional": "6. 附加配置:",52 53 "gethost.dialog.processing" : "处理中, 请稍候...",54 "gethost.dialog.title.tips" : "提示信息",55 "gethost.dialog.title.create" : "创建监视器",56 "gethost.dialog.title.update" : "修改监视器",57 58 "gethost.confirm.order.save" : "确认保存订单吗?",59 "gethost.confirm.order.submit" : "确认提交订单吗?",60 61 "gethost.message.type.in.saveorder.template.name" : "请填写模板名称。",62 "gethost.message.loading" : "数据加载中...",63 "gethost.message.error" : "出现异常, 请联系管理员",64 "gethost.message.undefined" : "未定义的返回 [%s]",65 "gethost.message.no_data": "无该模块数据",66 67 "gethost.template.tips" : "1. 请完整填写VM订单。<br/>2. 提交订单后请等待系统创建VM。",68 "gethost.template.tips.confirm" : "请仔细确认订单信息,订单中价格均以'元'为单位。",69 70 "gethost.template.software.name": "镜像名",71 "gethost.template.software.desc": "镜像描述",72 73 "gethost.template.hardware.type": "硬件类型",74 "gethost.template.hardware.dcpu": "默认CPU",75 "gethost.template.hardware.mcpu": "最大CPU",76 "gethost.template.hardware.dmem": "默认内存",77 "gethost.template.hardware.mmem": "最大内存",78 79 "gethost.template.plan.name": "付费套餐",80 "gethost.template.plan.desc": "套餐说明",81 "gethost.template.plan.price": "金额",82 "gethost.template.plan.cpuprice": "CPU价格(每运行1小时)",83 "gethost.template.plan.memprice": "内存价格",84 "gethost.template.plan.netprice": "网络流量(每GB)",85 86 "gethost.template.naming.name": "输入VM名",87 "gethost.template.naming.btncheck": "检查VM名,并进入下一步",88 "gethost.template.naming.tips": "(只允许输入英文字母, 数字或下划线, 数字不能作为开头)",89 90 "gethost.template.additional.network.subtitle": "公共网络:",91 "gethost.template.additional.network.needed": "是否购买公网IP",92 "gethost.template.additional.network.needed.yes": "是",93 "gethost.template.additional.network.needed.no": "否",94 "gethost.template.additional.network.type": "选择要使用的网络类型",95 "gethost.template.additional.network.type.public": "发布网站",96 "gethost.template.additional.network.type.private": "不发布网站",97 98 "gethost.template.additional.volume.subtitle": "扩展磁盘:",99 "gethost.template.additional.volume.needed": "是否购买公网IP",100 "gethost.template.additional.volume.needed.yes": "是",101 "gethost.template.additional.volume.needed.no": "否",102 "gethost.template.additional.volume.name": "扩展磁盘名",103 "gethost.template.additional.volume.name.tips": "(只允许输入英文字母, 数字或下划线, 数字不能作为开头)",104 "gethost.template.additional.volume.size": "选择扩展磁盘大小",105 106 "gethost.template.button.order.submit": "填写完毕,校验订单",107 108 "gethost.template.dialog.confirm.title": "订单",109 "gethost.template.dialog.confirm.software": "镜像",110 "gethost.template.dialog.confirm.vmname": "主机名",111 "gethost.template.dialog.confirm.datacenter": "数据中心",112 "gethost.template.dialog.confirm.dcpu": "默认CPU",113 "gethost.template.dialog.confirm.mcpu": "最大CPU",114 "gethost.template.dialog.confirm.dmem": "默认内存",115 "gethost.template.dialog.confirm.mmem": "最大内存",116 "gethost.template.dialog.confirm.plan": "付费套餐",117 "gethost.template.dialog.confirm.price": "金额",118 "gethost.template.dialog.confirm.cpuprice": "CPU价格",119 "gethost.template.dialog.confirm.memprice": "内存价格",120 "gethost.template.dialog.confirm.netprice": "网络流量价格",121 "gethost.template.dialog.confirm.hasnetwork": "是否购买公网IP",122 "gethost.template.dialog.confirm.networktype": "网络类型",123 "gethost.template.dialog.confirm.hasvolume": "是否购买扩展磁盘",124 "gethost.template.dialog.confirm.volumename": "扩展磁盘名",125 "gethost.template.dialog.confirm.volumesize": "磁盘大小",126 "gethost.template.dialog.confirm.fee.vm": "主机价格",127 "gethost.template.dialog.confirm.fee.network": "IP价格",128 "gethost.template.dialog.confirm.fee.volume": "磁盘价格",129 "gethost.template.dialog.confirm.fee.ordercount": "订单数量",130 "gethost.template.dialog.confirm.fee.total": "金额总计",131 "gethost.template.dialog.confirm.subtitle.software": "基础配置",132 "gethost.template.dialog.confirm.subtitle.hardware": "硬件配置",133 "gethost.template.dialog.confirm.subtitle.plan": "付费套餐",134 "gethost.template.dialog.confirm.subtitle.network": "网络配置",135 "gethost.template.dialog.confirm.subtitle.volume": "扩展磁盘配置",136 "gethost.template.dialog.confirm.subtitle.total": "订单合计",137 138 "gethost.template.dialog.saveorder.title": "保存订单模板",139 "gethost.template.dialog.saveorder.template.name": "模板名称",140 "gethost.template.dialog.saveorder.template.desc": "模板描述",141142 "gethost.label.fee.network": "(IP价格: %s 元/个/30天)",143 "gethost.label.fee.volume": "(磁盘价格: %s 元/GB/天)",144145 "gethost.label.tips.vmname.invalid": "该VM名不合法,请使用字母,数字或下划线组合。且数字不能作为开头,总字符数不超过8个。",146 "gethost.label.tips.vmname.unavailable": "该VM名不可用,请重新输入。",147 "gethost.label.tips.network.vacancy": "若需要使用网络设置,请填写网络的相关信息。",148 "gethost.label.tips.volume.vacancy": "若需要使用扩展磁盘,请填写扩展磁盘的相关信息。",149 "gethost.label.tips.volume.name.invalid": "该扩展磁盘名不合法,请使用字母,数字或下划线组合。且数字不能作为开头,总字符数不超过10个。",150 "gethost.label.tips.datacenter.unavailable": "数据中心不可用,请刷新页面或联系系统管理员。",151 152 "gethost.label.boolean.true": "是",153 "gethost.label.boolean.false": "否",154 "gethost.label.network.public": "发布网站",155 "gethost.label.network.private": "不发布网站",156 157 "gethost.button.order.save": "保存订单",158 "gethost.button.order.submit": "提交订单",159 160 "gethost.page.message.buy.prefix": "您的订单:",161 "gethost.page.message.buy.prefix.inst": "云主机:",162 "gethost.page.message.buy.NO_ENOUGH_STOCK": "对不起,系统无足够库存,请稍候再试",163 "gethost.page.message.buy.VM_EXCEEDED": "对不起,系统VM数已达许可证上限,请联系管理员",164 "gethost.page.message.buy.NOIDORDER": "对不起,无法下单,请稍后再试",165 "gethost.page.message.buy.ERROR": "对不起,无法下单,请稍后再试",166 "gethost.page.message.buy.EXCEPTION": "对不起,服务器异常,请稍候再试",167 "gethost.page.message.buy.LOWBALANCE": "对不起,您的余额已不足,请先充值",168 "gethost.page.message.buy.inst.NO_ENOUGH_STOCK": "对不起,系统暂无足够库存,请联系管理员或稍候再试",169 "gethost.page.message.buy.inst.EXCEPTION": "对不起,服务器可能在维护,您的云主机购买操作未完成",170 "gethost.page.message.buy.inst.NAMENOTAVAILABLE": "对不起,您的云主机名字已被占用,您的云主机购买操作未完成",171 "gethost.page.message.buy.inst.OSTYPEERROR": "对不起,系统信息错误,请立即联系管理员",172 "gethost.page.message.buy.inst.ORDERED": "云主机申请成功,请等待管理员审核",173 "gethost.page.message.buy.inst.CREATED": "云主机购买提交成功,请等待Email确认,邮件确认后您可以到 “%s” 中操作您的云主机",174 "gethost.page.message.buy.inst.CREATED.keyword": "我的云产品",175 "gethost.page.message.buy.inst.LOWBALANCE": "对不起,由于您的余额不足,您的云主机购买操作未完成",176 "gethost.page.message.buy.inst.ONEVMONLY": "对不起,您已不能申请更多的云主机实例",177 "gethost.page.message.buy.inst.DONE": "云主机购买提交成功,成功 %s 个,失败 %s 个",178 "gethost.page.message.buy.inst.UNKNOWN_ERROR": "未知错误,请立即联系管理员",179 "gethost.page.message.buy.ip.NO_ENOUGH_STOCK": "对不起,系统暂无足够库存,请联系管理员或稍候再试",180 "gethost.page.message.buy.ip.EXCEPTION": "对不起,系统暂无足够库存,请联系管理员或稍候再试",181 "gethost.page.message.buy.ip.NOIP": "IP地址:对不起,您所选择的数据中心已无可用IP,您的IP购买操作未完成,请与管理员联系",182 "gethost.page.message.buy.ip.WEB": "IP地址:提交成功,如您需要发布网站,请提供您的备案信息",183 "gethost.page.message.buy.ip.LOWBALANCE": "IP地址:对不起,由于您的余额已不足,您的IP购买操作未完成",184 "gethost.page.message.buy.ip.PERSONAL": "IP地址:购买成功,您可以到 “%s” 中操作您的IP",185 "gethost.page.message.buy.ip.PERSONAL.keyword": "我的云产品",186 "gethost.page.message.buy.ip.BATCH": "IP地址:提交成功 %s 个,失败 %s 个",187 "gethost.page.message.buy.ip.UNKNOWN_ERROR": "IP地址:未知错误,请立即联系管理员",188 "gethost.page.message.buy.volume.NO_ENOUGH_STOCK": "对不起,系统暂无足够库存,请联系管理员或稍候再试",189 "gethost.page.message.buy.volume.EXCEPTION": "磁盘:对不起,服务器可能在维护,您的磁盘购买操作未完成",190 "gethost.page.message.buy.volume.LOWBALANCE": "磁盘:对不起,由于您的余额已不足,您的磁盘购买操作未完成",191 "gethost.page.message.buy.volume.DONE": "磁盘:购买成功,您可以到 “%s” 中操作您的磁盘",192 "gethost.page.message.buy.volume.DONE.keyword": "我的云产品",193 "gethost.page.message.buy.volume.BATCH": "磁盘:购买成功 %s 个,失败 %s 个",194 "gethost.page.message.buy.volume.UNKNOWN_ERROR": "磁盘:未知错误,请立即联系管理员",195 196 "gethost.page.message.save.success": "保存完成。",197 "gethost.page.message.save.failure": "保存失败,请重试。"198199200 // please customize your locale string in file "extension/zh_CN.ex"201 //<!--#include virtual="extension/zh_CN.ex"-->202}203204205var Resource={206}207208209 ...

Full Screen

Full Screen

VegaDNSClient.js

Source:VegaDNSClient.js Github

copy

Full Screen

...31 dataType: "json"32 });33}34VegaDNSClient.prototype.login = function(email, password) {35 var url = this.getHost() + "/login";36 var data = {37 email: email,38 password: password39 };40 return this.send(url, "POST", data);41}42VegaDNSClient.prototype.checkLogin = function() {43 var url = this.getHost() + "/login";44 return this.send(url, "GET");45}46VegaDNSClient.prototype.logout = function() {47 var url = this.getHost() + "/logout";48 return this.send(url, "POST");49}50VegaDNSClient.prototype.domains = function(page, perpage, sort, order, search = false) {51 var data = {52 include_permissions: 153 };54 if (page !== false) {55 data.page = page;56 }57 if (perpage !== false) {58 data.perpage = perpage;59 }60 if (sort !== false) {61 data.sort = sort;62 }63 if (order !== false) {64 data.order = order;65 }66 if (search !== false) {67 data.search = search;68 }69 var url = this.getHost() + "/domains";70 return this.send(url, "GET", data);71}72VegaDNSClient.prototype.updateDomainStatus = function(domain_id, status) {73 var url = this.getHost() + "/domains/" + domain_id;74 var data = {75 status: status76 }77 return this.send(url, "PUT", data);78}79VegaDNSClient.prototype.updateDomainOwner = function(domain_id, owner_id) {80 var url = this.getHost() + "/domains/" + domain_id;81 var data = {82 owner_id: owner_id83 }84 return this.send(url, "PUT", data);85}86VegaDNSClient.prototype.defaultRecords = function() {87 var url = this.getHost() + "/default_records";88 return this.send(url, "GET");89}90VegaDNSClient.prototype.addDefaultRecord = function(payload) {91 var url = this.getHost() + "/default_records";92 return this.send(url, "POST", payload);93}94VegaDNSClient.prototype.deleteDefaultRecord = function(recordId) {95 var url = this.getHost() + "/default_records/" + recordId;96 return this.send(url, "DELETE");97}98VegaDNSClient.prototype.getDefaultSOARecord = function() {99 var url = this.getHost() + "/default_records?filter_record_type=soa";100 return this.send(url, "GET");101}102VegaDNSClient.prototype.getDefaultRecord = function(recordId) {103 var url = this.getHost() + "/default_records/" + recordId;104 return this.send(url, "GET");105}106VegaDNSClient.prototype.editDefaultRecord = function(data) {107 var url = this.getHost() + "/default_records/" + data.record_id;108 return this.send(url, "PUT", data);109}110VegaDNSClient.prototype.getSOARecord = function(domainId) {111 var url = this.getHost() + "/records?domain_id=" + domainId + "&filter_record_type=soa";112 return this.send(url, "GET");113}114VegaDNSClient.prototype.getRecord = function(recordId) {115 var url = this.getHost() + "/records/" + recordId;116 return this.send(url, "GET");117}118VegaDNSClient.prototype.records = function(119 domain_id, page, perpage, sort, order, search_name=false, search_value=false120) {121 var url = this.getHost() + "/records"122 var data = {123 domain_id: domain_id,124 page: page,125 perpage: perpage,126 sort: sort,127 order: order,128 include_permissions: 1129 }130 if (search_name !== false) {131 data.search_name = search_name;132 }133 if (search_value !== false) {134 data.search_value = search_value;135 }136 return this.send(url, "GET", data);137}138VegaDNSClient.prototype.addDefaultSOA = function(domain) {139 var url = this.getHost() + "/domains/" + domain + "/create_default_soa" ;140 var data = {141 domain: domain142 }143 return this.send(url, "POST", data);144}145VegaDNSClient.prototype.addRecord = function(payload) {146 var url = this.getHost() + "/records";147 return this.send(url, "POST", payload);148}149VegaDNSClient.prototype.editRecord = function(data) {150 var url = this.getHost() + "/records/" + data.record_id;151 return this.send(url, "PUT", data);152}153VegaDNSClient.prototype.deleteRecord = function(recordId) {154 var url = this.getHost() + "/records/" + recordId;155 return this.send(url, "DELETE");156}157VegaDNSClient.prototype.apikeys = function(accountIds) {158 var url = this.getHost() + "/apikeys";159 var data = {160 account_ids: accountIds161 }162 return this.send(url, "GET", data);163}164VegaDNSClient.prototype.addApiKey = function(account_id, description) {165 var url = this.getHost() + "/apikeys";166 var data = {167 account_id: account_id,168 description: description169 }170 return this.send(url, "POST", data);171}172VegaDNSClient.prototype.deleteApiKey = function(apiKeyId) {173 var url = this.getHost() + "/apikeys/" + apiKeyId;174 return this.send(url, "DELETE");175}176VegaDNSClient.prototype.getAccount = function(accountId) {177 var url = this.getHost() + "/accounts/" + accountId;178 return this.send(url, "GET");179}180VegaDNSClient.prototype.accounts = function(search = false) {181 var data = {}182 if (search !== false) {183 data.search = search;184 }185 var url = this.getHost() + "/accounts";186 return this.send(url, "GET", data);187}188VegaDNSClient.prototype.addAccount = function(data) {189 var url = this.getHost() + "/accounts";190 return this.send(url, "POST", data);191}192VegaDNSClient.prototype.editAccount = function(data) {193 var url = this.getHost() + "/accounts/" + data.account_id;194 return this.send(url, "PUT", data);195}196VegaDNSClient.prototype.deleteAccount = function(accountId) {197 var url = this.getHost() + "/accounts/" + accountId;198 return this.send(url, "DELETE");199}200VegaDNSClient.prototype.domaingroupmaps = function(groupId) {201 var url = this.getHost() + "/domaingroupmaps?group_id=" + groupId;202 return this.send(url, "GET");203}204VegaDNSClient.prototype.addDomainGroupMap = function(groupId, domainId, permissions) {205 var url = this.getHost() + "/domaingroupmaps";206 var data = {207 group_id: groupId,208 domain_id: domainId,209 can_read: permissions.can_read,210 can_write: permissions.can_write,211 can_delete: permissions.can_delete212 };213 return this.send(url, "POST", data);214}215VegaDNSClient.prototype.editDomainGroupMap = function(domaingroupmapId, permissions) {216 var url = this.getHost() + "/domaingroupmaps/" + domaingroupmapId;217 var data = {218 can_read: permissions.can_read,219 can_write: permissions.can_write,220 can_delete: permissions.can_delete221 };222 return this.send(url, "PUT", data);223}224VegaDNSClient.prototype.deleteDomainGroupMap = function(domaingroupmapId) {225 var url = this.getHost() + "/domaingroupmaps/" + domaingroupmapId;226 return this.send(url, "DELETE");227}228VegaDNSClient.prototype.groupmembers = function(groupId) {229 var url = this.getHost() + "/groupmembers?group_id=" + groupId;230 return this.send(url, "GET");231}232VegaDNSClient.prototype.addGroupMember = function(groupId, accountId) {233 var url = this.getHost() + "/groupmembers";234 var data = {235 group_id: groupId,236 account_id: accountId,237 is_admin: 0 // Defaults to non-admin238 };239 return this.send(url, "POST", data);240}241VegaDNSClient.prototype.editGroupMember = function(groupmemberId, isAdmin) {242 var url = this.getHost() + "/groupmembers/" + groupmemberId;243 var data = { is_admin: isAdmin };244 return this.send(url, "PUT", data);245}246VegaDNSClient.prototype.deleteGroupMember = function(groupmemberId) {247 var url = this.getHost() + "/groupmembers/" + groupmemberId;248 return this.send(url, "DELETE");249}250VegaDNSClient.prototype.groups = function() {251 var url = this.getHost() + "/groups";252 return this.send(url, "GET");253}254VegaDNSClient.prototype.addGroup = function(data) {255 var url = this.getHost() + "/groups";256 return this.send(url, "POST", data);257}258VegaDNSClient.prototype.editGroup = function(data) {259 var url = this.getHost() + "/groups/" + data.group_id;260 return this.send(url, "PUT", data);261}262VegaDNSClient.prototype.deleteGroup = function(groupId) {263 var url = this.getHost() + "/groups/" + groupId;264 return this.send(url, "DELETE");265}266VegaDNSClient.prototype.getGroup = function(groupId) {267 var url = this.getHost() + "/groups/" + groupId;268 return this.send(url, "GET");269}270VegaDNSClient.prototype.getDomain = function(domainId) {271 var url = this.getHost() + "/domains/" + domainId;272 return this.send(url, "GET");273}274VegaDNSClient.prototype.addDomain = function(275 domain, skipSoa = false, skipDefaultRecords = false, moveCollidingRecords = false276) {277 var url = this.getHost() + "/domains" ;278 var data = {279 domain: domain280 }281 if (skipSoa !== false) {282 data.skip_soa = 1;283 }284 if (skipDefaultRecords !== false) {285 data.skip_default_records = 1;286 }287 if (moveCollidingRecords !== false) {288 data.move_colliding_records = 1;289 }290 return this.send(url, "POST", data);291}292VegaDNSClient.prototype.deleteDomain = function(domainId) {293 var url = this.getHost() + "/domains/" + domainId;294 return this.send(url, "DELETE");295}296VegaDNSClient.prototype.locations = function() {297 var url = this.getHost() + "/locations";298 return this.send(url, "GET");299}300VegaDNSClient.prototype.getLocation = function(locationId) {301 var url = this.getHost() + "/locations/" + locationId;302 return this.send(url, "GET");303}304VegaDNSClient.prototype.addLocation = function(locationName, locationDescription) {305 var url = this.getHost() + "/locations";306 var data = {307 location: locationName,308 location_description: locationDescription309 }310 return this.send(url, "POST", data);311}312VegaDNSClient.prototype.editLocation = function(locationId, locationName, locationDescription) {313 var url = this.getHost() + "/locations/" + locationId;314 var data = {315 location: locationName,316 location_description: locationDescription317 }318 return this.send(url, "PUT", data);319}320VegaDNSClient.prototype.deleteLocation = function(locationId) {321 var url = this.getHost() + "/locations/" + locationId;322 return this.send(url, "DELETE");323}324VegaDNSClient.prototype.locationPrefixes = function(locationId) {325 var url = this.getHost() + "/location_prefixes";326 var data = {location_id: locationId}327 return this.send(url, "GET", data);328}329VegaDNSClient.prototype.getLocationPrefix = function(prefixId) {330 var url = this.getHost() + "/location_prefixes/" + prefixId;331 return this.send(url, "GET");332}333VegaDNSClient.prototype.addLocationPrefix = function(locationId, prefix, prefixDescription, prefixType) {334 var url = this.getHost() + "/location_prefixes";335 var data = {336 location_id: locationId,337 prefix: prefix,338 prefix_description: prefixDescription,339 prefix_type: prefixType340 }341 return this.send(url, "POST", data);342}343VegaDNSClient.prototype.editLocationPrefix = function(prefixId, prefix, prefixDescription, prefixType) {344 var url = this.getHost() + "/location_prefixes/" + prefixId;345 var data = {346 prefix: prefix,347 prefix_description: prefixDescription,348 prefix_type: prefixType349 }350 return this.send(url, "PUT", data);351}352VegaDNSClient.prototype.deleteLocationPrefix = function(prefixId) {353 var url = this.getHost() + "/location_prefixes/" + prefixId;354 return this.send(url, "DELETE");355}356VegaDNSClient.prototype.audit_logs = function(page, perpage, sort, order, search = false, domainIds = false) {357 var data = {358 page: page,359 perpage: perpage,360 sort: sort,361 order: order362 };363 if (domainIds !== false) {364 data.domain_ids = domainIds;365 }366 if (search !== false) {367 data.search = search;368 }369 var url = this.getHost() + "/audit_logs";370 return this.send(url, "GET", data);371}372VegaDNSClient.prototype.passwordResetRequest = function(email) {373 var url = this.getHost() + "/password_reset_tokens";374 var data = {375 email: email376 };377 return this.send(url, "POST", data);378}379VegaDNSClient.prototype.passwordReset = function(password, token) {380 var url = this.getHost() + "/password_reset_tokens/" + token;381 var data = {382 password: password383 };384 return this.send(url, "PUT", data);385}386VegaDNSClient.prototype.passwordResetTokenCheck = function(token) {387 var url = this.getHost() + "/password_reset_tokens/" + token;388 return this.send(url, "GET");389}390VegaDNSClient.prototype.healthcheck = function() {391 var url = this.getHost(false) + "/healthcheck";392 return this.send(url, "GET");393}394VegaDNSClient.prototype.releaseVersion = function() {395 var url = this.getHost() + "/release_version";396 return this.send(url, "GET");397}398VegaDNSClient.prototype.containsAuthError = function(data) {399 if ("status" in data) {400 if (data.status == "error") {401 return true;402 }403 }404 return false;405}...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

2const fs = require('fs');3const path = require('path');4const express = require('express');5const router = express.Router();6function getHost() {7 if ("undefined" === typeof process.env.LOCAL_NETWORK) {8 return encodeURIComponent('localhost:3211');9 } else {10 return encodeURIComponent(process.env.LOCAL_NETWORK);11 }12}13const initialData = {14 title: 'JSON-LD Course',15 introduction: 'This is a short course in JSON-LD',16 tools: [17 {18 part: 1,19 title: 'JSON-LD Playground (running locally)',20 resource: 'json-ld.org/playground/'21 }22 ],23 parts: [24 {25 part: 1,26 title: 'Example 1: Adding context',27 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa001'28 },29 {30 part: 2,31 title: 'Example 2: Adding context',32 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa002'33 },34 {35 part: 3,36 title: 'Example 3: Adding context',37 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa003&context=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa003.jsonld'38 },39 {40 part: 4,41 title: 'Example 4: Aliasing',42 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa004.json&context=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa004.jsonld'43 },44 {45 part: 5,46 title: 'Example 5: Aliasing',47 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa005.json&context=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa005.jsonld'48 },49 {50 part: 6,51 title: 'Example 6: Datatypes',52 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa006'53 },54 {55 part: 7,56 title: 'Example 7: Datatypes',57 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa007'58 },59 {60 part: 8,61 title: 'Example 8: Datatypes',62 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa008'63 },64 {65 part: 9,66 title: 'Example 9: Datatypes (fails)',67 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa009'68 },69 {70 part: 10,71 title: 'Example 10: Datatypes',72 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa010'73 },74 {75 part: 11,76 title: 'Example 11: Languages',77 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa011'78 },79 {80 part: 12,81 title: 'Example 12: Languages',82 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa012'83 },84 {85 part: 13,86 title: 'Example 13: Languages',87 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa013'88 },89 {90 part: 14,91 title: 'Example 14 A: Embedding resources',92 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fperson%2Fp001'93 },94 {95 part: 15,96 title: 'Example 14 B: Embedding resources',97 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa014'98 },99 {100 part: 16,101 title: 'Example 15: Embedding resources',102 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa015'103 },104 {105 part: 17,106 title: 'Example 16: Embedding resources',107 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa016'108 },109 {110 part: 18,111 title: 'Example 17 A: Simple frame document (no frame)',112 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa017'113 },114 {115 part: 19,116 title: 'Example 17 B: Simple frame document (framed)',117 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa017&frame=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa017.jsonld'118 },119 {120 part: 20,121 title: 'Example 18 A: Default (no frame)',122 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa018'123 },124 {125 part: 21,126 title: 'Example 18 B: Default (framed)',127 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa018&frame=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa018.jsonld'128 },129 {130 part: 22,131 title: 'Example 19: Embedding in frames',132 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa019&frame=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa019.jsonld'133 },134 {135 part: 23,136 title: 'Example 20: embedding with @last',137 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa020&frame=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa020.jsonld'138 },139 {140 part: 24,141 title: 'Example 21: Embedding with @always',142 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fdocument%2Fa021&frame=http%3A%2F%2F' + getHost() + '%2Fcontext%2Fa021.jsonld'143 }144 ],145 exercises: [146 {147 exercise: 1,148 title: 'Exercise 1: Adding context',149 resource: 'json-ld.org/playground/#startTab=tab-expanded&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe001'150 },151 {152 exercise: 2,153 title: 'Exercise 2: Tagging strings for language',154 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe002'155 },156 {157 exercise: 3,158 title: 'Exercise 2: Datatypes',159 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe003'160 },161 {162 exercise: 4,163 title: 'Exercise 4: More datatypes',164 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe004'165 },166 {167 exercise: 5,168 title: 'Exercise 5: Coercing things into arrays',169 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe005'170 },171 {172 exercise: 6,173 title: 'Exercise 6: Reversing semantics',174 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe006'175 },176 {177 exercise: 7,178 title: 'Exercise 7: Indexer-friendly syntax',179 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe007'180 },181 {182 exercise: 8,183 title: 'Exercise 8: Making things pretty',184 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe008'185 },186 {187 exercise: 9,188 title: 'Exercise 9: Aliasing',189 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe009'190 },191 {192 exercise: 10,193 title: 'Exercise 10: Yet more datatypes',194 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe010'195 },196 {197 exercise: 11,198 title: 'Exercise 11: Language maps',199 resource: 'json-ld.org/playground/#startTab=tab-compacted&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe011'200 },201 {202 exercise: 12,203 title: 'Exercise 12: Framing',204 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe012'205 },206 {207 exercise: 13,208 title: 'Exercise 13: Embedding',209 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe013'210 },211 {212 exercise: 14,213 title: 'Exercise 14: More embedding',214 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe014'215 },216 {217 exercise: 15,218 title: 'Exercise 15: The whole shebang',219 resource: 'json-ld.org/playground/#startTab=tab-framed&json-ld=http%3A%2F%2F' + getHost() + '%2Fexercises%2Fe015'220 }221 ]222};223/* GET home page. */224router.get('/', function (req, res, next) {225 res.render('index', initialData);226});227router.get('/:contextDirectory/:contextFile', function (req, res, next) {228 const json = '.json';229 const contextFile = req.params.contextFile;230 const contextDirectory = req.params.contextDirectory;231 const leaf = (contextDirectory !== 'context' && contextFile.substring(contextFile.length - json.length) !== json) ?232 contextFile + json : contextFile;233 const options = {...

Full Screen

Full Screen

Api.js

Source:Api.js Github

copy

Full Screen

...12 };13 constructor() {}14 //版本 根据id获取版本信息15 versionLast() {16 let url = `${this.#getHost()}v1/version/last`;17 return new Fetch().get(url, null);18 }19 //登录20 signIn(email, password) {21 let url = `${this.#getHost()}v1/account/signin`;22 return new Fetch().post(url, {email, password});23 }24 //注册25 signUp(email, password, verify, code) {26 let url = `${this.#getHost()}v1/account/signup`;27 return new Fetch().post(url, {email, password, verify, code});28 }29 //忘记密码30 forget(email, password, confirm, verify) {31 let url = `${this.#getHost()}v1/account/forget`;32 return new Fetch().post(url, {email, password, confirm, verify});33 }34 //发送验证码35 code(email, scene) {36 let url = `${this.#getHost()}v1/system/code`;37 return new Fetch().post(url, {email, scene});38 }39 //发送验证码40 codeNoEmail(scene) {41 let url = `${this.#getHost()}v1/system/code/{scene}`;42 return new Fetch().post(url, {scene}, {isAuth: true});43 }44 //极光推送45 putJPush(registerId) {46 let url = `${this.#getHost()}v1/account/notice/register/{registerId}`;47 return new Fetch().put(url, {registerId}, {isAuth: true});48 }49 //用户信息50 user() {51 let url = `${this.#getHost()}v1/user`;52 return new Fetch().get(url, null, {isAuth: true});53 }54 //修改用户昵称55 editUserName(name) {56 let url = `${this.#getHost()}v1/user/name`;57 return new Fetch().post(url, {name}, {isAuth: true});58 }59 //修改支付密码60 editPayPwd(confirm, code, password) {61 let url = `${this.#getHost()}v1/user/paypass`;62 return new Fetch().post(url, {confirm, code, password}, {isAuth: true});63 }64 /**65 * ------------- 资产66 */67 //用户资产68 assets() {69 let url = `${this.#getHost()}v1/assets`;70 return new Fetch().get(url, null, {isAuth: true});71 }72 //用户奖励资产73 assetsReward() {74 let url = `${this.#getHost()}v1/assets/reward`;75 return new Fetch().get(url, null, {isAuth: true});76 }77 //系统资产78 assetsSystem() {79 let url = `${this.#getHost()}v1/system/assets`;80 return new Fetch().get(url, null, {isAuth: true});81 }82 /**83 * -------- 通知84 */85 //通知86 noticeList(size, p) {87 let url = `${this.#getHost()}v1/notice/{size}/{p}`;88 return new Fetch().get(url, {size, p}, {isAuth: true});89 }90 //系统通知91 systemNoticeList(size, p) {92 let url = `${this.#getHost()}v1/notice/system/{size}/{p}`;93 return new Fetch().get(url, {size, p}, {isAuth: true});94 }95 //系统通知 详细96 systemNoticeById(id) {97 let url = `${this.#getHost()}v1/notice/system/{id}`;98 return new Fetch().get(url, {id}, {isAuth: true});99 }100 /**101 * -------- 文章102 */103 //文章详细104 articleById(id) {105 let url = `${this.#getHost()}v1/system/article/{id}`;106 return new Fetch().get(url, {id}, {isAuth: true});107 }108 /**109 * -------- 我的团队110 */111 //我的团队112 userTeam() {113 let url = `${this.#getHost()}v1/user/team`;114 return new Fetch().get(url, null, {isAuth: true});115 }116 /**117 * -------- 矿机118 */119 //矿机详细120 minerMeerById() {121 let url = `${this.#getHost()}v1/miner/meer`;122 return new Fetch().get(url, null, {isAuth: true});123 }124 //矿机购买125 minerMeerBuy(id, count, payment, verifyCode, payType, code) {126 let url = `${this.#getHost()}v1/miner/meer/order`;127 return new Fetch().post(128 url,129 {id, count, payment, verifyCode, payType, code},130 {isAuth: true},131 );132 }133 //矿机订单列表134 minerMeerOrderList(size, p) {135 let url = `${this.#getHost()}v1/miner/meer/order/{size}/{p}`;136 return new Fetch().get(url, {size, p}, {isAuth: true});137 }138 /**139 * -------- 兑换140 */141 //兑换记录142 exchangeList(size, p) {143 let url = `${this.#getHost()}v1/exchange/{size}/{p}`;144 return new Fetch().get(url, {size, p}, {isAuth: true});145 }146 //兑换选项147 exchangeOptions() {148 let url = `${this.#getHost()}v1/exchange/options`;149 return new Fetch().get(url, null, {isAuth: true});150 }151 /**152 * -------- 资产记录153 */154 //主资产记录155 assetsList(id, size, p) {156 let url = `${this.#getHost()}v1/assets/history/{id}/{size}/{p}`;157 return new Fetch().get(url, {id, size, p}, {isAuth: true});158 }159 //奖励资产记录160 assetsRewardList(id, size, p) {161 let url = `${this.#getHost()}v1/assets/reward/history/{id}/{size}/{p}`;162 return new Fetch().get(url, {id, size, p}, {isAuth: true});163 }164 /**165 * -------- 划转166 */167 //划转168 transform(assetsId, amount, payment) {169 let url = `${this.#getHost()}v1/transform`;170 return new Fetch().post(url, {assetsId, amount, payment}, {isAuth: true});171 }172 //划转记录173 transformList(assetsId, size, p) {174 let url = `${this.#getHost()}v1/transform/{assetsId}/{size}/{p}`;175 return new Fetch().get(url, {assetsId, size, p}, {isAuth: true});176 }177 /**178 * -------- 主资产转账179 */180 //主资产转账181 transfer(email, amount, assetsId, payment, code, memo, type) {182 let url = `${this.#getHost()}v1/transfer`;183 return new Fetch().post(184 url,185 {email, amount, assetsId, payment, code, memo, type},186 {isAuth: true},187 );188 }189 //奖励资产转账190 transferReward(email, amount, assetsId, payment, code, memo, type) {191 let url = `${this.#getHost()}v1/transfer/reward`;192 return new Fetch().post(193 url,194 {email, amount, assetsId, payment, code, memo, type},195 {isAuth: true},196 );197 }198 /**199 * -------- 资产转账记录200 */201 //主资产转账记录202 transferList(assetsId, size, p) {203 let url = `${this.#getHost()}v1/transfer/{assetsId}/{size}/{p}`;204 return new Fetch().get(url, {assetsId, size, p}, {isAuth: true});205 }206 //奖励资产转账记录207 transferRewardList(assetsId, size, p) {208 let url = `${this.#getHost()}v1/transfer/reward/{assetsId}/{size}/{p}`;209 return new Fetch().get(url, {assetsId, size, p}, {isAuth: true});210 }211 /**212 * -------- 提现213 */214 //提现215 withdraw(assetsId, payment, code, amount, address, memo) {216 let url = `${this.#getHost()}v1/withdraw`;217 return new Fetch().post(218 url,219 {assetsId, payment, code, amount, address, memo},220 {isAuth: true},221 );222 }223 //提现记录224 withdrawList(assetsId, size, p) {225 let url = `${this.#getHost()}v1/withdraw/{assetsId}/{size}/{p}`;226 return new Fetch().get(url, {assetsId, size, p}, {isAuth: true});227 }228 /**229 * -------- 兑换230 */231 //兑换比例232 exchangeRate() {233 let url = `${this.#getHost()}v1/exchange/rate`;234 return new Fetch().get(url, null, {isAuth: true});235 }236 //兑换237 exchange(count, exchangeId) {238 let url = `${this.#getHost()}v1/exchange`;239 return new Fetch().post(url, {count, exchangeId}, {isAuth: true});240 }241 /**242 * -------- 充值243 */244 //主资产充值记录245 topupList(assetsId, size, p) {246 let url = `${this.#getHost()}v1/topup/{assetsId}/{size}/{p}`;247 return new Fetch().get(url, {assetsId, size, p}, {isAuth: true});248 }249 /**250 * ------- 市场行情251 */252 market() {253 let url = `${this.#getHost()}v1/market`;254 return new Fetch().get(url, null, {isAuth: true});255 }256 /**257 * ------- MEER期货258 */259 //价格260 futurePrice() {261 let url = `${this.#getHost()}v1/future/price`;262 return new Fetch().get(url, null, {isAuth: true});263 }264 //购买265 future(count, payment, code) {266 let url = `${this.#getHost()}v1/future`;267 return new Fetch().post(url, {count, payment, code}, {isAuth: true});268 }269 //购买记录270 futureList(size, p) {271 let url = `${this.#getHost()}v1/future/{size}/{p}`;272 return new Fetch().get(url, {size, p}, {isAuth: true});273 }274 /**275 * -------- 易链通276 */277 //列表278 easyChainList(size, p) {279 let url = `${this.#getHost()}v1/easyChain/list/{size}/{p}`;280 return new Fetch().get(url, {size, p}, {isAuth: true});281 }282 //详情283 easyChainDetail(id) {284 let url = `${this.#getHost()}v1/easyChain/{id}`;285 return new Fetch().get(url, {id}, {isAuth: true});286 }287 //购买288 easyChainBuy(easyChainId, verifyCode, Payment) {289 let url = `${this.#getHost()}v1/easyChainOrder`;290 return new Fetch().post(291 url,292 {easyChainId, verifyCode, Payment},293 {isAuth: true},294 );295 }296 //订单列表297 easyChainOrder(size, p) {298 let url = `${this.#getHost()}v1/easyChainOrder/list/{size}/{p}`;299 return new Fetch().get(url, {size, p}, {isAuth: true});300 }301 //订单详情302 easyChainOrderDetail(id) {303 let url = `${this.#getHost()}v1/easyChainOrder/{id}`;304 return new Fetch().get(url, {id}, {isAuth: true});305 }...

Full Screen

Full Screen

cloud.js

Source:cloud.js Github

copy

Full Screen

...7})8routerApi.get('/ok', async(ctx) => {9 try {10 ctx.body = await request({11 url: host.getHost()12 })13 } catch (e) {14 ctx.body = e.error15 }16})17routerApi.get('/vpc/describe', async(ctx) => {18 try {19 ctx.body = await request({20 headers: {21 authorization: ctx.header.authorization22 },23 url: `${host.getHost()}${prefix}/vpc/describe`,24 qs: ctx.query25 })26 } catch (e) {27 ctx.body = e.error28 }29})30routerApi.get('/subnet/describe', async(ctx) => {31 try {32 ctx.body = await request({33 headers: {34 authorization: ctx.header.authorization35 },36 url: `${host.getHost()}${prefix}/subnet/describe`,37 qs: ctx.query38 })39 } catch (e) {40 ctx.body = e.error41 }42})43routerApi.get('/security_group/describe', async(ctx) => {44 try {45 ctx.body = await request({46 headers: {47 authorization: ctx.header.authorization48 },49 url: `${host.getHost()}${prefix}/security_group/describe`,50 qs: ctx.query51 })52 } catch (e) {53 ctx.body = e.error54 }55})56routerApi.get('/cloud_account/list', async(ctx) => {57 try {58 ctx.body = await request({59 headers: {60 authorization: ctx.header.authorization61 },62 url: `${host.getHost()}${prefix}/cloud_account/list`,63 qs: {64 ...ctx.query65 }66 })67 } catch (e) {68 ctx.body = e.error69 }70})71routerApi.post('/cloud_account/create', async(ctx) => {72 ctx.body = await request({73 headers: {74 authorization: ctx.header.authorization75 },76 url: `${host.getHost()}${prefix}/cloud_account/create`,77 method: 'POST',78 body: ctx.request.body,79 json: true80 })81})82routerApi.post('/cloud_account/edit', async(ctx) => {83 try {84 ctx.body = await request({85 headers: {86 authorization: ctx.header.authorization87 },88 url: `${host.getHost()}${prefix}/cloud_account/edit`,89 method: 'POST',90 body: ctx.request.body,91 json: true92 })93 } catch (e) {94 ctx.body = e.error95 }96})97routerApi.delete('/cloud_account/delete/:ids', async(ctx) => {98 try {99 ctx.body = await request({100 headers: {101 authorization: ctx.header.authorization102 },103 url: `${host.getHost()}${prefix}/cloud_account/delete/${ctx.params.ids}`,104 method: 'DELETE'105 })106 } catch (e) {107 ctx.body = e.error108 }109})110routerApi.get('/region/list', async(ctx) => {111 try {112 ctx.body = await request({113 headers: {114 authorization: ctx.header.authorization115 },116 url: `${host.getHost()}${prefix}/region/list`,117 qs: ctx.query118 })119 } catch (e) {120 ctx.body = e.error121 }122})123routerApi.get('/zone/list', async(ctx) => {124 try {125 ctx.body = await request({126 headers: {127 authorization: ctx.header.authorization128 },129 url: `${host.getHost()}${prefix}/zone/list`,130 qs: ctx.query131 })132 } catch (e) {133 ctx.body = e.error134 }135})136routerApi.get('/instance_type/list', async(ctx) => {137 try {138 ctx.body = await request({139 headers: {140 authorization: ctx.header.authorization141 },142 url: `${host.getHost()}${prefix}/instance_type/list`,143 qs: ctx.query144 })145 } catch (e) {146 ctx.body = e.error147 }148})149routerApi.post('/vpc/create', async(ctx) => {150 try {151 ctx.body = await request({152 headers: {153 authorization: ctx.header.authorization154 },155 method: 'POST',156 url: `${host.getHost()}${prefix}/vpc/create`,157 body: ctx.request.body,158 json: true159 })160 } catch (e) {161 ctx.body = e.error162 }163})164routerApi.post('/subnet/create', async(ctx) => {165 try {166 ctx.body = await request({167 headers: {168 authorization: ctx.header.authorization169 },170 method: 'POST',171 url: `${host.getHost()}${prefix}/subnet/create`,172 body: ctx.request.body,173 json: true174 })175 } catch (e) {176 ctx.body = e.error177 }178})179routerApi.post('/security_group/create', async(ctx) => {180 try {181 ctx.body = await request({182 headers: {183 authorization: ctx.header.authorization184 },185 method: 'POST',186 url: `${host.getHost()}${prefix}/security_group/create`,187 body: ctx.request.body,188 json: true189 })190 } catch (e) {191 ctx.body = e.error192 }193})194routerApi.post('/security_group/create_with_rule', async(ctx) => {195 try {196 ctx.body = await request({197 headers: {198 authorization: ctx.header.authorization199 },200 method: 'POST',201 url: `${host.getHost()}${prefix}/security_group/create_with_rule`,202 body: ctx.request.body,203 json: true204 })205 } catch (e) {206 ctx.body = e.error207 }208})209routerApi.post('/security_group/rule/add', async(ctx) => {210 try {211 ctx.body = await request({212 headers: {213 authorization: ctx.header.authorization214 },215 method: 'POST',216 url: `${host.getHost()}${prefix}/security_group/rule/add`,217 body: ctx.request.body,218 json: true219 })220 } catch (e) {221 ctx.body = e.error222 }223})224routerApi.get('/image/list', async(ctx) => {225 try {226 ctx.body = await request({227 headers: {228 authorization: ctx.header.authorization229 },230 url: `${host.getHost()}${prefix}/image/list`,231 qs: ctx.query232 })233 } catch (e) {234 ctx.body = e.error235 }236})237routerApi.post('/network_config/sync', async(ctx) => {238 try {239 ctx.body = await request({240 headers: {241 authorization: ctx.header.authorization242 },243 url: `${host.getHost()}${prefix}/network_config/sync`,244 method: 'POST',245 body: ctx.request.body,246 json: true247 })248 } catch (e) {249 ctx.body = e.error250 }251})252routerApi.get('/vpc/info/:id', async(ctx) => {253 try {254 ctx.body = await request({255 headers: {256 authorization: ctx.header.authorization257 },258 url: `${host.getHost()}${prefix}/vpc/info/${ctx.params.id}`,259 })260 } catch (e) {261 ctx.body = e.error262 }263})264routerApi.get('/subnet/info/:id', async(ctx) => {265 try {266 ctx.body = await request({267 headers: {268 authorization: ctx.header.authorization269 },270 url: `${host.getHost()}${prefix}/subnet/info/${ctx.params.id}`,271 qs: ctx.query272 })273 } catch (e) {274 ctx.body = e.error275 }276})277routerApi.get('/security_group/:id/rules', async(ctx) => {278 try {279 ctx.body = await request({280 headers: {281 authorization: ctx.header.authorization282 },283 url: `${host.getHost()}${prefix}/security_group/${ctx.params.id}/rules`,284 qs: ctx.query285 })286 } catch (e) {287 ctx.body = e.error288 }289})...

Full Screen

Full Screen

services.js

Source:services.js Github

copy

Full Screen

...36envs.forEach(function(env) {37 appConfig[env] = {38 domain: env + "." + domain,39 services: {40 "riox-ui-frontend": { url: "http://" + getHost(env, "riox-ui-frontend") + "/" },41 "riox-ui": { url: "http://" + getHost(env, "riox-ui") + ":8081/" },42 billing: { url: "http://" + getHost(env, "billing-service") + ":8080/api/v1/billing" },43 users: { url: "http://" + getHost(env, "users-service") + ":8084/api/v1/users" },44 organizations: { url: "http://" + getHost(env, "organizations-service") + ":8084/api/v1/organizations" },45 gateway: { url: "http://" + getHost(env, "gateway-service") + ":8088/api/v1/gateway" },46 statistics: { url: "http://" + getHost(env, "statistics-service") + ":8088/api/v1/statistics" },47 proxies: { url: "http://" + getHost(env, "proxies-service") + ":8088/api/v1/proxies" },48 pipes: { url: "http://" + getHost(env, "pipes-service") + ":8085/api/v1/pipes" },49 pipeelements: { url: "http://" + getHost(env, "pipes-service") + ":8085/api/v1/pipeelements" },50 pipedeployments: { url: "http://" + getHost(env, "pipes-service") + ":8085/api/v1/pipes/deployments" }, 51 access: { url: "http://" + getHost(env, "access-service") + ":8089/api/v1/access" },52 consents: { url: "http://" + getHost(env, "consent-service") + ":8089/api/v1/consents" },53 files: { url: "http://" + getHost(env, "files-service") + ":8087/api/v1/files" },54 notifications: { url: "http://" + getHost(env, "notifications-service") + ":8084/api/v1/notifications" },55 analytics: { url: "http://" + getHost(env, "analytics-service") + ":8086/api/v1/analytics" },56 certificates: { url: "http://" + getHost(env, "certificates-service") + ":8084/api/v1/certificates" },57 pricing: { url: "http://" + getHost(env, "pricing-service") + ":8090/api/v1/pricing" },58 ratings: { url: "http://" + getHost(env, "ratings-service") + ":8090/api/v1/ratings" },59 websocket: { url: "ws://" + getHost(env, "statistics-service") + ":8085/" }60 },61 infra: {62 mongodb: {63 baseurl: "mongodb://" + getHost(env, "mongo") + "/",64 url: "mongodb://" + getHost(env, "mongo") + "/riox-" + env65 },66 kafka: {67 hostname: getHost(env, "kafka")68 },69 zookeeper: {70 hostname: getHost(env, "zookeeper"),71 host: getHost(env, "zookeeper") + ":2181"72 },73 redis: {74 hostname: getHost(env, "redis"),75 url: "redis://" + getHost(env, "redis") + ":6379",76 sentinels: getHost(env, "redis-sentinel") + ":26379",77 master: "mymaster"78 },79 kibana: {80 url: "http://" + getHost(env, "kibana") + ":5601"81 },82 nginx: {83 url: "http://" + getHost(env, "nginx-config") + ":8082"84 },85 elasticsearch: {86 hostname: getHost(env, "elasticsearch")87 },88 springcdf: {89 hostname: getHost(env, "scd-admin-k8s")90 },91 springcdfLocal: {92 hostname: getHost(env, "scd-admin-local")93 },94 statsd: {95 hostname: getHost(env, "statsd")96 }97 }98 };99});100if(typeof module != "undefined") {101 module.exports = appConfig;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getHost } = require('appium-xcuitest-driver');2console.log(getHost());3const { getPort } = require('appium-xcuitest-driver');4console.log(getPort());5const { getDevice } = require('appium-xcuitest-driver');6console.log(getDevice());7const { getUdid } = require('appium-xcuitest-driver');8console.log(getUdid());9const { getPlatformVersion } = require('appium-xcuitest-driver');10console.log(getPlatformVersion());11const { getPlatformName } = require('appium-xcuitest-driver');12console.log(getPlatformName());13const { getAutomationName } = require('appium-xcuitest-driver');14console.log(getAutomationName());15const { getBundleId } = require('appium-xcuitest-driver');16console.log(getBundleId());17const { getLanguage } = require('appium-xcuitest-driver');18console.log(getLanguage());19const { getLocale } = require('appium-xcuitest-driver');20console.log(getLocale());21const { getIosInstallPause } = require('appium-xcuitest-driver');22console.log(getIosInstallPause());

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var caps = {4};5var driver = wd.promiseChainRemote('localhost', 4723);6 .init(caps)7 .getHost()8 .then(function(host) {9 console.log(host);10 })11 .quit();12{ address: '

Full Screen

Using AI Code Generation

copy

Full Screen

1var driver = getDriver();2var device = driver.getHost();3console.log(device);4var driver = getDriver();5var platformVersion = driver.getPlatformVersion();6console.log(platformVersion);7var driver = getDriver();8var deviceTime = driver.getDeviceTime();9console.log(deviceTime);10var driver = getDriver();11var deviceTime = driver.getDeviceTime();12console.log(deviceTime);13var driver = getDriver();14var deviceTime = driver.getDeviceTime();15console.log(deviceTime);16var driver = getDriver();17var deviceTime = driver.getDeviceTime();18console.log(deviceTime);19var driver = getDriver();20var deviceTime = driver.getDeviceTime();21console.log(deviceTime);22var driver = getDriver();23var deviceTime = driver.getDeviceTime();24console.log(deviceTime);25var driver = getDriver();26var deviceTime = driver.getDeviceTime();27console.log(deviceTime);28var driver = getDriver();29var deviceTime = driver.getDeviceTime();30console.log(deviceTime);31var driver = getDriver();32var deviceTime = driver.getDeviceTime();33console.log(deviceTime);34var driver = getDriver();35var deviceTime = driver.getDeviceTime();36console.log(deviceTime);37var driver = getDriver();38var deviceTime = driver.getDeviceTime();39console.log(deviceTime);40var driver = getDriver();41var deviceTime = driver.getDeviceTime();42console.log(deviceTime);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { getDriver } = require('appium-xcuitest-driver');2const driver = getDriver('sessionId');3driver.getHost();4const { getDriver } = require('appium-xcuitest-driver');5const driver = getDriver('sessionId');6driver.getHost();7const { getDriver } = require('appium-xcuitest-driver');8const driver = getDriver('sessionId');9driver.getHost();10const { getDriver } = require('appium-xcuitest-driver');11const driver = getDriver('sessionId');12driver.getHost();13const { getDriver } = require('appium-xcuitest-driver');14const driver = getDriver('sessionId');15driver.getHost();16const { getDriver } = require('appium-xcuitest-driver');17const driver = getDriver('sessionId');18driver.getHost();19const { getDriver } = require('appium-xcuitest-driver');20const driver = getDriver('sessionId');21driver.getHost();22const { getDriver } = require('appium-xcuitest-driver');23const driver = getDriver('sessionId');24driver.getHost();25const { getDriver } = require('appium-xcuitest-driver');26const driver = getDriver('sessionId');27driver.getHost();28const { getDriver } = require('appium-xcuitest-driver');29const driver = getDriver('sessionId');30driver.getHost();31const { getDriver } = require('

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var serverConfig = {4};5var desiredCaps = {6};7var driver = wd.promiseChainRemote(serverConfig);8 .init(desiredCaps)9 .then(function () {10 return driver.getHost();11 })12 .then(function (host) {13 console.log(host);14 })15 .catch(function (err) {16 console.log(err);17 })18 .fin(function () {19 return driver.quit();20 })21 .done();22var wd = require('wd');23var assert = require('assert');24var serverConfig = {25};26var desiredCaps = {27};28var driver = wd.promiseChainRemote(serverConfig);29 .init(desiredCaps)30 .then(function () {31 return driver.setHost('

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Test Appium XCUITest Driver', () => {2 it('should get the host', async () => {3 const driver = await wdio.remote({4 capabilities: {5 }6 });7 const host = await driver.getHost();8 console.log(host);9 await driver.deleteSession();10 });11});12exports.config = {13 capabilities: [{14 }],15 appium: {16 args: {

Full Screen

Using AI Code Generation

copy

Full Screen

1console.log("Appium Xcuitest Driver: getHost");2console.log("Host: "+driver.getHost());3console.log("Appium Xcuitest Driver: getHost - DONE");4console.log("Appium Xcuitest Driver: getPort");5console.log("Port: "+driver.getPort());6console.log("Appium Xcuitest Driver: getPort - DONE");7console.log("Appium Xcuitest Driver: getDriverInfo");8console.log("Driver Info: "+driver.getDriverInfo());9console.log("Appium Xcuitest Driver: getDriverInfo - DONE");10console.log("Appium Xcuitest Driver: getPlatform");11console.log("Platform: "+driver.getPlatform());12console.log("Appium Xcuitest Driver: getPlatform - DONE");13console.log("Appium Xcuitest Driver: getSessionId");14console.log("SessionId: "+driver.getSessionId());15console.log("Appium Xcuitest Driver: getSessionId - DONE");16console.log("Appium Xcuitest Driver: getCapabilities");17console.log("Capabilities: "+driver.getCapabilities());18console.log("Appium Xcuitest Driver: getCapabilities - DONE");19console.log("Appium Xcuitest Driver: getDeviceTime");20console.log("DeviceTime: "+driver.getDeviceTime());21console.log("Appium Xcuitest Driver: getDeviceTime - DONE");22console.log("Appium Xcuitest Driver: getDevicePlatform");23console.log("DevicePlatform: "+driver.getDevicePlatform());24console.log("Appium Xcuitest Driver: getDevicePlatform - DONE");25console.log("Appium Xcuitest Driver: getDeviceName");26console.log("DeviceName: "+driver.getDeviceName());27console.log("Appium Xcuitest Driver: getDeviceName - DONE");

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Xcuitest Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Sign up Free
_

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful