mirror of https://gitee.com/karson/fastadmin.git
parent
ac97988661
commit
3f4e54d0dd
|
|
@ -77,7 +77,7 @@
|
||||||
<div class="widget-body no-padding">
|
<div class="widget-body no-padding">
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
{:build_toolbar('refresh')}
|
{:build_toolbar('refresh')}
|
||||||
<button type="button" id="faupload-addon" class="btn btn-danger faupload" data-url="addon/local" data-mimetype="application/zip" data-multiple="false"><i class="fa fa-upload"></i>
|
<button type="button" id="faupload-addon" class="btn btn-danger faupload" data-url="addon/local" data-mimetype="zip" data-multiple="false"><i class="fa fa-upload"></i>
|
||||||
{:__('Offline install')}
|
{:__('Offline install')}
|
||||||
</button>
|
</button>
|
||||||
{if $Think.config.fastadmin.api_url}
|
{if $Think.config.fastadmin.api_url}
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@
|
||||||
<div class="box-body box-profile">
|
<div class="box-body box-profile">
|
||||||
|
|
||||||
<div class="profile-avatar-container">
|
<div class="profile-avatar-container">
|
||||||
<img class="profile-user-img img-responsive img-circle faupload" src="{$admin.avatar|cdnurl|htmlentities}" alt="">
|
<img class="profile-user-img img-responsive img-circle" src="{$admin.avatar|cdnurl|htmlentities}" alt="">
|
||||||
<div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
|
<div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
|
||||||
<button id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
|
<button type="button" id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="profile-username text-center">{$admin.username|htmlentities}</h3>
|
<h3 class="profile-username text-center">{$admin.username|htmlentities}</h3>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class Common extends Api
|
||||||
} catch (UploadException $e) {
|
} catch (UploadException $e) {
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
$this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
|
$this->success(__('Uploaded successful'), ['url' => $attachment->url]);
|
||||||
} elseif ($method == 'clean') {
|
} elseif ($method == 'clean') {
|
||||||
//删除冗余的分片文件
|
//删除冗余的分片文件
|
||||||
try {
|
try {
|
||||||
|
|
@ -102,7 +102,7 @@ class Common extends Api
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
|
$this->success(__('Uploaded successful'), ['url' => $attachment->url]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
|
||||||
$("#faupload-avatar").data("upload-success", function (data) {
|
$("#faupload-avatar").data("upload-success", function (data) {
|
||||||
var url = Fast.api.cdnurl(data.url);
|
var url = Fast.api.cdnurl(data.url);
|
||||||
$(".profile-user-img").prop("src", url);
|
$(".profile-user-img").prop("src", url);
|
||||||
Toastr.success(__('Upload successful'));
|
Toastr.success(__('Uploaded successful'));
|
||||||
});
|
});
|
||||||
Form.api.bindevent($("#profile-form"));
|
Form.api.bindevent($("#profile-form"));
|
||||||
$(document).on("click", ".btn-change", function () {
|
$(document).on("click", ".btn-change", function () {
|
||||||
|
|
|
||||||
|
|
@ -7387,7 +7387,7 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
||||||
}
|
}
|
||||||
$(this).attr("initialized", true);
|
$(this).attr("initialized", true);
|
||||||
var that = this;
|
var that = this;
|
||||||
var id = $(this).prop("id");
|
var id = $(this).prop("id") || $(this).prop("name") || Dropzone.uuidv4();
|
||||||
var url = $(this).data("url");
|
var url = $(this).data("url");
|
||||||
var maxsize = $(this).data("maxsize");
|
var maxsize = $(this).data("maxsize");
|
||||||
var maxcount = $(this).data("maxcount");
|
var maxcount = $(this).data("maxcount");
|
||||||
|
|
@ -7431,12 +7431,12 @@ define('upload',['jquery', 'bootstrap', 'dropzone', 'template'], function ($, un
|
||||||
return bytes / Math.pow(1024, 2);
|
return bytes / Math.pow(1024, 2);
|
||||||
}(maxsize));
|
}(maxsize));
|
||||||
|
|
||||||
var options = $("#" + id).data() || {};
|
var options = $(this).data() || {};
|
||||||
delete options.success;
|
delete options.success;
|
||||||
delete options.url;
|
delete options.url;
|
||||||
multipart = $.isArray(multipart) ? {} : multipart;
|
multipart = $.isArray(multipart) ? {} : multipart;
|
||||||
|
|
||||||
Upload.list[id] = new Dropzone("#" + id, $.extend({
|
Upload.list[id] = new Dropzone(this, $.extend({
|
||||||
url: url,
|
url: url,
|
||||||
params: function (files, xhr, chunk) {
|
params: function (files, xhr, chunk) {
|
||||||
var params = multipart;
|
var params = multipart;
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
|
||||||
}
|
}
|
||||||
$(this).attr("initialized", true);
|
$(this).attr("initialized", true);
|
||||||
var that = this;
|
var that = this;
|
||||||
var id = $(this).prop("id");
|
var id = $(this).prop("id") || $(this).prop("name") || Dropzone.uuidv4();
|
||||||
var url = $(this).data("url");
|
var url = $(this).data("url");
|
||||||
var maxsize = $(this).data("maxsize");
|
var maxsize = $(this).data("maxsize");
|
||||||
var maxcount = $(this).data("maxcount");
|
var maxcount = $(this).data("maxcount");
|
||||||
|
|
@ -169,12 +169,12 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
|
||||||
return bytes / Math.pow(1024, 2);
|
return bytes / Math.pow(1024, 2);
|
||||||
}(maxsize));
|
}(maxsize));
|
||||||
|
|
||||||
var options = $("#" + id).data() || {};
|
var options = $(this).data() || {};
|
||||||
delete options.success;
|
delete options.success;
|
||||||
delete options.url;
|
delete options.url;
|
||||||
multipart = $.isArray(multipart) ? {} : multipart;
|
multipart = $.isArray(multipart) ? {} : multipart;
|
||||||
|
|
||||||
Upload.list[id] = new Dropzone("#" + id, $.extend({
|
Upload.list[id] = new Dropzone(this, $.extend({
|
||||||
url: url,
|
url: url,
|
||||||
params: function (files, xhr, chunk) {
|
params: function (files, xhr, chunk) {
|
||||||
var params = multipart;
|
var params = multipart;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue