dir option in new task page supports history
This commit is contained in:
parent
65b116d1ba
commit
e94946a384
|
@ -51,6 +51,7 @@
|
||||||
"angular-busy": "^4.1.4",
|
"angular-busy": "^4.1.4",
|
||||||
"angular-promise-buttons": "^0.1.23",
|
"angular-promise-buttons": "^0.1.23",
|
||||||
"angular-clipboard": "^1.6.2",
|
"angular-clipboard": "^1.6.2",
|
||||||
|
"angular-input-dropdown": "mayswind/angular-input-dropdown#33e48a818215b9d582f5db8d3b59fce4ed6b92c7",
|
||||||
"angularjs-dragula": "^2.0.0",
|
"angularjs-dragula": "^2.0.0",
|
||||||
"ngSweetAlert": "^1.1.2"
|
"ngSweetAlert": "^1.1.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
<link rel="stylesheet" href="../bower_components/angular/angular-csp.css"/>
|
<link rel="stylesheet" href="../bower_components/angular/angular-csp.css"/>
|
||||||
<link rel="stylesheet" href="../bower_components/angular-ui-notification/dist/angular-ui-notification.min.css"/>
|
<link rel="stylesheet" href="../bower_components/angular-ui-notification/dist/angular-ui-notification.min.css"/>
|
||||||
<link rel="stylesheet" href="../bower_components/angular-busy/dist/angular-busy.min.css"/>
|
<link rel="stylesheet" href="../bower_components/angular-busy/dist/angular-busy.min.css"/>
|
||||||
|
<link rel="stylesheet" href="../bower_components/angular-input-dropdown/inputDropdownStyles.css"/>
|
||||||
<link rel="stylesheet" href="../bower_components/angularjs-dragula/dist/dragula.min.css"/>
|
<link rel="stylesheet" href="../bower_components/angularjs-dragula/dist/dragula.min.css"/>
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
<!-- build:css css/aria-ng.min.css -->
|
<!-- build:css css/aria-ng.min.css -->
|
||||||
|
@ -339,6 +340,7 @@
|
||||||
<script src="../bower_components/angular-busy/dist/angular-busy.min.js"></script>
|
<script src="../bower_components/angular-busy/dist/angular-busy.min.js"></script>
|
||||||
<script src="../bower_components/angular-promise-buttons/dist/angular-promise-buttons.min.js"></script>
|
<script src="../bower_components/angular-promise-buttons/dist/angular-promise-buttons.min.js"></script>
|
||||||
<script src="../bower_components/angular-clipboard/angular-clipboard.js"></script>
|
<script src="../bower_components/angular-clipboard/angular-clipboard.js"></script>
|
||||||
|
<script src="../bower_components/angular-input-dropdown/inputDropdown.js"></script>
|
||||||
<script src="../bower_components/angularjs-dragula/dist/angularjs-dragula.min.js"></script>
|
<script src="../bower_components/angularjs-dragula/dist/angularjs-dragula.min.js"></script>
|
||||||
<script src="../bower_components/ngSweetAlert/SweetAlert.js"></script>
|
<script src="../bower_components/ngSweetAlert/SweetAlert.js"></script>
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
|
|
|
@ -143,6 +143,8 @@ Activate=激活
|
||||||
Reset Settings=重置设置
|
Reset Settings=重置设置
|
||||||
Confirm Reset=确认重置
|
Confirm Reset=确认重置
|
||||||
Are you sure you want to reset all settings?=您是否要重置所有设置?
|
Are you sure you want to reset all settings?=您是否要重置所有设置?
|
||||||
|
Clear Settings History=清除设置历史
|
||||||
|
Are you sure you want to clear all settings history?=您是否要清除所有设置的历史记录?
|
||||||
Delete RPC Setting=删除 RPC 设置
|
Delete RPC Setting=删除 RPC 设置
|
||||||
Add New RPC Setting=添加新 RPC 设置
|
Add New RPC Setting=添加新 RPC 设置
|
||||||
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"?
|
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"?
|
||||||
|
|
|
@ -143,6 +143,8 @@ Activate=啟用
|
||||||
Reset Settings=重設設定
|
Reset Settings=重設設定
|
||||||
Confirm Reset=確認重設
|
Confirm Reset=確認重設
|
||||||
Are you sure you want to reset all settings?=您是否要重設所有設定?
|
Are you sure you want to reset all settings?=您是否要重設所有設定?
|
||||||
|
Clear Settings History=清除設定歷史
|
||||||
|
Are you sure you want to clear all settings history?=您是否要清除所有設定的歷史紀錄?
|
||||||
Delete RPC Setting=刪除 RPC 設定
|
Delete RPC Setting=刪除 RPC 設定
|
||||||
Add New RPC Setting=加入新 RPC 設定
|
Add New RPC Setting=加入新 RPC 設定
|
||||||
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要刪除 RPC 設定 "{{rpcName}}"?
|
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要刪除 RPC 設定 "{{rpcName}}"?
|
||||||
|
|
|
@ -889,12 +889,14 @@
|
||||||
// category: 'global|http|bittorrent',
|
// category: 'global|http|bittorrent',
|
||||||
// [canShow: 'new|active|waiting|paused',] // possible to show in specific status, supporting multiple choice. if not set, always show
|
// [canShow: 'new|active|waiting|paused',] // possible to show in specific status, supporting multiple choice. if not set, always show
|
||||||
// [canUpdate: 'new|active|waiting|paused',] // possible to write in specific status, supporting multiple choice. if not set, always writable
|
// [canUpdate: 'new|active|waiting|paused',] // possible to write in specific status, supporting multiple choice. if not set, always writable
|
||||||
|
// [showHistory: true|false,] // show history under the input box, only supporting "string" type. if not set, this is set to false
|
||||||
// }
|
// }
|
||||||
taskOptions: [
|
taskOptions: [
|
||||||
{
|
{
|
||||||
key: 'dir',
|
key: 'dir',
|
||||||
category: 'global',
|
category: 'global',
|
||||||
canUpdate: 'new'
|
canUpdate: 'new',
|
||||||
|
showHistory: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'out',
|
key: 'out',
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
appPrefix: 'AriaNg',
|
appPrefix: 'AriaNg',
|
||||||
optionStorageKey: 'Options',
|
optionStorageKey: 'Options',
|
||||||
languageStorageKeyPrefix: 'Language',
|
languageStorageKeyPrefix: 'Language',
|
||||||
|
settingHistoryKeyPrefix: 'History',
|
||||||
languagePath: 'langs',
|
languagePath: 'langs',
|
||||||
languageFileExtension: '.txt',
|
languageFileExtension: '.txt',
|
||||||
defaultLanguage: 'en',
|
defaultLanguage: 'en',
|
||||||
|
@ -16,6 +17,7 @@
|
||||||
lazySaveTimeout: 500,
|
lazySaveTimeout: 500,
|
||||||
errorTooltipDelay: 500,
|
errorTooltipDelay: 500,
|
||||||
notificationInPageTimeout: 2000,
|
notificationInPageTimeout: 2000,
|
||||||
|
historyMaxStoreCount: 10,
|
||||||
cachedDebugLogsLimit: 100
|
cachedDebugLogsLimit: 100
|
||||||
}).constant('ariaNgDefaultOptions', {
|
}).constant('ariaNgDefaultOptions', {
|
||||||
language: 'en',
|
language: 'en',
|
||||||
|
|
|
@ -147,6 +147,8 @@
|
||||||
'Reset Settings': 'Reset Settings',
|
'Reset Settings': 'Reset Settings',
|
||||||
'Confirm Reset': 'Confirm Reset',
|
'Confirm Reset': 'Confirm Reset',
|
||||||
'Are you sure you want to reset all settings?': 'Are you sure you want to reset all settings?',
|
'Are you sure you want to reset all settings?': 'Are you sure you want to reset all settings?',
|
||||||
|
'Clear Settings History': 'Clear Settings History',
|
||||||
|
'Are you sure you want to clear all settings history?': 'Are you sure you want to clear all settings history?',
|
||||||
'Delete RPC Setting': 'Delete RPC Setting',
|
'Delete RPC Setting': 'Delete RPC Setting',
|
||||||
'Add New RPC Setting': 'Add New RPC Setting',
|
'Add New RPC Setting': 'Add New RPC Setting',
|
||||||
'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?',
|
'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?',
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
var tabOrders = ['links', 'options'];
|
var tabOrders = ['links', 'options'];
|
||||||
var parameters = $location.search();
|
var parameters = $location.search();
|
||||||
|
|
||||||
|
var saveDownloadPath = function (options) {
|
||||||
|
if (!options || !options.dir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
aria2SettingService.addSettingHistory('dir', options.dir);
|
||||||
|
};
|
||||||
|
|
||||||
var downloadByLinks = function (pauseOnAdded, responseCallback) {
|
var downloadByLinks = function (pauseOnAdded, responseCallback) {
|
||||||
var urls = ariaNgCommonService.parseUrlsFromOriginInput($scope.context.urls);
|
var urls = ariaNgCommonService.parseUrlsFromOriginInput($scope.context.urls);
|
||||||
var options = angular.copy($scope.context.options);
|
var options = angular.copy($scope.context.options);
|
||||||
|
@ -21,6 +29,8 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveDownloadPath(options);
|
||||||
|
|
||||||
return aria2TaskService.newUriTasks(tasks, pauseOnAdded, responseCallback);
|
return aria2TaskService.newUriTasks(tasks, pauseOnAdded, responseCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,6 +40,8 @@
|
||||||
options: angular.copy($scope.context.options)
|
options: angular.copy($scope.context.options)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
saveDownloadPath(options);
|
||||||
|
|
||||||
return aria2TaskService.newTorrentTask(task, pauseOnAdded, responseCallback);
|
return aria2TaskService.newTorrentTask(task, pauseOnAdded, responseCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,6 +51,8 @@
|
||||||
options: angular.copy($scope.context.options)
|
options: angular.copy($scope.context.options)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
saveDownloadPath(options);
|
||||||
|
|
||||||
return aria2TaskService.newMetalinkTask(task, pauseOnAdded, responseCallback);
|
return aria2TaskService.newMetalinkTask(task, pauseOnAdded, responseCallback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').controller('AriaNgSettingsController', ['$rootScope', '$scope', '$routeParams', '$window', '$interval', '$timeout', 'ariaNgLanguages', 'ariaNgCommonService', 'ariaNgSettingService', 'ariaNgMonitorService', 'ariaNgNotificationService', 'ariaNgTitleService', function ($rootScope, $scope, $routeParams, $window, $interval, $timeout, ariaNgLanguages, ariaNgCommonService, ariaNgSettingService, ariaNgMonitorService, ariaNgNotificationService, ariaNgTitleService) {
|
angular.module('ariaNg').controller('AriaNgSettingsController', ['$rootScope', '$scope', '$routeParams', '$window', '$interval', '$timeout', 'ariaNgLanguages', 'ariaNgCommonService', 'aria2SettingService', 'ariaNgSettingService', 'ariaNgMonitorService', 'ariaNgNotificationService', 'ariaNgTitleService', function ($rootScope, $scope, $routeParams, $window, $interval, $timeout, ariaNgLanguages, ariaNgCommonService, aria2SettingService, ariaNgSettingService, ariaNgMonitorService, ariaNgNotificationService, ariaNgTitleService) {
|
||||||
var extendType = $routeParams.extendType;
|
var extendType = $routeParams.extendType;
|
||||||
var lastRefreshPageNotification = null;
|
var lastRefreshPageNotification = null;
|
||||||
|
|
||||||
|
@ -203,6 +203,13 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.clearHistory = function () {
|
||||||
|
ariaNgCommonService.confirm('Confirm Clear', 'Are you sure you want to clear all settings history?', 'warning', function () {
|
||||||
|
aria2SettingService.clearSettingsHistorys();
|
||||||
|
$window.location.reload();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
angular.element('[data-toggle="popover"]').popover();
|
angular.element('[data-toggle="popover"]').popover();
|
||||||
|
|
||||||
$rootScope.loadPromise = $timeout(function () {}, 100);
|
$rootScope.loadPromise = $timeout(function () {}, 100);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
'angularPromiseButtons',
|
'angularPromiseButtons',
|
||||||
'oitozero.ngSweetAlert',
|
'oitozero.ngSweetAlert',
|
||||||
'angular-clipboard',
|
'angular-clipboard',
|
||||||
|
'inputDropdown',
|
||||||
angularDragula(angular)
|
angularDragula(angular)
|
||||||
]);
|
]);
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').directive('ngSetting', ['$timeout', '$translate', 'ariaNgConstants', function ($timeout, $translate, ariaNgConstants) {
|
angular.module('ariaNg').directive('ngSetting', ['$timeout', '$q', '$translate', 'ariaNgConstants', 'aria2SettingService', function ($timeout, $q, $translate, ariaNgConstants, aria2SettingService) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
templateUrl: 'views/setting.html',
|
templateUrl: 'views/setting.html',
|
||||||
|
@ -22,6 +22,14 @@
|
||||||
|
|
||||||
angular.extend(options, attrs);
|
angular.extend(options, attrs);
|
||||||
|
|
||||||
|
var loadHistory = function () {
|
||||||
|
if (!scope.option || !scope.option.showHistory) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scope.history = aria2SettingService.getSettingHistory(scope.option.key);
|
||||||
|
};
|
||||||
|
|
||||||
var destroyTooltip = function () {
|
var destroyTooltip = function () {
|
||||||
angular.element(element).tooltip('destroy');
|
angular.element(element).tooltip('destroy');
|
||||||
};
|
};
|
||||||
|
@ -229,6 +237,20 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope.filterHistory = function (userInput) {
|
||||||
|
var result = [];
|
||||||
|
|
||||||
|
if (scope.history && userInput) {
|
||||||
|
for (var i = 0; i < scope.history.length; i++) {
|
||||||
|
if (scope.history[i].indexOf(userInput) === 0) {
|
||||||
|
result.push(scope.history[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $q.resolve(result);
|
||||||
|
};
|
||||||
|
|
||||||
if (ngModel) {
|
if (ngModel) {
|
||||||
scope.$watch(function () {
|
scope.$watch(function () {
|
||||||
return ngModel.$viewValue;
|
return ngModel.$viewValue;
|
||||||
|
@ -238,6 +260,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.$watch('option', function () {
|
scope.$watch('option', function () {
|
||||||
|
loadHistory();
|
||||||
element.find('[data-toggle="popover"]').popover();
|
element.find('[data-toggle="popover"]').popover();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -257,6 +280,8 @@
|
||||||
|
|
||||||
scope.placeholder = getHumanReadableValue(displayValue);
|
scope.placeholder = getHumanReadableValue(displayValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
loadHistory();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('ariaNg').factory('aria2SettingService', ['aria2AllOptions', 'aria2GlobalAvailableOptions', 'aria2QuickSettingsAvailableOptions', 'aria2TaskAvailableOptions', 'aria2RpcService', 'ariaNgLogService', function (aria2AllOptions, aria2GlobalAvailableOptions, aria2QuickSettingsAvailableOptions, aria2TaskAvailableOptions, aria2RpcService, ariaNgLogService) {
|
angular.module('ariaNg').factory('aria2SettingService', ['localStorageService', 'ariaNgConstants', 'aria2AllOptions', 'aria2GlobalAvailableOptions', 'aria2QuickSettingsAvailableOptions', 'aria2TaskAvailableOptions', 'aria2RpcService', 'ariaNgLogService', function (localStorageService, ariaNgConstants, aria2AllOptions, aria2GlobalAvailableOptions, aria2QuickSettingsAvailableOptions, aria2TaskAvailableOptions, aria2RpcService, ariaNgLogService) {
|
||||||
var processStatResult = function (stat) {
|
var processStatResult = function (stat) {
|
||||||
if (!stat) {
|
if (!stat) {
|
||||||
return stat;
|
return stat;
|
||||||
|
@ -16,6 +16,14 @@
|
||||||
return stat;
|
return stat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var getSettingHistoryKey = function (key) {
|
||||||
|
return ariaNgConstants.settingHistoryKeyPrefix + '.' + key;
|
||||||
|
};
|
||||||
|
|
||||||
|
var isSettingHistoryKey = function (key) {
|
||||||
|
return key.indexOf(ariaNgConstants.settingHistoryKeyPrefix + '.') === 0;
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isOptionKeyValid: function (key) {
|
isOptionKeyValid: function (key) {
|
||||||
var option = aria2AllOptions[key];
|
var option = aria2AllOptions[key];
|
||||||
|
@ -88,7 +96,8 @@
|
||||||
var option = allOptions[i];
|
var option = allOptions[i];
|
||||||
var optionKey = {
|
var optionKey = {
|
||||||
key: option.key,
|
key: option.key,
|
||||||
category: option.category
|
category: option.category,
|
||||||
|
showHistory: option.showHistory
|
||||||
};
|
};
|
||||||
|
|
||||||
if (option.canShow && option.canShow.indexOf('new') < 0) {
|
if (option.canShow && option.canShow.indexOf('new') < 0) {
|
||||||
|
@ -115,6 +124,7 @@
|
||||||
var key = keys[i];
|
var key = keys[i];
|
||||||
var readonly = false;
|
var readonly = false;
|
||||||
var category = null;
|
var category = null;
|
||||||
|
var showHistory = false;
|
||||||
|
|
||||||
if (angular.isObject(key)) {
|
if (angular.isObject(key)) {
|
||||||
var optionKey = key;
|
var optionKey = key;
|
||||||
|
@ -122,6 +132,7 @@
|
||||||
key = optionKey.key;
|
key = optionKey.key;
|
||||||
readonly = !!optionKey.readonly;
|
readonly = !!optionKey.readonly;
|
||||||
category = optionKey.category;
|
category = optionKey.category;
|
||||||
|
showHistory = !!optionKey.showHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = aria2AllOptions[key];
|
var option = aria2AllOptions[key];
|
||||||
|
@ -148,6 +159,10 @@
|
||||||
option.readonly = true;
|
option.readonly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (showHistory) {
|
||||||
|
option.showHistory = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (extendSettings && extendSettings.disableRequired) {
|
if (extendSettings && extendSettings.disableRequired) {
|
||||||
option.required = false;
|
option.required = false;
|
||||||
}
|
}
|
||||||
|
@ -170,6 +185,50 @@
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
},
|
},
|
||||||
|
getSettingHistory: function (key) {
|
||||||
|
if (!this.isOptionKeyValid(key)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
var storageKey = getSettingHistoryKey(key);
|
||||||
|
var history = localStorageService.get(storageKey) || [];
|
||||||
|
var newHistory = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < Math.min(history.length, ariaNgConstants.historyMaxStoreCount); i++) {
|
||||||
|
newHistory.push(history[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return newHistory;
|
||||||
|
},
|
||||||
|
addSettingHistory: function (key, value) {
|
||||||
|
if (!this.isOptionKeyValid(key)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
var storageKey = getSettingHistoryKey(key);
|
||||||
|
var history = localStorageService.get(storageKey) || [];
|
||||||
|
var newHistory = [];
|
||||||
|
newHistory.push(value);
|
||||||
|
|
||||||
|
for (var i = 0; i < Math.min(history.length, ariaNgConstants.historyMaxStoreCount - 1); i++) {
|
||||||
|
if (history[i] !== value) {
|
||||||
|
newHistory.push(history[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorageService.set(storageKey, newHistory);
|
||||||
|
|
||||||
|
return newHistory;
|
||||||
|
},
|
||||||
|
clearSettingsHistorys: function () {
|
||||||
|
var keys = localStorageService.keys();
|
||||||
|
|
||||||
|
for (var i = 0; i < keys.length; i++) {
|
||||||
|
if (isSettingHistoryKey(keys[i])) {
|
||||||
|
localStorageService.remove(keys[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
getGlobalOption: function (callback, silent) {
|
getGlobalOption: function (callback, silent) {
|
||||||
return aria2RpcService.getGlobalOption({
|
return aria2RpcService.getGlobalOption({
|
||||||
silent: !!silent,
|
silent: !!silent,
|
||||||
|
|
|
@ -110,6 +110,23 @@
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* angular-input-dropdown */
|
||||||
|
input-dropdown[input-class-name="form-control"] > .input-dropdown {
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-dropdown ul {
|
||||||
|
border: 1px solid #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-dropdown ul > li.active {
|
||||||
|
background-color: #e1e3e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-dropdown ul > li {
|
||||||
|
padding: 2px 14px 2px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
/* angular-dragula extend */
|
/* angular-dragula extend */
|
||||||
.gu-mirror {
|
.gu-mirror {
|
||||||
cursor: grabbing;
|
cursor: grabbing;
|
||||||
|
|
|
@ -12,8 +12,14 @@
|
||||||
<div ng-class="{'input-group': !!option.suffix}">
|
<div ng-class="{'input-group': !!option.suffix}">
|
||||||
<div class="form-group has-feedback" ng-class="[optionStatus.getStatusFeedbackStyle()]">
|
<div class="form-group has-feedback" ng-class="[optionStatus.getStatusFeedbackStyle()]">
|
||||||
<input class="form-control" type="text" placeholder="{{::placeholder}}" ng-disabled="!!option.readonly"
|
<input class="form-control" type="text" placeholder="{{::placeholder}}" ng-disabled="!!option.readonly"
|
||||||
ng-if="option.type === 'string' || option.type === 'integer' || option.type === 'float'"
|
ng-if="(option.type === 'string' && !option.showHistory) || option.type === 'integer' || option.type === 'float'"
|
||||||
ng-model="optionValue" ng-change="changeValue(optionValue, true)"/>
|
ng-model="optionValue" ng-change="changeValue(optionValue, true)"/>
|
||||||
|
<input-dropdown input-class-name="form-control" style="width: 100%;" input-placeholder="{{::placeholder}}"
|
||||||
|
ng-if="option.type === 'string' && option.showHistory" disabled="!!option.readonly"
|
||||||
|
ng-model="optionValue" selected-item="optionValue" allow-custom-input="true"
|
||||||
|
only-show-non-empty-dropdown="true" default-dropdown-items="history"
|
||||||
|
filter-list-method="filterHistory(userInput)"
|
||||||
|
value-changed-method="changeValue(value, from === 'input')"></input-dropdown>
|
||||||
<textarea class="form-control" rows="6" placeholder="{{::placeholder}}" ng-disabled="!!option.readonly"
|
<textarea class="form-control" rows="6" placeholder="{{::placeholder}}" ng-disabled="!!option.readonly"
|
||||||
ng-if="option.type === 'text'"
|
ng-if="option.type === 'text'"
|
||||||
ng-model="optionValue" ng-change="changeValue(optionValue, true)"></textarea>
|
ng-model="optionValue" ng-change="changeValue(optionValue, true)"></textarea>
|
||||||
|
|
|
@ -144,6 +144,9 @@
|
||||||
<button class="btn btn-xs btn-default" ng-click="resetSettings()">
|
<button class="btn btn-xs btn-default" ng-click="resetSettings()">
|
||||||
<span translate>Reset Settings</span>
|
<span translate>Reset Settings</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-xs btn-default" ng-click="clearHistory()">
|
||||||
|
<span translate>Clear Settings History</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue