Skip to content

Commit

Permalink
export command api dialog supports parsing actual AriaNg root page ur…
Browse files Browse the repository at this point in the history
…l from user input
  • Loading branch information
mayswind committed Apr 3, 2023
1 parent a144955 commit 01c7dd5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/scripts/directives/exportCommandApiDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@
isCopied: false
};

var getBaseUrl = function () {
var baseUrl = scope.context.baseUrl;

if (baseUrl.indexOf('#') >= 0) {
baseUrl = baseUrl.substring(0, baseUrl.indexOf('#'));
}

return baseUrl;
};

var getNewTaskCommandAPIUrl = function (task) {
var commandAPIUrl = scope.context.baseUrl + '#!/new/task?' +
var commandAPIUrl = getBaseUrl() + '#!/new/task?' +
'url=' + ariaNgCommonService.base64UrlEncode(task.urls[0]);

if (scope.context.pauseOnAdded) {
Expand Down Expand Up @@ -54,7 +64,7 @@
};

var getSettingCommandAPIUrl = function (setting) {
var commandAPIUrl = scope.context.baseUrl + '#!/settings/rpc/set?' +
var commandAPIUrl = getBaseUrl() + '#!/settings/rpc/set?' +
'protocol=' + setting.protocol +
'&host=' + setting.rpcHost +
'&port=' + setting.rpcPort +
Expand Down

0 comments on commit 01c7dd5

Please sign in to comment.