mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
refactor(ui/box-selector): replace all selectors [EE-3856] (#7902)
This commit is contained in:
parent
c9253319d9
commit
2dddc1c6b9
80 changed files with 1267 additions and 1011 deletions
|
@ -1,8 +1,11 @@
|
|||
import { options } from './options';
|
||||
|
||||
angular.module('portainer.docker').controller('BuildImageController', BuildImageController);
|
||||
|
||||
/* @ngInject */
|
||||
function BuildImageController($scope, $async, $window, ModalService, BuildService, Notifications, HttpRequestHelper, endpoint) {
|
||||
$scope.endpoint = endpoint;
|
||||
$scope.options = options;
|
||||
|
||||
$scope.state = {
|
||||
BuildType: 'editor',
|
||||
|
@ -31,6 +34,12 @@ function BuildImageController($scope, $async, $window, ModalService, BuildServic
|
|||
$scope.state.isEditorDirty = false;
|
||||
});
|
||||
|
||||
$scope.onChangeBuildType = function (type) {
|
||||
$scope.$evalAsync(() => {
|
||||
$scope.state.BuildType = type;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.checkName = function (index) {
|
||||
var item = $scope.formValues.ImageNames[index];
|
||||
item.Valid = true;
|
||||
|
|
|
@ -69,46 +69,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- !name-input-list -->
|
||||
<!-- build-method -->
|
||||
<div class="col-sm-12 form-section-title"> Build method </div>
|
||||
<div class="form-group"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<div class="boxselector_wrapper">
|
||||
<div>
|
||||
<input type="radio" id="method_editor" ng-model="state.BuildType" value="editor" ng-click="toggleEditor()" />
|
||||
<label for="method_editor">
|
||||
<div class="boxselector_header vertical-center">
|
||||
<pr-icon icon="'edit'"></pr-icon>
|
||||
Web editor
|
||||
</div>
|
||||
<p>Use our Web editor</p>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" id="method_upload" ng-model="state.BuildType" value="upload" ng-click="saveEditorContent()" />
|
||||
<label for="method_upload">
|
||||
<div class="boxselector_header vertical-center">
|
||||
<pr-icon icon="'upload'"></pr-icon>
|
||||
Upload
|
||||
</div>
|
||||
<p>Upload a tarball or a Dockerfile from your computer</p>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" id="method_url" ng-model="state.BuildType" value="url" ng-click="saveEditorContent()" />
|
||||
<label for="method_url">
|
||||
<div class="boxselector_header vertical-center">
|
||||
<pr-icon icon="'globe'"></pr-icon>
|
||||
URL
|
||||
</div>
|
||||
<p>Specify a URL to a file</p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !build-method -->
|
||||
<box-selector options="options" slim="true" value="state.BuildType" on-change="(onChangeBuildType)"></box-selector>
|
||||
|
||||
<!-- web-editor -->
|
||||
<div ng-show="state.BuildType === 'editor'">
|
||||
<div class="col-sm-12 form-section-title"> Web editor </div>
|
||||
|
|
7
app/docker/views/images/build/options.tsx
Normal file
7
app/docker/views/images/build/options.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
import {
|
||||
editor,
|
||||
upload,
|
||||
url,
|
||||
} from '@@/BoxSelector/common-options/build-methods';
|
||||
|
||||
export const options = [editor, upload, url] as const;
|
Loading…
Add table
Add a link
Reference in a new issue